Output.FileWriters.Enhanced : (1) Old style ResultsConfigDlg removed, (2) Configuration change handling, ver. 2 12.466
This commit is contained in:
@@ -20,14 +20,15 @@ namespace Results.Forms
|
||||
{
|
||||
Item,
|
||||
Caption,
|
||||
TestID,
|
||||
Units,
|
||||
Format,
|
||||
Precision,
|
||||
Width,
|
||||
Alignment,
|
||||
TestID,
|
||||
Count,
|
||||
}
|
||||
|
||||
Control[] editors; /// all editors except of units
|
||||
ComboBox unitsCB; /// units combo box
|
||||
|
||||
@@ -35,14 +36,24 @@ namespace Results.Forms
|
||||
public IList<WMeterRsltItemSpec> AvailableItems;
|
||||
public IList<WMeterRsltItemSpec> SelectedItems;
|
||||
|
||||
|
||||
public MetersKind MetersKind;
|
||||
|
||||
|
||||
bool supressTestIDColumn;
|
||||
|
||||
|
||||
public ResultsConfigDlg(bool supressTestIDColumn)
|
||||
: this()
|
||||
{
|
||||
this.supressTestIDColumn = supressTestIDColumn;
|
||||
}
|
||||
|
||||
public ResultsConfigDlg()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
|
||||
void Localize()
|
||||
{
|
||||
Text = Strings.Configuration;
|
||||
@@ -64,12 +75,15 @@ namespace Results.Forms
|
||||
/// Add columns to ListViewEx
|
||||
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Item, Width = 120 });
|
||||
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Caption });
|
||||
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Test_ID });
|
||||
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Units });
|
||||
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Format });
|
||||
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Precision });
|
||||
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Width });
|
||||
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Alignment });
|
||||
if (!supressTestIDColumn)
|
||||
{
|
||||
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Test_ID });
|
||||
}
|
||||
|
||||
/// Create controls used by ListViewEx to edit items
|
||||
unitsCB = new ComboBox();
|
||||
@@ -83,13 +97,13 @@ namespace Results.Forms
|
||||
editors = new Control[]
|
||||
{
|
||||
null,
|
||||
new TextBox(),
|
||||
new TextBox(),
|
||||
new TextBox(), /// caption
|
||||
unitsCB,
|
||||
new TextBox(),
|
||||
new TextBox(),
|
||||
new TextBox(),
|
||||
new TextBox(), /// format
|
||||
new TextBox(), /// precision
|
||||
new TextBox(), /// width
|
||||
alignmentCB,
|
||||
new TextBox(), /// testID
|
||||
};
|
||||
foreach (var edi in editors)
|
||||
{
|
||||
@@ -120,7 +134,7 @@ namespace Results.Forms
|
||||
}
|
||||
selectedResultsListViewEx.StartEditing(unitsCB, e.Item, e.SubItem);
|
||||
}
|
||||
else if ((e.SubItem > 0) && (e.SubItem < (int)Column.Count))
|
||||
else if ((e.SubItem > 0) && (e.SubItem < (int)(supressTestIDColumn ? Column.TestID : Column.Count)))
|
||||
{
|
||||
selectedResultsListViewEx.StartEditing(editors[e.SubItem], e.Item, e.SubItem);
|
||||
}
|
||||
@@ -134,10 +148,6 @@ namespace Results.Forms
|
||||
switch ((Column)e.SubItem)
|
||||
{
|
||||
case Column.Caption: item.Caption = e.DisplayText; return;
|
||||
case Column.TestID: item.TestID = e.DisplayText; return;
|
||||
case Column.Format: item.Format = e.DisplayText; return;
|
||||
case Column.Precision: item.Precision = e.DisplayText; return;
|
||||
|
||||
case Column.Units:
|
||||
for (Config.Unit u = 0; u < Config.Unit.Count; u++)
|
||||
{
|
||||
@@ -149,6 +159,19 @@ namespace Results.Forms
|
||||
}
|
||||
break; /// Error
|
||||
|
||||
case Column.Format: item.Format = e.DisplayText; return;
|
||||
case Column.Precision: item.Precision = e.DisplayText; return;
|
||||
case Column.Width:
|
||||
{
|
||||
int width;
|
||||
if (Int32.TryParse(editors[e.SubItem].Text, out width) && width >= 0)
|
||||
{
|
||||
item.Width = width;
|
||||
return; /// OK
|
||||
}
|
||||
break; /// Error
|
||||
}
|
||||
|
||||
case Column.Alignment:
|
||||
for (Config.Entities.Alignment a = 0; a < Config.Entities.Alignment.Count; a++)
|
||||
{
|
||||
@@ -160,16 +183,8 @@ namespace Results.Forms
|
||||
}
|
||||
break; /// Error
|
||||
|
||||
case Column.Width:
|
||||
{
|
||||
int width;
|
||||
if (Int32.TryParse(editors[e.SubItem].Text, out width) && width >= 0)
|
||||
{
|
||||
item.Width = width;
|
||||
return; /// OK
|
||||
}
|
||||
break; /// Error
|
||||
}
|
||||
case Column.TestID: item.TestID = e.DisplayText; return;
|
||||
|
||||
default:
|
||||
return; /// OK
|
||||
}
|
||||
@@ -204,12 +219,15 @@ namespace Results.Forms
|
||||
ListViewItem lvi = new ListViewItem(item.Name); /// Item
|
||||
lvi.Tag = item;
|
||||
lvi.SubItems.Add(item.Caption); /// Header
|
||||
lvi.SubItems.Add(item.TestID); /// TestID
|
||||
lvi.SubItems.Add(item.Units.ToDescription()); /// Units
|
||||
lvi.SubItems.Add(item.Format); /// Format
|
||||
lvi.SubItems.Add(item.Precision); /// Precision
|
||||
lvi.SubItems.Add(item.Width.ToString()); /// Width
|
||||
lvi.SubItems.Add(item.Alignment.ToDescription()); /// Alignment
|
||||
if (!supressTestIDColumn)
|
||||
{
|
||||
lvi.SubItems.Add(item.TestID); /// TestID
|
||||
}
|
||||
|
||||
selectedResultsListViewEx.Items.Add(lvi);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,11 @@ namespace Results
|
||||
/// <summary> Safe wrapper which replaces null-s by empty strings </summary>
|
||||
public string Print(WaterMeter waterMeterResult)
|
||||
{
|
||||
string str = printDlgt(waterMeterResult, TestID, Units, Format, Precision);
|
||||
return Print(waterMeterResult, TestID);
|
||||
}
|
||||
public string Print(WaterMeter waterMeterResult, string testId)
|
||||
{
|
||||
string str = printDlgt(waterMeterResult, testId, Units, Format, Precision);
|
||||
if (str == null) str = string.Empty;
|
||||
|
||||
if (!string.IsNullOrEmpty(Format))
|
||||
@@ -286,8 +290,11 @@ namespace Results
|
||||
{
|
||||
try
|
||||
{
|
||||
//if (strArray[i].Contains("~"))
|
||||
//{
|
||||
if (strArray[i].Contains("~"))
|
||||
{
|
||||
///
|
||||
/// Load the new style results item specification
|
||||
///
|
||||
string[] field = strArray[i].Split(new char[] { '~' });
|
||||
WMeterRsltItemSpec item = GetItem(int.Parse(field[0]));
|
||||
|
||||
@@ -308,10 +315,36 @@ namespace Results
|
||||
}
|
||||
|
||||
result.Add(item);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
//}
|
||||
}
|
||||
else
|
||||
{
|
||||
///
|
||||
/// Try to load the old style results item specification
|
||||
///
|
||||
bool added = false;
|
||||
foreach (var it in AllItems)
|
||||
{
|
||||
if (strArray[i].Equals(it.OldUid))
|
||||
{
|
||||
WMeterRsltItemSpec item = it.Clone();
|
||||
item.Caption = item.Name.Replace("()", "").Replace(" *", "");
|
||||
item.Units = 0; /// use default units
|
||||
item.Format = null; /// the same like format string "{0}"
|
||||
item.Precision = null;
|
||||
item.Width = 0; /// do not ad any extra spaces
|
||||
item.Alignment = Alignment.Left;
|
||||
result.Add(item);
|
||||
added = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!added)
|
||||
{
|
||||
WMeterRsltItemSpec item = GetItem(0);
|
||||
item.Format = string.Format("Parse error: {0}", strArray[i]);
|
||||
result.Add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
@@ -27,6 +27,7 @@ namespace TBF.BenchControl
|
||||
Warning = 0x02, /// Some settings in the user control are suspicious, can be set after user confirmation
|
||||
RestartRqrd = 0x04, /// TBF program restart is required to apply all changed parameters
|
||||
AnyChange = 0x08, /// At least one parameter have changed
|
||||
InvokeCfgChange = 0x10, /// Invoke CfgChange handler of the component
|
||||
}
|
||||
|
||||
public enum CfgChangeCmd
|
||||
|
||||
@@ -116,35 +116,35 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
||||
if (config.RoiParams != argsTextBox.Text)
|
||||
{
|
||||
config.RoiParams = argsTextBox.Text;
|
||||
flags |= CfgUpdateFlags.AnyChange;
|
||||
Roi.OnCfgChange(this, new CfgChangeArgs(CfgChangeCmd.CfgChange, config));
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
if (config.UseTestImages != useTestImagesCheckBox.Checked)
|
||||
{
|
||||
config.UseTestImages = useTestImagesCheckBox.Checked;
|
||||
flags |= CfgUpdateFlags.AnyChange;
|
||||
Roi.OnCfgChange(this, new CfgChangeArgs(CfgChangeCmd.CfgChange, config));
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
if (config.DetectionImagesCount != int.Parse(imagesCountTextBox.Text))
|
||||
{
|
||||
config.DetectionImagesCount = int.Parse(imagesCountTextBox.Text);
|
||||
flags |= CfgUpdateFlags.AnyChange;
|
||||
Roi.OnCfgChange(this, new CfgChangeArgs(CfgChangeCmd.CfgChange, config));
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
if (config.DetectionPeriod1 != int.Parse(period1TextBox.Text))
|
||||
{
|
||||
config.DetectionPeriod1 = int.Parse(period1TextBox.Text);
|
||||
flags |= CfgUpdateFlags.AnyChange;
|
||||
Roi.OnCfgChange(this, new CfgChangeArgs(CfgChangeCmd.CfgChange, config));
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
if (config.DetectionPeriod2 != int.Parse(period2TextBox.Text))
|
||||
{
|
||||
config.DetectionPeriod2 = int.Parse(period2TextBox.Text);
|
||||
flags |= CfgUpdateFlags.AnyChange;
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
if ((flags & CfgUpdateFlags.InvokeCfgChange) != 0)
|
||||
{
|
||||
Roi.OnCfgChange(this, new CfgChangeArgs(CfgChangeCmd.CfgChange, config));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,143 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2016 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using Config.Entities;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.BenchControl.Output.FileWriters.Enhanced
|
||||
{
|
||||
public partial class ResultsConfigDlg : Form
|
||||
{
|
||||
public IList<Results.ItemSpec> AvailableItems;
|
||||
public IList<Results.ItemSpec> SelectedItems;
|
||||
|
||||
public MetersKind MetersKind;
|
||||
|
||||
public ResultsConfigDlg()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
Text = Strings.Configuration;
|
||||
availableResultsLabel.Text = Strings.Available_results;
|
||||
selectedResultsLabel.Text = Strings.Selected_results;
|
||||
addButton.Text = Strings.Add;
|
||||
removeButton.Text = Strings.Remove;
|
||||
removeAllButton.Text = Strings.Remove_all;
|
||||
okButton.Text = Strings.OkBtnText;
|
||||
cancelButton.Text = Strings.CancelBtnText;
|
||||
}
|
||||
|
||||
void ResultsConfig_Load(object sender, EventArgs e)
|
||||
{
|
||||
Localize();
|
||||
RedrawAvailable();
|
||||
RedrawSelected();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Redraw selected items (right hand side)
|
||||
/// </summary>
|
||||
void RedrawAvailable()
|
||||
{
|
||||
availableResultsListBox.Items.Clear();
|
||||
AvailableItems = new List<Results.ItemSpec>();
|
||||
foreach (var item in Results.ItemSpec.AllItems)
|
||||
{
|
||||
if (((MetersKind == MetersKind.Single) && item.CanPrintSingle) ||
|
||||
((MetersKind == MetersKind.Combined) && item.CanPrintCompoundMeter) ||
|
||||
((MetersKind == MetersKind.HeatMeter) && item.CanPrintHeatMeter))
|
||||
{
|
||||
if (!SelectedItems.Contains(item))
|
||||
{
|
||||
AvailableItems.Add(item);
|
||||
availableResultsListBox.Items.Add(item.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Redraw selected items (right hand side)
|
||||
/// </summary>
|
||||
void RedrawSelected()
|
||||
{
|
||||
selectedResultsListBox.Items.Clear();
|
||||
foreach (var item in SelectedItems)
|
||||
{
|
||||
selectedResultsListBox.Items.Add(item.Name);
|
||||
}
|
||||
}
|
||||
|
||||
void availableResultsListBox_DoubleClick(object sender, EventArgs e)
|
||||
{
|
||||
/// Double click works when just one item is selected
|
||||
IList<Results.ItemSpec> itemsToRemove = new List<Results.ItemSpec>();
|
||||
if (availableResultsListBox.SelectedIndices.Count == 1)
|
||||
{
|
||||
var item = AvailableItems[availableResultsListBox.SelectedIndices[0]];
|
||||
SelectedItems.Add(item);
|
||||
RedrawAvailable();
|
||||
RedrawSelected();
|
||||
}
|
||||
}
|
||||
|
||||
void addButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
/// Append at the end, this code supports multiple selected items,
|
||||
/// although ListBox control settings may limit the max.number of selected items to one.
|
||||
|
||||
for (int i = availableResultsListBox.SelectedIndices.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var item = AvailableItems[availableResultsListBox.SelectedIndices[i]];
|
||||
SelectedItems.Add(item);
|
||||
}
|
||||
RedrawAvailable();
|
||||
RedrawSelected();
|
||||
}
|
||||
|
||||
private void selectedResultsListBox_DoubleClick(object sender, EventArgs e)
|
||||
{
|
||||
/// Double click works when just one item is selected
|
||||
|
||||
if (selectedResultsListBox.SelectedIndices.Count == 1)
|
||||
{
|
||||
SelectedItems.RemoveAt(selectedResultsListBox.SelectedIndices[0]);
|
||||
RedrawAvailable();
|
||||
RedrawSelected();
|
||||
}
|
||||
}
|
||||
|
||||
void removeButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
/// Remove from the list (the last selected item first so that the indexes are not affected)
|
||||
|
||||
for (int i = selectedResultsListBox.SelectedIndices.Count - 1; i >= 0; i--)
|
||||
{
|
||||
SelectedItems.RemoveAt(selectedResultsListBox.SelectedIndices[i]);
|
||||
}
|
||||
RedrawAvailable();
|
||||
RedrawSelected();
|
||||
}
|
||||
|
||||
void removeAllButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
/// Remove all items from 'Selected' list
|
||||
|
||||
SelectedItems.Clear();
|
||||
RedrawAvailable();
|
||||
RedrawSelected();
|
||||
}
|
||||
|
||||
void okButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
-168
@@ -1,168 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2016 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF.BenchControl.Output.FileWriters.Enhanced
|
||||
{
|
||||
partial class ResultsConfigDlg
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.okButton = new System.Windows.Forms.Button();
|
||||
this.cancelButton = new System.Windows.Forms.Button();
|
||||
this.availableResultsListBox = new System.Windows.Forms.ListBox();
|
||||
this.selectedResultsListBox = new System.Windows.Forms.ListBox();
|
||||
this.availableResultsLabel = new System.Windows.Forms.Label();
|
||||
this.selectedResultsLabel = new System.Windows.Forms.Label();
|
||||
this.removeAllButton = new System.Windows.Forms.Button();
|
||||
this.removeButton = new System.Windows.Forms.Button();
|
||||
this.addButton = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// okButton
|
||||
//
|
||||
this.okButton.Location = new System.Drawing.Point(90, 236);
|
||||
this.okButton.Name = "okButton";
|
||||
this.okButton.Size = new System.Drawing.Size(104, 30);
|
||||
this.okButton.TabIndex = 4;
|
||||
this.okButton.Text = "OK";
|
||||
this.okButton.UseVisualStyleBackColor = true;
|
||||
this.okButton.Click += new System.EventHandler(this.okButton_Click);
|
||||
//
|
||||
// cancelButton
|
||||
//
|
||||
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.cancelButton.Location = new System.Drawing.Point(211, 236);
|
||||
this.cancelButton.Name = "cancelButton";
|
||||
this.cancelButton.Size = new System.Drawing.Size(104, 30);
|
||||
this.cancelButton.TabIndex = 5;
|
||||
this.cancelButton.Text = "Cancel";
|
||||
this.cancelButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// availableResultsListBox
|
||||
//
|
||||
this.availableResultsListBox.FormattingEnabled = true;
|
||||
this.availableResultsListBox.Location = new System.Drawing.Point(12, 31);
|
||||
this.availableResultsListBox.Name = "availableResultsListBox";
|
||||
this.availableResultsListBox.Size = new System.Drawing.Size(135, 186);
|
||||
this.availableResultsListBox.TabIndex = 6;
|
||||
this.availableResultsListBox.DoubleClick += new System.EventHandler(this.availableResultsListBox_DoubleClick);
|
||||
//
|
||||
// selectedResultsListBox
|
||||
//
|
||||
this.selectedResultsListBox.FormattingEnabled = true;
|
||||
this.selectedResultsListBox.Location = new System.Drawing.Point(252, 31);
|
||||
this.selectedResultsListBox.Name = "selectedResultsListBox";
|
||||
this.selectedResultsListBox.Size = new System.Drawing.Size(135, 186);
|
||||
this.selectedResultsListBox.TabIndex = 7;
|
||||
this.selectedResultsListBox.DoubleClick += new System.EventHandler(this.selectedResultsListBox_DoubleClick);
|
||||
//
|
||||
// availableResultsLabel
|
||||
//
|
||||
this.availableResultsLabel.AutoSize = true;
|
||||
this.availableResultsLabel.Location = new System.Drawing.Point(12, 9);
|
||||
this.availableResultsLabel.Name = "availableResultsLabel";
|
||||
this.availableResultsLabel.Size = new System.Drawing.Size(86, 13);
|
||||
this.availableResultsLabel.TabIndex = 8;
|
||||
this.availableResultsLabel.Text = "Available results:";
|
||||
//
|
||||
// selectedResultsLabel
|
||||
//
|
||||
this.selectedResultsLabel.AutoSize = true;
|
||||
this.selectedResultsLabel.Location = new System.Drawing.Point(249, 9);
|
||||
this.selectedResultsLabel.Name = "selectedResultsLabel";
|
||||
this.selectedResultsLabel.Size = new System.Drawing.Size(85, 13);
|
||||
this.selectedResultsLabel.TabIndex = 9;
|
||||
this.selectedResultsLabel.Text = "Selected results:";
|
||||
//
|
||||
// removeAllButton
|
||||
//
|
||||
this.removeAllButton.Location = new System.Drawing.Point(153, 144);
|
||||
this.removeAllButton.Name = "removeAllButton";
|
||||
this.removeAllButton.Size = new System.Drawing.Size(94, 30);
|
||||
this.removeAllButton.TabIndex = 46;
|
||||
this.removeAllButton.Text = "<< R&emove all";
|
||||
this.removeAllButton.UseVisualStyleBackColor = true;
|
||||
this.removeAllButton.Click += new System.EventHandler(this.removeAllButton_Click);
|
||||
//
|
||||
// removeButton
|
||||
//
|
||||
this.removeButton.Location = new System.Drawing.Point(153, 109);
|
||||
this.removeButton.Name = "removeButton";
|
||||
this.removeButton.Size = new System.Drawing.Size(93, 30);
|
||||
this.removeButton.TabIndex = 45;
|
||||
this.removeButton.Text = "< &Remove";
|
||||
this.removeButton.UseVisualStyleBackColor = true;
|
||||
this.removeButton.Click += new System.EventHandler(this.removeButton_Click);
|
||||
//
|
||||
// addButton
|
||||
//
|
||||
this.addButton.Location = new System.Drawing.Point(153, 74);
|
||||
this.addButton.Name = "addButton";
|
||||
this.addButton.Size = new System.Drawing.Size(93, 30);
|
||||
this.addButton.TabIndex = 44;
|
||||
this.addButton.Text = "&Add >";
|
||||
this.addButton.UseVisualStyleBackColor = true;
|
||||
this.addButton.Click += new System.EventHandler(this.addButton_Click);
|
||||
//
|
||||
// ResultsConfig
|
||||
//
|
||||
this.AcceptButton = this.okButton;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.cancelButton;
|
||||
this.ClientSize = new System.Drawing.Size(399, 282);
|
||||
this.Controls.Add(this.removeAllButton);
|
||||
this.Controls.Add(this.removeButton);
|
||||
this.Controls.Add(this.addButton);
|
||||
this.Controls.Add(this.selectedResultsLabel);
|
||||
this.Controls.Add(this.availableResultsLabel);
|
||||
this.Controls.Add(this.selectedResultsListBox);
|
||||
this.Controls.Add(this.availableResultsListBox);
|
||||
this.Controls.Add(this.cancelButton);
|
||||
this.Controls.Add(this.okButton);
|
||||
this.Name = "ResultsConfig";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "ResultsConfig";
|
||||
this.Load += new System.EventHandler(this.ResultsConfig_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button okButton;
|
||||
private System.Windows.Forms.Button cancelButton;
|
||||
private System.Windows.Forms.ListBox availableResultsListBox;
|
||||
private System.Windows.Forms.ListBox selectedResultsListBox;
|
||||
private System.Windows.Forms.Label availableResultsLabel;
|
||||
private System.Windows.Forms.Label selectedResultsLabel;
|
||||
private System.Windows.Forms.Button removeAllButton;
|
||||
private System.Windows.Forms.Button removeButton;
|
||||
private System.Windows.Forms.Button addButton;
|
||||
}
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
<?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>
|
||||
@@ -17,22 +17,23 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced
|
||||
public override string ToString() { return string.Format("Output.FileWriters.Enhanced({0})", Cfg.ToString(1)); }
|
||||
|
||||
readonly WriterCfg writerCfg;
|
||||
readonly string separatorStr;
|
||||
|
||||
readonly string header;
|
||||
readonly string footer;
|
||||
string separatorStr;
|
||||
|
||||
///
|
||||
/// Items to print
|
||||
///
|
||||
readonly IList<Results.WMeterRsltItemSpec> commonItems;
|
||||
readonly IList<Results.ItemSpec> testItems;
|
||||
string header;
|
||||
string footer;
|
||||
IList<Results.WMeterRsltItemSpec> commonItems;
|
||||
IList<Results.WMeterRsltItemSpec> testItems;
|
||||
|
||||
///
|
||||
/// Results to print
|
||||
///
|
||||
Results.Entities.Batch batch;
|
||||
|
||||
|
||||
StreamWriter writer;
|
||||
StreamWriter writer2;
|
||||
|
||||
@@ -43,7 +44,13 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced
|
||||
: base(cfg)
|
||||
{
|
||||
writerCfg = cfg as WriterCfg;
|
||||
ApplyConfig();
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
|
||||
void ApplyConfig()
|
||||
{
|
||||
switch (writerCfg.Separator)
|
||||
{
|
||||
default:
|
||||
@@ -54,15 +61,55 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced
|
||||
case Separator.Semicolon: separatorStr = ";"; break;
|
||||
}
|
||||
|
||||
header = writerCfg.Header.Replace("~", "\r\n");
|
||||
header = writerCfg.Header.Replace("~", Environment.NewLine);
|
||||
commonItems = Results.WMeterRsltItemSpec.FromStrArray(writerCfg.CommonItems);
|
||||
testItems = Results.ItemSpec.FromStrArray(writerCfg.SelectedItems);
|
||||
footer = writerCfg.Footer.Replace("~", "\r\n");
|
||||
|
||||
log.Debug(this.ToString());
|
||||
testItems = Results.WMeterRsltItemSpec.FromStrArray(writerCfg.SelectedItems); /// TestID info will be overwritten later on
|
||||
footer = 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.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>
|
||||
@@ -265,32 +312,12 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced
|
||||
int totalWidth = 0;
|
||||
for (int i = 0; i < testItems.Count; i++)
|
||||
{
|
||||
columnWidths[i] = ElSpaces(testItems[i].ClmnHeaderText).Length;
|
||||
columnWidths[i] = ElSpaces(testItems[i].Caption).Length;
|
||||
foreach (var mtr in wm.MeterTestRslts)
|
||||
{
|
||||
if ((mtr != null) && (mtr.Publish() == Config.Entities.Publish.Always))
|
||||
{
|
||||
string itemText;
|
||||
|
||||
if (wm.Compound())
|
||||
{
|
||||
if (mtr.CompoundMeterId != (byte)CompoundMeterId.Compound) continue;
|
||||
|
||||
Results.Entities.MeterTestRslt mainMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
|
||||
Results.Entities.MeterTestRslt auxMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux);
|
||||
itemText = testItems[i].PrintCombined(mainMtr, auxMtr, mtr);
|
||||
}
|
||||
else if (wm.HeatMeter())
|
||||
{
|
||||
if (mtr.CompoundMeterId != (byte)CompoundMeterId.HeatMeterEnergy) continue;
|
||||
|
||||
Results.Entities.MeterTestRslt volumeMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.HeatMeterVolume);
|
||||
itemText = testItems[i].PrintHeatMeter(volumeMtr, mtr);
|
||||
}
|
||||
else /// Single water meter
|
||||
{
|
||||
itemText = testItems[i].Print(mtr);
|
||||
}
|
||||
string itemText = testItems[i].Print(wm, mtr.Name());
|
||||
|
||||
/// Strip color information
|
||||
string[] texts = itemText.Split(new char[] { '|' });
|
||||
@@ -311,13 +338,13 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced
|
||||
/// Write column headers
|
||||
for (int i = 0; i < testItems.Count; i++)
|
||||
{
|
||||
wr.Write(ElSpaces(testItems[i].ClmnHeaderText));
|
||||
wr.Write(ElSpaces(testItems[i].Caption));
|
||||
|
||||
if (i < testItems.Count - 1)
|
||||
{
|
||||
if (!writerCfg.EliminateSpaces)
|
||||
{
|
||||
wr.Write(new string(' ', columnWidths[i] - testItems[i].ClmnHeaderText.Length + 3));
|
||||
wr.Write(new string(' ', columnWidths[i] - testItems[i].Caption.Length + 3));
|
||||
}
|
||||
wr.Write(separatorStr);
|
||||
}
|
||||
@@ -338,37 +365,14 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced
|
||||
{
|
||||
for (int i = 0; i < testItems.Count; i++)
|
||||
{
|
||||
string itemText;
|
||||
/// Fetch the item
|
||||
string itemText = testItems[i].Print(wm, mtr.Name());
|
||||
|
||||
///
|
||||
/// Fetch an item
|
||||
///
|
||||
if (wm.Compound() && 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 = testItems[i].PrintCombined(mainMtr, auxMtr, mtr);
|
||||
}
|
||||
else if (wm.HeatMeter() && mtr.CompoundMeterId == (byte)CompoundMeterId.HeatMeterEnergy)
|
||||
{
|
||||
Results.Entities.MeterTestRslt volumeMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.HeatMeterVolume);
|
||||
itemText = testItems[i].PrintHeatMeter(volumeMtr, mtr);
|
||||
}
|
||||
else if (!wm.Compound() && !wm.HeatMeter() && mtr.CompoundMeterId == (byte)CompoundMeterId.Single) /// Single water meter
|
||||
{
|
||||
itemText = testItems[i].Print(mtr);
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
///
|
||||
/// Print the item
|
||||
///
|
||||
/// Strip color information
|
||||
string[] texts = itemText.Split(new char[] { '|' });
|
||||
if (texts.Length == 2) { itemText = texts[0]; } /// Strip color information
|
||||
if (texts.Length == 2) { itemText = texts[0]; }
|
||||
|
||||
/// Print the item
|
||||
wr.Write(ElSpaces(itemText));
|
||||
|
||||
if (i < testItems.Count - 1)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2016 Sensus Metering Systems
|
||||
/// Copyright (c) 2016-2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -152,20 +152,24 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced
|
||||
|
||||
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.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.RestartRqrd;
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
if (config.DestinationPath2 != destination2TextBox.Text)
|
||||
{
|
||||
config.DestinationPath2 = destination2TextBox.Text;
|
||||
if (!config.DestinationPath2.EndsWith("\\")) config.DestinationPath2 += "\\";
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
for (YearFolders i = 0; i < YearFolders.Count; i++)
|
||||
@@ -173,7 +177,7 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced
|
||||
if (i.ToString().Equals(yearFoldersComboBox.Text) && (config.YearFolders != i))
|
||||
{
|
||||
config.YearFolders = i;
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -183,7 +187,7 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced
|
||||
if (i.ToString().Equals(monthFoldersComboBox.Text) && (config.MonthFolders != i))
|
||||
{
|
||||
config.MonthFolders = i;
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -193,7 +197,7 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced
|
||||
if (i.ToString().Equals(dayFoldersComboBox.Text) && (config.DayFolders != i))
|
||||
{
|
||||
config.DayFolders = i;
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -201,15 +205,16 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced
|
||||
if (config.FileNameFormat != fileNameFmtTextBox.Text)
|
||||
{
|
||||
config.FileNameFormat = fileNameFmtTextBox.Text;
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
|
||||
for (Separator i = 0; i < Separator.Count; i++)
|
||||
{
|
||||
if (i.ToString().Equals(separatorComboBox.Text) && (config.Separator != i))
|
||||
{
|
||||
config.Separator = i;
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -217,31 +222,36 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced
|
||||
if (config.EliminateSpaces != eliminateSpacesCheckBox.Checked)
|
||||
{
|
||||
config.EliminateSpaces = eliminateSpacesCheckBox.Checked;
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
if (config.CommonItems != commonItems)
|
||||
{
|
||||
config.CommonItems = commonItems;
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
if (config.SelectedItems != testItems)
|
||||
{
|
||||
config.SelectedItems = testItems;
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
if (config.Header != header)
|
||||
{
|
||||
config.Header = header;
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
if (config.Footer != footer)
|
||||
{
|
||||
config.Footer = footer;
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
if ((flags & CfgUpdateFlags.InvokeCfgChange) != 0)
|
||||
{
|
||||
Writer.OnCfgChange(this, new CfgChangeArgs(CfgChangeCmd.CfgChange, config));
|
||||
}
|
||||
|
||||
return flags;
|
||||
@@ -254,10 +264,10 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced
|
||||
|
||||
private void headerButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
HeaderFooterDlg dlg = new HeaderFooterDlg(true, header.Replace("~", "\r\n"));
|
||||
HeaderFooterDlg dlg = new HeaderFooterDlg(true, header.Replace("~", Environment.NewLine));
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
header = dlg.EditedText.Replace("\r\n", "~");
|
||||
header = dlg.EditedText.Replace(Environment.NewLine, "~");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -280,27 +290,27 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced
|
||||
|
||||
private void testItemsButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
ResultsConfigDlg dlg = new ResultsConfigDlg()
|
||||
Results.Forms.ResultsConfigDlg dlg = new Results.Forms.ResultsConfigDlg(true)
|
||||
{
|
||||
MetersKind = config.MetersKind,
|
||||
SelectedItems = Results.ItemSpec.FromStrArray(testItems),
|
||||
AvailableItems = new List<Results.ItemSpec>()
|
||||
SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(testItems),
|
||||
AvailableItems = new List<Results.WMeterRsltItemSpec>()
|
||||
};
|
||||
|
||||
foreach (var v in Results.ItemSpec.AllItems) dlg.AvailableItems.Add(v);
|
||||
foreach (var v in Results.WMeterRsltItemSpec.AllItems) dlg.AvailableItems.Add(v);
|
||||
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
testItems = Results.ItemSpec.ToStrArray(dlg.SelectedItems);
|
||||
testItems = Results.WMeterRsltItemSpec.ToStrArray(dlg.SelectedItems);
|
||||
}
|
||||
}
|
||||
|
||||
private void footerButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
HeaderFooterDlg dlg = new HeaderFooterDlg(false, footer.Replace("~", "\r\n"));
|
||||
HeaderFooterDlg dlg = new HeaderFooterDlg(false, footer.Replace("~", Environment.NewLine));
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
footer = dlg.EditedText.Replace("\r\n", "~");
|
||||
footer = dlg.EditedText.Replace(Environment.NewLine, "~");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -333,5 +343,21 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced
|
||||
testItemsButton_Click(this, null);
|
||||
}
|
||||
}
|
||||
|
||||
#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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("2.12.465.1")]
|
||||
[assembly: AssemblyFileVersion("2.12.465.1")]
|
||||
[assembly: AssemblyVersion("2.12.466.1")]
|
||||
[assembly: AssemblyFileVersion("2.12.466.1")]
|
||||
|
||||
@@ -596,12 +596,6 @@
|
||||
<Compile Include="BenchControl\Output\FileWriters\Enhanced\HeaderFooterDlg.Designer.cs">
|
||||
<DependentUpon>HeaderFooterDlg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BenchControl\Output\FileWriters\Enhanced\ResultsConfigDlg.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="BenchControl\Output\FileWriters\Enhanced\ResultsConfigDlg.designer.cs">
|
||||
<DependentUpon>ResultsConfigDlg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BenchControl\Output\FileWriters\Enhanced\Writer.cs" />
|
||||
<Compile Include="BenchControl\Output\FileWriters\Enhanced\WriterCfg.cs" />
|
||||
<Compile Include="BenchControl\Output\FileWriters\Enhanced\WriterCfgCtrl.cs">
|
||||
@@ -1923,9 +1917,6 @@
|
||||
<EmbeddedResource Include="BenchControl\Output\FileWriters\Enhanced\HeaderFooterDlg.resx">
|
||||
<DependentUpon>HeaderFooterDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="BenchControl\Output\FileWriters\Enhanced\ResultsConfigDlg.resx">
|
||||
<DependentUpon>ResultsConfigDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="BenchControl\Output\FileWriters\Enhanced\WriterCfgCtrl.resx">
|
||||
<DependentUpon>WriterCfgCtrl.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
||||
Reference in New Issue
Block a user