ResultsBrowser: Statistics implemented (NOK yet), user options saved in LocalSettings.
This commit is contained in:
@@ -33,8 +33,8 @@ namespace ResultsBrowser.Forms
|
||||
|
||||
void Localize()
|
||||
{
|
||||
Text = "Select a Filters";
|
||||
label1.Text = "Filters";
|
||||
Text = Strings.Select_a_filter;
|
||||
label1.Text = Strings.Filters;
|
||||
okButton.Text = Strings.OkBtnText;
|
||||
cancelButton.Text = Strings.CancelBtnText;
|
||||
}
|
||||
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
namespace ResultsBrowser.Forms
|
||||
{
|
||||
partial class StatisticsDlg
|
||||
{
|
||||
/// <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.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.statisticsListView = new System.Windows.Forms.ListView();
|
||||
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
|
||||
this.okButton = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
this.splitContainer1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
|
||||
this.splitContainer2.Panel2.SuspendLayout();
|
||||
this.splitContainer2.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
||||
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitContainer1.Name = "splitContainer1";
|
||||
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
this.splitContainer1.Panel1.Controls.Add(this.statisticsListView);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
|
||||
this.splitContainer1.Size = new System.Drawing.Size(572, 409);
|
||||
this.splitContainer1.SplitterDistance = 320;
|
||||
this.splitContainer1.TabIndex = 0;
|
||||
//
|
||||
// statisticsListView
|
||||
//
|
||||
this.statisticsListView.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.statisticsListView.GridLines = true;
|
||||
this.statisticsListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
|
||||
this.statisticsListView.Location = new System.Drawing.Point(0, 0);
|
||||
this.statisticsListView.Name = "statisticsListView";
|
||||
this.statisticsListView.Size = new System.Drawing.Size(572, 320);
|
||||
this.statisticsListView.TabIndex = 0;
|
||||
this.statisticsListView.UseCompatibleStateImageBehavior = false;
|
||||
//
|
||||
// splitContainer2
|
||||
//
|
||||
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
||||
this.splitContainer2.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitContainer2.Name = "splitContainer2";
|
||||
//
|
||||
// splitContainer2.Panel2
|
||||
//
|
||||
this.splitContainer2.Panel2.Controls.Add(this.okButton);
|
||||
this.splitContainer2.Size = new System.Drawing.Size(572, 85);
|
||||
this.splitContainer2.SplitterDistance = 390;
|
||||
this.splitContainer2.TabIndex = 0;
|
||||
//
|
||||
// okButton
|
||||
//
|
||||
this.okButton.Location = new System.Drawing.Point(45, 20);
|
||||
this.okButton.Name = "okButton";
|
||||
this.okButton.Size = new System.Drawing.Size(108, 41);
|
||||
this.okButton.TabIndex = 0;
|
||||
this.okButton.Text = "OK";
|
||||
this.okButton.UseVisualStyleBackColor = true;
|
||||
this.okButton.Click += new System.EventHandler(this.okButton_Click);
|
||||
//
|
||||
// StatisticsDlg
|
||||
//
|
||||
this.AcceptButton = this.okButton;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(572, 409);
|
||||
this.Controls.Add(this.splitContainer1);
|
||||
this.Name = "StatisticsDlg";
|
||||
this.Text = "StatisticsDlg";
|
||||
this.Load += new System.EventHandler(this.StatisticsDlg_Load);
|
||||
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
|
||||
this.splitContainer1.ResumeLayout(false);
|
||||
this.splitContainer2.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
|
||||
this.splitContainer2.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||
private System.Windows.Forms.ListView statisticsListView;
|
||||
private System.Windows.Forms.SplitContainer splitContainer2;
|
||||
private System.Windows.Forms.Button okButton;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using Results.Entities;
|
||||
using ResultsBrowser.Resources;
|
||||
|
||||
namespace ResultsBrowser.Forms
|
||||
{
|
||||
public partial class StatisticsDlg : Form
|
||||
{
|
||||
IList<WaterMeter> waterMeters;
|
||||
|
||||
bool twoDim;
|
||||
//int rowItemID;
|
||||
//int columnItemID;
|
||||
//string rowTestSpec;
|
||||
//string columnTestSpec;
|
||||
|
||||
Results.WMeterRsltItemSpec rowItem;
|
||||
Results.WMeterRsltItemSpec columnItem;
|
||||
|
||||
IList<string> rowValues;
|
||||
IList<string> columnValues;
|
||||
|
||||
public StatisticsDlg(IList<WaterMeter> waterMeters, bool twoDim, int rowItemID, int columnItemID, string rowTestSpec, string columnTestSpec)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Text = Strings.Statistics;
|
||||
okButton.Text = Strings.OkBtnText;
|
||||
|
||||
this.waterMeters = waterMeters;
|
||||
|
||||
this.twoDim = twoDim;
|
||||
|
||||
foreach (var item in Results.WMeterRsltItemSpec.AllItems)
|
||||
{
|
||||
if (item.Uid == rowItemID)
|
||||
{
|
||||
rowItem = item.Clone();
|
||||
item.TestID = rowTestSpec;
|
||||
}
|
||||
if (twoDim && item.Uid == columnItemID)
|
||||
{
|
||||
columnItem = item.Clone();
|
||||
item.TestID = columnTestSpec;
|
||||
}
|
||||
}
|
||||
|
||||
//this.rowItemID = rowItemID;
|
||||
//this.columnItemID = columnItemID;
|
||||
//this.rowTestSpec = rowTestSpec;
|
||||
//this.columnTestSpec = columnTestSpec;
|
||||
}
|
||||
|
||||
private void StatisticsDlg_Load(object sender, EventArgs e)
|
||||
{
|
||||
Calculate();
|
||||
}
|
||||
|
||||
bool Calculate()
|
||||
{
|
||||
try
|
||||
{
|
||||
rowValues = new List<string>();
|
||||
columnValues = new List<string>();
|
||||
|
||||
///
|
||||
/// Find discrete values of rows and columns
|
||||
///
|
||||
foreach (var wm in waterMeters)
|
||||
{
|
||||
string value = rowItem.Print(wm);
|
||||
if (!rowValues.Contains(value)) rowValues.Add(value);
|
||||
|
||||
if (twoDim)
|
||||
{
|
||||
value = columnItem.Print(wm);
|
||||
if (!columnValues.Contains(value)) columnValues.Add(value);
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
/// Calculate occurances
|
||||
///
|
||||
int columns = Math.Max(1, columnValues.Count);
|
||||
int[,] occurances = new int[rowValues.Count, columns];
|
||||
|
||||
foreach (var wm in waterMeters)
|
||||
{
|
||||
for (int row = 0; row < rowValues.Count; row++)
|
||||
{
|
||||
if (twoDim)
|
||||
{
|
||||
for (int column = 0; column < columns; column++)
|
||||
{
|
||||
if (rowItem.Print(wm).Equals(rowValues[row]) && columnItem.Print(wm).Equals(columnValues[column]))
|
||||
{
|
||||
occurances[row, column]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rowItem.Print(wm).Equals(rowValues[row])) occurances[row, 0]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
/// Update ListBox
|
||||
///
|
||||
statisticsListView.Columns.Add(new ColumnHeader { Text = "*", Width = 200 });
|
||||
statisticsListView.Columns.Add(new ColumnHeader { Text = "a", Width = 70 });
|
||||
statisticsListView.Columns.Add(new ColumnHeader { Text = "b", Width = 70 });
|
||||
|
||||
ListViewItem lvi = new ListViewItem("row1");
|
||||
lvi.SubItems.Add("c");
|
||||
lvi.SubItems.Add("d");
|
||||
statisticsListView.Items.Add(lvi);
|
||||
|
||||
lvi = new ListViewItem("row2");
|
||||
lvi.SubItems.Add("e");
|
||||
lvi.SubItems.Add("f");
|
||||
statisticsListView.Items.Add(lvi);
|
||||
|
||||
//statisticsListView.Columns.Add(new ColumnHeader { Text = "*", Width = 200 });
|
||||
//for (int column = 0; column < columns; column++)
|
||||
//{
|
||||
// statisticsListView.Columns.Add(new ColumnHeader { Text = twoDim ? columnValues[column] : "Count", Width = 70 });
|
||||
//}
|
||||
|
||||
//for (int row = 0; row < rowValues.Count; row++)
|
||||
//{
|
||||
// ListViewItem lvi = new ListViewItem(rowValues[row]);
|
||||
// for (int column = 0; column < columns; column++) lvi.SubItems.Add(occurances[row, column].ToString());
|
||||
// statisticsListView.Items.Add(lvi);
|
||||
//}
|
||||
|
||||
return true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
MessageBox.Show(exc.Message, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void okButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
+188
@@ -0,0 +1,188 @@
|
||||
namespace ResultsBrowser.Forms
|
||||
{
|
||||
partial class StatisticsOptionsDlg
|
||||
{
|
||||
/// <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.cancelButton = new System.Windows.Forms.Button();
|
||||
this.okButton = new System.Windows.Forms.Button();
|
||||
this.rowsGroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.rowTestSpecTextBox = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.rowsComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.columnsGroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.columnTestSpecTextBox = new System.Windows.Forms.TextBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.columnsComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.twoDimCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.rowsGroupBox.SuspendLayout();
|
||||
this.columnsGroupBox.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// cancelButton
|
||||
//
|
||||
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.cancelButton.Location = new System.Drawing.Point(368, 196);
|
||||
this.cancelButton.Name = "cancelButton";
|
||||
this.cancelButton.Size = new System.Drawing.Size(95, 38);
|
||||
this.cancelButton.TabIndex = 9;
|
||||
this.cancelButton.Text = "Cancel";
|
||||
this.cancelButton.UseVisualStyleBackColor = true;
|
||||
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
|
||||
//
|
||||
// okButton
|
||||
//
|
||||
this.okButton.Location = new System.Drawing.Point(257, 196);
|
||||
this.okButton.Name = "okButton";
|
||||
this.okButton.Size = new System.Drawing.Size(95, 38);
|
||||
this.okButton.TabIndex = 8;
|
||||
this.okButton.Text = "OK";
|
||||
this.okButton.UseVisualStyleBackColor = true;
|
||||
this.okButton.Click += new System.EventHandler(this.okButton_Click);
|
||||
//
|
||||
// rowsGroupBox
|
||||
//
|
||||
this.rowsGroupBox.Controls.Add(this.rowTestSpecTextBox);
|
||||
this.rowsGroupBox.Controls.Add(this.label1);
|
||||
this.rowsGroupBox.Controls.Add(this.rowsComboBox);
|
||||
this.rowsGroupBox.Location = new System.Drawing.Point(38, 50);
|
||||
this.rowsGroupBox.Name = "rowsGroupBox";
|
||||
this.rowsGroupBox.Size = new System.Drawing.Size(427, 56);
|
||||
this.rowsGroupBox.TabIndex = 10;
|
||||
this.rowsGroupBox.TabStop = false;
|
||||
this.rowsGroupBox.Text = "Rows";
|
||||
//
|
||||
// rowTestSpecTextBox
|
||||
//
|
||||
this.rowTestSpecTextBox.Location = new System.Drawing.Point(326, 22);
|
||||
this.rowTestSpecTextBox.Name = "rowTestSpecTextBox";
|
||||
this.rowTestSpecTextBox.Size = new System.Drawing.Size(61, 20);
|
||||
this.rowTestSpecTextBox.TabIndex = 2;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(242, 24);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(35, 13);
|
||||
this.label1.TabIndex = 1;
|
||||
this.label1.Text = "label1";
|
||||
//
|
||||
// rowsComboBox
|
||||
//
|
||||
this.rowsComboBox.FormattingEnabled = true;
|
||||
this.rowsComboBox.Location = new System.Drawing.Point(32, 21);
|
||||
this.rowsComboBox.Name = "rowsComboBox";
|
||||
this.rowsComboBox.Size = new System.Drawing.Size(185, 21);
|
||||
this.rowsComboBox.TabIndex = 0;
|
||||
//
|
||||
// columnsGroupBox
|
||||
//
|
||||
this.columnsGroupBox.Controls.Add(this.columnTestSpecTextBox);
|
||||
this.columnsGroupBox.Controls.Add(this.label2);
|
||||
this.columnsGroupBox.Controls.Add(this.columnsComboBox);
|
||||
this.columnsGroupBox.Location = new System.Drawing.Point(38, 112);
|
||||
this.columnsGroupBox.Name = "columnsGroupBox";
|
||||
this.columnsGroupBox.Size = new System.Drawing.Size(427, 56);
|
||||
this.columnsGroupBox.TabIndex = 11;
|
||||
this.columnsGroupBox.TabStop = false;
|
||||
this.columnsGroupBox.Text = "Columns";
|
||||
//
|
||||
// columnTestSpecTextBox
|
||||
//
|
||||
this.columnTestSpecTextBox.Location = new System.Drawing.Point(326, 21);
|
||||
this.columnTestSpecTextBox.Name = "columnTestSpecTextBox";
|
||||
this.columnTestSpecTextBox.Size = new System.Drawing.Size(61, 20);
|
||||
this.columnTestSpecTextBox.TabIndex = 3;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(242, 23);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(35, 13);
|
||||
this.label2.TabIndex = 2;
|
||||
this.label2.Text = "label2";
|
||||
//
|
||||
// columnsComboBox
|
||||
//
|
||||
this.columnsComboBox.FormattingEnabled = true;
|
||||
this.columnsComboBox.Location = new System.Drawing.Point(32, 20);
|
||||
this.columnsComboBox.Name = "columnsComboBox";
|
||||
this.columnsComboBox.Size = new System.Drawing.Size(185, 21);
|
||||
this.columnsComboBox.TabIndex = 1;
|
||||
//
|
||||
// twoDimCheckBox
|
||||
//
|
||||
this.twoDimCheckBox.AutoSize = true;
|
||||
this.twoDimCheckBox.Location = new System.Drawing.Point(39, 21);
|
||||
this.twoDimCheckBox.Name = "twoDimCheckBox";
|
||||
this.twoDimCheckBox.Size = new System.Drawing.Size(40, 17);
|
||||
this.twoDimCheckBox.TabIndex = 12;
|
||||
this.twoDimCheckBox.Text = "2D";
|
||||
this.twoDimCheckBox.UseVisualStyleBackColor = true;
|
||||
this.twoDimCheckBox.CheckedChanged += new System.EventHandler(this.twoDimCheckBox_CheckedChanged);
|
||||
//
|
||||
// StatisticsOptionsDlg
|
||||
//
|
||||
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(503, 262);
|
||||
this.Controls.Add(this.columnsGroupBox);
|
||||
this.Controls.Add(this.twoDimCheckBox);
|
||||
this.Controls.Add(this.rowsGroupBox);
|
||||
this.Controls.Add(this.cancelButton);
|
||||
this.Controls.Add(this.okButton);
|
||||
this.Name = "StatisticsOptionsDlg";
|
||||
this.Text = "StatisticsOptionsDlg";
|
||||
this.Load += new System.EventHandler(this.StatisticsOptionsDlg_Load);
|
||||
this.rowsGroupBox.ResumeLayout(false);
|
||||
this.rowsGroupBox.PerformLayout();
|
||||
this.columnsGroupBox.ResumeLayout(false);
|
||||
this.columnsGroupBox.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button cancelButton;
|
||||
private System.Windows.Forms.Button okButton;
|
||||
private System.Windows.Forms.GroupBox rowsGroupBox;
|
||||
private System.Windows.Forms.ComboBox rowsComboBox;
|
||||
private System.Windows.Forms.GroupBox columnsGroupBox;
|
||||
private System.Windows.Forms.ComboBox columnsComboBox;
|
||||
private System.Windows.Forms.CheckBox twoDimCheckBox;
|
||||
private System.Windows.Forms.TextBox rowTestSpecTextBox;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.TextBox columnTestSpecTextBox;
|
||||
private System.Windows.Forms.Label label2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using ResultsBrowser.Resources;
|
||||
|
||||
namespace ResultsBrowser.Forms
|
||||
{
|
||||
public partial class StatisticsOptionsDlg : Form
|
||||
{
|
||||
public bool TwoDim;
|
||||
public int RowItemID;
|
||||
public int ColumnItemID;
|
||||
public string RowTestSpecifier;
|
||||
public string ColumnTestSpecifier;
|
||||
|
||||
public StatisticsOptionsDlg()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void StatisticsOptionsDlg_Load(object sender, EventArgs e)
|
||||
{
|
||||
Localize();
|
||||
|
||||
twoDimCheckBox.Checked = TwoDim = Program.LocalSettings.TwoDim;
|
||||
RowItemID = Math.Max(1, Program.LocalSettings.RowItemID);
|
||||
ColumnItemID = Math.Max(1, Program.LocalSettings.ColumnItemID);
|
||||
rowTestSpecTextBox.Text = RowTestSpecifier = Program.LocalSettings.RowTestSpecifier;
|
||||
columnTestSpecTextBox.Text = ColumnTestSpecifier = Program.LocalSettings.ColumnTestSpecifier;
|
||||
|
||||
|
||||
rowsComboBox.Text = Results.WMeterRsltItemSpec.AllItems[RowItemID].Name; /// TODO: Use Caption
|
||||
columnsComboBox.Text = Results.WMeterRsltItemSpec.AllItems[ColumnItemID].Name; /// TODO: Use Caption
|
||||
///
|
||||
for (int i = 1; i < Results.WMeterRsltItemSpec.AllItems.Count; i++)
|
||||
{
|
||||
string item = Results.WMeterRsltItemSpec.AllItems[i].Name; /// TODO: Use Caption
|
||||
rowsComboBox.Items.Add(item);
|
||||
columnsComboBox.Items.Add(item);
|
||||
}
|
||||
|
||||
columnsComboBox.Enabled = TwoDim;
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
Text = Strings.Statistics;
|
||||
okButton.Text = Strings.OkBtnText;
|
||||
cancelButton.Text = Strings.CancelBtnText;
|
||||
rowsGroupBox.Text = Strings.Rows;
|
||||
columnsGroupBox.Text = Strings.Columns;
|
||||
label1.Text = Strings.Test;
|
||||
label2.Text = Strings.Test;
|
||||
}
|
||||
|
||||
private void twoDimCheckBox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
columnsComboBox.Enabled = twoDimCheckBox.Checked;
|
||||
}
|
||||
|
||||
private void okButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
TwoDim = twoDimCheckBox.Checked;
|
||||
RowTestSpecifier = rowTestSpecTextBox.Text;
|
||||
ColumnTestSpecifier = columnTestSpecTextBox.Text;
|
||||
|
||||
RowItemID = 0;
|
||||
|
||||
for (int i = 0; i < rowsComboBox.Items.Count; i++)
|
||||
{
|
||||
if (rowsComboBox.Text.Equals(rowsComboBox.Items[i]))
|
||||
{
|
||||
RowItemID = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (TwoDim)
|
||||
{
|
||||
ColumnItemID = 0;
|
||||
|
||||
for (int i = 0; i < columnsComboBox.Items.Count; i++)
|
||||
{
|
||||
if (columnsComboBox.Text.Equals(columnsComboBox.Items[i]))
|
||||
{
|
||||
ColumnItemID = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (RowItemID == 0 || ColumnItemID == 0)
|
||||
{
|
||||
MessageBox.Show(Strings.Error, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
|
||||
Program.LocalSettings.TwoDim = TwoDim;
|
||||
Program.LocalSettings.RowItemID = RowItemID;
|
||||
Program.LocalSettings.ColumnItemID = ColumnItemID;
|
||||
Program.LocalSettings.RowTestSpecifier = RowTestSpecifier;
|
||||
Program.LocalSettings.ColumnTestSpecifier = ColumnTestSpecifier;
|
||||
Program.LocalSettings.Save();
|
||||
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void cancelButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user