Compare commits

...
41 changed files with 4066 additions and 321 deletions
+7 -7
View File
@@ -28,10 +28,9 @@ namespace Config.Entities
public virtual int Revision { get; set; }
public virtual int PredecessorId { get; set; }
public virtual bool ObtainedByCopy { get; set; } /// Initial version of this procedure was a copy of another procedure
///
///
public virtual MetersKind MetersKind { get; set; } /// single / compound / heat meters
public virtual string Watermeters { get; set; } /// Water meter name or Id
public virtual string ProtocolTitle { get; set; } /// Title of the printed and saved protocol
public virtual bool Protected { get; set; } /// true = procedure cannot be changed by a testing specialist
public virtual bool MustBeComplete { get; set; } /// true = procedure can be finished just when all tests were finished
public virtual bool ManualCtrlDisabled { get; set; } /// true = manual control of valves, etc. is disabled
@@ -42,6 +41,9 @@ namespace Config.Entities
public virtual string TransitionStart { get; set; }
public virtual string TransitionEnd { get; set; }
public virtual string AltProcName { get; set; } /// Alternative procedure name (null or string.Empty = no alt. procedure)
public virtual int AltProcPeriod { get; set; } /// Period of alternative procedures (0 = no alt. procedure)
public virtual IList<ComponentProcedure> MoreParams { get; set; }
public virtual IList<Test> Tests { get; set; }
@@ -60,7 +62,9 @@ namespace Config.Entities
LastChgUser = CreationUser;
LastChgTime = CreationTime;
MetersKind = Entities.MetersKind.Single;
ProtocolTitle = "Watermeter test protocol";
Watermeters = string.Empty;
Description = string.Empty;
LongDescription = string.Empty;
}
public Procedure(string name, int itemNr)
@@ -90,7 +94,6 @@ namespace Config.Entities
result.MetersKind = MetersKind;
result.Watermeters = Watermeters;
result.ProtocolTitle = ProtocolTitle;
result.Protected = Protected;
result.MustBeComplete = MustBeComplete;
result.ManualCtrlDisabled = ManualCtrlDisabled;
@@ -117,7 +120,6 @@ namespace Config.Entities
output.WriteLine(LastChgTime.ToString(CultureInfo.InvariantCulture));
output.WriteLine(MetersKind.ToString());
output.WriteLine(Watermeters);
output.WriteLine(ProtocolTitle);
output.WriteLine(Protected.ToString());
output.WriteLine(MustBeComplete.ToString());
output.WriteLine(ManualCtrlDisabled.ToString());
@@ -150,7 +152,6 @@ namespace Config.Entities
string line = input.ReadLine();
result.MetersKind = line.Equals(MetersKind.Single.ToString()) ? MetersKind.Single : (line.Equals(MetersKind.Combined.ToString()) ? MetersKind.Combined : MetersKind.HeatMeter);
result.Watermeters = input.ReadLine();
result.ProtocolTitle = input.ReadLine();
result.Protected = bool.Parse(input.ReadLine());
result.MustBeComplete = bool.Parse(input.ReadLine());
result.ManualCtrlDisabled = bool.Parse(input.ReadLine());
@@ -196,7 +197,6 @@ namespace Config.Entities
ln = inp.ReadLine(); /// skip LastChgTime
ln = inp.ReadLine(); if (ln != MetersKind.ToString()) { diff.AppendFormat(fmt, "MetersKind", MetersKind, ln); };
ln = inp.ReadLine(); if (ln != Watermeters) { diff.AppendFormat(fmt, "Watermeters", Watermeters, ln); };
ln = inp.ReadLine(); if (ln != ProtocolTitle) { diff.AppendFormat(fmt, "ProtocolTitle", ProtocolTitle, ln); };
ln = inp.ReadLine(); if (ln != Protected.ToString()) { diff.AppendFormat(fmt, "Protected", Protected, ln); };
ln = inp.ReadLine(); if (ln != MustBeComplete.ToString()) { diff.AppendFormat(fmt, "MustBeComplete", MustBeComplete, ln); };
+4 -1
View File
@@ -28,7 +28,6 @@ namespace Config.Mappings
Map(x => x.MetersKind);
Map(x => x.Watermeters);
Map(x => x.ProtocolTitle);
Map(x => x.Protected);
Map(x => x.MustBeComplete);
Map(x => x.ManualCtrlDisabled);
@@ -38,6 +37,10 @@ namespace Config.Mappings
Map(x => x.ResultsWriter);
Map(x => x.TransitionStart);
Map(x => x.TransitionEnd);
Map(x => x.AltProcName);
Map(x => x.AltProcPeriod);
////Map(x => x.MetrologicalClass);
////HasOne(x => x.WMType);
HasMany(x => x.MoreParams)
+1 -1
View File
@@ -46,7 +46,7 @@ namespace Results
ProcedureDescription = procedure.Description,
WatermetersStr = procedure.Watermeters,
ProcedureRevision = procedure.Revision,
ProtocolTitle = procedure.ProtocolTitle,
ProtocolTitle = string.Empty,
StartTime = DateTime.Now,
DensityCorr = (float)densityCorr,
Compound = (procedure.MetersKind == Config.Entities.MetersKind.Combined),
+3 -1
View File
@@ -22,7 +22,8 @@ namespace Results.Entities
public virtual double QFall { get; set; } /// [m3/h] detected Q_fall of a composed meter
public virtual bool Passed { get; set; }
public virtual int ResultCode { get; set; }
public virtual string Remark { get; set; }
public virtual string ArchivePath { get; set; }
public virtual string Remark { get; set; }
#if IPERL
public virtual int SerialNrEx { get; set; } /// Aux s/n for compound meters, Serial number for iPerl water meter
@@ -202,6 +203,7 @@ namespace Results.Entities
QFall = src.QFall;
Passed = src.Passed;
ResultCode = src.ResultCode;
ArchivePath = src.ArchivePath;
Remark = src.Remark;
#if IPERL
SerialNrEx = src.SerialNrEx;
+2 -1
View File
@@ -22,7 +22,8 @@ namespace Results.Mappings
Map(x => x.QFall);
Map(x => x.Passed);
Map(x => x.ResultCode);
Map(x => x.Remark)
Map(x => x.ArchivePath);
Map(x => x.Remark)
.CustomType("StringClob")
.CustomSqlType("varchar(2000)");
#if IPERL
@@ -1,4 +1,7 @@
using System;
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -7,34 +7,38 @@ using System.Drawing;
using System.Drawing.Printing;
using System.IO;
using Config.Entities;
using TBF.Resources;
using Results.Resources;
namespace TBF.BenchControl.Output.Printers.Enhanced
namespace Results.Output.Printers.OnePagePerMeter
{
public class BasicPrintDocument : PrintDocument
public class EnhancedPrintDocument : PrintDocument
{
const string FontFamilyName = "Arial"; //"Times New Roman";
const int SpacingOne = 18;
const int SpacingOneAndHalf = (3 * SpacingOne) / 2;
/// Size of the printed area without margins, after taking into account 'pageOrientation'
readonly int printHeight;
readonly int printWidth;
readonly int topMargin;
readonly int bottomMargin;
readonly int leftMargin;
readonly int TitleX;
readonly int TitleY; /// Depends on the size of the header
readonly int HdrTop; /// = TitleY + 60
readonly int BodyTop; /// = HdrTop + 160
/// Size of the printed area without margins, after taking into account 'pageOrientation'
int printHeight;
int printWidth;
readonly int SpacingOne;
readonly int SpacingOneAndHalf;
readonly int SpacingOne4Header;
readonly int SpacingOneAndHalf4Header;
int CommonTop; /// = TitleY + 60
int BodyTop; /// = HdrTop + 160
///
int titleHeight;
int commonHeight;
/// <summary>
/// Property variable for the Font the user wishes to use
/// </summary>
Font font;
Font boldFont;
Font headerFont;
Font titleFont;
///
@@ -42,10 +46,15 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
///
Results.Entities.Batch batch;
EnhancedPrinterCfg cfg;
///
/// Items to print
///
readonly IList<Results.ItemSpec> rsltItems;
string header;
IList<WMeterRsltItemSpec> commonItems;
IList<WMeterRsltItemSpec> testItems;
string footer;
///
/// Layout and status
@@ -61,33 +70,28 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
/// Constructor
/// </summary>
/// <param name="textToPrint">Text to be printed</param>
public BasicPrintDocument(Results.Entities.Batch batch,
PageOrientation pageOrientation,
int topMargin, int bottomMargin, int leftMargin)
public EnhancedPrintDocument(Results.Entities.Batch batch, EnhancedPrinterCfg cfg)
{
this.batch = batch;
DefaultPageSettings.Landscape = (pageOrientation == PageOrientation.Landscape);
this.cfg = cfg;
topMargin = cfg.TopMargin;
bottomMargin = cfg.BottomMargin;
leftMargin = cfg.LeftMargin;
this.topMargin = topMargin;
this.bottomMargin = bottomMargin;
this.leftMargin = leftMargin;
header = string.IsNullOrEmpty(cfg.Header) ? string.Empty : cfg.Header.Replace("~", Environment.NewLine);
commonItems = Results.WMeterRsltItemSpec.FromStrArray(cfg.CommonItems);
testItems = Results.WMeterRsltItemSpec.FromStrArray(cfg.TestItems); /// TestID info will be overwritten later on
footer = string.IsNullOrEmpty(cfg.Footer) ? string.Empty : cfg.Footer.Replace("~", Environment.NewLine);
TitleX = leftMargin;
TitleY = topMargin; /// Depends on the size of the header
HdrTop = TitleY + 60;
BodyTop = HdrTop + 160;
if (batch.WaterMeters.Count > 0 && batch.WaterMeters[0].Compound())
{
rsltItems = Results.ItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Printer_CombinedWM);
}
else
{
rsltItems = Results.ItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Printer_SingleWM);
}
/// Initialize fonts
titleFont = new Font(cfg.TitFntFml, cfg.TitFntSz, (FontStyle)cfg.TitFntSty);
headerFont = new Font(cfg.HdrFntFml, cfg.HdrFntSz, (FontStyle)cfg.HdrFntSty);
font = new Font(cfg.BodyFntFml, cfg.BodyFntSz, (FontStyle)cfg.BodyFntSty);
/// Set print area size and margins (in dots using 100 dpi)
DefaultPageSettings.Landscape = (cfg.PageOrientation == PageOrientation.Landscape);
///
if (DefaultPageSettings.Landscape)
{
printHeight = base.DefaultPageSettings.PaperSize.Width - topMargin - bottomMargin;
@@ -99,22 +103,36 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
printWidth = base.DefaultPageSettings.PaperSize.Width - leftMargin - leftMargin;
}
SpacingOne = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", font).Height;
SpacingOneAndHalf = (3 * SpacingOne) / 2;
SpacingOne4Header = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", headerFont).Height;
SpacingOneAndHalf4Header = (3 * SpacingOne4Header) / 2;
/// Calculate the tests count
int testsCount = 0;
if (batch.WaterMeters.Count > 0)
{
foreach (var mtr in batch.WaterMeters[0].MeterTestRslts)
{
if (mtr.Publish() == Config.Entities.Publish.Always) testsCount++;
if (mtr.Publish() == Config.Entities.Publish.Always && mtr.IsPilotRslt()) testsCount++;
}
}
if (batch.WaterMeters.Count > 0 && batch.WaterMeters[0].Compound()) testsCount /= 3;
/// Prepare document outline
TitleX = cfg.LeftMargin;
TitleY = cfg.TopMargin;
int wmSectionHeight = (testsCount + 4) * SpacingOne;
titleHeight = System.Windows.Forms.TextRenderer.MeasureText(header, titleFont).Height;
CommonTop = TitleY + titleHeight + SpacingOne4Header;
commonHeight = commonItems.Count * SpacingOne;
BodyTop = CommonTop + commonHeight + SpacingOne4Header;
int wmSectionHeight = (testsCount + 1) * SpacingOne + 3 * SpacingOne4Header;
nrWMsOnFirstPage = (printHeight - BodyTop + TitleY - 2 * SpacingOne) / wmSectionHeight;
nrWMsOnNextPage = (printHeight - 2 * SpacingOne) / wmSectionHeight;
nrWMsOnNextPage = Math.Max(nrWMsOnNextPage, 1); /// Prevent division by zero if there are too many WM tests
nrWMsOnNextPage = Math.Max(nrWMsOnNextPage, 1); /// Prevent division by zero if there are too many WM tests
nrPages = 1 + (batch.WaterMeters.Count - nrWMsOnFirstPage + nrWMsOnNextPage - 1) / nrWMsOnNextPage;
@@ -130,10 +148,6 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
protected override void OnBeginPrint(System.Drawing.Printing.PrintEventArgs e)
{
base.OnBeginPrint(e);
if (font == null) { font = new Font(FontFamilyName, 10, FontStyle.Regular); }
if (boldFont == null) { boldFont = new Font(FontFamilyName, 10, FontStyle.Bold); }
if (titleFont == null) { titleFont = new Font(FontFamilyName, 18, FontStyle.Bold); }
}
/// <summary>
@@ -158,33 +172,24 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
if (pageNr == 1)
{
///----------
/// Header
/// Title
///----------
RectangleF printArea = new RectangleF(TitleX, TitleY, printWidth, 40);
e.Graphics.DrawString(batch.ProtocolTitle, titleFont, Brushes.Black, printArea);
RectangleF printArea = new RectangleF(TitleX, TitleY, printWidth, titleHeight);
e.Graphics.DrawString(header, titleFont, Brushes.Black, printArea);
string[] leftColumn = new string[]
{
"Batch number: ",
"Date and time: ",
"Procedure: ",
Strings.User + ": ",
"Ambient temperature: ",
"Ambient pressure: ",
"Ambient humidity: ",
};
///----------------
/// Common items
///----------------
string[] leftColumn = new string[commonItems.Count];
string[] rightColumn = new string[commonItems.Count];
string[] rightColumn = new string[]
{
batch.BatchNr.ToString(),
//batch.EndTime.ToShortDateString() + " " + batch.EndTime.ToShortTimeString(),
string.Format("{0:yyyy.MM.dd HH:mm}", batch.EndTime),
batch.ProcedureName,
Users.GlobalData.CurrentUser.UserName,
batch.AmbientTempAve().ToString("F1") + " °C",
Config.Units.ConvertTo(Config.Unit.mbar, batch.AmbientPressAve()).ToString("F0") + " mbar",
batch.AmbientHumiAve().ToString("F0") + " %",
};
int cnt = 0;
foreach (var v in commonItems)
{
leftColumn[cnt] = v.Caption;
rightColumn[cnt] = (batch.WaterMeters.Count > 0) ? v.Print(batch.WaterMeters[0]) : string.Empty;
cnt++;
}
/// Determine max. left column width in characters
int maxLen = 0;
@@ -193,8 +198,8 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
/// Write aligned columns
for (int i = 0; i < Math.Min(leftColumn.Length, rightColumn.Length); i++)
{
PrintAt(e, leftMargin, HdrTop + SpacingOne * i, leftColumn[i]);
PrintAt(e, 300, HdrTop + SpacingOne * i, rightColumn[i]);
PrintAt(e, leftMargin, CommonTop + SpacingOne * i, leftColumn[i]);
PrintAt(e, 300, CommonTop + SpacingOne * i, rightColumn[i]);
}
}
@@ -220,10 +225,12 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
///----------
/// Footer
///----------
string footerText = string.Format("str. {1}/{2}", Strings.Page, pageNr++, nrPages);
int footerWidth = (int)e.Graphics.MeasureString(footerText, font).Width;
PrintAt(e, leftMargin + (printWidth - footerWidth) / 2, topMargin + printHeight - SpacingOne, footerText);
int footerWidth = (int)e.Graphics.MeasureString(footer, font).Width;
PrintAt(e, leftMargin + (printWidth - footerWidth) / 2, topMargin + printHeight - 2 * SpacingOne, footer);
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);
}
@@ -238,89 +245,61 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
Results.Entities.WaterMeter wm, int printedWMNr, int top)
{
/// Determin column widths
float[] columnPos = new float[rsltItems.Count + 1];
float[] columnPos = new float[testItems.Count + 1];
columnPos[0] = (float)leftMargin;
for (int i = 0; i < rsltItems.Count; i++)
for (int i = 0; i < testItems.Count; i++)
{
float columnWidth = e.Graphics.MeasureString(rsltItems[i].ClmnHeaderText, font).Width;
float columnWidth = e.Graphics.MeasureString(testItems[i].Caption, headerFont).Width;
foreach (var mtr in wm.MeterTestRslts)
{
string itemText;
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always)
{
string itemText = testItems[i].Print(wm, mtr.Name());
if (!wm.Compound())
{
itemText = rsltItems[i].Print(mtr);
}
else if (mtr.CompoundMeterId == (byte)CompoundMeterId.Compound)
{
Results.Entities.MeterTestRslt mainMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
Results.Entities.MeterTestRslt auxMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux);
itemText = rsltItems[i].PrintCombined(mainMtr, auxMtr, mtr);
}
else
{
continue;
}
/// Strip color information
string[] texts = itemText.Split(new char[] { '|' });
if (texts.Length == 2) { itemText = texts[0]; }
/// Strip color information
string[] texts = itemText.Split(new char[] { '|' });
if (texts.Length == 2) { itemText = texts[0]; }
float width = e.Graphics.MeasureString(itemText, font).Width;
if (width > columnWidth) columnWidth = width;
float width = e.Graphics.MeasureString(itemText, font).Width;
if (width > columnWidth) columnWidth = width;
}
}
columnPos[i + 1] = columnPos[i] + columnWidth + 20.0f;
}
int tableLeftX = (int)columnPos[0];
int tableRightX = (int)columnPos[rsltItems.Count] - 20;
int tableRightX = (int)columnPos[testItems.Count] - 20;
string wmText = string.Format("Water meter {0}", printedWMNr);
PrintAt(e, leftMargin, top, wmText);
string wmText = string.Format("{0} {1}", Strings.Water_Meter, printedWMNr);
PrintHeaderAt(e, leftMargin, top, wmText);
if (!string.IsNullOrEmpty(wm.SerialNr))
{
PrintAt(e, leftMargin + (int)e.Graphics.MeasureString(wmText, font).Width, top,
string.Format(" s/n = {0}", wm.SerialNr));
PrintHeaderAt(e, leftMargin + (int)e.Graphics.MeasureString(wmText, headerFont).Width, top,
string.Format(" {0} = {1}", Strings.sn, wm.SerialNr));
}
/// Horizontal line
int horY = top + 25;
int horY = top + SpacingOneAndHalf4Header;
e.Graphics.DrawLine(new Pen(Color.Black, 2), new Point(tableLeftX, horY), new Point(tableRightX, horY));
for (int i = 0; i < rsltItems.Count; i++)
for (int i = 0; i < testItems.Count; i++)
{
PrintAt(e, (int)columnPos[i], top + 27, rsltItems[i].ClmnHeaderText);
PrintHeaderAt(e, (int)columnPos[i], top + (int)(1.6 * SpacingOne4Header), testItems[i].Caption);
}
/// Horizontal line
horY = top + 27 + SpacingOne;
horY = top + (int)(2.8 * SpacingOne4Header);
e.Graphics.DrawLine(new Pen(Color.Black, 2), new Point(tableLeftX, horY), new Point(tableRightX, horY));
int testsCount = 0;
foreach (var mtr in wm.MeterTestRslts)
{
if (mtr.Publish() == Config.Entities.Publish.Always)
if ((mtr != null) && (mtr.Publish() == Config.Entities.Publish.Always))
{
testsCount++;
for (int i = 0; i < rsltItems.Count; i++)
for (int i = 0; i < testItems.Count; i++)
{
string itemText;
if (!wm.Compound())
{
/// Single water meter
itemText = rsltItems[i].Print(mtr);
}
else if (mtr.CompoundMeterId == (byte)CompoundMeterId.Compound)
{
Results.Entities.MeterTestRslt mainMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
Results.Entities.MeterTestRslt auxMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
itemText = rsltItems[i].PrintCombined(mainMtr, auxMtr, mtr);
}
else
{
continue;
}
string itemText = testItems[i].Print(wm, mtr.Name());
/// Strip color information
string[] texts = itemText.Split(new char[] { '|' });
@@ -331,16 +310,16 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
/// TODO: How to print colors?
}
PrintAt(e, (int)columnPos[i], top + 30 + SpacingOne * testsCount, itemText);
PrintAt(e, (int)columnPos[i], top + 2 * SpacingOne4Header + SpacingOne * testsCount, itemText);
}
}
}
/// Horizontal line
horY = top + 30 + SpacingOne * (testsCount + 1);
horY = top + 2 * SpacingOneAndHalf4Header + SpacingOne * testsCount;
e.Graphics.DrawLine(new Pen(Color.Black, 2), new Point(tableLeftX, horY), new Point(tableRightX, horY));
return (testsCount + 4) * SpacingOne;
return (testsCount + 1) * SpacingOne + 3 * SpacingOne4Header;
}
@@ -352,21 +331,21 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
void PrintAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text)
{
RectangleF printArea = new RectangleF(x, y, 667, SpacingOne);
RectangleF printArea = new RectangleF(x, y, 2000, SpacingOne);
e.Graphics.DrawString(text, this.font, Brushes.Black, printArea);
}
void PrintBoldAt(System.Drawing.Printing.PrintPageEventArgs e, Point p, string text)
void PrintHeaderAt(System.Drawing.Printing.PrintPageEventArgs e, Point p, string text)
{
PrintBoldAt(e, p.X, p.Y, text);
PrintHeaderAt(e, p.X, p.Y, text);
}
void PrintBoldAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text)
void PrintHeaderAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text)
{
RectangleF printArea = new RectangleF(x, y, 667, SpacingOne);
e.Graphics.DrawString(text, this.boldFont, Brushes.Black, printArea);
RectangleF printArea = new RectangleF(x, y, 2000, SpacingOne4Header);
e.Graphics.DrawString(text, this.headerFont, Brushes.Black, printArea);
}
}
}
@@ -0,0 +1,33 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Results.Output.Printers.OnePagePerMeter
{
public class EnhancedPrinterCfg
{
public Config.Entities.PageOrientation PageOrientation;
public int TopMargin;
public int BottomMargin;
public int LeftMargin;
public string TitFntFml;
public int TitFntSz;
public int TitFntSty;
public string HdrFntFml;
public int HdrFntSz;
public int HdrFntSty;
public string BodyFntFml;
public int BodyFntSz;
public int BodyFntSty;
public bool SupressPrinting; /// Bypass printing when true
public System.Globalization.CultureInfo CultureInfo;
public string[] CommonItems;
public string[] TestItems;
public string Header; /// =Title
public string Footer;
}
}
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.14.611.0")]
[assembly: AssemblyFileVersion("2.14.611.0")]
[assembly: AssemblyVersion("2.14.619.0")]
[assembly: AssemblyFileVersion("2.14.619.0")]
+5 -1
View File
@@ -107,6 +107,10 @@
<Compile Include="Output\Printers\Munich\MunichPrintDocument.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Output\Printers\OnePagePerMeter\EnhancedPrintDocument.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Output\Printers\OnePagePerMeter\EnhancedPrinterCfg.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ItemSpec.cs" />
<Compile Include="Properties\Resources.Designer.cs">
@@ -133,9 +137,9 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="FileWriters\" />
<Folder Include="Output\FileWriters\Basic\" />
<Folder Include="Output\FileWriters\Enhanced\" />
<Folder Include="Output\FileWriters\OneFilePerMeter\" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Forms\BatchResultsDlg.resx">
@@ -46,7 +46,6 @@ namespace TBF.BenchControl.Elde.FixedStartRegisterReader
public RegisterReader()
{
Clear();
}
public RegisterReader(Generic.IComponentCfg cfg, IList<Generic.IComponent> components)
@@ -64,6 +63,7 @@ namespace TBF.BenchControl.Elde.FixedStartRegisterReader
public void Clear()
{
log.DebugFormat("{0}:Clear()", Name);
beginWMState = 0;
endWMState = 0;
wmRefPulses = 0;
@@ -72,6 +72,7 @@ namespace TBF.BenchControl.Elde.FixedStartRegisterReader
public void TestCompleted()
{
log.DebugFormat("{0}:TestCompleted()", Name);
ReadPulses();
}
@@ -39,7 +39,6 @@ namespace TBF.BenchControl.Elde.RegisterReader
public RegisterReader()
{
Clear();
}
public RegisterReader(Generic.IComponentCfg cfg, IList<Generic.IComponent> components)
@@ -50,6 +49,8 @@ namespace TBF.BenchControl.Elde.RegisterReader
controlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components);
if (controlBoard == null) throw new Exception("Cannot find " + Name + " parent");
Clear();
/// Prepare data for SendCalibData() control board component method
log.Debug(this.ToString());
@@ -57,12 +57,8 @@ namespace TBF.BenchControl.Elde.ValveEx
{
foreach (var cmpntEntity in components)
{
IComponentFactory fac = TbfComponents.CmpntFactoryFromClassName(cmpntEntity.ClassName);
if (fac is Elde.Valve.ValveFactory || /// IValve component factories
fac is Elde.Pump.PumpFactory ||
fac is Danfoss.VLT2800.PumpFactory ||
fac is Elde.PumpWithFM.PumpFactory)
IComponent comp = TbfComponents.CmpntFactoryFromClassName(cmpntEntity.ClassName).DummyComponent();
if (comp is GenericDevices.IValve )
{
combo.Items.Add(cmpntEntity.Name);
}
@@ -262,7 +262,6 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced
/// Header
///----------
if (!string.IsNullOrEmpty(writerCfg.Header)) wrtr.Write(header);
wrtr.WriteLine(batch.ProtocolTitle);
wrtr.WriteLine(string.Empty);
///----------------
@@ -0,0 +1,173 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Threading;
using log4net;
using Config.Entities;
using TBF.BenchControl;
using TBF.Resources;
namespace TBF.BenchControl.Output.FileWriters.ImageArchiver
{
public class Archiver : ComponentBase, IOperation, GenericDevices.IResultsWriter
{
private static readonly ILog log = LogManager.GetLogger(typeof(Archiver));
public override string ToString() { return string.Format("Output.FileWriters.Basic({0})", Cfg.ToString(1)); }
readonly ArchiverCfg writerCfg;
Results.Entities.Batch batch;
bool abort; /// Set to 'true' by Stop() operation to abort writing to the file
public Archiver() {}
public Archiver(Generic.IComponentCfg cfg)
: base(cfg)
{
writerCfg = cfg as ArchiverCfg;
log.Debug(this.ToString());
}
/// <summary>
/// Returns a file name derived from a DateTime structure.
/// Creates directories on this path as a side effect.
/// </summary>
/// <param name="time">Date and time</param>
/// <returns>File name</returns>
string GetArchivePath(string destinationPath, DateTime time, int wmPosition, string wmSN)
{
string directory = destinationPath; /// Ends with "\\";
switch (writerCfg.YearFolders)
{
case YearFolders.FourDigit:
directory = string.Format("{0}{1}\\", directory, time.Year.ToString("D4"));
break;
case YearFolders.TwoDigit:
directory = string.Format("{0}{1}\\", directory, (time.Year % 100).ToString("D2"));
break;
}
switch (writerCfg.MonthFolders)
{
case MonthFolders.Name:
{
string monthStr;
switch (time.Month)
{
default:
case 1: monthStr = "January"; break;
case 2: monthStr = "February"; break;
case 3: monthStr = "March"; break;
case 4: monthStr = "April"; break;
case 5: monthStr = "May"; break;
case 6: monthStr = "June"; break;
case 7: monthStr = "July"; break;
case 8: monthStr = "August"; break;
case 9: monthStr = "September"; break;
case 10: monthStr = "October"; break;
case 11: monthStr = "November"; break;
case 12: monthStr = "December"; break;
}
directory = string.Format("{0}{1}\\", directory, monthStr);
break;
}
case MonthFolders.Digit:
directory = string.Format("{0}{1}\\", directory, time.Month.ToString());
break;
case MonthFolders.TwoDigit:
directory = string.Format("{0}{1}\\", directory, time.Month.ToString("D2"));
break;
}
switch (writerCfg.DayFolders)
{
case DayFolders.Digit:
directory = string.Format("{0}{1}\\", directory, time.Day.ToString());
break;
case DayFolders.TwoDigit:
directory = string.Format("{0}{1}\\", directory, time.Day.ToString("D2"));
break;
}
Directory.CreateDirectory(directory);
try
{
if (string.IsNullOrEmpty(writerCfg.ArchiveFormat)) throw new Exception();
return directory + string.Format(writerCfg.ArchiveFormat, time, wmPosition, wmSN);
}
catch
{
return string.Format("{0}{1:yyMMdd-HHmm}-{2}", directory, time, wmPosition);
}
}
/// <summary>
/// Writes the test cycle results into a file
/// Events:
/// Event.ResultsWritten
/// Event.Busy
/// </summary>
/// <param name="batch">Results to write into a file</param>
/// <returns>Reference to the operation</returns>
public IOperation WriteResultsOp(Results.Entities.Batch batch)
{
this.batch = batch;
return this;
}
/// <summary>Start this operation</summary>
public void Start()
{
MoveFilesToArchive(batch, writerCfg.DestinationPath);
MoveFilesToArchive(batch, writerCfg.DestinationPath2);
}
/// <summary>Run this operation</summary>
/// <returns>Event.ResultsWritten</returns>
public Event Run()
{
return Event.ResultsWritten;
}
/// <summary>Stop this operation</summary>
public void Stop()
{
}
void MoveFilesToArchive(Results.Entities.Batch batch, string destination)
{
if (batch == null || batch.WaterMeters == null || batch.WaterMeters.Count <= 0) return;
if (!string.IsNullOrEmpty(writerCfg.DestinationPath))
{
foreach (var wm in batch.WaterMeters)
{
if (wm != null && (!writerCfg.SaveGoodOnly || wm.Passed))
{
string srcFolder = Path.Combine(Program.ImagesDir, batch.BatchNr.ToString(), wm.WMPosition.ToString());
try
{
/// TODO: Copy files when files are on different disks.
Directory.Move(srcFolder, GetArchivePath(writerCfg.DestinationPath, batch.EndTime, wm.WMPosition, wm.SerialNr));
}
catch
{
log.ErrorFormat("Failed to move archive files from {0}", srcFolder);
}
}
}
}
}
}
}
@@ -0,0 +1,64 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Output.FileWriters.ImageArchiver
{
public class ArchiverCfg : ComponentCfgBase, Generic.IComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ArchiverCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new ArchiverCfgCtrl(); }
public string DestinationPath; /// Directory path into which the results will be saved
public string DestinationPath2; /// Directory path into which the 2nd copy of results will be saved
public YearFolders YearFolders;
public MonthFolders MonthFolders;
public DayFolders DayFolders;
public string ArchiveFormat;
public bool SaveGoodOnly;
[XmlIgnore]
public Config.Entities.MetersKind MetersKind;
/// Private parameterless constructor invoked by all other (public) constructors
ArchiverCfg()
{
}
public ArchiverCfg(string name, IComponentFactory factory, Config.Entities.MetersKind metersKind)
: this()
{
Name = name;
Factory = factory;
MetersKind = metersKind;
ParentName = string.Empty;
DestinationPath = Program.HomeDir + "Results\\";
DestinationPath2 = string.Empty;
YearFolders = YearFolders.FourDigit;
MonthFolders = MonthFolders.Digit;
DayFolders = DayFolders.Digit;
ArchiveFormat = "{0:yyyyMMdd}";
SaveGoodOnly = false;
}
public string ToString(int i)
{
return string.Format("Name={0}, Path={1}, Y={2}, M={3}, D={4}, ArchiveFmt={5}, GoodOnly={6}",
Name,
DestinationPath,
YearFolders,
MonthFolders,
DayFolders,
ArchiveFormat,
SaveGoodOnly);
}
}
}
@@ -0,0 +1,175 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Windows.Forms;
using log4net;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Output.FileWriters.ImageArchiver
{
public partial class ArchiverCfgCtrl : UserControl, IComponentCfgCtrl
{
static readonly ILog log = LogManager.GetLogger(typeof(ArchiverCfgCtrl));
public bool ShowMore { get { return false; } }
public bool Compound;
ArchiverCfg config;
public IComponentCfg Config
{
get { return config as IComponentCfg; }
set
{
config = value as ArchiverCfg;
Redraw();
}
}
string[] selectedItems;
public ArchiverCfgCtrl()
{
InitializeComponent();
}
private void WriterCfgCtrl_Load(object sender, EventArgs e)
{
for (YearFolders s = 0; s < YearFolders.Count; s++) yearFoldersComboBox.Items.Add(s.ToString());
for (MonthFolders s = 0; s < MonthFolders.Count; s++) monthFoldersComboBox.Items.Add(s.ToString());
for (DayFolders s = 0; s < DayFolders.Count; s++) dayFoldersComboBox.Items.Add(s.ToString());
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;
destinationTextBox.Text = config.DestinationPath;
destination2TextBox.Text = config.DestinationPath2;
yearFoldersComboBox.Text = config.YearFolders.ToString();
monthFoldersComboBox.Text = config.MonthFolders.ToString();
dayFoldersComboBox.Text = config.DayFolders.ToString();
archiveFmtTextBox.Text = config.ArchiveFormat;
goodOnlyCheckBox.Checked = config.SaveGoodOnly;
}
public void Unlock()
{
nameTextBox.Enabled = true;
destinationTextBox.Enabled = true;
destinationButton.Enabled = true;
destination2TextBox.Enabled = true;
destination2Button.Enabled = true;
yearFoldersComboBox.Enabled = true;
monthFoldersComboBox.Enabled = true;
dayFoldersComboBox.Enabled = true;
archiveFmtTextBox.Enabled = true;
goodOnlyCheckBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
if (!yearFoldersComboBox.Items.Contains(yearFoldersComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Invalid year folders selection";
}
if (!monthFoldersComboBox.Items.Contains(monthFoldersComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Invalid month folders selection";
}
if (!dayFoldersComboBox.Items.Contains(dayFoldersComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Invalid day folder selection";
}
return flags;
}
public CfgUpdateFlags UpdateCfg()
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
if (config.Name != nameTextBox.Text) { config.Name = nameTextBox.Text; flags = CfgUpdateFlags.RestartRqrd; }
if (config.DestinationPath != destinationTextBox.Text)
{
config.DestinationPath = destinationTextBox.Text;
if (!config.DestinationPath.EndsWith("\\")) config.DestinationPath += "\\";
flags = CfgUpdateFlags.RestartRqrd;
}
if (config.DestinationPath2 != destination2TextBox.Text)
{
config.DestinationPath2 = destination2TextBox.Text;
if (!config.DestinationPath2.EndsWith("\\")) config.DestinationPath2 += "\\";
flags = CfgUpdateFlags.RestartRqrd;
}
for (YearFolders i = 0; i < YearFolders.Count; i++)
{
if (i.ToString().Equals(yearFoldersComboBox.Text) && (config.YearFolders != i))
{
config.YearFolders = i;
flags = CfgUpdateFlags.RestartRqrd;
break;
}
}
for (MonthFolders i = 0; i < MonthFolders.Count; i++)
{
if (i.ToString().Equals(monthFoldersComboBox.Text) && (config.MonthFolders != i))
{
config.MonthFolders = i;
flags = CfgUpdateFlags.RestartRqrd;
break;
}
}
for (DayFolders i = 0; i < DayFolders.Count; i++)
{
if (i.ToString().Equals(dayFoldersComboBox.Text) && (config.DayFolders != i))
{
config.DayFolders = i;
flags = CfgUpdateFlags.RestartRqrd;
break;
}
}
if (config.ArchiveFormat != archiveFmtTextBox.Text)
{
config.ArchiveFormat = archiveFmtTextBox.Text;
flags = CfgUpdateFlags.RestartRqrd;
}
if (config.SaveGoodOnly != goodOnlyCheckBox.Checked)
{
config.SaveGoodOnly = goodOnlyCheckBox.Checked;
flags = CfgUpdateFlags.RestartRqrd;
}
return flags;
}
private void destinationButton_Click(object sender, EventArgs e)
{
}
}
}
@@ -0,0 +1,267 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
namespace TBF.BenchControl.Output.FileWriters.ImageArchiver
{
partial class ArchiverCfgCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label();
this.destinationTextBox = new System.Windows.Forms.TextBox();
this.destinationLabel = new System.Windows.Forms.Label();
this.destinationButton = new System.Windows.Forms.Button();
this.yearFoldersLabel = new System.Windows.Forms.Label();
this.monthFoldersLabel = new System.Windows.Forms.Label();
this.dayFoldersLabel = new System.Windows.Forms.Label();
this.yearFoldersComboBox = new System.Windows.Forms.ComboBox();
this.monthFoldersComboBox = new System.Windows.Forms.ComboBox();
this.dayFoldersComboBox = new System.Windows.Forms.ComboBox();
this.destination2Button = new System.Windows.Forms.Button();
this.destination2TextBox = new System.Windows.Forms.TextBox();
this.destination2Label = new System.Windows.Forms.Label();
this.archiveFmtTextBox = new System.Windows.Forms.TextBox();
this.archiveFmtLabel = new System.Windows.Forms.Label();
this.goodOnlyCheckBox = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(108, 31);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(146, 20);
this.nameTextBox.TabIndex = 2;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(17, 34);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(35, 13);
this.nameLabel.TabIndex = 1;
this.nameLabel.Text = "Name";
//
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(105, 9);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 0;
this.classNameLabel.Text = "ComonentName";
//
// destinationTextBox
//
this.destinationTextBox.Enabled = false;
this.destinationTextBox.Location = new System.Drawing.Point(108, 54);
this.destinationTextBox.Name = "destinationTextBox";
this.destinationTextBox.Size = new System.Drawing.Size(202, 20);
this.destinationTextBox.TabIndex = 4;
//
// destinationLabel
//
this.destinationLabel.AutoSize = true;
this.destinationLabel.Location = new System.Drawing.Point(17, 57);
this.destinationLabel.Name = "destinationLabel";
this.destinationLabel.Size = new System.Drawing.Size(60, 13);
this.destinationLabel.TabIndex = 3;
this.destinationLabel.Text = "Destination";
//
// destinationButton
//
this.destinationButton.Enabled = false;
this.destinationButton.Location = new System.Drawing.Point(316, 53);
this.destinationButton.Name = "destinationButton";
this.destinationButton.Size = new System.Drawing.Size(30, 20);
this.destinationButton.TabIndex = 16;
this.destinationButton.Text = "...";
this.destinationButton.UseVisualStyleBackColor = true;
this.destinationButton.Click += new System.EventHandler(this.destinationButton_Click);
//
// yearFoldersLabel
//
this.yearFoldersLabel.AutoSize = true;
this.yearFoldersLabel.Location = new System.Drawing.Point(17, 103);
this.yearFoldersLabel.Name = "yearFoldersLabel";
this.yearFoldersLabel.Size = new System.Drawing.Size(63, 13);
this.yearFoldersLabel.TabIndex = 7;
this.yearFoldersLabel.Text = "Year folders";
//
// monthFoldersLabel
//
this.monthFoldersLabel.AutoSize = true;
this.monthFoldersLabel.Location = new System.Drawing.Point(17, 127);
this.monthFoldersLabel.Name = "monthFoldersLabel";
this.monthFoldersLabel.Size = new System.Drawing.Size(71, 13);
this.monthFoldersLabel.TabIndex = 9;
this.monthFoldersLabel.Text = "Month folders";
//
// dayFoldersLabel
//
this.dayFoldersLabel.AutoSize = true;
this.dayFoldersLabel.Location = new System.Drawing.Point(17, 151);
this.dayFoldersLabel.Name = "dayFoldersLabel";
this.dayFoldersLabel.Size = new System.Drawing.Size(60, 13);
this.dayFoldersLabel.TabIndex = 11;
this.dayFoldersLabel.Text = "Day folders";
//
// yearFoldersComboBox
//
this.yearFoldersComboBox.Enabled = false;
this.yearFoldersComboBox.FormattingEnabled = true;
this.yearFoldersComboBox.Location = new System.Drawing.Point(108, 100);
this.yearFoldersComboBox.Name = "yearFoldersComboBox";
this.yearFoldersComboBox.Size = new System.Drawing.Size(146, 21);
this.yearFoldersComboBox.TabIndex = 8;
//
// monthFoldersComboBox
//
this.monthFoldersComboBox.Enabled = false;
this.monthFoldersComboBox.FormattingEnabled = true;
this.monthFoldersComboBox.Location = new System.Drawing.Point(108, 124);
this.monthFoldersComboBox.Name = "monthFoldersComboBox";
this.monthFoldersComboBox.Size = new System.Drawing.Size(146, 21);
this.monthFoldersComboBox.TabIndex = 10;
//
// dayFoldersComboBox
//
this.dayFoldersComboBox.Enabled = false;
this.dayFoldersComboBox.FormattingEnabled = true;
this.dayFoldersComboBox.Location = new System.Drawing.Point(108, 148);
this.dayFoldersComboBox.Name = "dayFoldersComboBox";
this.dayFoldersComboBox.Size = new System.Drawing.Size(146, 21);
this.dayFoldersComboBox.TabIndex = 12;
//
// destination2Button
//
this.destination2Button.Enabled = false;
this.destination2Button.Location = new System.Drawing.Point(316, 78);
this.destination2Button.Name = "destination2Button";
this.destination2Button.Size = new System.Drawing.Size(30, 20);
this.destination2Button.TabIndex = 17;
this.destination2Button.Text = "...";
this.destination2Button.UseVisualStyleBackColor = true;
//
// destination2TextBox
//
this.destination2TextBox.Enabled = false;
this.destination2TextBox.Location = new System.Drawing.Point(108, 77);
this.destination2TextBox.Name = "destination2TextBox";
this.destination2TextBox.Size = new System.Drawing.Size(202, 20);
this.destination2TextBox.TabIndex = 6;
//
// destination2Label
//
this.destination2Label.AutoSize = true;
this.destination2Label.Location = new System.Drawing.Point(17, 80);
this.destination2Label.Name = "destination2Label";
this.destination2Label.Size = new System.Drawing.Size(69, 13);
this.destination2Label.TabIndex = 5;
this.destination2Label.Text = "Destination 2";
//
// archiveFmtTextBox
//
this.archiveFmtTextBox.Enabled = false;
this.archiveFmtTextBox.Location = new System.Drawing.Point(108, 172);
this.archiveFmtTextBox.Name = "archiveFmtTextBox";
this.archiveFmtTextBox.Size = new System.Drawing.Size(202, 20);
this.archiveFmtTextBox.TabIndex = 14;
//
// archiveFmtLabel
//
this.archiveFmtLabel.AutoSize = true;
this.archiveFmtLabel.Location = new System.Drawing.Point(17, 175);
this.archiveFmtLabel.Name = "archiveFmtLabel";
this.archiveFmtLabel.Size = new System.Drawing.Size(75, 13);
this.archiveFmtLabel.TabIndex = 13;
this.archiveFmtLabel.Text = "Archive format";
//
// goodOnlyCheckBox
//
this.goodOnlyCheckBox.AutoSize = true;
this.goodOnlyCheckBox.Location = new System.Drawing.Point(108, 200);
this.goodOnlyCheckBox.Name = "goodOnlyCheckBox";
this.goodOnlyCheckBox.Size = new System.Drawing.Size(74, 17);
this.goodOnlyCheckBox.TabIndex = 15;
this.goodOnlyCheckBox.Text = "Good only";
this.goodOnlyCheckBox.UseVisualStyleBackColor = true;
//
// ArchiverCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.goodOnlyCheckBox);
this.Controls.Add(this.archiveFmtTextBox);
this.Controls.Add(this.archiveFmtLabel);
this.Controls.Add(this.destination2Button);
this.Controls.Add(this.destination2TextBox);
this.Controls.Add(this.destination2Label);
this.Controls.Add(this.dayFoldersComboBox);
this.Controls.Add(this.monthFoldersComboBox);
this.Controls.Add(this.yearFoldersComboBox);
this.Controls.Add(this.dayFoldersLabel);
this.Controls.Add(this.monthFoldersLabel);
this.Controls.Add(this.yearFoldersLabel);
this.Controls.Add(this.destinationButton);
this.Controls.Add(this.destinationTextBox);
this.Controls.Add(this.destinationLabel);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Name = "ArchiverCfgCtrl";
this.Size = new System.Drawing.Size(384, 282);
this.Load += new System.EventHandler(this.WriterCfgCtrl_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox nameTextBox;
private System.Windows.Forms.Label nameLabel;
private System.Windows.Forms.Label classNameLabel;
private System.Windows.Forms.TextBox destinationTextBox;
private System.Windows.Forms.Label destinationLabel;
private System.Windows.Forms.Button destinationButton;
private System.Windows.Forms.Label yearFoldersLabel;
private System.Windows.Forms.Label monthFoldersLabel;
private System.Windows.Forms.Label dayFoldersLabel;
private System.Windows.Forms.ComboBox yearFoldersComboBox;
private System.Windows.Forms.ComboBox monthFoldersComboBox;
private System.Windows.Forms.ComboBox dayFoldersComboBox;
private System.Windows.Forms.Button destination2Button;
private System.Windows.Forms.TextBox destination2TextBox;
private System.Windows.Forms.Label destination2Label;
private System.Windows.Forms.TextBox archiveFmtTextBox;
private System.Windows.Forms.Label archiveFmtLabel;
private System.Windows.Forms.CheckBox goodOnlyCheckBox;
}
}
@@ -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,29 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Output.FileWriters.ImageArchiver
{
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public void ResetStaticProperties() { Archiver.ResetStaticProperties(); }
public IComponent DummyComponent() { return new Archiver(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Archiver(cfg); }
public IComponentCfg DefaultConfig() { return new ArchiverCfg("FileWriter.ImageArchiver", this, Config.Entities.MetersKind.Single); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
IComponentCfg cfg = ComponentCfgBase.CreateFromDbEntity(ArchiverCfg.Serializer, component, this);
(cfg as ArchiverCfg).MetersKind = Config.Entities.MetersKind.Single;
return cfg;
}
}
}
@@ -0,0 +1,29 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Output.FileWriters.OneFilePerMeter
{
public class FactoryCompound : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17) + ".Compound"; } }
public void ResetStaticProperties() { Writer.ResetStaticProperties(); }
public IComponent DummyComponent() { return new Writer(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Writer(cfg); }
public IComponentCfg DefaultConfig() { return new WriterCfg("FileWriter.OneFilePerMeter.Compound", this, Config.Entities.MetersKind.Combined); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
IComponentCfg cfg = ComponentCfgBase.CreateFromDbEntity(WriterCfg.Serializer, component, this);
(cfg as WriterCfg).MetersKind = Config.Entities.MetersKind.Combined;
return cfg;
}
}
}
@@ -0,0 +1,29 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Output.FileWriters.OneFilePerMeter
{
public class FactoryHeatMeters : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17) + ".HeatMeters"; } }
public void ResetStaticProperties() { Writer.ResetStaticProperties(); }
public IComponent DummyComponent() { return new Writer(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Writer(cfg); }
public IComponentCfg DefaultConfig() { return new WriterCfg("FileWriter.OneFilePerMeter.HeatMeters", this, Config.Entities.MetersKind.HeatMeter); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
IComponentCfg cfg = ComponentCfgBase.CreateFromDbEntity(WriterCfg.Serializer, component, this);
(cfg as WriterCfg).MetersKind = Config.Entities.MetersKind.HeatMeter;
return cfg;
}
}
}
@@ -0,0 +1,29 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Output.FileWriters.OneFilePerMeter
{
public class FactorySingle : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17) + ".Single"; } }
public void ResetStaticProperties() { Writer.ResetStaticProperties(); }
public IComponent DummyComponent() { return new Writer(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Writer(cfg); }
public IComponentCfg DefaultConfig() { return new WriterCfg("FileWriter.OneFilePerMeter.Single", this, Config.Entities.MetersKind.Single); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
IComponentCfg cfg = ComponentCfgBase.CreateFromDbEntity(WriterCfg.Serializer, component, this);
(cfg as WriterCfg).MetersKind = Config.Entities.MetersKind.Single;
return cfg;
}
}
}
@@ -0,0 +1,438 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Threading;
using log4net;
using TBF.Resources;
namespace TBF.BenchControl.Output.FileWriters.OneFilePerMeter
{
public class Writer : ComponentBase, IOperation, GenericDevices.IResultsWriter
{
private static readonly ILog log = LogManager.GetLogger(typeof(Writer));
public override string ToString() { return string.Format("Output.FileWriters.Enhanced({0})", Cfg.ToString(1)); }
readonly WriterCfg writerCfg;
string separatorStr;
///
/// Items to print
///
string header;
IList<Results.WMeterRsltItemSpec> commonItems;
IList<Results.WMeterRsltItemSpec> testItems;
string footer;
Results.Entities.Batch batch;
bool abort; /// Set to 'true' by Stop() operation to abort writing to files
public Writer() {}
public Writer(Generic.IComponentCfg cfg)
: base(cfg)
{
writerCfg = cfg as WriterCfg;
ApplyConfig();
log.Debug(this.ToString());
}
void ApplyConfig()
{
switch (writerCfg.Separator)
{
default:
case Separator.None: separatorStr = string.Empty; break;
case Separator.Space: separatorStr = " "; break;
case Separator.Tabulator: separatorStr = "\t"; break;
case Separator.Comma: separatorStr = ","; break;
case Separator.Semicolon: separatorStr = ";"; break;
}
header = string.IsNullOrEmpty(writerCfg.Header) ? string.Empty : writerCfg.Header.Replace("~", Environment.NewLine);
commonItems = Results.WMeterRsltItemSpec.FromStrArray(writerCfg.CommonItems);
testItems = Results.WMeterRsltItemSpec.FromStrArray(writerCfg.SelectedItems); /// TestID info will be overwritten later on
footer = string.IsNullOrEmpty(writerCfg.Footer) ? string.Empty : writerCfg.Footer.Replace("~", Environment.NewLine);
}
#region Configuration Change Handling
public static void OnCfgChange(object sender, CfgChangeArgs args)
{
if (CfgChangeHandler == null) return;
try { CfgChangeHandler(sender, args); }
catch (Exception e) { log.Error("CfgChangeHandler(...) failed", e); }
}
public static event EventHandler<CfgChangeArgs> CfgChangeHandler;
public override void StartChangeHandler()
{
CfgChangeHandler += delegate(object sender, CfgChangeArgs args)
{
WriterCfg newCfg = args.Cfg as WriterCfg;
if (newCfg != null && newCfg.Name.Equals(Name))
{
if (args.Command == CfgChangeCmd.CfgChange)
{
writerCfg.DestinationPath = newCfg.DestinationPath;
writerCfg.DestinationPath2 = newCfg.DestinationPath2;
writerCfg.YearFolders = newCfg.YearFolders;
writerCfg.MonthFolders = newCfg.MonthFolders;
writerCfg.DayFolders = newCfg.DayFolders;
writerCfg.FileNameFormat = newCfg.FileNameFormat;
writerCfg.Culture = newCfg.Culture;
writerCfg.Separator = newCfg.Separator;
writerCfg.EliminateSpaces = newCfg.EliminateSpaces;
writerCfg.CommonItems = newCfg.CommonItems;
writerCfg.SelectedItems = newCfg.SelectedItems;
writerCfg.Header = newCfg.Header;
writerCfg.Footer = newCfg.Footer;
ApplyConfig();
}
}
};
}
#endregion Configuration Change Handling
/// <summary>
/// Eliminate spaces conditionally, depesing on bool WriterCfg.EliminateSpaces
/// </summary>
/// <param name="item">Input string</param>
/// <returns>Output string</returns>
string ElSpaces(string item)
{
if (writerCfg.EliminateSpaces)
return item.Replace(" ", string.Empty);
else
return item;
}
/// <summary>
/// Returns a file name derived from a DateTime structure.
/// Creates directories on this path as a side effect.
/// </summary>
/// <param name="time">Date and time</param>
/// <returns>File name</returns>
string GetFilename(string destinationPath, DateTime time)
{
string directory = destinationPath; /// Ends with "\\";
switch (writerCfg.YearFolders)
{
case YearFolders.FourDigit:
directory = string.Format("{0}{1:yyyy}\\", directory, time);
break;
case YearFolders.TwoDigit:
directory = string.Format("{0}{1:yy}\\", directory, time);
break;
}
switch (writerCfg.MonthFolders)
{
case MonthFolders.Name:
{
string monthStr;
switch (time.Month)
{
default:
case 1: monthStr = "January"; break;
case 2: monthStr = "February"; break;
case 3: monthStr = "March"; break;
case 4: monthStr = "April"; break;
case 5: monthStr = "May"; break;
case 6: monthStr = "June"; break;
case 7: monthStr = "July"; break;
case 8: monthStr = "August"; break;
case 9: monthStr = "September"; break;
case 10: monthStr = "October"; break;
case 11: monthStr = "November"; break;
case 12: monthStr = "December"; break;
}
directory = string.Format("{0}{1}\\", directory, monthStr);
break;
}
case MonthFolders.Digit:
directory = string.Format("{0}{1}\\", directory, time.Month.ToString());
break;
case MonthFolders.TwoDigit:
directory = string.Format("{0}{1:MM}\\", directory, time);
break;
}
switch (writerCfg.DayFolders)
{
case DayFolders.Digit:
directory = string.Format("{0}{1}\\", directory, time.Day.ToString());
break;
case DayFolders.TwoDigit:
directory = string.Format("{0}{1:dd}\\", directory, time);
break;
}
Directory.CreateDirectory(directory);
try
{
if (string.IsNullOrEmpty(writerCfg.FileNameFormat)) throw new Exception();
return directory + string.Format(writerCfg.FileNameFormat, time);
}
catch
{
return string.Format("{0}{1:yyMMdd-HHmm}.txt", directory, time);
}
}
/// <summary>
/// Writes the test cycle results into a file
/// Events:
/// Event.ResultsWritten
/// Event.Busy
/// </summary>
/// <param name="batch">Results to write into a file</param>
/// <returns>Reference to the operation</returns>
public IOperation WriteResultsOp(Results.Entities.Batch batch)
{
this.batch = batch;
return this;
}
/// <summary>Start this operation</summary>
public void Start()
{
CultureInfo oriCulture = Thread.CurrentThread.CurrentCulture;
try { Thread.CurrentThread.CurrentCulture = new CultureInfo(writerCfg.Culture.ToString()); }
catch { }
WriteRslts(batch, writerCfg.DestinationPath);
WriteRslts(batch, writerCfg.DestinationPath2);
Thread.CurrentThread.CurrentCulture = oriCulture;
}
/// <summary>Run this operation</summary>
/// <returns>Event.ResultsWritten</returns>
public Event Run()
{
return Event.ResultsWritten;
}
/// <summary>Stop this operation</summary>
public void Stop()
{
}
void WriteRslts(Results.Entities.Batch batch, string destination)
{
StreamWriter writer = StreamWriter.Null;
if (!string.IsNullOrEmpty(destination))
{
try
{
writer = File.AppendText(GetFilename(destination, batch.EndTime));
}
catch
{
}
}
WriteRsltsEx(batch, writer);
writer.Close();
}
void WriteRsltsEx(Results.Entities.Batch batch, StreamWriter wrtr)
{
///----------
/// Header
///----------
if (!string.IsNullOrEmpty(writerCfg.Header)) wrtr.Write(header);
wrtr.WriteLine(string.Empty);
///----------------
/// Common items
///----------------
string[] leftColumn = new string[commonItems.Count];
string[] rightColumn = new string[commonItems.Count];
int cnt = 0;
foreach (var v in commonItems)
{
leftColumn[cnt] = v.Caption;
rightColumn[cnt] = (batch.WaterMeters.Count > 0) ? v.Print(batch.WaterMeters[0]) : string.Empty;
cnt++;
}
/// Determine max. left column width in characters
int maxLen = 0;
foreach (var s in leftColumn) if (s.Length > maxLen) maxLen = s.Length;
/// Write aligned columns
for (int i = 0; i < Math.Min(leftColumn.Length, rightColumn.Length); i++)
{
if (abort) return;
wrtr.Write(leftColumn[i]);
wrtr.Write(new string(' ', maxLen - leftColumn[i].Length + 3));
wrtr.WriteLine(rightColumn[i]);
}
///--------
/// Body
///--------
foreach (var wm in batch.WaterMeters)
{
WriteWM(wrtr, wm);
if (abort) return;
}
///----------
/// Footer
///----------
if (!string.IsNullOrEmpty(writerCfg.Footer)) wrtr.Write(footer);
}
/// <summary>
/// Write one water meter results
/// </summary>
/// <param name="wmNr">Water meter number (0-based)</param>
void WriteWM(StreamWriter wr, Results.Entities.WaterMeter wm)
{
wr.WriteLine(string.Empty);
/// Write water meter number and s/n
#if BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || BADGER_VELKA_TRAT
wr.Write(string.Format("Water meter {0} s/n: {1}", wm.WMPosition, wm.SerialNr));
#else
wr.Write(string.Format(Strings.Water_Meter_nr, wm.WMPosition));
if (!wm.Compound())
{
if (!string.IsNullOrEmpty(wm.SerialNr))
{
wr.Write(string.Format(", {0} {1}", Strings.SerialNr, wm.SerialNr));
}
}
else
{
if (!string.IsNullOrEmpty(wm.SerialNr))
{
wr.Write(string.Format(", {0} {1}", Strings.Main_WM_SerialNr, wm.SerialNr));
}
if (!string.IsNullOrEmpty(wm.SerialNrAux))
{
wr.Write(string.Format(", {0} {1}", Strings.Aux_WM_SerialNr, wm.SerialNrAux));
}
}
#endif
wr.WriteLine(string.Empty);
/// Determine column widths
int[] columnWidths = new int[testItems.Count];
int totalWidth = 0;
for (int i = 0; i < testItems.Count; i++)
{
if (abort) return;
columnWidths[i] = ElSpaces(testItems[i].Caption).Length;
foreach (var mtr in wm.MeterTestRslts)
{
if ((mtr != null) && (mtr.Publish() == Config.Entities.Publish.Always))
{
string itemText = testItems[i].Print(wm, mtr.Name());
/// Strip color information
string[] texts = itemText.Split(new char[] { '|' });
if (texts.Length == 2) { itemText = texts[0]; }
int len = ElSpaces(itemText).Length;
if (len > columnWidths[i]) columnWidths[i] = len;
}
}
totalWidth += columnWidths[i];
}
totalWidth += 3 * (testItems.Count - 1);
if (totalWidth < 0) totalWidth = 0;
string horizontalLine = new String('-', totalWidth);
wr.WriteLine(horizontalLine); /// Horizontal line above the header
/// Write column headers
for (int i = 0; i < testItems.Count; i++)
{
if (abort) return;
string caption = ElSpaces(testItems[i].Caption);
wr.Write(caption);
if (i < testItems.Count - 1)
{
if (!writerCfg.EliminateSpaces)
{
wr.Write(new string(' ', columnWidths[i] - testItems[i].Caption.Length + 3));
}
wr.Write(separatorStr);
}
else
{
wr.WriteLine(string.Empty);
}
}
wr.WriteLine(horizontalLine); /// Horizontal line between the header and the body
/// Write table data
foreach (var mtr in wm.MeterTestRslts)
{
if (abort) return;
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always)
{
for (int i = 0; i < testItems.Count; i++)
{
/// Fetch the item
string itemText = testItems[i].Print(wm, mtr.Name());
/// Strip color information
string[] texts = itemText.Split(new char[] { '|' });
if (texts.Length == 2) { itemText = texts[0]; }
/// Print the item
string itemText2 = ElSpaces(itemText);
wr.Write(itemText2);
if (i < testItems.Count - 1)
{
if (!writerCfg.EliminateSpaces)
{
wr.Write(new string(' ', columnWidths[i] - itemText.Length + 3));
}
wr.Write(separatorStr);
}
else
{
wr.WriteLine(string.Empty);
}
}
}
}
wr.WriteLine(horizontalLine); /// Horizontal line below the body
}
}
}
@@ -0,0 +1,71 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Output.FileWriters.OneFilePerMeter
{
public class WriterCfg : ComponentCfgBase, Generic.IComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(WriterCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new WriterCfgCtrl(); }
public string DestinationPath; /// Directory path into which the results will be saved
public string DestinationPath2; /// Directory path into which the 2nd copy of results will be saved
public YearFolders YearFolders;
public MonthFolders MonthFolders;
public DayFolders DayFolders;
public string FileNameFormat;
public Culture Culture;
public Separator Separator;
public bool EliminateSpaces;
public string[] CommonItems;
public string[] SelectedItems;
public string Header;
public string Footer;
[XmlIgnore]
public Config.Entities.MetersKind MetersKind;
/// Private parameterless constructor invoked by all other (public) constructors
WriterCfg()
{
}
public WriterCfg(string name, IComponentFactory factory, Config.Entities.MetersKind metersKind)
: this()
{
Name = name;
Factory = factory;
MetersKind = metersKind;
ParentName = string.Empty;
DestinationPath = Program.HomeDir + "Results\\";
DestinationPath2 = string.Empty;
YearFolders = YearFolders.FourDigit;
MonthFolders = MonthFolders.Digit;
DayFolders = DayFolders.Digit;
FileNameFormat = "{0:yyMMdd-HHmm}.txt";
Separator = Separator.None;
EliminateSpaces = false;
Header = string.Empty;
Footer = string.Empty;
}
public string ToString(int i)
{
return string.Format("Name={0}, Path={1}, Y={2}, M={3}, D={4}, FNameFmt={5}, Separator={6}, EliminateSpaces={7}",
Name,
DestinationPath,
YearFolders,
MonthFolders,
DayFolders,
FileNameFormat,
Separator,
EliminateSpaces);
}
}
}
@@ -0,0 +1,338 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using log4net;
using TBF.BenchControl.Generic;
using TBF.Resources;
namespace TBF.BenchControl.Output.FileWriters.OneFilePerMeter
{
public partial class WriterCfgCtrl : UserControl, IComponentCfgCtrl
{
static readonly ILog log = LogManager.GetLogger(typeof(WriterCfgCtrl));
public bool ShowMore { get { return false; } }
WriterCfg config;
public IComponentCfg Config
{
get { return config as IComponentCfg; }
set
{
config = value as WriterCfg;
Redraw();
}
}
string header;
string[] commonItems;
string[] testItems;
string footer;
public WriterCfgCtrl()
{
InitializeComponent();
Localize();
}
private void WriterCfgCtrl_Load(object sender, EventArgs e)
{
for (YearFolders s = 0; s < YearFolders.Count; s++) yearFoldersComboBox.Items.Add(s.ToString());
for (MonthFolders s = 0; s < MonthFolders.Count; s++) monthFoldersComboBox.Items.Add(s.ToString());
for (DayFolders s = 0; s < DayFolders.Count; s++) dayFoldersComboBox.Items.Add(s.ToString());
for (Culture s = 0; s < Culture.Count; s++) cultureComboBox.Items.Add(s.ToString());
for (Separator s = 0; s < Separator.Count; s++) separatorComboBox.Items.Add(s.ToString());
header = config.Header;
commonItems = config.CommonItems;
testItems = config.SelectedItems;
footer = config.Footer;
Redraw();
}
void Localize()
{
nameLabel.Text = Strings.Name;
destinationLabel.Text = "Destination";
destination2Label.Text = "Destination" + " 2";
yearFoldersLabel.Text = "Year folders";
monthFoldersLabel.Text = "Month folders";
dayFoldersLabel.Text = "Day folders";
fileNameFmtLabel.Text = "File name format";
cultureLabel.Text = "Culture";
separatorLabel.Text = "Separator";
eliminateSpacesCheckBox.Text = "No spaces";
headerButton.Text = Strings.Header;
commonItemsButton.Text = "Common items";
testItemsButton.Text = "Test items";
footerButton.Text = Strings.Footer;
}
public void Closing()
{
}
void Redraw()
{
if (config == null) return; /// Control was not loaded, settings were not changed
classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name;
destinationTextBox.Text = config.DestinationPath;
destination2TextBox.Text = config.DestinationPath2;
yearFoldersComboBox.Text = config.YearFolders.ToString();
monthFoldersComboBox.Text = config.MonthFolders.ToString();
dayFoldersComboBox.Text = config.DayFolders.ToString();
fileNameFmtTextBox.Text = config.FileNameFormat;
cultureComboBox.Text = config.Culture.ToString();
separatorComboBox.Text = config.Separator.ToString();
eliminateSpacesCheckBox.Checked = config.EliminateSpaces;
}
public void Unlock()
{
nameTextBox.Enabled = true;
destinationTextBox.Enabled = true;
destinationButton.Enabled = true;
destination2TextBox.Enabled = true;
destination2Button.Enabled = true;
yearFoldersComboBox.Enabled = true;
monthFoldersComboBox.Enabled = true;
dayFoldersComboBox.Enabled = true;
fileNameFmtTextBox.Enabled = true;
cultureComboBox.Enabled = true;
separatorComboBox.Enabled = true;
eliminateSpacesCheckBox.Enabled = true;
headerButton.Enabled = true;
commonItemsButton.Enabled = true;
testItemsButton.Enabled = true;
footerButton.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
if (!yearFoldersComboBox.Items.Contains(yearFoldersComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Invalid year folders selection";
}
if (!monthFoldersComboBox.Items.Contains(monthFoldersComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Invalid month folders selection";
}
if (!dayFoldersComboBox.Items.Contains(dayFoldersComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Invalid day folder selection";
}
if (!cultureComboBox.Items.Contains(cultureComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Invalid culture";
}
if (!separatorComboBox.Items.Contains(separatorComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Invalid separator";
}
return flags;
}
public CfgUpdateFlags UpdateCfg()
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
if (config.Name != nameTextBox.Text)
{
config.Name = nameTextBox.Text;
flags |= (CfgUpdateFlags.RestartRqrd | CfgUpdateFlags.AnyChange);
}
if (config.DestinationPath != destinationTextBox.Text)
{
config.DestinationPath = destinationTextBox.Text;
if (!config.DestinationPath.EndsWith("\\")) config.DestinationPath += "\\";
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.DestinationPath2 != destination2TextBox.Text)
{
config.DestinationPath2 = destination2TextBox.Text;
if (!config.DestinationPath2.EndsWith("\\")) config.DestinationPath2 += "\\";
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
for (YearFolders i = 0; i < YearFolders.Count; i++)
{
if (i.ToString().Equals(yearFoldersComboBox.Text) && (config.YearFolders != i))
{
config.YearFolders = i;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
break;
}
}
for (MonthFolders i = 0; i < MonthFolders.Count; i++)
{
if (i.ToString().Equals(monthFoldersComboBox.Text) && (config.MonthFolders != i))
{
config.MonthFolders = i;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
break;
}
}
for (DayFolders i = 0; i < DayFolders.Count; i++)
{
if (i.ToString().Equals(dayFoldersComboBox.Text) && (config.DayFolders != i))
{
config.DayFolders = i;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
break;
}
}
if (config.FileNameFormat != fileNameFmtTextBox.Text)
{
config.FileNameFormat = fileNameFmtTextBox.Text;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
for (Culture i = 0; i < Culture.Count; i++)
{
if (i.ToString().Equals(cultureComboBox.Text) && (config.Culture != i))
{
config.Culture = i;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
break;
}
}
for (Separator i = 0; i < Separator.Count; i++)
{
if (i.ToString().Equals(separatorComboBox.Text) && (config.Separator != i))
{
config.Separator = i;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
break;
}
}
if (config.EliminateSpaces != eliminateSpacesCheckBox.Checked)
{
config.EliminateSpaces = eliminateSpacesCheckBox.Checked;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.CommonItems != commonItems)
{
config.CommonItems = commonItems;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.SelectedItems != testItems)
{
config.SelectedItems = testItems;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.Header != header)
{
config.Header = header;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.Footer != footer)
{
config.Footer = footer;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if ((flags & CfgUpdateFlags.InvokeCfgChange) != 0)
{
Writer.OnCfgChange(this, new CfgChangeArgs(CfgChangeCmd.CfgChange, config));
}
return flags;
}
private void destinationButton_Click(object sender, EventArgs e)
{
}
private void headerButton_Click(object sender, EventArgs e)
{
HeaderFooterDlg dlg = new HeaderFooterDlg(true, string.IsNullOrEmpty(header) ? string.Empty : header.Replace("~", Environment.NewLine));
if (dlg.ShowDialog() == DialogResult.OK)
{
header = dlg.EditedText.Replace(Environment.NewLine, "~");
}
}
private void commonItemsButton_Click(object sender, EventArgs e)
{
Results.Forms.ResultsConfigDlg dlg = new Results.Forms.ResultsConfigDlg()
{
MetersKind = config.MetersKind,
SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(commonItems),
};
if (dlg.ShowDialog() == DialogResult.OK)
{
commonItems = Results.WMeterRsltItemSpec.ToStrArray(dlg.SelectedItems);
}
}
private void testItemsButton_Click(object sender, EventArgs e)
{
Results.Forms.ResultsConfigDlg dlg = new Results.Forms.ResultsConfigDlg(true)
{
MetersKind = config.MetersKind,
SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(testItems),
};
if (dlg.ShowDialog() == DialogResult.OK)
{
testItems = Results.WMeterRsltItemSpec.ToStrArray(dlg.SelectedItems);
}
}
private void footerButton_Click(object sender, EventArgs e)
{
HeaderFooterDlg dlg = new HeaderFooterDlg(false, string.IsNullOrEmpty(footer) ? string.Empty : footer.Replace("~", Environment.NewLine));
if (dlg.ShowDialog() == DialogResult.OK)
{
footer = dlg.EditedText.Replace(Environment.NewLine, "~");
}
}
#region Configuration Change Handling
public static void OnCmdResponse(object sender, CmdResponseArgs args)
{
if (CmdResponseHandler == null) return;
try { CmdResponseHandler(sender, args); }
catch (Exception e) { log.Error("CmdResponseHandler(...) failed", e); }
}
public static event EventHandler<CmdResponseArgs> CmdResponseHandler;
public void StartResponseHandler() { }
public void StopResponseHandler() { }
#endregion Configuration Change Handling
}
}
@@ -0,0 +1,371 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
namespace TBF.BenchControl.Output.FileWriters.OneFilePerMeter
{
partial class WriterCfgCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label();
this.destinationTextBox = new System.Windows.Forms.TextBox();
this.destinationLabel = new System.Windows.Forms.Label();
this.destinationButton = new System.Windows.Forms.Button();
this.separatorLabel = new System.Windows.Forms.Label();
this.separatorComboBox = new System.Windows.Forms.ComboBox();
this.testItemsButton = new System.Windows.Forms.Button();
this.yearFoldersLabel = new System.Windows.Forms.Label();
this.monthFoldersLabel = new System.Windows.Forms.Label();
this.dayFoldersLabel = new System.Windows.Forms.Label();
this.yearFoldersComboBox = new System.Windows.Forms.ComboBox();
this.monthFoldersComboBox = new System.Windows.Forms.ComboBox();
this.dayFoldersComboBox = new System.Windows.Forms.ComboBox();
this.destination2Button = new System.Windows.Forms.Button();
this.destination2TextBox = new System.Windows.Forms.TextBox();
this.destination2Label = new System.Windows.Forms.Label();
this.fileNameFmtTextBox = new System.Windows.Forms.TextBox();
this.fileNameFmtLabel = new System.Windows.Forms.Label();
this.eliminateSpacesCheckBox = new System.Windows.Forms.CheckBox();
this.headerButton = new System.Windows.Forms.Button();
this.footerButton = new System.Windows.Forms.Button();
this.commonItemsButton = new System.Windows.Forms.Button();
this.cultureComboBox = new System.Windows.Forms.ComboBox();
this.cultureLabel = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(108, 28);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(146, 20);
this.nameTextBox.TabIndex = 2;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(17, 31);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(35, 13);
this.nameLabel.TabIndex = 1;
this.nameLabel.Text = "Name";
//
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(105, 6);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 0;
this.classNameLabel.Text = "ComonentName";
//
// destinationTextBox
//
this.destinationTextBox.Enabled = false;
this.destinationTextBox.Location = new System.Drawing.Point(108, 49);
this.destinationTextBox.Name = "destinationTextBox";
this.destinationTextBox.Size = new System.Drawing.Size(146, 20);
this.destinationTextBox.TabIndex = 4;
//
// destinationLabel
//
this.destinationLabel.AutoSize = true;
this.destinationLabel.Location = new System.Drawing.Point(17, 52);
this.destinationLabel.Name = "destinationLabel";
this.destinationLabel.Size = new System.Drawing.Size(60, 13);
this.destinationLabel.TabIndex = 3;
this.destinationLabel.Text = "Destination";
//
// destinationButton
//
this.destinationButton.Enabled = false;
this.destinationButton.Location = new System.Drawing.Point(269, 49);
this.destinationButton.Name = "destinationButton";
this.destinationButton.Size = new System.Drawing.Size(30, 20);
this.destinationButton.TabIndex = 5;
this.destinationButton.Text = "...";
this.destinationButton.UseVisualStyleBackColor = true;
this.destinationButton.Click += new System.EventHandler(this.destinationButton_Click);
//
// separatorLabel
//
this.separatorLabel.AutoSize = true;
this.separatorLabel.Location = new System.Drawing.Point(17, 203);
this.separatorLabel.Name = "separatorLabel";
this.separatorLabel.Size = new System.Drawing.Size(53, 13);
this.separatorLabel.TabIndex = 19;
this.separatorLabel.Text = "Separator";
//
// separatorComboBox
//
this.separatorComboBox.Enabled = false;
this.separatorComboBox.FormattingEnabled = true;
this.separatorComboBox.Location = new System.Drawing.Point(108, 200);
this.separatorComboBox.Name = "separatorComboBox";
this.separatorComboBox.Size = new System.Drawing.Size(146, 21);
this.separatorComboBox.TabIndex = 20;
//
// testItemsButton
//
this.testItemsButton.Enabled = false;
this.testItemsButton.Location = new System.Drawing.Point(108, 297);
this.testItemsButton.Name = "testItemsButton";
this.testItemsButton.Size = new System.Drawing.Size(146, 23);
this.testItemsButton.TabIndex = 24;
this.testItemsButton.Text = "Test items";
this.testItemsButton.UseVisualStyleBackColor = true;
this.testItemsButton.Click += new System.EventHandler(this.testItemsButton_Click);
//
// yearFoldersLabel
//
this.yearFoldersLabel.AutoSize = true;
this.yearFoldersLabel.Location = new System.Drawing.Point(17, 94);
this.yearFoldersLabel.Name = "yearFoldersLabel";
this.yearFoldersLabel.Size = new System.Drawing.Size(63, 13);
this.yearFoldersLabel.TabIndex = 9;
this.yearFoldersLabel.Text = "Year folders";
//
// monthFoldersLabel
//
this.monthFoldersLabel.AutoSize = true;
this.monthFoldersLabel.Location = new System.Drawing.Point(17, 116);
this.monthFoldersLabel.Name = "monthFoldersLabel";
this.monthFoldersLabel.Size = new System.Drawing.Size(71, 13);
this.monthFoldersLabel.TabIndex = 11;
this.monthFoldersLabel.Text = "Month folders";
//
// dayFoldersLabel
//
this.dayFoldersLabel.AutoSize = true;
this.dayFoldersLabel.Location = new System.Drawing.Point(17, 138);
this.dayFoldersLabel.Name = "dayFoldersLabel";
this.dayFoldersLabel.Size = new System.Drawing.Size(60, 13);
this.dayFoldersLabel.TabIndex = 13;
this.dayFoldersLabel.Text = "Day folders";
//
// yearFoldersComboBox
//
this.yearFoldersComboBox.Enabled = false;
this.yearFoldersComboBox.FormattingEnabled = true;
this.yearFoldersComboBox.Location = new System.Drawing.Point(108, 91);
this.yearFoldersComboBox.Name = "yearFoldersComboBox";
this.yearFoldersComboBox.Size = new System.Drawing.Size(146, 21);
this.yearFoldersComboBox.TabIndex = 10;
//
// monthFoldersComboBox
//
this.monthFoldersComboBox.Enabled = false;
this.monthFoldersComboBox.FormattingEnabled = true;
this.monthFoldersComboBox.Location = new System.Drawing.Point(108, 113);
this.monthFoldersComboBox.Name = "monthFoldersComboBox";
this.monthFoldersComboBox.Size = new System.Drawing.Size(146, 21);
this.monthFoldersComboBox.TabIndex = 12;
//
// dayFoldersComboBox
//
this.dayFoldersComboBox.Enabled = false;
this.dayFoldersComboBox.FormattingEnabled = true;
this.dayFoldersComboBox.Location = new System.Drawing.Point(108, 135);
this.dayFoldersComboBox.Name = "dayFoldersComboBox";
this.dayFoldersComboBox.Size = new System.Drawing.Size(146, 21);
this.dayFoldersComboBox.TabIndex = 14;
//
// destination2Button
//
this.destination2Button.Enabled = false;
this.destination2Button.Location = new System.Drawing.Point(269, 70);
this.destination2Button.Name = "destination2Button";
this.destination2Button.Size = new System.Drawing.Size(30, 20);
this.destination2Button.TabIndex = 8;
this.destination2Button.Text = "...";
this.destination2Button.UseVisualStyleBackColor = true;
//
// destination2TextBox
//
this.destination2TextBox.Enabled = false;
this.destination2TextBox.Location = new System.Drawing.Point(108, 70);
this.destination2TextBox.Name = "destination2TextBox";
this.destination2TextBox.Size = new System.Drawing.Size(146, 20);
this.destination2TextBox.TabIndex = 7;
//
// destination2Label
//
this.destination2Label.AutoSize = true;
this.destination2Label.Location = new System.Drawing.Point(17, 73);
this.destination2Label.Name = "destination2Label";
this.destination2Label.Size = new System.Drawing.Size(69, 13);
this.destination2Label.TabIndex = 6;
this.destination2Label.Text = "Destination 2";
//
// fileNameFmtTextBox
//
this.fileNameFmtTextBox.Enabled = false;
this.fileNameFmtTextBox.Location = new System.Drawing.Point(108, 157);
this.fileNameFmtTextBox.Name = "fileNameFmtTextBox";
this.fileNameFmtTextBox.Size = new System.Drawing.Size(146, 20);
this.fileNameFmtTextBox.TabIndex = 16;
//
// fileNameFmtLabel
//
this.fileNameFmtLabel.AutoSize = true;
this.fileNameFmtLabel.Location = new System.Drawing.Point(17, 160);
this.fileNameFmtLabel.Name = "fileNameFmtLabel";
this.fileNameFmtLabel.Size = new System.Drawing.Size(84, 13);
this.fileNameFmtLabel.TabIndex = 15;
this.fileNameFmtLabel.Text = "File name format";
//
// eliminateSpacesCheckBox
//
this.eliminateSpacesCheckBox.AutoSize = true;
this.eliminateSpacesCheckBox.Location = new System.Drawing.Point(108, 227);
this.eliminateSpacesCheckBox.Name = "eliminateSpacesCheckBox";
this.eliminateSpacesCheckBox.Size = new System.Drawing.Size(77, 17);
this.eliminateSpacesCheckBox.TabIndex = 21;
this.eliminateSpacesCheckBox.Text = "No spaces";
this.eliminateSpacesCheckBox.UseVisualStyleBackColor = true;
//
// headerButton
//
this.headerButton.Enabled = false;
this.headerButton.Location = new System.Drawing.Point(108, 247);
this.headerButton.Name = "headerButton";
this.headerButton.Size = new System.Drawing.Size(146, 23);
this.headerButton.TabIndex = 22;
this.headerButton.Text = "Header";
this.headerButton.UseVisualStyleBackColor = true;
this.headerButton.Click += new System.EventHandler(this.headerButton_Click);
//
// footerButton
//
this.footerButton.Enabled = false;
this.footerButton.Location = new System.Drawing.Point(108, 322);
this.footerButton.Name = "footerButton";
this.footerButton.Size = new System.Drawing.Size(146, 23);
this.footerButton.TabIndex = 25;
this.footerButton.Text = "Footer";
this.footerButton.UseVisualStyleBackColor = true;
this.footerButton.Click += new System.EventHandler(this.footerButton_Click);
//
// commonItemsButton
//
this.commonItemsButton.Enabled = false;
this.commonItemsButton.Location = new System.Drawing.Point(108, 272);
this.commonItemsButton.Name = "commonItemsButton";
this.commonItemsButton.Size = new System.Drawing.Size(146, 23);
this.commonItemsButton.TabIndex = 23;
this.commonItemsButton.Text = "Common items";
this.commonItemsButton.UseVisualStyleBackColor = true;
this.commonItemsButton.Click += new System.EventHandler(this.commonItemsButton_Click);
//
// cultureComboBox
//
this.cultureComboBox.Enabled = false;
this.cultureComboBox.FormattingEnabled = true;
this.cultureComboBox.Location = new System.Drawing.Point(108, 178);
this.cultureComboBox.Name = "cultureComboBox";
this.cultureComboBox.Size = new System.Drawing.Size(146, 21);
this.cultureComboBox.TabIndex = 18;
//
// cultureLabel
//
this.cultureLabel.AutoSize = true;
this.cultureLabel.Location = new System.Drawing.Point(17, 181);
this.cultureLabel.Name = "cultureLabel";
this.cultureLabel.Size = new System.Drawing.Size(42, 13);
this.cultureLabel.TabIndex = 17;
this.cultureLabel.Text = "Cullture";
//
// WriterCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.cultureComboBox);
this.Controls.Add(this.cultureLabel);
this.Controls.Add(this.commonItemsButton);
this.Controls.Add(this.footerButton);
this.Controls.Add(this.headerButton);
this.Controls.Add(this.eliminateSpacesCheckBox);
this.Controls.Add(this.fileNameFmtTextBox);
this.Controls.Add(this.fileNameFmtLabel);
this.Controls.Add(this.destination2Button);
this.Controls.Add(this.destination2TextBox);
this.Controls.Add(this.destination2Label);
this.Controls.Add(this.dayFoldersComboBox);
this.Controls.Add(this.monthFoldersComboBox);
this.Controls.Add(this.yearFoldersComboBox);
this.Controls.Add(this.dayFoldersLabel);
this.Controls.Add(this.monthFoldersLabel);
this.Controls.Add(this.yearFoldersLabel);
this.Controls.Add(this.testItemsButton);
this.Controls.Add(this.separatorComboBox);
this.Controls.Add(this.separatorLabel);
this.Controls.Add(this.destinationButton);
this.Controls.Add(this.destinationTextBox);
this.Controls.Add(this.destinationLabel);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Name = "WriterCfgCtrl";
this.Size = new System.Drawing.Size(400, 350);
this.Load += new System.EventHandler(this.WriterCfgCtrl_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox nameTextBox;
private System.Windows.Forms.Label nameLabel;
private System.Windows.Forms.Label classNameLabel;
private System.Windows.Forms.TextBox destinationTextBox;
private System.Windows.Forms.Label destinationLabel;
private System.Windows.Forms.Button destinationButton;
private System.Windows.Forms.Label separatorLabel;
private System.Windows.Forms.ComboBox separatorComboBox;
private System.Windows.Forms.Button testItemsButton;
private System.Windows.Forms.Label yearFoldersLabel;
private System.Windows.Forms.Label monthFoldersLabel;
private System.Windows.Forms.Label dayFoldersLabel;
private System.Windows.Forms.ComboBox yearFoldersComboBox;
private System.Windows.Forms.ComboBox monthFoldersComboBox;
private System.Windows.Forms.ComboBox dayFoldersComboBox;
private System.Windows.Forms.Button destination2Button;
private System.Windows.Forms.TextBox destination2TextBox;
private System.Windows.Forms.Label destination2Label;
private System.Windows.Forms.TextBox fileNameFmtTextBox;
private System.Windows.Forms.Label fileNameFmtLabel;
private System.Windows.Forms.CheckBox eliminateSpacesCheckBox;
private System.Windows.Forms.Button headerButton;
private System.Windows.Forms.Button footerButton;
private System.Windows.Forms.Button commonItemsButton;
private System.Windows.Forms.ComboBox cultureComboBox;
private System.Windows.Forms.Label cultureLabel;
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,26 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Output.Printers.OnePagePerMeter
{
public class FactoryCompound : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17) + ".Compound"; } }
public void ResetStaticProperties() { Printer.ResetStaticProperties(); }
public IComponent DummyComponent() { return new Printer(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Printer(cfg); }
public IComponentCfg DefaultConfig() { return new PrinterCfg("Printer.OnePagePerMeter.Compound", this, Config.Entities.MetersKind.Combined); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(PrinterCfg.Serializer, component, this);
}
}
}
@@ -0,0 +1,26 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Output.Printers.OnePagePerMeter
{
public class FactoryHeatMeters : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17) + ".HeatMeters"; } }
public void ResetStaticProperties() { Printer.ResetStaticProperties(); }
public IComponent DummyComponent() { return new Printer(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Printer(cfg); }
public IComponentCfg DefaultConfig() { return new PrinterCfg("Printer.OnePagePerMeter.HeatMeters", this, Config.Entities.MetersKind.HeatMeter); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(PrinterCfg.Serializer, component, this);
}
}
}
@@ -0,0 +1,26 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Output.Printers.OnePagePerMeter
{
public class FactorySingle : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17) + ".Single"; } }
public void ResetStaticProperties() { Printer.ResetStaticProperties(); }
public IComponent DummyComponent() { return new Printer(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Printer(cfg); }
public IComponentCfg DefaultConfig() { return new PrinterCfg("Printer.OnePagePerMeter.Single", this, Config.Entities.MetersKind.Single); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(PrinterCfg.Serializer, component, this);
}
}
}
@@ -0,0 +1,191 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Threading;
using Results.Output.Printers.Enhanced;
using log4net;
namespace TBF.BenchControl.Output.Printers.OnePagePerMeter
{
public class Printer : ComponentBase, IOperation, GenericDevices.IResultsPrinter
{
private static readonly ILog log = LogManager.GetLogger(typeof(Printer));
public override string ToString() { return string.Format("ResultsPrinters.Basic({0})", Cfg.ToString(1)); }
readonly PrinterCfg printerCfg;
public bool SupressPrinting { get { return printerCfg.SupressPrinting; } }
///
/// Items to print
///
string header;
IList<Results.WMeterRsltItemSpec> commonItems;
IList<Results.WMeterRsltItemSpec> testItems;
string footer;
Thread thread; /// Thread where results are printed
bool completed; /// Set to 'true' by the thread when printing results is completed
bool abort; /// Set to 'true' by Stop() operation to abort printing results
public Printer() { }
public Printer(Generic.IComponentCfg cfg)
: base(cfg)
{
printerCfg = cfg as PrinterCfg;
ApplyConfig();
log.Debug(this.ToString());
}
void ApplyConfig()
{
header = string.IsNullOrEmpty(printerCfg.Header) ? string.Empty : printerCfg.Header.Replace("~", Environment.NewLine);
commonItems = Results.WMeterRsltItemSpec.FromStrArray(printerCfg.CommonItems);
testItems = Results.WMeterRsltItemSpec.FromStrArray(printerCfg.SelectedItems); /// TestID info will be overwritten later on
footer = string.IsNullOrEmpty(printerCfg.Footer) ? string.Empty : printerCfg.Footer.Replace("~", Environment.NewLine);
}
#region Configuration Change Handling
public static void OnCfgChange(object sender, CfgChangeArgs args)
{
if (CfgChangeHandler == null) return;
try { CfgChangeHandler(sender, args); }
catch (Exception e) { log.Error("CfgChangeHandler(...) failed", e); }
}
public static event EventHandler<CfgChangeArgs> CfgChangeHandler;
public override void StartChangeHandler()
{
CfgChangeHandler += delegate(object sender, CfgChangeArgs args)
{
PrinterCfg newCfg = args.Cfg as PrinterCfg;
if (newCfg != null && newCfg.Name.Equals(Name))
{
if (args.Command == CfgChangeCmd.CfgChange)
{
printerCfg.PageOrientation = newCfg.PageOrientation;
printerCfg.TopMargin = newCfg.TopMargin;
printerCfg.BottomMargin = newCfg.BottomMargin;
printerCfg.LeftMargin = newCfg.LeftMargin;
printerCfg.TitFntFml = newCfg.TitFntFml;
printerCfg.TitFntSz = newCfg.TitFntSz;
printerCfg.TitFntSty = newCfg.TitFntSty;
printerCfg.HdrFntFml = newCfg.HdrFntFml;
printerCfg.HdrFntSz = newCfg.HdrFntSz;
printerCfg.HdrFntSty = newCfg.HdrFntSty;
printerCfg.BodyFntFml = newCfg.BodyFntFml;
printerCfg.BodyFntSz = newCfg.BodyFntSz;
printerCfg.BodyFntSty = newCfg.BodyFntSty;
printerCfg.SupressPrinting = newCfg.SupressPrinting;
printerCfg.Culture = newCfg.Culture;
printerCfg.CommonItems = newCfg.CommonItems;
printerCfg.SelectedItems = newCfg.SelectedItems;
printerCfg.Header = newCfg.Header;
printerCfg.Footer = newCfg.Footer;
ApplyConfig();
}
}
};
}
#endregion Configuration Change Handling
/// <summary>
/// Prints the test cycle results, Events: Event.ResultsPrinted
/// </summary>
/// <param name="batch">Batch results to print</param>
/// <returns>Reference to the operation</returns>
public IOperation PrintResultsOp(Results.Entities.Batch batch)
{
thread = new Thread(() =>
{
PrintResults(batch);
completed = true;
});
thread.CurrentCulture = Thread.CurrentThread.CurrentCulture;
thread.CurrentUICulture = Thread.CurrentThread.CurrentUICulture;
if (printerCfg.Culture > Culture.system && printerCfg.Culture < Culture.Count)
{
thread.CurrentCulture = new CultureInfo(printerCfg.Culture.ToString());
}
return this;
}
/// <summary>Start this operation</summary>
public void Start()
{
completed = false;
abort = false;
thread.Start();
}
/// <summary>Run this operation</summary>
/// <returns>Event.ResultsPrinted</returns>
public Event Run()
{
if (completed)
return Event.ResultsPrinted;
else
return Event.Busy;
}
/// <summary>Stop this operation</summary>
public void Stop()
{
if (!completed) abort = true;
}
void PrintResults(Results.Entities.Batch batch)
{
CultureInfo culture = Thread.CurrentThread.CurrentCulture;
try { culture = new System.Globalization.CultureInfo(printerCfg.Culture.ToString()); }
catch { }
if (batch.WaterMeters.Count > 0)
{
EnhancedPrinterCfg cfg = new EnhancedPrinterCfg {
PageOrientation = printerCfg.PageOrientation,
TopMargin = printerCfg.TopMargin,
BottomMargin = printerCfg.BottomMargin,
LeftMargin = printerCfg.LeftMargin,
TitFntFml = printerCfg.TitFntFml,
HdrFntFml = printerCfg.HdrFntFml,
BodyFntFml = printerCfg.BodyFntFml,
TitFntSz = printerCfg.TitFntSz,
HdrFntSz = printerCfg.HdrFntSz,
BodyFntSz = printerCfg.BodyFntSz,
TitFntSty = printerCfg.TitFntSty,
HdrFntSty = printerCfg.HdrFntSty,
BodyFntSty = printerCfg.BodyFntSty,
SupressPrinting = printerCfg.SupressPrinting,
CultureInfo = culture,
Header = printerCfg.Header,
CommonItems = printerCfg.CommonItems,
TestItems = printerCfg.SelectedItems,
Footer = printerCfg.Footer,
};
new Results.Output.Printers.Enhanced.EnhancedPrintDocument(batch, cfg).Print();
}
}
}
}
@@ -0,0 +1,86 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System.Xml.Serialization;
using Config.Entities;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Output.Printers.OnePagePerMeter
{
public class PrinterCfg : ComponentCfgBase, Generic.IComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(PrinterCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new PrinterCfgCtrl(); }
///
/// Serialized parameters
///
public PageOrientation PageOrientation;
public int TopMargin;
public int BottomMargin;
public int LeftMargin;
public string TitFntFml;
public string HdrFntFml;
public string BodyFntFml;
public int TitFntSz;
public int HdrFntSz;
public int BodyFntSz;
public int TitFntSty;
public int HdrFntSty;
public int BodyFntSty;
public bool SupressPrinting; /// Bypass printing when true
public Culture Culture;
public string[] CommonItems;
public string[] SelectedItems;
public string Header; /// =Title
public string Footer;
[XmlIgnore]
public Config.Entities.MetersKind MetersKind;
/// Private parameterless constructor invoked by all other (public) constructors
PrinterCfg()
{
}
public PrinterCfg(string name, IComponentFactory factory, Config.Entities.MetersKind metersKind)
: this()
{
Name = name;
Factory = factory;
MetersKind = metersKind;
ParentName = string.Empty;
PageOrientation = PageOrientation.Portrait;
TopMargin = 100;
BottomMargin = 100;
LeftMargin = 100;
TitFntFml = "Arial";
TitFntSz = 18;
TitFntSty = 1;
TitFntFml = "Arial";
TitFntSz = 10;
TitFntSty = 0;
TitFntFml = "Arial";
TitFntSz = 10;
TitFntSty = 0;
SupressPrinting = false;
Header = string.Empty;
Footer = string.Empty;
}
public string ToString(int i)
{
return string.Format("Name={0}, Orientation={1}, Margins T={2} B={3} L={4}, SupressPrinting={5}",
Name,
PageOrientation,
TopMargin,
BottomMargin,
LeftMargin,
SupressPrinting ? "yes" : "no"
);
}
}
}
@@ -0,0 +1,458 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
namespace TBF.BenchControl.Output.Printers.OnePagePerMeter
{
partial class PrinterCfgCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label();
this.supressPrintingCheckBox = new System.Windows.Forms.CheckBox();
this.orientationLabel = new System.Windows.Forms.Label();
this.orientationComboBox = new System.Windows.Forms.ComboBox();
this.topMarginTextBox = new System.Windows.Forms.TextBox();
this.topMarginLabel = new System.Windows.Forms.Label();
this.leftMarginTextBox = new System.Windows.Forms.TextBox();
this.bottomMarginTextBox = new System.Windows.Forms.TextBox();
this.cultureComboBox = new System.Windows.Forms.ComboBox();
this.cultureLabel = new System.Windows.Forms.Label();
this.commonItemsButton = new System.Windows.Forms.Button();
this.footerButton = new System.Windows.Forms.Button();
this.headerButton = new System.Windows.Forms.Button();
this.testItemsButton = new System.Windows.Forms.Button();
this.headerFontLabel = new System.Windows.Forms.Label();
this.titleFontLabel = new System.Windows.Forms.Label();
this.titleFontFamilyComboBox = new System.Windows.Forms.ComboBox();
this.headerFontFamilyComboBox = new System.Windows.Forms.ComboBox();
this.bodyFontFamilyComboBox = new System.Windows.Forms.ComboBox();
this.bodyFontLabel = new System.Windows.Forms.Label();
this.titleFontSizeTextBox = new System.Windows.Forms.TextBox();
this.headerFontSizeTextBox = new System.Windows.Forms.TextBox();
this.bodyFontSizeTextBox = new System.Windows.Forms.TextBox();
this.titleBoldCheckBox = new System.Windows.Forms.CheckBox();
this.titleItalicCheckBox = new System.Windows.Forms.CheckBox();
this.headerItalicCheckBox = new System.Windows.Forms.CheckBox();
this.headerBoldCheckBox = new System.Windows.Forms.CheckBox();
this.bodyItalicCheckBox = new System.Windows.Forms.CheckBox();
this.bodyBoldCheckBox = new System.Windows.Forms.CheckBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(142, 40);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(218, 20);
this.nameTextBox.TabIndex = 2;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(16, 43);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(35, 13);
this.nameLabel.TabIndex = 1;
this.nameLabel.Text = "Name";
//
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(139, 16);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 0;
this.classNameLabel.Text = "ComonentName";
//
// supressPrintingCheckBox
//
this.supressPrintingCheckBox.AutoSize = true;
this.supressPrintingCheckBox.Enabled = false;
this.supressPrintingCheckBox.Location = new System.Drawing.Point(143, 188);
this.supressPrintingCheckBox.Name = "supressPrintingCheckBox";
this.supressPrintingCheckBox.Size = new System.Drawing.Size(101, 17);
this.supressPrintingCheckBox.TabIndex = 24;
this.supressPrintingCheckBox.Text = "Supress printing";
this.supressPrintingCheckBox.UseVisualStyleBackColor = true;
//
// orientationLabel
//
this.orientationLabel.AutoSize = true;
this.orientationLabel.Location = new System.Drawing.Point(16, 67);
this.orientationLabel.Name = "orientationLabel";
this.orientationLabel.Size = new System.Drawing.Size(84, 13);
this.orientationLabel.TabIndex = 3;
this.orientationLabel.Text = "Page orientation";
//
// orientationComboBox
//
this.orientationComboBox.Enabled = false;
this.orientationComboBox.FormattingEnabled = true;
this.orientationComboBox.Location = new System.Drawing.Point(142, 64);
this.orientationComboBox.Name = "orientationComboBox";
this.orientationComboBox.Size = new System.Drawing.Size(218, 21);
this.orientationComboBox.TabIndex = 4;
//
// topMarginTextBox
//
this.topMarginTextBox.Enabled = false;
this.topMarginTextBox.Location = new System.Drawing.Point(142, 89);
this.topMarginTextBox.Name = "topMarginTextBox";
this.topMarginTextBox.Size = new System.Drawing.Size(44, 20);
this.topMarginTextBox.TabIndex = 6;
//
// topMarginLabel
//
this.topMarginLabel.AutoSize = true;
this.topMarginLabel.Location = new System.Drawing.Point(16, 92);
this.topMarginLabel.Name = "topMarginLabel";
this.topMarginLabel.Size = new System.Drawing.Size(116, 13);
this.topMarginLabel.TabIndex = 5;
this.topMarginLabel.Text = "Top/bottom/left margin";
//
// leftMarginTextBox
//
this.leftMarginTextBox.Enabled = false;
this.leftMarginTextBox.Location = new System.Drawing.Point(244, 89);
this.leftMarginTextBox.Name = "leftMarginTextBox";
this.leftMarginTextBox.Size = new System.Drawing.Size(44, 20);
this.leftMarginTextBox.TabIndex = 8;
//
// bottomMarginTextBox
//
this.bottomMarginTextBox.Enabled = false;
this.bottomMarginTextBox.Location = new System.Drawing.Point(193, 89);
this.bottomMarginTextBox.Name = "bottomMarginTextBox";
this.bottomMarginTextBox.Size = new System.Drawing.Size(44, 20);
this.bottomMarginTextBox.TabIndex = 7;
//
// cultureComboBox
//
this.cultureComboBox.Enabled = false;
this.cultureComboBox.FormattingEnabled = true;
this.cultureComboBox.Location = new System.Drawing.Point(142, 209);
this.cultureComboBox.Name = "cultureComboBox";
this.cultureComboBox.Size = new System.Drawing.Size(218, 21);
this.cultureComboBox.TabIndex = 26;
//
// cultureLabel
//
this.cultureLabel.AutoSize = true;
this.cultureLabel.Location = new System.Drawing.Point(16, 212);
this.cultureLabel.Name = "cultureLabel";
this.cultureLabel.Size = new System.Drawing.Size(42, 13);
this.cultureLabel.TabIndex = 25;
this.cultureLabel.Text = "Cullture";
//
// commonItemsButton
//
this.commonItemsButton.Enabled = false;
this.commonItemsButton.Location = new System.Drawing.Point(142, 259);
this.commonItemsButton.Name = "commonItemsButton";
this.commonItemsButton.Size = new System.Drawing.Size(218, 23);
this.commonItemsButton.TabIndex = 28;
this.commonItemsButton.Text = "Common items";
this.commonItemsButton.UseVisualStyleBackColor = true;
this.commonItemsButton.Click += new System.EventHandler(this.commonItemsButton_Click);
//
// footerButton
//
this.footerButton.Enabled = false;
this.footerButton.Location = new System.Drawing.Point(142, 309);
this.footerButton.Name = "footerButton";
this.footerButton.Size = new System.Drawing.Size(218, 23);
this.footerButton.TabIndex = 30;
this.footerButton.Text = "Footer";
this.footerButton.UseVisualStyleBackColor = true;
this.footerButton.Click += new System.EventHandler(this.footerButton_Click);
//
// headerButton
//
this.headerButton.Enabled = false;
this.headerButton.Location = new System.Drawing.Point(142, 234);
this.headerButton.Name = "headerButton";
this.headerButton.Size = new System.Drawing.Size(218, 23);
this.headerButton.TabIndex = 27;
this.headerButton.Text = "Title";
this.headerButton.UseVisualStyleBackColor = true;
this.headerButton.Click += new System.EventHandler(this.headerButton_Click);
//
// testItemsButton
//
this.testItemsButton.Enabled = false;
this.testItemsButton.Location = new System.Drawing.Point(142, 284);
this.testItemsButton.Name = "testItemsButton";
this.testItemsButton.Size = new System.Drawing.Size(218, 23);
this.testItemsButton.TabIndex = 29;
this.testItemsButton.Text = "Test items";
this.testItemsButton.UseVisualStyleBackColor = true;
this.testItemsButton.Click += new System.EventHandler(this.testItemsButton_Click);
//
// headerFontLabel
//
this.headerFontLabel.AutoSize = true;
this.headerFontLabel.Location = new System.Drawing.Point(16, 140);
this.headerFontLabel.Name = "headerFontLabel";
this.headerFontLabel.Size = new System.Drawing.Size(112, 13);
this.headerFontLabel.TabIndex = 14;
this.headerFontLabel.Text = "Header font/size/style";
//
// titleFontLabel
//
this.titleFontLabel.AutoSize = true;
this.titleFontLabel.Location = new System.Drawing.Point(16, 116);
this.titleFontLabel.Name = "titleFontLabel";
this.titleFontLabel.Size = new System.Drawing.Size(97, 13);
this.titleFontLabel.TabIndex = 9;
this.titleFontLabel.Text = "Title font/size/style";
//
// titleFontFamilyComboBox
//
this.titleFontFamilyComboBox.Enabled = false;
this.titleFontFamilyComboBox.FormattingEnabled = true;
this.titleFontFamilyComboBox.Location = new System.Drawing.Point(142, 113);
this.titleFontFamilyComboBox.Name = "titleFontFamilyComboBox";
this.titleFontFamilyComboBox.Size = new System.Drawing.Size(110, 21);
this.titleFontFamilyComboBox.TabIndex = 10;
//
// headerFontFamilyComboBox
//
this.headerFontFamilyComboBox.Enabled = false;
this.headerFontFamilyComboBox.FormattingEnabled = true;
this.headerFontFamilyComboBox.Location = new System.Drawing.Point(142, 137);
this.headerFontFamilyComboBox.Name = "headerFontFamilyComboBox";
this.headerFontFamilyComboBox.Size = new System.Drawing.Size(110, 21);
this.headerFontFamilyComboBox.TabIndex = 15;
//
// bodyFontFamilyComboBox
//
this.bodyFontFamilyComboBox.Enabled = false;
this.bodyFontFamilyComboBox.FormattingEnabled = true;
this.bodyFontFamilyComboBox.Location = new System.Drawing.Point(142, 161);
this.bodyFontFamilyComboBox.Name = "bodyFontFamilyComboBox";
this.bodyFontFamilyComboBox.Size = new System.Drawing.Size(110, 21);
this.bodyFontFamilyComboBox.TabIndex = 20;
//
// bodyFontLabel
//
this.bodyFontLabel.AutoSize = true;
this.bodyFontLabel.Location = new System.Drawing.Point(16, 164);
this.bodyFontLabel.Name = "bodyFontLabel";
this.bodyFontLabel.Size = new System.Drawing.Size(101, 13);
this.bodyFontLabel.TabIndex = 19;
this.bodyFontLabel.Text = "Body font/size/style";
//
// titleFontSizeTextBox
//
this.titleFontSizeTextBox.Enabled = false;
this.titleFontSizeTextBox.Location = new System.Drawing.Point(258, 113);
this.titleFontSizeTextBox.Name = "titleFontSizeTextBox";
this.titleFontSizeTextBox.Size = new System.Drawing.Size(30, 20);
this.titleFontSizeTextBox.TabIndex = 11;
//
// headerFontSizeTextBox
//
this.headerFontSizeTextBox.Enabled = false;
this.headerFontSizeTextBox.Location = new System.Drawing.Point(258, 137);
this.headerFontSizeTextBox.Name = "headerFontSizeTextBox";
this.headerFontSizeTextBox.Size = new System.Drawing.Size(30, 20);
this.headerFontSizeTextBox.TabIndex = 16;
//
// bodyFontSizeTextBox
//
this.bodyFontSizeTextBox.Enabled = false;
this.bodyFontSizeTextBox.Location = new System.Drawing.Point(258, 161);
this.bodyFontSizeTextBox.Name = "bodyFontSizeTextBox";
this.bodyFontSizeTextBox.Size = new System.Drawing.Size(29, 20);
this.bodyFontSizeTextBox.TabIndex = 21;
//
// titleBoldCheckBox
//
this.titleBoldCheckBox.AutoSize = true;
this.titleBoldCheckBox.Enabled = false;
this.titleBoldCheckBox.Location = new System.Drawing.Point(306, 116);
this.titleBoldCheckBox.Name = "titleBoldCheckBox";
this.titleBoldCheckBox.Size = new System.Drawing.Size(15, 14);
this.titleBoldCheckBox.TabIndex = 12;
this.titleBoldCheckBox.UseVisualStyleBackColor = true;
//
// titleItalicCheckBox
//
this.titleItalicCheckBox.AutoSize = true;
this.titleItalicCheckBox.Enabled = false;
this.titleItalicCheckBox.Location = new System.Drawing.Point(334, 116);
this.titleItalicCheckBox.Name = "titleItalicCheckBox";
this.titleItalicCheckBox.Size = new System.Drawing.Size(15, 14);
this.titleItalicCheckBox.TabIndex = 13;
this.titleItalicCheckBox.UseVisualStyleBackColor = true;
//
// headerItalicCheckBox
//
this.headerItalicCheckBox.AutoSize = true;
this.headerItalicCheckBox.Enabled = false;
this.headerItalicCheckBox.Location = new System.Drawing.Point(334, 140);
this.headerItalicCheckBox.Name = "headerItalicCheckBox";
this.headerItalicCheckBox.Size = new System.Drawing.Size(15, 14);
this.headerItalicCheckBox.TabIndex = 18;
this.headerItalicCheckBox.UseVisualStyleBackColor = true;
//
// headerBoldCheckBox
//
this.headerBoldCheckBox.AutoSize = true;
this.headerBoldCheckBox.Enabled = false;
this.headerBoldCheckBox.Location = new System.Drawing.Point(306, 140);
this.headerBoldCheckBox.Name = "headerBoldCheckBox";
this.headerBoldCheckBox.Size = new System.Drawing.Size(15, 14);
this.headerBoldCheckBox.TabIndex = 17;
this.headerBoldCheckBox.UseVisualStyleBackColor = true;
//
// bodyItalicCheckBox
//
this.bodyItalicCheckBox.AutoSize = true;
this.bodyItalicCheckBox.Enabled = false;
this.bodyItalicCheckBox.Location = new System.Drawing.Point(334, 164);
this.bodyItalicCheckBox.Name = "bodyItalicCheckBox";
this.bodyItalicCheckBox.Size = new System.Drawing.Size(15, 14);
this.bodyItalicCheckBox.TabIndex = 23;
this.bodyItalicCheckBox.UseVisualStyleBackColor = true;
//
// bodyBoldCheckBox
//
this.bodyBoldCheckBox.AutoSize = true;
this.bodyBoldCheckBox.Enabled = false;
this.bodyBoldCheckBox.Location = new System.Drawing.Point(306, 164);
this.bodyBoldCheckBox.Name = "bodyBoldCheckBox";
this.bodyBoldCheckBox.Size = new System.Drawing.Size(15, 14);
this.bodyBoldCheckBox.TabIndex = 22;
this.bodyBoldCheckBox.UseVisualStyleBackColor = true;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label1.Location = new System.Drawing.Point(296, 100);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(32, 13);
this.label1.TabIndex = 31;
this.label1.Text = "Bold";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label2.Location = new System.Drawing.Point(330, 100);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(24, 13);
this.label2.TabIndex = 32;
this.label2.Text = "Ital.";
//
// PrinterCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.bodyItalicCheckBox);
this.Controls.Add(this.bodyBoldCheckBox);
this.Controls.Add(this.headerItalicCheckBox);
this.Controls.Add(this.headerBoldCheckBox);
this.Controls.Add(this.titleItalicCheckBox);
this.Controls.Add(this.titleBoldCheckBox);
this.Controls.Add(this.bodyFontSizeTextBox);
this.Controls.Add(this.headerFontSizeTextBox);
this.Controls.Add(this.titleFontSizeTextBox);
this.Controls.Add(this.bodyFontFamilyComboBox);
this.Controls.Add(this.bodyFontLabel);
this.Controls.Add(this.headerFontFamilyComboBox);
this.Controls.Add(this.titleFontFamilyComboBox);
this.Controls.Add(this.cultureComboBox);
this.Controls.Add(this.cultureLabel);
this.Controls.Add(this.commonItemsButton);
this.Controls.Add(this.footerButton);
this.Controls.Add(this.headerButton);
this.Controls.Add(this.testItemsButton);
this.Controls.Add(this.bottomMarginTextBox);
this.Controls.Add(this.titleFontLabel);
this.Controls.Add(this.leftMarginTextBox);
this.Controls.Add(this.headerFontLabel);
this.Controls.Add(this.topMarginTextBox);
this.Controls.Add(this.topMarginLabel);
this.Controls.Add(this.orientationComboBox);
this.Controls.Add(this.orientationLabel);
this.Controls.Add(this.supressPrintingCheckBox);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Name = "PrinterCfgCtrl";
this.Size = new System.Drawing.Size(400, 350);
this.Load += new System.EventHandler(this.PrinterCfgCtrl_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox nameTextBox;
private System.Windows.Forms.Label nameLabel;
private System.Windows.Forms.Label classNameLabel;
private System.Windows.Forms.CheckBox supressPrintingCheckBox;
private System.Windows.Forms.Label orientationLabel;
private System.Windows.Forms.ComboBox orientationComboBox;
private System.Windows.Forms.TextBox topMarginTextBox;
private System.Windows.Forms.Label topMarginLabel;
private System.Windows.Forms.TextBox leftMarginTextBox;
private System.Windows.Forms.TextBox bottomMarginTextBox;
private System.Windows.Forms.ComboBox cultureComboBox;
private System.Windows.Forms.Label cultureLabel;
private System.Windows.Forms.Button commonItemsButton;
private System.Windows.Forms.Button footerButton;
private System.Windows.Forms.Button headerButton;
private System.Windows.Forms.Button testItemsButton;
private System.Windows.Forms.Label headerFontLabel;
private System.Windows.Forms.Label titleFontLabel;
private System.Windows.Forms.ComboBox titleFontFamilyComboBox;
private System.Windows.Forms.ComboBox headerFontFamilyComboBox;
private System.Windows.Forms.ComboBox bodyFontFamilyComboBox;
private System.Windows.Forms.Label bodyFontLabel;
private System.Windows.Forms.TextBox titleFontSizeTextBox;
private System.Windows.Forms.TextBox headerFontSizeTextBox;
private System.Windows.Forms.TextBox bodyFontSizeTextBox;
private System.Windows.Forms.CheckBox titleBoldCheckBox;
private System.Windows.Forms.CheckBox titleItalicCheckBox;
private System.Windows.Forms.CheckBox headerItalicCheckBox;
private System.Windows.Forms.CheckBox headerBoldCheckBox;
private System.Windows.Forms.CheckBox bodyItalicCheckBox;
private System.Windows.Forms.CheckBox bodyBoldCheckBox;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
}
}
@@ -0,0 +1,396 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using log4net;
using Config.Entities;
using TBF.BenchControl.Generic;
using TBF.Resources;
namespace TBF.BenchControl.Output.Printers.OnePagePerMeter
{
public partial class PrinterCfgCtrl : UserControl, IComponentCfgCtrl
{
static readonly ILog log = LogManager.GetLogger(typeof(PrinterCfgCtrl));
public bool ShowMore { get { return false; } }
PrinterCfg config;
public IComponentCfg Config
{
get { return config as IComponentCfg; }
set
{
config = value as PrinterCfg;
Redraw();
}
}
string header;
string[] commonItems;
string[] testItems;
string footer;
public PrinterCfgCtrl()
{
InitializeComponent();
Localize();
orientationComboBox.Items.Add(PageOrientation.Portrait.ToString());
orientationComboBox.Items.Add(PageOrientation.Landscape.ToString());
foreach (var ff in System.Drawing.FontFamily.Families)
{
titleFontFamilyComboBox.Items.Add(ff.Name);
headerFontFamilyComboBox.Items.Add(ff.Name);
bodyFontFamilyComboBox.Items.Add(ff.Name);
}
}
private void PrinterCfgCtrl_Load(object sender, EventArgs e)
{
for (Culture s = 0; s < Culture.Count; s++) cultureComboBox.Items.Add(s.ToString());
header = config.Header;
commonItems = config.CommonItems;
testItems = config.SelectedItems;
footer = config.Footer;
Redraw();
}
void Localize()
{
nameLabel.Text = Strings.Name;
cultureLabel.Text = "Culture";
headerButton.Text = Strings.Header;
commonItemsButton.Text = "Common items";
testItemsButton.Text = "Test items";
footerButton.Text = Strings.Footer;
}
public void Closing()
{
}
PageOrientation GetOrientation(string str)
{
if (str.Equals(PageOrientation.Landscape.ToString())) return PageOrientation.Landscape;
if (str.Equals(PageOrientation.Portrait.ToString())) return PageOrientation.Portrait;
return (PageOrientation)(-1);
}
void Redraw()
{
if (config == null) return; /// Control was not loaded, settings were not changed
classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name;
orientationComboBox.Text = config.PageOrientation.ToString();
topMarginTextBox.Text = config.TopMargin.ToString();
bottomMarginTextBox.Text = config.BottomMargin.ToString();
leftMarginTextBox.Text = config.LeftMargin.ToString();
titleFontFamilyComboBox.Text = config.TitFntFml;
titleFontSizeTextBox.Text = config.TitFntSz.ToString();
titleBoldCheckBox.Checked = ((config.TitFntSty & (int)System.Drawing.FontStyle.Bold) != 0);
titleItalicCheckBox.Checked = ((config.TitFntSty & (int)System.Drawing.FontStyle.Italic) != 0);
headerFontFamilyComboBox.Text = config.HdrFntFml;
headerFontSizeTextBox.Text = config.HdrFntSz.ToString();
headerBoldCheckBox.Checked = ((config.HdrFntSty & (int)System.Drawing.FontStyle.Bold) != 0);
headerItalicCheckBox.Checked = ((config.HdrFntSty & (int)System.Drawing.FontStyle.Italic) != 0);
bodyFontFamilyComboBox.Text = config.BodyFntFml;
bodyFontSizeTextBox.Text = config.BodyFntSz.ToString();
bodyBoldCheckBox.Checked = ((config.BodyFntSty & (int)System.Drawing.FontStyle.Bold) != 0);
bodyItalicCheckBox.Checked = ((config.BodyFntSty & (int)System.Drawing.FontStyle.Italic) != 0);
supressPrintingCheckBox.Checked = config.SupressPrinting;
cultureComboBox.Text = config.Culture.ToString();
}
public void Unlock()
{
nameTextBox.Enabled = true;
orientationComboBox.Enabled = true;
topMarginTextBox.Enabled = true;
bottomMarginTextBox.Enabled = true;
leftMarginTextBox.Enabled = true;
titleFontFamilyComboBox.Enabled = true;
titleFontSizeTextBox.Enabled = true;
titleBoldCheckBox.Enabled = true;
titleItalicCheckBox.Enabled = true;
headerFontFamilyComboBox.Enabled = true;
headerFontSizeTextBox.Enabled = true;
headerBoldCheckBox.Enabled = true;
headerItalicCheckBox.Enabled = true;
bodyFontFamilyComboBox.Enabled = true;
bodyFontSizeTextBox.Enabled = true;
bodyBoldCheckBox.Enabled = true;
bodyItalicCheckBox.Enabled = true;
supressPrintingCheckBox.Enabled = true;
cultureComboBox.Enabled = true;
headerButton.Enabled = true;
commonItemsButton.Enabled = true;
testItemsButton.Enabled = true;
footerButton.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
if ((int)GetOrientation(orientationComboBox.Text) < 0)
{
message += Environment.NewLine + "Invalid 'Page orientation'";
flags |= CfgUpdateFlags.Error;
}
int dummy;
if (!int.TryParse(topMarginTextBox.Text, out dummy) || dummy < 0 || dummy > 500)
{
message += Environment.NewLine + "'Top margin' should be between 0 and 500";
flags |= CfgUpdateFlags.Error;
}
if (!int.TryParse(bottomMarginTextBox.Text, out dummy) || dummy < 0 || dummy > 200)
{
message += Environment.NewLine + "'Bottom margin' should be between 0 and 200";
flags |= CfgUpdateFlags.Error;
}
if (!int.TryParse(leftMarginTextBox.Text, out dummy) || dummy < 0 || dummy > 200)
{
message += Environment.NewLine + "Left margin' should be between 0 and 200";
flags |= CfgUpdateFlags.Error;
}
if (!int.TryParse(titleFontSizeTextBox.Text, out dummy) || dummy < 6 || dummy > 48)
{
message += Environment.NewLine + "Title font size' should be between 6 and 48";
flags |= CfgUpdateFlags.Error;
}
if (!int.TryParse(headerFontSizeTextBox.Text, out dummy) || dummy < 6 || dummy > 48)
{
message += Environment.NewLine + "Header font size' should be between 6 and 48";
flags |= CfgUpdateFlags.Error;
}
if (!int.TryParse(bodyFontSizeTextBox.Text, out dummy) || dummy < 6 || dummy > 48)
{
message += Environment.NewLine + "Body font size' should be between 6 and 48";
flags |= CfgUpdateFlags.Error;
}
if (!cultureComboBox.Items.Contains(cultureComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Invalid culture";
}
return flags;
}
public CfgUpdateFlags UpdateCfg()
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
if (config.Name != nameTextBox.Text)
{
config.Name = nameTextBox.Text;
flags |= (CfgUpdateFlags.RestartRqrd | CfgUpdateFlags.AnyChange);
}
if (config.PageOrientation != GetOrientation(orientationComboBox.Text))
{
config.PageOrientation = GetOrientation(orientationComboBox.Text);
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
int tmp = int.Parse(topMarginTextBox.Text);
if (config.TopMargin != tmp)
{
config.TopMargin = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
tmp = int.Parse(bottomMarginTextBox.Text);
if (config.BottomMargin != tmp)
{
config.BottomMargin = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
tmp = int.Parse(leftMarginTextBox.Text);
if (config.LeftMargin != tmp)
{
config.LeftMargin = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
/// Title font properties
if (config.TitFntFml != titleFontFamilyComboBox.Text)
{
config.TitFntFml = titleFontFamilyComboBox.Text;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
tmp = int.Parse(titleFontSizeTextBox.Text);
if (config.TitFntSz != tmp)
{
config.TitFntSz = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
tmp = (titleBoldCheckBox.Checked ? (int)System.Drawing.FontStyle.Bold : 0)
+ (titleItalicCheckBox.Checked ? (int)System.Drawing.FontStyle.Italic : 0);
if (config.TitFntSty != tmp)
{
config.TitFntSty = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
/// Header font properties
if (config.HdrFntFml != headerFontFamilyComboBox.Text)
{
config.HdrFntFml = headerFontFamilyComboBox.Text;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
tmp = int.Parse(headerFontSizeTextBox.Text);
if (config.HdrFntSz != tmp)
{
config.HdrFntSz = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
tmp = (headerBoldCheckBox.Checked ? (int)System.Drawing.FontStyle.Bold : 0)
+ (headerItalicCheckBox.Checked ? (int)System.Drawing.FontStyle.Italic : 0);
if (config.HdrFntSty != tmp)
{
config.HdrFntSty = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
/// Body font properties
if (config.BodyFntFml != bodyFontFamilyComboBox.Text)
{
config.BodyFntFml = bodyFontFamilyComboBox.Text;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
tmp = int.Parse(bodyFontSizeTextBox.Text);
if (config.BodyFntSz != tmp)
{
config.BodyFntSz = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
tmp = (bodyBoldCheckBox.Checked ? (int)System.Drawing.FontStyle.Bold : 0)
+ (bodyItalicCheckBox.Checked ? (int)System.Drawing.FontStyle.Italic : 0);
if (config.BodyFntSty != tmp)
{
config.BodyFntSty = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.SupressPrinting != supressPrintingCheckBox.Checked)
{
config.SupressPrinting = supressPrintingCheckBox.Checked;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.CommonItems != commonItems)
{
config.CommonItems = commonItems;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.SelectedItems != testItems)
{
config.SelectedItems = testItems;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.Header != header)
{
config.Header = header;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.Footer != footer)
{
config.Footer = footer;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if ((flags & CfgUpdateFlags.InvokeCfgChange) != 0)
{
Printer.OnCfgChange(this, new CfgChangeArgs(CfgChangeCmd.CfgChange, config));
}
return flags;
}
private void headerButton_Click(object sender, EventArgs e)
{
HeaderFooterDlg dlg = new HeaderFooterDlg(true, string.IsNullOrEmpty(header) ? string.Empty : header.Replace("~", Environment.NewLine));
if (dlg.ShowDialog() == DialogResult.OK)
{
header = dlg.EditedText.Replace(Environment.NewLine, "~");
}
}
private void commonItemsButton_Click(object sender, EventArgs e)
{
Results.Forms.ResultsConfigDlg dlg = new Results.Forms.ResultsConfigDlg()
{
MetersKind = config.MetersKind,
SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(commonItems),
};
if (dlg.ShowDialog() == DialogResult.OK)
{
commonItems = Results.WMeterRsltItemSpec.ToStrArray(dlg.SelectedItems);
}
}
private void testItemsButton_Click(object sender, EventArgs e)
{
Results.Forms.ResultsConfigDlg dlg = new Results.Forms.ResultsConfigDlg(true)
{
MetersKind = config.MetersKind,
SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(testItems),
};
if (dlg.ShowDialog() == DialogResult.OK)
{
testItems = Results.WMeterRsltItemSpec.ToStrArray(dlg.SelectedItems);
}
}
private void footerButton_Click(object sender, EventArgs e)
{
HeaderFooterDlg dlg = new HeaderFooterDlg(false, string.IsNullOrEmpty(footer) ? string.Empty : footer.Replace("~", Environment.NewLine));
if (dlg.ShowDialog() == DialogResult.OK)
{
footer = dlg.EditedText.Replace(Environment.NewLine, "~");
}
}
#region Configuration Change Handling
public static void OnCmdResponse(object sender, CmdResponseArgs args)
{
if (CmdResponseHandler == null) return;
try { CmdResponseHandler(sender, args); }
catch (Exception e) { log.Error("CmdResponseHandler(...) failed", e); }
}
public static event EventHandler<CmdResponseArgs> CmdResponseHandler;
public void StartResponseHandler() { }
public void StopResponseHandler() { }
#endregion Configuration Change Handling
}
}
@@ -0,0 +1,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>
@@ -87,13 +87,20 @@ namespace TBF.BenchControl
Factories.Add(new Output.FileWriters.Enhanced.FactorySingle());
Factories.Add(new Output.FileWriters.Enhanced.FactoryCompound());
Factories.Add(new Output.FileWriters.Enhanced.FactoryHeatMeters());
Factories.Add(new Output.FileWriters.ImageArchiver.Factory());
Factories.Add(new Output.FileWriters.OneFilePerMeter.FactorySingle());
Factories.Add(new Output.FileWriters.OneFilePerMeter.FactoryCompound());
Factories.Add(new Output.FileWriters.OneFilePerMeter.FactoryHeatMeters());
Factories.Add(new Output.FileWriters.Xml.FactorySingle());
Factories.Add(new Output.FileWriters.Xml.FactoryCompound());
Factories.Add(new Output.FileWriters.Xml.FactoryHeatMeters());
Factories.Add(new Output.Printers.Enhanced.FactorySingle());
Factories.Add(new Output.Printers.Enhanced.FactoryCompound());
Factories.Add(new Output.Printers.Enhanced.FactoryHeatMeters());
Factories.Add(new Elde.PressureMeter.PressureMeterFactory());
Factories.Add(new Output.Printers.OnePagePerMeter.FactorySingle());
Factories.Add(new Output.Printers.OnePagePerMeter.FactoryCompound());
Factories.Add(new Output.Printers.OnePagePerMeter.FactoryHeatMeters());
Factories.Add(new Elde.PressureMeter.PressureMeterFactory());
Factories.Add(new Elde.PressureMeterInternal.PressureMeterFactory());
Factories.Add(new Elde.Pump.PumpFactory());
Factories.Add(new Danfoss.VLT2800.PumpFactory());
+32 -17
View File
@@ -35,6 +35,10 @@ namespace TBF
this.mainSplitContainer = new System.Windows.Forms.SplitContainer();
this.tabControl = new System.Windows.Forms.TabControl();
this.generalTabPage = new System.Windows.Forms.TabPage();
this.altProcPeriodTextBox = new System.Windows.Forms.TextBox();
this.altProcPeriodLabel = new System.Windows.Forms.Label();
this.altProcNameTextBox = new System.Windows.Forms.TextBox();
this.altProcNameLabel = new System.Windows.Forms.Label();
this.manualControlDisabledCheckBox = new System.Windows.Forms.CheckBox();
this.mustBeCompleteCheckBox = new System.Windows.Forms.CheckBox();
this.protectedCheckBox = new System.Windows.Forms.CheckBox();
@@ -43,8 +47,6 @@ namespace TBF
this.fileWriter3ComboBox = new System.Windows.Forms.ComboBox();
this.printer2ComboBox = new System.Windows.Forms.ComboBox();
this.fileWriter2ComboBox = new System.Windows.Forms.ComboBox();
this.protocolTitleTextBox = new System.Windows.Forms.TextBox();
this.protocolTitleLabel = new System.Windows.Forms.Label();
this.metersKindRadioButton2 = new System.Windows.Forms.RadioButton();
this.metersKindRadioButton1 = new System.Windows.Forms.RadioButton();
this.transitionEndComboBox = new System.Windows.Forms.ComboBox();
@@ -126,6 +128,10 @@ namespace TBF
//
// generalTabPage
//
this.generalTabPage.Controls.Add(this.altProcPeriodTextBox);
this.generalTabPage.Controls.Add(this.altProcPeriodLabel);
this.generalTabPage.Controls.Add(this.altProcNameTextBox);
this.generalTabPage.Controls.Add(this.altProcNameLabel);
this.generalTabPage.Controls.Add(this.manualControlDisabledCheckBox);
this.generalTabPage.Controls.Add(this.mustBeCompleteCheckBox);
this.generalTabPage.Controls.Add(this.protectedCheckBox);
@@ -134,8 +140,6 @@ namespace TBF
this.generalTabPage.Controls.Add(this.fileWriter3ComboBox);
this.generalTabPage.Controls.Add(this.printer2ComboBox);
this.generalTabPage.Controls.Add(this.fileWriter2ComboBox);
this.generalTabPage.Controls.Add(this.protocolTitleTextBox);
this.generalTabPage.Controls.Add(this.protocolTitleLabel);
this.generalTabPage.Controls.Add(this.metersKindRadioButton2);
this.generalTabPage.Controls.Add(this.metersKindRadioButton1);
this.generalTabPage.Controls.Add(this.transitionEndComboBox);
@@ -168,6 +172,26 @@ namespace TBF
this.generalTabPage.Name = "generalTabPage";
this.generalTabPage.UseVisualStyleBackColor = true;
//
// altProcPeriodTextBox
//
resources.ApplyResources(this.altProcPeriodTextBox, "altProcPeriodTextBox");
this.altProcPeriodTextBox.Name = "altProcPeriodTextBox";
//
// altProcPeriodLabel
//
resources.ApplyResources(this.altProcPeriodLabel, "altProcPeriodLabel");
this.altProcPeriodLabel.Name = "altProcPeriodLabel";
//
// altProcNameTextBox
//
resources.ApplyResources(this.altProcNameTextBox, "altProcNameTextBox");
this.altProcNameTextBox.Name = "altProcNameTextBox";
//
// altProcNameLabel
//
resources.ApplyResources(this.altProcNameLabel, "altProcNameLabel");
this.altProcNameLabel.Name = "altProcNameLabel";
//
// manualControlDisabledCheckBox
//
resources.ApplyResources(this.manualControlDisabledCheckBox, "manualControlDisabledCheckBox");
@@ -217,17 +241,6 @@ namespace TBF
resources.ApplyResources(this.fileWriter2ComboBox, "fileWriter2ComboBox");
this.fileWriter2ComboBox.Name = "fileWriter2ComboBox";
//
// protocolTitleTextBox
//
resources.ApplyResources(this.protocolTitleTextBox, "protocolTitleTextBox");
this.protocolTitleTextBox.Name = "protocolTitleTextBox";
//
// protocolTitleLabel
//
resources.ApplyResources(this.protocolTitleLabel, "protocolTitleLabel");
this.protocolTitleLabel.ImageKey = global::TBF.Resources.Strings.Closing_the_tank;
this.protocolTitleLabel.Name = "protocolTitleLabel";
//
// metersKindRadioButton2
//
resources.ApplyResources(this.metersKindRadioButton2, "metersKindRadioButton2");
@@ -542,8 +555,6 @@ namespace TBF
private System.Windows.Forms.RadioButton metersKindRadioButton1;
private System.Windows.Forms.TabPage parametersTabPage;
private Results.Forms.ListViewEx parametersListViewEx;
private System.Windows.Forms.TextBox protocolTitleTextBox;
private System.Windows.Forms.Label protocolTitleLabel;
private System.Windows.Forms.ComboBox fileWriter2ComboBox;
private System.Windows.Forms.ComboBox fileWriter3ComboBox;
private System.Windows.Forms.ComboBox printer2ComboBox;
@@ -552,5 +563,9 @@ namespace TBF
private System.Windows.Forms.CheckBox mustBeCompleteCheckBox;
private System.Windows.Forms.CheckBox protectedCheckBox;
private System.Windows.Forms.CheckBox manualControlDisabledCheckBox;
private System.Windows.Forms.TextBox altProcNameTextBox;
private System.Windows.Forms.Label altProcNameLabel;
private System.Windows.Forms.TextBox altProcPeriodTextBox;
private System.Windows.Forms.Label altProcPeriodLabel;
}
}
+21 -5
View File
@@ -301,13 +301,20 @@ namespace TBF
PrepareMetrology12AndProcessTabs();
/// Disable controls in General tab
#if IPERL
altProcNameLabel.Visible = true;
altProcNameTextBox.Visible = true;
altProcPeriodLabel.Visible = true;
altProcPeriodTextBox.Visible = true;
#endif
procNameTextBox.Enabled = false;
descriptionTextBox.Enabled = false;
watermetersTextBox.Enabled = false;
protocolTitleTextBox.Enabled = false;
protectedCheckBox.Enabled = false;
mustBeCompleteCheckBox.Enabled = false;
manualControlDisabledCheckBox.Enabled = false;
altProcNameTextBox.Enabled = false;
altProcPeriodTextBox.Enabled = false;
dataEntryComboBox.Enabled = false;
transitionStartComboBox.Enabled = false;
transitionEndComboBox.Enabled = false;
@@ -362,7 +369,6 @@ namespace TBF
label15.Text = Strings.Date;
label18.Text = Strings.Notes;
watermetersLabel.Text = Strings.Meter_types_tested;
protocolTitleLabel.Text = Strings.Protocol_title;
protectedCheckBox.Text = Strings.Protected_procedure;
mustBeCompleteCheckBox.Text = Strings.All_tests_must_be_completed;
manualControlDisabledCheckBox.Text = Strings.Manual_control_disabled;
@@ -400,7 +406,6 @@ namespace TBF
lastChangedOnTextBox.Text = LoadedProcedure.LastChgTime.ToString();
}
watermetersTextBox.Text = LoadedProcedure.Watermeters;
protocolTitleTextBox.Text = LoadedProcedure.ProtocolTitle;
protectedCheckBox.Checked = LoadedProcedure.Protected;
mustBeCompleteCheckBox.Checked = LoadedProcedure.MustBeComplete;
manualControlDisabledCheckBox.Checked = LoadedProcedure.ManualCtrlDisabled;
@@ -408,6 +413,9 @@ namespace TBF
transitionStartComboBox.Text = string.IsNullOrEmpty(LoadedProcedure.TransitionStart) ? "---" : LoadedProcedure.TransitionStart;
transitionEndComboBox.Text = string.IsNullOrEmpty(LoadedProcedure.TransitionEnd) ? "---" : LoadedProcedure.TransitionEnd;
altProcNameTextBox.Text = string.IsNullOrEmpty(LoadedProcedure.AltProcName) ? "---" : LoadedProcedure.AltProcName;
altProcPeriodTextBox.Text = LoadedProcedure.AltProcPeriod.ToString();
if (string.IsNullOrEmpty(LoadedProcedure.ResultsPrinter))
{
printer1ComboBox.Text = "---";
@@ -451,12 +459,19 @@ namespace TBF
LoadedProcedure.Description = descriptionTextBox.Text;
LoadedProcedure.Watermeters = watermetersTextBox.Text;
LoadedProcedure.ProtocolTitle = protocolTitleTextBox.Text;
LoadedProcedure.Protected = protectedCheckBox.Checked;
LoadedProcedure.MustBeComplete = mustBeCompleteCheckBox.Checked;
LoadedProcedure.ManualCtrlDisabled = manualControlDisabledCheckBox.Checked;
LoadedProcedure.AltProcName = altProcNameTextBox.Text.Equals("---") ? string.Empty : altProcNameTextBox.Text;
int itmp;
if (int.TryParse(altProcPeriodTextBox.Text, out itmp) && itmp >= 0)
{
LoadedProcedure.AltProcPeriod = itmp;
}
if (transitionStartComboBox.Items.Contains(transitionStartComboBox.Text))
{
LoadedProcedure.TransitionStart = transitionStartComboBox.Text.Equals("---") ? string.Empty : transitionStartComboBox.Text;
@@ -1547,13 +1562,14 @@ namespace TBF
procNameTextBox.Enabled = true;
descriptionTextBox.Enabled = true;
watermetersTextBox.Enabled = true;
protocolTitleTextBox.Enabled = true;
protectedCheckBox.Enabled = Users.GlobalData.CurrentUser.IsMemberOf(Users.Grp.GID.Metrologists);
mustBeCompleteCheckBox.Enabled = true;
manualControlDisabledCheckBox.Enabled = true;
dataEntryComboBox.Enabled = true;
metersKindRadioButton1.Enabled = true;
metersKindRadioButton2.Enabled = true;
altProcNameTextBox.Enabled = true;
altProcPeriodTextBox.Enabled = true;
#if HEAT_METERS
metersKindRadioButton3.Enabled = true;
#endif
+204 -141
View File
@@ -129,6 +129,120 @@
<data name="mainSplitContainer.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="altProcPeriodTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>636, 128</value>
</data>
<data name="altProcPeriodTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>34, 20</value>
</data>
<data name="altProcPeriodTextBox.TabIndex" type="System.Int32, mscorlib">
<value>19</value>
</data>
<data name="altProcPeriodTextBox.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;altProcPeriodTextBox.Name" xml:space="preserve">
<value>altProcPeriodTextBox</value>
</data>
<data name="&gt;&gt;altProcPeriodTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;altProcPeriodTextBox.Parent" xml:space="preserve">
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;altProcPeriodTextBox.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="altProcPeriodLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="altProcPeriodLabel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="altProcPeriodLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>502, 131</value>
</data>
<data name="altProcPeriodLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>116, 13</value>
</data>
<data name="altProcPeriodLabel.TabIndex" type="System.Int32, mscorlib">
<value>18</value>
</data>
<data name="altProcPeriodLabel.Text" xml:space="preserve">
<value>Alternative proc. period</value>
</data>
<data name="altProcPeriodLabel.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;altProcPeriodLabel.Name" xml:space="preserve">
<value>altProcPeriodLabel</value>
</data>
<data name="&gt;&gt;altProcPeriodLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;altProcPeriodLabel.Parent" xml:space="preserve">
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;altProcPeriodLabel.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="altProcNameTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>148, 128</value>
</data>
<data name="altProcNameTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>217, 20</value>
</data>
<data name="altProcNameTextBox.TabIndex" type="System.Int32, mscorlib">
<value>17</value>
</data>
<data name="altProcNameTextBox.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;altProcNameTextBox.Name" xml:space="preserve">
<value>altProcNameTextBox</value>
</data>
<data name="&gt;&gt;altProcNameTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;altProcNameTextBox.Parent" xml:space="preserve">
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;altProcNameTextBox.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="altProcNameLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="altProcNameLabel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="altProcNameLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>20, 131</value>
</data>
<data name="altProcNameLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>113, 13</value>
</data>
<data name="altProcNameLabel.TabIndex" type="System.Int32, mscorlib">
<value>16</value>
</data>
<data name="altProcNameLabel.Text" xml:space="preserve">
<value>Alternative proc. name</value>
</data>
<data name="altProcNameLabel.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;altProcNameLabel.Name" xml:space="preserve">
<value>altProcNameLabel</value>
</data>
<data name="&gt;&gt;altProcNameLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;altProcNameLabel.Parent" xml:space="preserve">
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;altProcNameLabel.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="manualControlDisabledCheckBox.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
@@ -136,13 +250,13 @@
<value>NoControl</value>
</data>
<data name="manualControlDisabledCheckBox.Location" type="System.Drawing.Point, System.Drawing">
<value>505, 206</value>
<value>505, 197</value>
</data>
<data name="manualControlDisabledCheckBox.Size" type="System.Drawing.Size, System.Drawing">
<value>138, 17</value>
</data>
<data name="manualControlDisabledCheckBox.TabIndex" type="System.Int32, mscorlib">
<value>37</value>
<value>39</value>
</data>
<data name="manualControlDisabledCheckBox.Text" xml:space="preserve">
<value>Manual control disabled</value>
@@ -157,7 +271,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;manualControlDisabledCheckBox.ZOrder" xml:space="preserve">
<value>0</value>
<value>4</value>
</data>
<data name="mustBeCompleteCheckBox.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -166,13 +280,13 @@
<value>NoControl</value>
</data>
<data name="mustBeCompleteCheckBox.Location" type="System.Drawing.Point, System.Drawing">
<value>505, 185</value>
<value>505, 176</value>
</data>
<data name="mustBeCompleteCheckBox.Size" type="System.Drawing.Size, System.Drawing">
<value>152, 17</value>
</data>
<data name="mustBeCompleteCheckBox.TabIndex" type="System.Int32, mscorlib">
<value>36</value>
<value>38</value>
</data>
<data name="mustBeCompleteCheckBox.Text" xml:space="preserve">
<value>All tests must be competed</value>
@@ -187,7 +301,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;mustBeCompleteCheckBox.ZOrder" xml:space="preserve">
<value>1</value>
<value>5</value>
</data>
<data name="protectedCheckBox.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -196,13 +310,13 @@
<value>NoControl</value>
</data>
<data name="protectedCheckBox.Location" type="System.Drawing.Point, System.Drawing">
<value>505, 164</value>
<value>505, 155</value>
</data>
<data name="protectedCheckBox.Size" type="System.Drawing.Size, System.Drawing">
<value>123, 17</value>
</data>
<data name="protectedCheckBox.TabIndex" type="System.Int32, mscorlib">
<value>35</value>
<value>37</value>
</data>
<data name="protectedCheckBox.Text" xml:space="preserve">
<value>Protected procedure</value>
@@ -217,7 +331,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;protectedCheckBox.ZOrder" xml:space="preserve">
<value>2</value>
<value>6</value>
</data>
<data name="metersKindRadioButton3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -226,13 +340,13 @@
<value>NoControl</value>
</data>
<data name="metersKindRadioButton3.Location" type="System.Drawing.Point, System.Drawing">
<value>356, 205</value>
<value>356, 196</value>
</data>
<data name="metersKindRadioButton3.Size" type="System.Drawing.Size, System.Drawing">
<value>77, 17</value>
</data>
<data name="metersKindRadioButton3.TabIndex" type="System.Int32, mscorlib">
<value>34</value>
<value>36</value>
</data>
<data name="metersKindRadioButton3.Text" xml:space="preserve">
<value>Heat meter</value>
@@ -247,16 +361,16 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;metersKindRadioButton3.ZOrder" xml:space="preserve">
<value>3</value>
<value>7</value>
</data>
<data name="fileWriter4ComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>148, 335</value>
<value>148, 336</value>
</data>
<data name="fileWriter4ComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>121, 21</value>
</data>
<data name="fileWriter4ComboBox.TabIndex" type="System.Int32, mscorlib">
<value>29</value>
<value>33</value>
</data>
<data name="&gt;&gt;fileWriter4ComboBox.Name" xml:space="preserve">
<value>fileWriter4ComboBox</value>
@@ -268,7 +382,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;fileWriter4ComboBox.ZOrder" xml:space="preserve">
<value>4</value>
<value>8</value>
</data>
<data name="fileWriter3ComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>148, 312</value>
@@ -277,7 +391,7 @@
<value>121, 21</value>
</data>
<data name="fileWriter3ComboBox.TabIndex" type="System.Int32, mscorlib">
<value>28</value>
<value>32</value>
</data>
<data name="&gt;&gt;fileWriter3ComboBox.Name" xml:space="preserve">
<value>fileWriter3ComboBox</value>
@@ -289,7 +403,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;fileWriter3ComboBox.ZOrder" xml:space="preserve">
<value>5</value>
<value>9</value>
</data>
<data name="printer2ComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>148, 243</value>
@@ -298,7 +412,7 @@
<value>121, 21</value>
</data>
<data name="printer2ComboBox.TabIndex" type="System.Int32, mscorlib">
<value>24</value>
<value>28</value>
</data>
<data name="&gt;&gt;printer2ComboBox.Name" xml:space="preserve">
<value>printer2ComboBox</value>
@@ -310,7 +424,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;printer2ComboBox.ZOrder" xml:space="preserve">
<value>6</value>
<value>10</value>
</data>
<data name="fileWriter2ComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>148, 289</value>
@@ -319,7 +433,7 @@
<value>121, 21</value>
</data>
<data name="fileWriter2ComboBox.TabIndex" type="System.Int32, mscorlib">
<value>27</value>
<value>31</value>
</data>
<data name="&gt;&gt;fileWriter2ComboBox.Name" xml:space="preserve">
<value>fileWriter2ComboBox</value>
@@ -331,58 +445,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;fileWriter2ComboBox.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="protocolTitleTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>148, 128</value>
</data>
<data name="protocolTitleTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>522, 20</value>
</data>
<data name="protocolTitleTextBox.TabIndex" type="System.Int32, mscorlib">
<value>15</value>
</data>
<data name="&gt;&gt;protocolTitleTextBox.Name" xml:space="preserve">
<value>protocolTitleTextBox</value>
</data>
<data name="&gt;&gt;protocolTitleTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;protocolTitleTextBox.Parent" xml:space="preserve">
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;protocolTitleTextBox.ZOrder" xml:space="preserve">
<value>8</value>
</data>
<data name="protocolTitleLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="protocolTitleLabel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="protocolTitleLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>20, 131</value>
</data>
<data name="protocolTitleLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>65, 13</value>
</data>
<data name="protocolTitleLabel.TabIndex" type="System.Int32, mscorlib">
<value>14</value>
</data>
<data name="protocolTitleLabel.Text" xml:space="preserve">
<value>Protocol title</value>
</data>
<data name="&gt;&gt;protocolTitleLabel.Name" xml:space="preserve">
<value>protocolTitleLabel</value>
</data>
<data name="&gt;&gt;protocolTitleLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;protocolTitleLabel.Parent" xml:space="preserve">
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;protocolTitleLabel.ZOrder" xml:space="preserve">
<value>9</value>
<value>11</value>
</data>
<data name="metersKindRadioButton2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -391,13 +454,13 @@
<value>NoControl</value>
</data>
<data name="metersKindRadioButton2.Location" type="System.Drawing.Point, System.Drawing">
<value>356, 184</value>
<value>356, 175</value>
</data>
<data name="metersKindRadioButton2.Size" type="System.Drawing.Size, System.Drawing">
<value>72, 17</value>
</data>
<data name="metersKindRadioButton2.TabIndex" type="System.Int32, mscorlib">
<value>31</value>
<value>35</value>
</data>
<data name="metersKindRadioButton2.Text" xml:space="preserve">
<value>Combined</value>
@@ -412,7 +475,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;metersKindRadioButton2.ZOrder" xml:space="preserve">
<value>10</value>
<value>12</value>
</data>
<data name="metersKindRadioButton1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -421,13 +484,13 @@
<value>NoControl</value>
</data>
<data name="metersKindRadioButton1.Location" type="System.Drawing.Point, System.Drawing">
<value>356, 163</value>
<value>356, 154</value>
</data>
<data name="metersKindRadioButton1.Size" type="System.Drawing.Size, System.Drawing">
<value>54, 17</value>
</data>
<data name="metersKindRadioButton1.TabIndex" type="System.Int32, mscorlib">
<value>30</value>
<value>34</value>
</data>
<data name="metersKindRadioButton1.Text" xml:space="preserve">
<value>Single</value>
@@ -442,7 +505,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;metersKindRadioButton1.ZOrder" xml:space="preserve">
<value>11</value>
<value>13</value>
</data>
<data name="transitionEndComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>148, 197</value>
@@ -451,7 +514,7 @@
<value>121, 21</value>
</data>
<data name="transitionEndComboBox.TabIndex" type="System.Int32, mscorlib">
<value>21</value>
<value>25</value>
</data>
<data name="&gt;&gt;transitionEndComboBox.Name" xml:space="preserve">
<value>transitionEndComboBox</value>
@@ -463,7 +526,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;transitionEndComboBox.ZOrder" xml:space="preserve">
<value>12</value>
<value>14</value>
</data>
<data name="transitionEndLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -478,7 +541,7 @@
<value>63, 13</value>
</data>
<data name="transitionEndLabel.TabIndex" type="System.Int32, mscorlib">
<value>20</value>
<value>24</value>
</data>
<data name="transitionEndLabel.Text" xml:space="preserve">
<value>Purge - End</value>
@@ -493,7 +556,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;transitionEndLabel.ZOrder" xml:space="preserve">
<value>13</value>
<value>15</value>
</data>
<data name="transitionStartComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>148, 174</value>
@@ -502,7 +565,7 @@
<value>121, 21</value>
</data>
<data name="transitionStartComboBox.TabIndex" type="System.Int32, mscorlib">
<value>19</value>
<value>23</value>
</data>
<data name="&gt;&gt;transitionStartComboBox.Name" xml:space="preserve">
<value>transitionStartComboBox</value>
@@ -514,7 +577,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;transitionStartComboBox.ZOrder" xml:space="preserve">
<value>14</value>
<value>16</value>
</data>
<data name="transitionStartLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -529,7 +592,7 @@
<value>71, 13</value>
</data>
<data name="transitionStartLabel.TabIndex" type="System.Int32, mscorlib">
<value>18</value>
<value>22</value>
</data>
<data name="transitionStartLabel.Text" xml:space="preserve">
<value>Purge - Begin</value>
@@ -544,7 +607,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;transitionStartLabel.ZOrder" xml:space="preserve">
<value>15</value>
<value>17</value>
</data>
<data name="fileWriter1ComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>148, 266</value>
@@ -553,7 +616,7 @@
<value>121, 21</value>
</data>
<data name="fileWriter1ComboBox.TabIndex" type="System.Int32, mscorlib">
<value>26</value>
<value>30</value>
</data>
<data name="&gt;&gt;fileWriter1ComboBox.Name" xml:space="preserve">
<value>fileWriter1ComboBox</value>
@@ -565,7 +628,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;fileWriter1ComboBox.ZOrder" xml:space="preserve">
<value>16</value>
<value>18</value>
</data>
<data name="printer1ComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>148, 220</value>
@@ -574,7 +637,7 @@
<value>121, 21</value>
</data>
<data name="printer1ComboBox.TabIndex" type="System.Int32, mscorlib">
<value>23</value>
<value>27</value>
</data>
<data name="&gt;&gt;printer1ComboBox.Name" xml:space="preserve">
<value>printer1ComboBox</value>
@@ -586,7 +649,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;printer1ComboBox.ZOrder" xml:space="preserve">
<value>17</value>
<value>19</value>
</data>
<data name="dataEntryComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>148, 151</value>
@@ -595,7 +658,7 @@
<value>121, 21</value>
</data>
<data name="dataEntryComboBox.TabIndex" type="System.Int32, mscorlib">
<value>17</value>
<value>21</value>
</data>
<data name="&gt;&gt;dataEntryComboBox.Name" xml:space="preserve">
<value>dataEntryComboBox</value>
@@ -607,7 +670,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;dataEntryComboBox.ZOrder" xml:space="preserve">
<value>18</value>
<value>20</value>
</data>
<data name="resultsWriterLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -622,7 +685,7 @@
<value>70, 13</value>
</data>
<data name="resultsWriterLabel.TabIndex" type="System.Int32, mscorlib">
<value>25</value>
<value>29</value>
</data>
<data name="resultsWriterLabel.Text" xml:space="preserve">
<value>Results writer</value>
@@ -637,7 +700,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;resultsWriterLabel.ZOrder" xml:space="preserve">
<value>19</value>
<value>21</value>
</data>
<data name="resultsPrinterLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -652,7 +715,7 @@
<value>42, 13</value>
</data>
<data name="resultsPrinterLabel.TabIndex" type="System.Int32, mscorlib">
<value>22</value>
<value>26</value>
</data>
<data name="resultsPrinterLabel.Text" xml:space="preserve">
<value>Printers</value>
@@ -667,7 +730,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;resultsPrinterLabel.ZOrder" xml:space="preserve">
<value>20</value>
<value>22</value>
</data>
<data name="dataEntryLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -682,7 +745,7 @@
<value>57, 13</value>
</data>
<data name="dataEntryLabel.TabIndex" type="System.Int32, mscorlib">
<value>16</value>
<value>20</value>
</data>
<data name="dataEntryLabel.Text" xml:space="preserve">
<value>Data Entry</value>
@@ -697,7 +760,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;dataEntryLabel.ZOrder" xml:space="preserve">
<value>21</value>
<value>23</value>
</data>
<data name="notesTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>353, 243</value>
@@ -709,7 +772,7 @@
<value>317, 113</value>
</data>
<data name="notesTextBox.TabIndex" type="System.Int32, mscorlib">
<value>33</value>
<value>41</value>
</data>
<data name="&gt;&gt;notesTextBox.Name" xml:space="preserve">
<value>notesTextBox</value>
@@ -721,7 +784,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;notesTextBox.ZOrder" xml:space="preserve">
<value>22</value>
<value>24</value>
</data>
<data name="label18.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -736,7 +799,7 @@
<value>35, 13</value>
</data>
<data name="label18.TabIndex" type="System.Int32, mscorlib">
<value>32</value>
<value>40</value>
</data>
<data name="label18.Text" xml:space="preserve">
<value>Notes</value>
@@ -751,7 +814,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;label18.ZOrder" xml:space="preserve">
<value>23</value>
<value>25</value>
</data>
<data name="watermetersTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>148, 105</value>
@@ -772,7 +835,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;watermetersTextBox.ZOrder" xml:space="preserve">
<value>24</value>
<value>26</value>
</data>
<data name="watermetersLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -802,10 +865,10 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;watermetersLabel.ZOrder" xml:space="preserve">
<value>25</value>
<value>27</value>
</data>
<data name="lastChangedOnTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>353, 82</value>
<value>362, 82</value>
</data>
<data name="lastChangedOnTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>150, 20</value>
@@ -823,7 +886,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;lastChangedOnTextBox.ZOrder" xml:space="preserve">
<value>26</value>
<value>28</value>
</data>
<data name="label15.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -832,7 +895,7 @@
<value>NoControl</value>
</data>
<data name="label15.Location" type="System.Drawing.Point, System.Drawing">
<value>291, 85</value>
<value>300, 85</value>
</data>
<data name="label15.Size" type="System.Drawing.Size, System.Drawing">
<value>30, 13</value>
@@ -853,7 +916,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;label15.ZOrder" xml:space="preserve">
<value>27</value>
<value>29</value>
</data>
<data name="lastChangedByTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>148, 82</value>
@@ -874,7 +937,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;lastChangedByTextBox.ZOrder" xml:space="preserve">
<value>28</value>
<value>30</value>
</data>
<data name="label16.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -904,10 +967,10 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;label16.ZOrder" xml:space="preserve">
<value>29</value>
<value>31</value>
</data>
<data name="createdOnTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>353, 59</value>
<value>362, 59</value>
</data>
<data name="createdOnTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>150, 20</value>
@@ -925,7 +988,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;createdOnTextBox.ZOrder" xml:space="preserve">
<value>30</value>
<value>32</value>
</data>
<data name="label14.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -934,7 +997,7 @@
<value>NoControl</value>
</data>
<data name="label14.Location" type="System.Drawing.Point, System.Drawing">
<value>291, 62</value>
<value>300, 62</value>
</data>
<data name="label14.Size" type="System.Drawing.Size, System.Drawing">
<value>30, 13</value>
@@ -955,7 +1018,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;label14.ZOrder" xml:space="preserve">
<value>31</value>
<value>33</value>
</data>
<data name="createdByTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>148, 59</value>
@@ -976,7 +1039,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;createdByTextBox.ZOrder" xml:space="preserve">
<value>32</value>
<value>34</value>
</data>
<data name="label13.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -1006,7 +1069,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;label13.ZOrder" xml:space="preserve">
<value>33</value>
<value>35</value>
</data>
<data name="descriptionTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>148, 36</value>
@@ -1027,7 +1090,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;descriptionTextBox.ZOrder" xml:space="preserve">
<value>34</value>
<value>36</value>
</data>
<data name="label12.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -1057,7 +1120,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;label12.ZOrder" xml:space="preserve">
<value>35</value>
<value>37</value>
</data>
<data name="procNameTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>148, 13</value>
@@ -1078,7 +1141,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;procNameTextBox.ZOrder" xml:space="preserve">
<value>36</value>
<value>38</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -1108,7 +1171,7 @@
<value>generalTabPage</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>37</value>
<value>39</value>
</data>
<data name="generalTabPage.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 34</value>
@@ -1117,7 +1180,7 @@
<value>3, 3, 3, 3</value>
</data>
<data name="generalTabPage.Size" type="System.Drawing.Size, System.Drawing">
<value>923, 364</value>
<value>923, 366</value>
</data>
<data name="generalTabPage.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
@@ -1144,7 +1207,7 @@
<value>3, 3</value>
</data>
<data name="historyListViewEx.Size" type="System.Drawing.Size, System.Drawing">
<value>917, 358</value>
<value>917, 360</value>
</data>
<data name="historyListViewEx.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
@@ -1153,7 +1216,7 @@
<value>historyListViewEx</value>
</data>
<data name="&gt;&gt;historyListViewEx.Type" xml:space="preserve">
<value>Results.Forms.ListViewEx, Results, Version=2.14.572.0, Culture=neutral, PublicKeyToken=null</value>
<value>Results.Forms.ListViewEx, Results, Version=2.15.619.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;historyListViewEx.Parent" xml:space="preserve">
<value>historyTabPage</value>
@@ -1168,7 +1231,7 @@
<value>3, 3, 3, 3</value>
</data>
<data name="historyTabPage.Size" type="System.Drawing.Size, System.Drawing">
<value>923, 364</value>
<value>923, 366</value>
</data>
<data name="historyTabPage.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
@@ -1195,7 +1258,7 @@
<value>3, 3</value>
</data>
<data name="metrology1ListViewEx.Size" type="System.Drawing.Size, System.Drawing">
<value>917, 358</value>
<value>917, 360</value>
</data>
<data name="metrology1ListViewEx.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
@@ -1204,7 +1267,7 @@
<value>metrology1ListViewEx</value>
</data>
<data name="&gt;&gt;metrology1ListViewEx.Type" xml:space="preserve">
<value>Results.Forms.ListViewEx, Results, Version=2.14.572.0, Culture=neutral, PublicKeyToken=null</value>
<value>Results.Forms.ListViewEx, Results, Version=2.15.619.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;metrology1ListViewEx.Parent" xml:space="preserve">
<value>metrology1TabPage</value>
@@ -1219,7 +1282,7 @@
<value>3, 3, 3, 3</value>
</data>
<data name="metrology1TabPage.Size" type="System.Drawing.Size, System.Drawing">
<value>923, 364</value>
<value>923, 366</value>
</data>
<data name="metrology1TabPage.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
@@ -1246,7 +1309,7 @@
<value>3, 3</value>
</data>
<data name="metrology2ListViewEx.Size" type="System.Drawing.Size, System.Drawing">
<value>917, 358</value>
<value>917, 360</value>
</data>
<data name="metrology2ListViewEx.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
@@ -1255,7 +1318,7 @@
<value>metrology2ListViewEx</value>
</data>
<data name="&gt;&gt;metrology2ListViewEx.Type" xml:space="preserve">
<value>Results.Forms.ListViewEx, Results, Version=2.14.572.0, Culture=neutral, PublicKeyToken=null</value>
<value>Results.Forms.ListViewEx, Results, Version=2.15.619.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;metrology2ListViewEx.Parent" xml:space="preserve">
<value>metrology2TabPage</value>
@@ -1270,7 +1333,7 @@
<value>3, 3, 3, 3</value>
</data>
<data name="metrology2TabPage.Size" type="System.Drawing.Size, System.Drawing">
<value>923, 364</value>
<value>923, 366</value>
</data>
<data name="metrology2TabPage.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
@@ -1297,7 +1360,7 @@
<value>3, 3</value>
</data>
<data name="processListViewEx.Size" type="System.Drawing.Size, System.Drawing">
<value>917, 358</value>
<value>917, 360</value>
</data>
<data name="processListViewEx.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
@@ -1306,7 +1369,7 @@
<value>processListViewEx</value>
</data>
<data name="&gt;&gt;processListViewEx.Type" xml:space="preserve">
<value>Results.Forms.ListViewEx, Results, Version=2.14.572.0, Culture=neutral, PublicKeyToken=null</value>
<value>Results.Forms.ListViewEx, Results, Version=2.15.619.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;processListViewEx.Parent" xml:space="preserve">
<value>processTabPage</value>
@@ -1321,7 +1384,7 @@
<value>3, 3, 3, 3</value>
</data>
<data name="processTabPage.Size" type="System.Drawing.Size, System.Drawing">
<value>923, 364</value>
<value>923, 366</value>
</data>
<data name="processTabPage.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
@@ -1348,7 +1411,7 @@
<value>0, 0</value>
</data>
<data name="parametersListViewEx.Size" type="System.Drawing.Size, System.Drawing">
<value>923, 364</value>
<value>923, 366</value>
</data>
<data name="parametersListViewEx.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
@@ -1357,7 +1420,7 @@
<value>parametersListViewEx</value>
</data>
<data name="&gt;&gt;parametersListViewEx.Type" xml:space="preserve">
<value>Results.Forms.ListViewEx, Results, Version=2.14.572.0, Culture=neutral, PublicKeyToken=null</value>
<value>Results.Forms.ListViewEx, Results, Version=2.15.619.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;parametersListViewEx.Parent" xml:space="preserve">
<value>parametersTabPage</value>
@@ -1369,7 +1432,7 @@
<value>4, 34</value>
</data>
<data name="parametersTabPage.Size" type="System.Drawing.Size, System.Drawing">
<value>923, 364</value>
<value>923, 366</value>
</data>
<data name="parametersTabPage.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
@@ -1399,10 +1462,10 @@
<value>0, 0</value>
</data>
<data name="tabControl.Size" type="System.Drawing.Size, System.Drawing">
<value>931, 402</value>
<value>931, 404</value>
</data>
<data name="tabControl.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
<value>0</value>
</data>
<data name="&gt;&gt;tabControl.Name" xml:space="preserve">
<value>tabControl</value>
@@ -1441,7 +1504,7 @@
<value>sharedButtons</value>
</data>
<data name="&gt;&gt;sharedButtons.Type" xml:space="preserve">
<value>TBF.UiControls.SharedButtons, TBF, Version=2.14.572.1, Culture=neutral, PublicKeyToken=null</value>
<value>TBF.UiControls.SharedButtons, TBF, Version=2.15.619.1, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;sharedButtons.Parent" xml:space="preserve">
<value>mainSplitContainer.Panel2</value>
@@ -1462,7 +1525,7 @@
<value>1</value>
</data>
<data name="mainSplitContainer.Size" type="System.Drawing.Size, System.Drawing">
<value>1034, 402</value>
<value>1034, 404</value>
</data>
<data name="mainSplitContainer.SplitterDistance" type="System.Int32, mscorlib">
<value>931</value>
@@ -1489,7 +1552,7 @@
<value>6, 13</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>1034, 402</value>
<value>1034, 404</value>
</data>
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
<value>CenterParent</value>
+40
View File
@@ -659,6 +659,26 @@
<DependentUpon>WriterCfgCtrl.cs</DependentUpon>
</Compile>
<Compile Include="BenchControl\Output\FileWriters\Enums.cs" />
<Compile Include="BenchControl\Output\FileWriters\ImageArchiver\Factory.cs" />
<Compile Include="BenchControl\Output\FileWriters\ImageArchiver\Archiver.cs" />
<Compile Include="BenchControl\Output\FileWriters\ImageArchiver\ArchiverCfg.cs" />
<Compile Include="BenchControl\Output\FileWriters\ImageArchiver\ArchiverCfgCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="BenchControl\Output\FileWriters\ImageArchiver\ArchiverCfgCtrl.designer.cs">
<DependentUpon>ArchiverCfgCtrl.cs</DependentUpon>
</Compile>
<Compile Include="BenchControl\Output\FileWriters\OneFilePerMeter\FactoryCompound.cs" />
<Compile Include="BenchControl\Output\FileWriters\OneFilePerMeter\FactoryHeatMeters.cs" />
<Compile Include="BenchControl\Output\FileWriters\OneFilePerMeter\FactorySingle.cs" />
<Compile Include="BenchControl\Output\FileWriters\OneFilePerMeter\Writer.cs" />
<Compile Include="BenchControl\Output\FileWriters\OneFilePerMeter\WriterCfg.cs" />
<Compile Include="BenchControl\Output\FileWriters\OneFilePerMeter\WriterCfgCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="BenchControl\Output\FileWriters\OneFilePerMeter\WriterCfgCtrl.designer.cs">
<DependentUpon>WriterCfgCtrl.cs</DependentUpon>
</Compile>
<Compile Include="BenchControl\Output\FileWriters\Xml\FactoryCompound.cs" />
<Compile Include="BenchControl\Output\FileWriters\Xml\FactoryHeatMeters.cs" />
<Compile Include="BenchControl\Output\FileWriters\Xml\FactorySingle.cs" />
@@ -687,6 +707,17 @@
<DependentUpon>PrinterCfgCtrl.cs</DependentUpon>
</Compile>
<Compile Include="BenchControl\Output\Printers\Enhanced\FactorySingle.cs" />
<Compile Include="BenchControl\Output\Printers\OnePagePerMeter\FactoryCompound.cs" />
<Compile Include="BenchControl\Output\Printers\OnePagePerMeter\FactoryHeatMeters.cs" />
<Compile Include="BenchControl\Output\Printers\OnePagePerMeter\FactorySingle.cs" />
<Compile Include="BenchControl\Output\Printers\OnePagePerMeter\Printer.cs" />
<Compile Include="BenchControl\Output\Printers\OnePagePerMeter\PrinterCfg.cs" />
<Compile Include="BenchControl\Output\Printers\OnePagePerMeter\PrinterCfgCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="BenchControl\Output\Printers\OnePagePerMeter\PrinterCfgCtrl.designer.cs">
<DependentUpon>PrinterCfgCtrl.cs</DependentUpon>
</Compile>
<Compile Include="BenchControl\ResultsPrinters\Cevak\Printer.cs" />
<Compile Include="BenchControl\ResultsPrinters\Cevak\PrinterCfg.cs" />
<Compile Include="BenchControl\ResultsPrinters\Cevak\PrinterCfgCtrl.cs">
@@ -1988,6 +2019,12 @@
<EmbeddedResource Include="BenchControl\Output\FileWriters\Enhanced\WriterCfgCtrl.resx">
<DependentUpon>WriterCfgCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BenchControl\Output\FileWriters\ImageArchiver\ArchiverCfgCtrl.resx">
<DependentUpon>ArchiverCfgCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BenchControl\Output\FileWriters\OneFilePerMeter\WriterCfgCtrl.resx">
<DependentUpon>WriterCfgCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BenchControl\Output\FileWriters\Xml\WriterCfgCtrl.resx">
<DependentUpon>WriterCfgCtrl.cs</DependentUpon>
</EmbeddedResource>
@@ -1997,6 +2034,9 @@
<EmbeddedResource Include="BenchControl\Output\Printers\Enhanced\PrinterCfgCtrl.resx">
<DependentUpon>PrinterCfgCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BenchControl\Output\Printers\OnePagePerMeter\PrinterCfgCtrl.resx">
<DependentUpon>PrinterCfgCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BenchControl\ResultsPrinters\Cevak\PrinterCfgCtrl.resx">
<DependentUpon>PrinterCfgCtrl.cs</DependentUpon>
</EmbeddedResource>