ReasultsBrowser : Histograms added, ver. 2.18.1146
This commit is contained in:
parent
bea3c04eb7
commit
86c063caee
76
ResultsBrowser/Forms/HistogramCtrl.Designer.cs
generated
Normal file
76
ResultsBrowser/Forms/HistogramCtrl.Designer.cs
generated
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
namespace ResultsBrowser.Forms
|
||||||
|
{
|
||||||
|
partial class HistogramCtrl
|
||||||
|
{
|
||||||
|
/// <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()
|
||||||
|
{
|
||||||
|
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
|
||||||
|
System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
|
||||||
|
System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
|
||||||
|
System.Windows.Forms.DataVisualization.Charting.Title title1 = new System.Windows.Forms.DataVisualization.Charting.Title();
|
||||||
|
this.myChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.myChart)).BeginInit();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// myChart
|
||||||
|
//
|
||||||
|
chartArea1.Name = "ChartArea1";
|
||||||
|
this.myChart.ChartAreas.Add(chartArea1);
|
||||||
|
this.myChart.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
legend1.Name = "Legend1";
|
||||||
|
this.myChart.Legends.Add(legend1);
|
||||||
|
this.myChart.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.myChart.Name = "myChart";
|
||||||
|
this.myChart.Palette = System.Windows.Forms.DataVisualization.Charting.ChartColorPalette.Bright;
|
||||||
|
series1.ChartArea = "ChartArea1";
|
||||||
|
series1.Legend = "Legend1";
|
||||||
|
series1.Name = "Series1";
|
||||||
|
this.myChart.Series.Add(series1);
|
||||||
|
this.myChart.Size = new System.Drawing.Size(400, 300);
|
||||||
|
this.myChart.TabIndex = 0;
|
||||||
|
this.myChart.Text = "chart1";
|
||||||
|
title1.Name = "Title1";
|
||||||
|
title1.Text = "Title1";
|
||||||
|
this.myChart.Titles.Add(title1);
|
||||||
|
//
|
||||||
|
// HistogramCtrl
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.Controls.Add(this.myChart);
|
||||||
|
this.Name = "HistogramCtrl";
|
||||||
|
this.Size = new System.Drawing.Size(400, 300);
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.myChart)).EndInit();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.DataVisualization.Charting.Chart myChart;
|
||||||
|
}
|
||||||
|
}
|
||||||
42
ResultsBrowser/Forms/HistogramCtrl.cs
Normal file
42
ResultsBrowser/Forms/HistogramCtrl.cs
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
///
|
||||||
|
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||||
|
///
|
||||||
|
using System;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using System.Windows.Forms.DataVisualization.Charting;
|
||||||
|
|
||||||
|
namespace ResultsBrowser.Forms
|
||||||
|
{
|
||||||
|
public partial class HistogramCtrl : UserControl
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Create user control that displays a bar chart iwth custom X-axis labels.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="title">Title of the chart displayed at the top</param>
|
||||||
|
/// <param name="values">Values = bar lengths</param>
|
||||||
|
/// <param name="labels">Labels for the X-axis</param>
|
||||||
|
public HistogramCtrl(string title, double[] values, string[] labels)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
if (myChart.Titles.Count > 0) myChart.Titles[0].Text = title;
|
||||||
|
|
||||||
|
if ((myChart.Series.Count > 0) && (values != null))
|
||||||
|
{
|
||||||
|
int startOffset = -1;
|
||||||
|
int endOffset = 1;
|
||||||
|
for (int i = 0; i < Math.Min(values.Length + 1, labels.Length); i++)
|
||||||
|
{
|
||||||
|
if (i < values.Length) myChart.Series[0].Points.Add(values[i]);
|
||||||
|
if (!string.IsNullOrEmpty(labels[i]))
|
||||||
|
{
|
||||||
|
myChart.ChartAreas[0].AxisX.CustomLabels.Add(new System.Windows.Forms.DataVisualization.Charting.CustomLabel(startOffset, endOffset, labels[i], 0, LabelMarkStyle.None));
|
||||||
|
}
|
||||||
|
startOffset = startOffset + 1;
|
||||||
|
endOffset = endOffset + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
120
ResultsBrowser/Forms/HistogramCtrl.resx
Normal file
120
ResultsBrowser/Forms/HistogramCtrl.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
150
ResultsBrowser/Forms/HistogramDlg.Designer.cs
generated
Normal file
150
ResultsBrowser/Forms/HistogramDlg.Designer.cs
generated
Normal file
@ -0,0 +1,150 @@
|
|||||||
|
namespace ResultsBrowser.Forms
|
||||||
|
{
|
||||||
|
partial class HistogramDlg
|
||||||
|
{
|
||||||
|
/// <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.splitContainer2 = new System.Windows.Forms.SplitContainer();
|
||||||
|
this.exportButton = new System.Windows.Forms.Button();
|
||||||
|
this.printButton = new System.Windows.Forms.Button();
|
||||||
|
this.closeButton = new System.Windows.Forms.Button();
|
||||||
|
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||||
|
((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.flowLayoutPanel1);
|
||||||
|
//
|
||||||
|
// 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;
|
||||||
|
//
|
||||||
|
// 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.exportButton);
|
||||||
|
this.splitContainer2.Panel2.Controls.Add(this.printButton);
|
||||||
|
this.splitContainer2.Panel2.Controls.Add(this.closeButton);
|
||||||
|
this.splitContainer2.Size = new System.Drawing.Size(572, 85);
|
||||||
|
this.splitContainer2.SplitterDistance = 249;
|
||||||
|
this.splitContainer2.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// exportButton
|
||||||
|
//
|
||||||
|
this.exportButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.exportButton.Location = new System.Drawing.Point(103, 21);
|
||||||
|
this.exportButton.Name = "exportButton";
|
||||||
|
this.exportButton.Size = new System.Drawing.Size(94, 41);
|
||||||
|
this.exportButton.TabIndex = 1;
|
||||||
|
this.exportButton.Text = "Export";
|
||||||
|
this.exportButton.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// printButton
|
||||||
|
//
|
||||||
|
this.printButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.printButton.Location = new System.Drawing.Point(4, 21);
|
||||||
|
this.printButton.Name = "printButton";
|
||||||
|
this.printButton.Size = new System.Drawing.Size(94, 41);
|
||||||
|
this.printButton.TabIndex = 0;
|
||||||
|
this.printButton.Text = "Print";
|
||||||
|
this.printButton.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// closeButton
|
||||||
|
//
|
||||||
|
this.closeButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.closeButton.Location = new System.Drawing.Point(203, 21);
|
||||||
|
this.closeButton.Name = "closeButton";
|
||||||
|
this.closeButton.Size = new System.Drawing.Size(94, 41);
|
||||||
|
this.closeButton.TabIndex = 2;
|
||||||
|
this.closeButton.Text = "Close";
|
||||||
|
this.closeButton.UseVisualStyleBackColor = true;
|
||||||
|
this.closeButton.Click += new System.EventHandler(this.closeButton_Click);
|
||||||
|
//
|
||||||
|
// flowLayoutPanel1
|
||||||
|
//
|
||||||
|
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||||
|
this.flowLayoutPanel1.Size = new System.Drawing.Size(572, 320);
|
||||||
|
this.flowLayoutPanel1.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// HistogramDlg
|
||||||
|
//
|
||||||
|
this.AcceptButton = this.closeButton;
|
||||||
|
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 = "HistogramDlg";
|
||||||
|
this.Text = "HistogramDlg";
|
||||||
|
this.Load += new System.EventHandler(this.HistogramDlg_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.SplitContainer splitContainer2;
|
||||||
|
private System.Windows.Forms.Button closeButton;
|
||||||
|
private System.Windows.Forms.Button printButton;
|
||||||
|
private System.Windows.Forms.Button exportButton;
|
||||||
|
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
|
||||||
|
}
|
||||||
|
}
|
||||||
152
ResultsBrowser/Forms/HistogramDlg.cs
Normal file
152
ResultsBrowser/Forms/HistogramDlg.cs
Normal file
@ -0,0 +1,152 @@
|
|||||||
|
///
|
||||||
|
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||||
|
///
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.IO;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using System.Windows.Forms.DataVisualization.Charting;
|
||||||
|
using Results.Entities;
|
||||||
|
using ResultsBrowser.Resources;
|
||||||
|
using ResultsBrowser.Output.Printers.Statistics;
|
||||||
|
|
||||||
|
namespace ResultsBrowser.Forms
|
||||||
|
{
|
||||||
|
public partial class HistogramDlg : Form
|
||||||
|
{
|
||||||
|
const int NrBins = 11;
|
||||||
|
|
||||||
|
IList<WaterMeter> waterMeters;
|
||||||
|
HistogramOptionsDlg options;
|
||||||
|
|
||||||
|
public HistogramDlg(IList<WaterMeter> waterMeters, HistogramOptionsDlg options, string title)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
this.waterMeters = waterMeters;
|
||||||
|
this.options = options;
|
||||||
|
Text = title;
|
||||||
|
|
||||||
|
closeButton.Text = Strings.OkBtnText;
|
||||||
|
printButton.Text = Strings.Print;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void HistogramDlg_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
CalculateAndDraw();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CalculateAndDraw()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < options.SelectedItems.Count; i++)
|
||||||
|
{
|
||||||
|
Results.WMeterRsltItemSpec item = options.SelectedItems[i];
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
/// Find minimum and maximum
|
||||||
|
double min = Double.MaxValue;
|
||||||
|
double max = Double.MinValue;
|
||||||
|
double sum = 0;
|
||||||
|
int count = 0;
|
||||||
|
foreach (var wm in waterMeters)
|
||||||
|
{
|
||||||
|
string strValue = item.Print(wm);
|
||||||
|
double value;
|
||||||
|
if (!double.TryParse(strValue, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.CurrentCulture, out value) &&
|
||||||
|
!double.TryParse(strValue, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture, out value))
|
||||||
|
{
|
||||||
|
throw new Exception(string.Format("{0} is not a number, cannot calculate histogram", item.Caption));
|
||||||
|
}
|
||||||
|
|
||||||
|
sum += value;
|
||||||
|
count++;
|
||||||
|
if (min > value) min = value;
|
||||||
|
if (max < value) max = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
double mean = (count != 0) ? (sum / count) : 0; /// Prevent division by zero
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Determine limits for bins
|
||||||
|
///
|
||||||
|
double[] binHiLim;
|
||||||
|
string[] labels;
|
||||||
|
if ((-0.55 <= min) && (max <= 0.55))
|
||||||
|
{
|
||||||
|
labels = new string[] { "-0.6", "", "-0.4", "", "-0.2", "", "0", "", "0.2", "", "0.4", "", "0.6" };
|
||||||
|
binHiLim = new double[] { -0.45, -0.35, -0.25, -0.15, -0.05, 0.05, 0.15, 0.25, 0.35, 0.45, 0.55 };
|
||||||
|
}
|
||||||
|
else if ((-1.1 <= min) && (max <= 1.1))
|
||||||
|
{
|
||||||
|
labels = new string[] { "-1.2", "", "-0.8", "", "-0.4", "", "0", "", "0.4", "", "0.8", "", "1.2" };
|
||||||
|
binHiLim = new double[] { -0.9, -0.7, -0.5, -0.3, -0.1, 0.1, 0.3, 0.5, 0.7, 0.9, 1.1 };
|
||||||
|
}
|
||||||
|
else if ((-2.2 <= min) && (max <= 2.2))
|
||||||
|
{
|
||||||
|
labels = new string[] { "-2.4", "", "-1.6", "", "-0.8", "", "0", "", "0.8", "", "1.6", "", "2.4" };
|
||||||
|
binHiLim = new double[] { -1.8, -1.4, -1.0, -0.6, -0.2, 0.2, 0.6, 1.0, 1.4, 1.8, 2.2 };
|
||||||
|
}
|
||||||
|
else if ((-4.4 <= min) && (max <= 4.4))
|
||||||
|
{
|
||||||
|
labels = new string[] { "-4.8", "", "-3.2", "", "-1.6", "", "0", "", "1.6", "", "3.2", "", "4.8" };
|
||||||
|
binHiLim = new double[] { -3.6, -2.8, -2.0, -1.2, -0.4, 0.4, 1.2, 2.0, 2.8, 3.6, 4.4 };
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
labels = new string[] { "-9.6", "", "-6.4", "", "-3.2", "", "0", "", "3.2", "", "6.4", "", "9.6" };
|
||||||
|
binHiLim = new double[] { -7.2, -5.6, -4.0, -2.4, -0.8, 0.8, 2.4, 4.0, 5.6, 7.2, 8.8 };
|
||||||
|
}
|
||||||
|
|
||||||
|
int nrBins = Math.Min(labels.Length - 1, binHiLim.Length + 1);
|
||||||
|
|
||||||
|
double[] bins = new double[nrBins];
|
||||||
|
for (int j = 0; j < nrBins; j++) bins[j] = 0;
|
||||||
|
|
||||||
|
/// Calculate bins
|
||||||
|
foreach (var wm in waterMeters)
|
||||||
|
{
|
||||||
|
string strValue = item.Print(wm);
|
||||||
|
double value;
|
||||||
|
if (!double.TryParse(strValue, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.CurrentCulture, out value) &&
|
||||||
|
!double.TryParse(strValue, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture, out value))
|
||||||
|
{
|
||||||
|
throw new Exception(string.Format("{0} is not a number, cannot calculate histogram", item.Caption));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int j = 0; j < nrBins - 1; j++)
|
||||||
|
{
|
||||||
|
if (value < binHiLim[j])
|
||||||
|
{
|
||||||
|
bins[j] += 1.0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (value >= binHiLim[nrBins - 2])
|
||||||
|
{
|
||||||
|
bins[nrBins - 1] += 1.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Draw
|
||||||
|
///
|
||||||
|
HistogramCtrl histo = new HistogramCtrl(string.Format("{0} mean = {1}", item.Caption, mean.ToString("F3")), bins, labels);
|
||||||
|
flowLayoutPanel1.Controls.Add(histo);
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
string msg = exc.Message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void closeButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
DialogResult = DialogResult.OK;
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
120
ResultsBrowser/Forms/HistogramDlg.resx
Normal file
120
ResultsBrowser/Forms/HistogramDlg.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
91
ResultsBrowser/Forms/HistogramOptionsDlg.Designer.cs
generated
Normal file
91
ResultsBrowser/Forms/HistogramOptionsDlg.Designer.cs
generated
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
namespace ResultsBrowser.Forms
|
||||||
|
{
|
||||||
|
partial class HistogramOptionsDlg
|
||||||
|
{
|
||||||
|
/// <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.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// cancelButton
|
||||||
|
//
|
||||||
|
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||||
|
this.cancelButton.Location = new System.Drawing.Point(380, 302);
|
||||||
|
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.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.okButton.Location = new System.Drawing.Point(269, 302);
|
||||||
|
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);
|
||||||
|
//
|
||||||
|
// flowLayoutPanel1
|
||||||
|
//
|
||||||
|
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
|
||||||
|
this.flowLayoutPanel1.Location = new System.Drawing.Point(12, 12);
|
||||||
|
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||||
|
this.flowLayoutPanel1.Size = new System.Drawing.Size(479, 271);
|
||||||
|
this.flowLayoutPanel1.TabIndex = 10;
|
||||||
|
//
|
||||||
|
// HistogramOptionsDlg
|
||||||
|
//
|
||||||
|
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, 355);
|
||||||
|
this.Controls.Add(this.flowLayoutPanel1);
|
||||||
|
this.Controls.Add(this.cancelButton);
|
||||||
|
this.Controls.Add(this.okButton);
|
||||||
|
this.Name = "HistogramOptionsDlg";
|
||||||
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||||
|
this.Text = "HistogramOptionsDlg";
|
||||||
|
this.Load += new System.EventHandler(this.HistogramOptionsDlg_Load);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.Button cancelButton;
|
||||||
|
private System.Windows.Forms.Button okButton;
|
||||||
|
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
|
||||||
|
}
|
||||||
|
}
|
||||||
67
ResultsBrowser/Forms/HistogramOptionsDlg.cs
Normal file
67
ResultsBrowser/Forms/HistogramOptionsDlg.cs
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
///
|
||||||
|
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||||
|
///
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using ResultsBrowser.Resources;
|
||||||
|
|
||||||
|
namespace ResultsBrowser.Forms
|
||||||
|
{
|
||||||
|
public partial class HistogramOptionsDlg : Form
|
||||||
|
{
|
||||||
|
IList<Results.WMeterRsltItemSpec> items;
|
||||||
|
public IList<Results.WMeterRsltItemSpec> SelectedItems;
|
||||||
|
|
||||||
|
IList<CheckBox> checkBoxes;
|
||||||
|
|
||||||
|
public HistogramOptionsDlg(IList<Results.WMeterRsltItemSpec> items)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
this.items = items;
|
||||||
|
|
||||||
|
checkBoxes = new List<CheckBox>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void HistogramOptionsDlg_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Localize();
|
||||||
|
|
||||||
|
foreach (var item in items)
|
||||||
|
{
|
||||||
|
CheckBox cb = new CheckBox();
|
||||||
|
cb.Text = item.Caption;
|
||||||
|
cb.Checked = false;
|
||||||
|
flowLayoutPanel1.Controls.Add(cb);
|
||||||
|
checkBoxes.Add(cb);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Localize()
|
||||||
|
{
|
||||||
|
Text = Strings.Statistics;
|
||||||
|
okButton.Text = Strings.OkBtnText;
|
||||||
|
cancelButton.Text = Strings.CancelBtnText;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void okButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
SelectedItems = new List<Results.WMeterRsltItemSpec>();
|
||||||
|
for (int i = 0; i < items.Count; i++)
|
||||||
|
{
|
||||||
|
if (checkBoxes[i].Checked) SelectedItems.Add(items[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Program.LocalSettings.RowItemCaption = RowItem.Caption;
|
||||||
|
// ...
|
||||||
|
//Program.LocalSettings.Save();
|
||||||
|
|
||||||
|
DialogResult = DialogResult.OK;
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cancelButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
120
ResultsBrowser/Forms/HistogramOptionsDlg.resx
Normal file
120
ResultsBrowser/Forms/HistogramOptionsDlg.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
@ -1,4 +1,7 @@
|
|||||||
using System;
|
///
|
||||||
|
/// Copyright (c) 2016-2019 Sensus Slovensko a.s.
|
||||||
|
///
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Results.Entities;
|
using Results.Entities;
|
||||||
@ -11,22 +14,7 @@ namespace ResultsBrowser.Forms
|
|||||||
public partial class StatisticsDlg : Form
|
public partial class StatisticsDlg : Form
|
||||||
{
|
{
|
||||||
IList<WaterMeter> waterMeters;
|
IList<WaterMeter> waterMeters;
|
||||||
|
StatisticsOptionsDlg options;
|
||||||
bool twoDim;
|
|
||||||
|
|
||||||
Results.WMeterRsltItemSpec rowItem;
|
|
||||||
Results.WMeterRsltItemSpec rowItem2;
|
|
||||||
Results.WMeterRsltItemSpec rowItem3;
|
|
||||||
Results.WMeterRsltItemSpec columnItem;
|
|
||||||
Results.WMeterRsltItemSpec columnItem2;
|
|
||||||
Results.WMeterRsltItemSpec columnItem3;
|
|
||||||
|
|
||||||
string rowTestSpec;
|
|
||||||
string rowTestSpec2;
|
|
||||||
string rowTestSpec3;
|
|
||||||
string columnTestSpec;
|
|
||||||
string columnTestSpec2;
|
|
||||||
string columnTestSpec3;
|
|
||||||
|
|
||||||
IList<string> rowValues;
|
IList<string> rowValues;
|
||||||
IList<string> columnValues;
|
IList<string> columnValues;
|
||||||
@ -36,23 +24,14 @@ namespace ResultsBrowser.Forms
|
|||||||
string title;
|
string title;
|
||||||
|
|
||||||
|
|
||||||
public StatisticsDlg(IList<WaterMeter> waterMeters, bool twoDim,
|
public StatisticsDlg(IList<WaterMeter> waterMeters, StatisticsOptionsDlg options,
|
||||||
Results.WMeterRsltItemSpec rowItem,
|
|
||||||
Results.WMeterRsltItemSpec rowItem2,
|
|
||||||
Results.WMeterRsltItemSpec rowItem3,
|
|
||||||
Results.WMeterRsltItemSpec columnItem,
|
|
||||||
Results.WMeterRsltItemSpec columnItem2,
|
|
||||||
Results.WMeterRsltItemSpec columnItem3,
|
|
||||||
string rowTestSpec,
|
|
||||||
string rowTestSpec2,
|
|
||||||
string rowTestSpec3,
|
|
||||||
string columnTestSpec,
|
|
||||||
string columnTestSpec2,
|
|
||||||
string columnTestSpec3,
|
|
||||||
DateTime startDate, DateTime endDate)
|
DateTime startDate, DateTime endDate)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
this.waterMeters = waterMeters;
|
||||||
|
this.options = options;
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(Program.LocalSettings.TimePeriodFormat) && (startDate != new DateTime(0)) && (endDate != new DateTime(0)))
|
if (!string.IsNullOrEmpty(Program.LocalSettings.TimePeriodFormat) && (startDate != new DateTime(0)) && (endDate != new DateTime(0)))
|
||||||
{
|
{
|
||||||
title = string.Format(Program.LocalSettings.TimePeriodFormat, startDate, endDate);
|
title = string.Format(Program.LocalSettings.TimePeriodFormat, startDate, endDate);
|
||||||
@ -66,26 +45,6 @@ namespace ResultsBrowser.Forms
|
|||||||
|
|
||||||
closeButton.Text = Strings.OkBtnText;
|
closeButton.Text = Strings.OkBtnText;
|
||||||
printButton.Text = Strings.Print;
|
printButton.Text = Strings.Print;
|
||||||
|
|
||||||
this.waterMeters = waterMeters;
|
|
||||||
|
|
||||||
this.twoDim = twoDim;
|
|
||||||
|
|
||||||
this.rowItem = rowItem;
|
|
||||||
this.rowItem2 = rowItem2;
|
|
||||||
this.rowItem3 = rowItem3;
|
|
||||||
|
|
||||||
this.columnItem = columnItem;
|
|
||||||
this.columnItem2 = columnItem2;
|
|
||||||
this.columnItem3 = columnItem3;
|
|
||||||
|
|
||||||
this.rowTestSpec = rowTestSpec;
|
|
||||||
this.rowTestSpec2 = rowTestSpec2;
|
|
||||||
this.rowTestSpec3 = rowTestSpec3;
|
|
||||||
|
|
||||||
this.columnTestSpec = columnTestSpec;
|
|
||||||
this.columnTestSpec2 = columnTestSpec2;
|
|
||||||
this.columnTestSpec3 = columnTestSpec3;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void StatisticsDlg_Load(object sender, EventArgs e)
|
private void StatisticsDlg_Load(object sender, EventArgs e)
|
||||||
@ -105,16 +64,16 @@ namespace ResultsBrowser.Forms
|
|||||||
///
|
///
|
||||||
foreach (var wm in waterMeters)
|
foreach (var wm in waterMeters)
|
||||||
{
|
{
|
||||||
string value = rowItem.Print(wm);
|
string value = options.RowItem.Print(wm);
|
||||||
if (rowItem2 != null) value = value + " | " + rowItem2.Print(wm);
|
if (options.RowItem2 != null) value = value + " | " + options.RowItem2.Print(wm);
|
||||||
if (rowItem3 != null) value = value + " | " + rowItem3.Print(wm);
|
if (options.RowItem3 != null) value = value + " | " + options.RowItem3.Print(wm);
|
||||||
if (!rowValues.Contains(value)) rowValues.Add(value);
|
if (!rowValues.Contains(value)) rowValues.Add(value);
|
||||||
|
|
||||||
if (twoDim)
|
if (options.TwoDim)
|
||||||
{
|
{
|
||||||
value = columnItem.Print(wm);
|
value = options.ColumnItem.Print(wm);
|
||||||
if (columnItem2 != null) value = value + " | " + columnItem2.Print(wm);
|
if (options.ColumnItem2 != null) value = value + " | " + options.ColumnItem2.Print(wm);
|
||||||
if (columnItem3 != null) value = value + " | " + columnItem3.Print(wm);
|
if (options.ColumnItem3 != null) value = value + " | " + options.ColumnItem3.Print(wm);
|
||||||
if (!columnValues.Contains(value)) columnValues.Add(value);
|
if (!columnValues.Contains(value)) columnValues.Add(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -129,17 +88,17 @@ namespace ResultsBrowser.Forms
|
|||||||
{
|
{
|
||||||
for (int row = 0; row < rowValues.Count; row++)
|
for (int row = 0; row < rowValues.Count; row++)
|
||||||
{
|
{
|
||||||
string rowValue = rowItem.Print(wm);
|
string rowValue = options.RowItem.Print(wm);
|
||||||
if (rowItem2 != null) rowValue = rowValue + " | " + rowItem2.Print(wm);
|
if (options.RowItem2 != null) rowValue = rowValue + " | " + options.RowItem2.Print(wm);
|
||||||
if (rowItem3 != null) rowValue = rowValue + " | " + rowItem3.Print(wm);
|
if (options.RowItem3 != null) rowValue = rowValue + " | " + options.RowItem3.Print(wm);
|
||||||
|
|
||||||
if (twoDim)
|
if (options.TwoDim)
|
||||||
{
|
{
|
||||||
for (int column = 0; column < columnsCount; column++)
|
for (int column = 0; column < columnsCount; column++)
|
||||||
{
|
{
|
||||||
string columnValue = columnItem.Print(wm);
|
string columnValue = options.ColumnItem.Print(wm);
|
||||||
if (columnItem2 != null) columnValue = columnValue + " | " + columnItem2.Print(wm);
|
if (options.ColumnItem2 != null) columnValue = columnValue + " | " + options.ColumnItem2.Print(wm);
|
||||||
if (columnItem3 != null) columnValue = columnValue + " | " + columnItem3.Print(wm);
|
if (options.ColumnItem3 != null) columnValue = columnValue + " | " + options.ColumnItem3.Print(wm);
|
||||||
|
|
||||||
if (rowValue == rowValues[row] && columnValue == columnValues[column])
|
if (rowValue == rowValues[row] && columnValue == columnValues[column])
|
||||||
{
|
{
|
||||||
@ -164,7 +123,7 @@ namespace ResultsBrowser.Forms
|
|||||||
statisticsListView.Columns.Add(" ", 200);
|
statisticsListView.Columns.Add(" ", 200);
|
||||||
for (int column = 0; column < columnsCount; column++)
|
for (int column = 0; column < columnsCount; column++)
|
||||||
{
|
{
|
||||||
statisticsListView.Columns.Add((twoDim ? columnValues[column] : Strings.Count), 70);
|
statisticsListView.Columns.Add((options.TwoDim ? columnValues[column] : Strings.Count), 70);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int row = 0; row < rowValues.Count; row++)
|
for (int row = 0; row < rowValues.Count; row++)
|
||||||
@ -197,7 +156,7 @@ namespace ResultsBrowser.Forms
|
|||||||
table[0, 0] = string.Empty;
|
table[0, 0] = string.Empty;
|
||||||
for (int column = 0; column < columnsCount; column++)
|
for (int column = 0; column < columnsCount; column++)
|
||||||
{
|
{
|
||||||
table[0, column + 1] = (twoDim ? columnValues[column] : Strings.Count);
|
table[0, column + 1] = (options.TwoDim ? columnValues[column] : Strings.Count);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int row = 0; row < rowValues.Count; row++)
|
for (int row = 0; row < rowValues.Count; row++)
|
||||||
@ -234,7 +193,7 @@ namespace ResultsBrowser.Forms
|
|||||||
{
|
{
|
||||||
using (TextWriter writer = new StreamWriter(dlg.FileName, false, System.Text.Encoding.UTF8))
|
using (TextWriter writer = new StreamWriter(dlg.FileName, false, System.Text.Encoding.UTF8))
|
||||||
{
|
{
|
||||||
if (twoDim)
|
if (options.TwoDim)
|
||||||
{
|
{
|
||||||
/// Write column headers
|
/// Write column headers
|
||||||
for (int i = 0; i < columnValues.Count; i++)
|
for (int i = 0; i < columnValues.Count; i++)
|
||||||
@ -245,7 +204,7 @@ namespace ResultsBrowser.Forms
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
writer.WriteLine(string.Format("\"{0}\";\"{1}\"", rowItem.Caption, Strings.Count));
|
writer.WriteLine(string.Format("\"{0}\";\"{1}\"", options.RowItem.Caption, Strings.Count));
|
||||||
}
|
}
|
||||||
|
|
||||||
int nrColumns = Math.Max(1, columnValues.Count);
|
int nrColumns = Math.Max(1, columnValues.Count);
|
||||||
|
|||||||
@ -1,4 +1,7 @@
|
|||||||
using System;
|
///
|
||||||
|
/// Copyright (c) 2016-2019 Sensus Slovensko a.s.
|
||||||
|
///
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using ResultsBrowser.Resources;
|
using ResultsBrowser.Resources;
|
||||||
|
|||||||
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("2.18.1140.0")]
|
[assembly: AssemblyVersion("2.18.1146.0")]
|
||||||
[assembly: AssemblyFileVersion("2.18.1140.0")]
|
[assembly: AssemblyFileVersion("2.18.1146.0")]
|
||||||
|
|||||||
@ -240,4 +240,7 @@
|
|||||||
<data name="Add_data_from_Oracle" xml:space="preserve">
|
<data name="Add_data_from_Oracle" xml:space="preserve">
|
||||||
<value>Dohledej údaje z Oracle</value>
|
<value>Dohledej údaje z Oracle</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Histograms" xml:space="preserve">
|
||||||
|
<value>Histogramy</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@ -828,4 +828,7 @@
|
|||||||
<data name="Add_data_from_Oracle" xml:space="preserve">
|
<data name="Add_data_from_Oracle" xml:space="preserve">
|
||||||
<value>Add data from Oracle</value>
|
<value>Add data from Oracle</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Histograms" xml:space="preserve">
|
||||||
|
<value>Histograms</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
9
ResultsBrowser/Resources/Strings1.Designer.cs
generated
9
ResultsBrowser/Resources/Strings1.Designer.cs
generated
@ -1257,6 +1257,15 @@ namespace ResultsBrowser.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Histograms.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Histograms {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Histograms", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Horizontally.
|
/// Looks up a localized string similar to Horizontally.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -60,6 +60,7 @@
|
|||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Windows.Forms.DataVisualization" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
@ -133,6 +134,24 @@
|
|||||||
<Compile Include="Forms\DatabaseSettingsDlg.Designer.cs">
|
<Compile Include="Forms\DatabaseSettingsDlg.Designer.cs">
|
||||||
<DependentUpon>DatabaseSettingsDlg.cs</DependentUpon>
|
<DependentUpon>DatabaseSettingsDlg.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Forms\HistogramCtrl.cs">
|
||||||
|
<SubType>UserControl</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Forms\HistogramCtrl.Designer.cs">
|
||||||
|
<DependentUpon>HistogramCtrl.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Forms\HistogramDlg.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Forms\HistogramDlg.Designer.cs">
|
||||||
|
<DependentUpon>HistogramDlg.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Forms\HistogramOptionsDlg.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Forms\HistogramOptionsDlg.Designer.cs">
|
||||||
|
<DependentUpon>HistogramOptionsDlg.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Forms\NoBenchOrDatabaseDlg.cs">
|
<Compile Include="Forms\NoBenchOrDatabaseDlg.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@ -202,6 +221,15 @@
|
|||||||
<EmbeddedResource Include="Forms\DatabaseSettingsDlg.resx">
|
<EmbeddedResource Include="Forms\DatabaseSettingsDlg.resx">
|
||||||
<DependentUpon>DatabaseSettingsDlg.cs</DependentUpon>
|
<DependentUpon>DatabaseSettingsDlg.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Forms\HistogramCtrl.resx">
|
||||||
|
<DependentUpon>HistogramCtrl.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Forms\HistogramDlg.resx">
|
||||||
|
<DependentUpon>HistogramDlg.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Forms\HistogramOptionsDlg.resx">
|
||||||
|
<DependentUpon>HistogramOptionsDlg.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Forms\NoBenchOrDatabaseDlg.resx">
|
<EmbeddedResource Include="Forms\NoBenchOrDatabaseDlg.resx">
|
||||||
<DependentUpon>NoBenchOrDatabaseDlg.cs</DependentUpon>
|
<DependentUpon>NoBenchOrDatabaseDlg.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
|||||||
111
ResultsBrowser/ResultsBrowserWnd.Designer.cs
generated
111
ResultsBrowser/ResultsBrowserWnd.Designer.cs
generated
@ -34,10 +34,13 @@
|
|||||||
this.filtersFlowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();
|
this.filtersFlowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();
|
||||||
this.resultsGroupBox = new System.Windows.Forms.GroupBox();
|
this.resultsGroupBox = new System.Windows.Forms.GroupBox();
|
||||||
this.resultsListView = new System.Windows.Forms.ListView();
|
this.resultsListView = new System.Windows.Forms.ListView();
|
||||||
this.printerConfigBtn = new System.Windows.Forms.Button();
|
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.histogramBtn = new System.Windows.Forms.Button();
|
||||||
this.statisticsBtn = new System.Windows.Forms.Button();
|
this.statisticsBtn = new System.Windows.Forms.Button();
|
||||||
this.printQueryResultsBtn = new System.Windows.Forms.Button();
|
this.outputGroupBox = new System.Windows.Forms.GroupBox();
|
||||||
this.exportQueryResultsBtn = new System.Windows.Forms.Button();
|
this.exportQueryResultsBtn = new System.Windows.Forms.Button();
|
||||||
|
this.printQueryResultsBtn = new System.Windows.Forms.Button();
|
||||||
|
this.printerConfigBtn = new System.Windows.Forms.Button();
|
||||||
this.formatOfResultsBtn = new System.Windows.Forms.Button();
|
this.formatOfResultsBtn = new System.Windows.Forms.Button();
|
||||||
this.clearFiltersBtn = new System.Windows.Forms.Button();
|
this.clearFiltersBtn = new System.Windows.Forms.Button();
|
||||||
this.settingsBtn = new System.Windows.Forms.Button();
|
this.settingsBtn = new System.Windows.Forms.Button();
|
||||||
@ -62,6 +65,8 @@
|
|||||||
this.hSplitContainer.SuspendLayout();
|
this.hSplitContainer.SuspendLayout();
|
||||||
this.filtersGroupBox.SuspendLayout();
|
this.filtersGroupBox.SuspendLayout();
|
||||||
this.resultsGroupBox.SuspendLayout();
|
this.resultsGroupBox.SuspendLayout();
|
||||||
|
this.groupBox1.SuspendLayout();
|
||||||
|
this.outputGroupBox.SuspendLayout();
|
||||||
this.testBenchesGroupBox.SuspendLayout();
|
this.testBenchesGroupBox.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
@ -79,10 +84,9 @@
|
|||||||
//
|
//
|
||||||
// vSplitContainer.Panel2
|
// vSplitContainer.Panel2
|
||||||
//
|
//
|
||||||
|
this.vSplitContainer.Panel2.Controls.Add(this.groupBox1);
|
||||||
|
this.vSplitContainer.Panel2.Controls.Add(this.outputGroupBox);
|
||||||
this.vSplitContainer.Panel2.Controls.Add(this.printerConfigBtn);
|
this.vSplitContainer.Panel2.Controls.Add(this.printerConfigBtn);
|
||||||
this.vSplitContainer.Panel2.Controls.Add(this.statisticsBtn);
|
|
||||||
this.vSplitContainer.Panel2.Controls.Add(this.printQueryResultsBtn);
|
|
||||||
this.vSplitContainer.Panel2.Controls.Add(this.exportQueryResultsBtn);
|
|
||||||
this.vSplitContainer.Panel2.Controls.Add(this.formatOfResultsBtn);
|
this.vSplitContainer.Panel2.Controls.Add(this.formatOfResultsBtn);
|
||||||
this.vSplitContainer.Panel2.Controls.Add(this.clearFiltersBtn);
|
this.vSplitContainer.Panel2.Controls.Add(this.clearFiltersBtn);
|
||||||
this.vSplitContainer.Panel2.Controls.Add(this.settingsBtn);
|
this.vSplitContainer.Panel2.Controls.Add(this.settingsBtn);
|
||||||
@ -154,6 +158,68 @@
|
|||||||
this.resultsListView.UseCompatibleStateImageBehavior = false;
|
this.resultsListView.UseCompatibleStateImageBehavior = false;
|
||||||
this.resultsListView.View = System.Windows.Forms.View.Details;
|
this.resultsListView.View = System.Windows.Forms.View.Details;
|
||||||
//
|
//
|
||||||
|
// groupBox1
|
||||||
|
//
|
||||||
|
this.groupBox1.Controls.Add(this.histogramBtn);
|
||||||
|
this.groupBox1.Controls.Add(this.statisticsBtn);
|
||||||
|
this.groupBox1.Location = new System.Drawing.Point(8, 608);
|
||||||
|
this.groupBox1.Name = "groupBox1";
|
||||||
|
this.groupBox1.Size = new System.Drawing.Size(125, 93);
|
||||||
|
this.groupBox1.TabIndex = 13;
|
||||||
|
this.groupBox1.TabStop = false;
|
||||||
|
this.groupBox1.Text = "Analysis";
|
||||||
|
//
|
||||||
|
// histogramBtn
|
||||||
|
//
|
||||||
|
this.histogramBtn.Location = new System.Drawing.Point(5, 55);
|
||||||
|
this.histogramBtn.Name = "histogramBtn";
|
||||||
|
this.histogramBtn.Size = new System.Drawing.Size(114, 32);
|
||||||
|
this.histogramBtn.TabIndex = 11;
|
||||||
|
this.histogramBtn.Text = "Histograms";
|
||||||
|
this.histogramBtn.UseVisualStyleBackColor = true;
|
||||||
|
this.histogramBtn.Click += new System.EventHandler(this.histogramBtn_Click);
|
||||||
|
//
|
||||||
|
// statisticsBtn
|
||||||
|
//
|
||||||
|
this.statisticsBtn.Location = new System.Drawing.Point(5, 18);
|
||||||
|
this.statisticsBtn.Name = "statisticsBtn";
|
||||||
|
this.statisticsBtn.Size = new System.Drawing.Size(114, 32);
|
||||||
|
this.statisticsBtn.TabIndex = 10;
|
||||||
|
this.statisticsBtn.Text = "Statistics";
|
||||||
|
this.statisticsBtn.UseVisualStyleBackColor = true;
|
||||||
|
this.statisticsBtn.Click += new System.EventHandler(this.statisticsBtn_Click);
|
||||||
|
//
|
||||||
|
// outputGroupBox
|
||||||
|
//
|
||||||
|
this.outputGroupBox.Controls.Add(this.exportQueryResultsBtn);
|
||||||
|
this.outputGroupBox.Controls.Add(this.printQueryResultsBtn);
|
||||||
|
this.outputGroupBox.Location = new System.Drawing.Point(8, 509);
|
||||||
|
this.outputGroupBox.Name = "outputGroupBox";
|
||||||
|
this.outputGroupBox.Size = new System.Drawing.Size(125, 93);
|
||||||
|
this.outputGroupBox.TabIndex = 12;
|
||||||
|
this.outputGroupBox.TabStop = false;
|
||||||
|
this.outputGroupBox.Text = "Output";
|
||||||
|
//
|
||||||
|
// exportQueryResultsBtn
|
||||||
|
//
|
||||||
|
this.exportQueryResultsBtn.Location = new System.Drawing.Point(5, 18);
|
||||||
|
this.exportQueryResultsBtn.Name = "exportQueryResultsBtn";
|
||||||
|
this.exportQueryResultsBtn.Size = new System.Drawing.Size(114, 32);
|
||||||
|
this.exportQueryResultsBtn.TabIndex = 8;
|
||||||
|
this.exportQueryResultsBtn.Text = "Export query results";
|
||||||
|
this.exportQueryResultsBtn.UseVisualStyleBackColor = true;
|
||||||
|
this.exportQueryResultsBtn.Click += new System.EventHandler(this.exportQueryResultsBtn_Click);
|
||||||
|
//
|
||||||
|
// printQueryResultsBtn
|
||||||
|
//
|
||||||
|
this.printQueryResultsBtn.Location = new System.Drawing.Point(5, 55);
|
||||||
|
this.printQueryResultsBtn.Name = "printQueryResultsBtn";
|
||||||
|
this.printQueryResultsBtn.Size = new System.Drawing.Size(113, 32);
|
||||||
|
this.printQueryResultsBtn.TabIndex = 9;
|
||||||
|
this.printQueryResultsBtn.Text = "Print query results";
|
||||||
|
this.printQueryResultsBtn.UseVisualStyleBackColor = true;
|
||||||
|
this.printQueryResultsBtn.Click += new System.EventHandler(this.printQueryResultsBtn_Click);
|
||||||
|
//
|
||||||
// printerConfigBtn
|
// printerConfigBtn
|
||||||
//
|
//
|
||||||
this.printerConfigBtn.Location = new System.Drawing.Point(8, 316);
|
this.printerConfigBtn.Location = new System.Drawing.Point(8, 316);
|
||||||
@ -164,36 +230,6 @@
|
|||||||
this.printerConfigBtn.UseVisualStyleBackColor = true;
|
this.printerConfigBtn.UseVisualStyleBackColor = true;
|
||||||
this.printerConfigBtn.Click += new System.EventHandler(this.printerConfigBtn_Click);
|
this.printerConfigBtn.Click += new System.EventHandler(this.printerConfigBtn_Click);
|
||||||
//
|
//
|
||||||
// statisticsBtn
|
|
||||||
//
|
|
||||||
this.statisticsBtn.Location = new System.Drawing.Point(8, 621);
|
|
||||||
this.statisticsBtn.Name = "statisticsBtn";
|
|
||||||
this.statisticsBtn.Size = new System.Drawing.Size(125, 35);
|
|
||||||
this.statisticsBtn.TabIndex = 10;
|
|
||||||
this.statisticsBtn.Text = "Statistics";
|
|
||||||
this.statisticsBtn.UseVisualStyleBackColor = true;
|
|
||||||
this.statisticsBtn.Click += new System.EventHandler(this.statisticsBtn_Click);
|
|
||||||
//
|
|
||||||
// printQueryResultsBtn
|
|
||||||
//
|
|
||||||
this.printQueryResultsBtn.Location = new System.Drawing.Point(8, 548);
|
|
||||||
this.printQueryResultsBtn.Name = "printQueryResultsBtn";
|
|
||||||
this.printQueryResultsBtn.Size = new System.Drawing.Size(125, 35);
|
|
||||||
this.printQueryResultsBtn.TabIndex = 9;
|
|
||||||
this.printQueryResultsBtn.Text = "Print query results";
|
|
||||||
this.printQueryResultsBtn.UseVisualStyleBackColor = true;
|
|
||||||
this.printQueryResultsBtn.Click += new System.EventHandler(this.printQueryResultsBtn_Click);
|
|
||||||
//
|
|
||||||
// exportQueryResultsBtn
|
|
||||||
//
|
|
||||||
this.exportQueryResultsBtn.Location = new System.Drawing.Point(8, 508);
|
|
||||||
this.exportQueryResultsBtn.Name = "exportQueryResultsBtn";
|
|
||||||
this.exportQueryResultsBtn.Size = new System.Drawing.Size(125, 35);
|
|
||||||
this.exportQueryResultsBtn.TabIndex = 8;
|
|
||||||
this.exportQueryResultsBtn.Text = "Export query results";
|
|
||||||
this.exportQueryResultsBtn.UseVisualStyleBackColor = true;
|
|
||||||
this.exportQueryResultsBtn.Click += new System.EventHandler(this.exportQueryResultsBtn_Click);
|
|
||||||
//
|
|
||||||
// formatOfResultsBtn
|
// formatOfResultsBtn
|
||||||
//
|
//
|
||||||
this.formatOfResultsBtn.Location = new System.Drawing.Point(8, 276);
|
this.formatOfResultsBtn.Location = new System.Drawing.Point(8, 276);
|
||||||
@ -370,6 +406,8 @@
|
|||||||
this.hSplitContainer.ResumeLayout(false);
|
this.hSplitContainer.ResumeLayout(false);
|
||||||
this.filtersGroupBox.ResumeLayout(false);
|
this.filtersGroupBox.ResumeLayout(false);
|
||||||
this.resultsGroupBox.ResumeLayout(false);
|
this.resultsGroupBox.ResumeLayout(false);
|
||||||
|
this.groupBox1.ResumeLayout(false);
|
||||||
|
this.outputGroupBox.ResumeLayout(false);
|
||||||
this.testBenchesGroupBox.ResumeLayout(false);
|
this.testBenchesGroupBox.ResumeLayout(false);
|
||||||
this.testBenchesGroupBox.PerformLayout();
|
this.testBenchesGroupBox.PerformLayout();
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
@ -402,5 +440,8 @@
|
|||||||
private System.Windows.Forms.RadioButton checkBox4;
|
private System.Windows.Forms.RadioButton checkBox4;
|
||||||
private System.Windows.Forms.Button printerConfigBtn;
|
private System.Windows.Forms.Button printerConfigBtn;
|
||||||
private System.Windows.Forms.RadioButton checkBox6;
|
private System.Windows.Forms.RadioButton checkBox6;
|
||||||
|
private System.Windows.Forms.GroupBox groupBox1;
|
||||||
|
private System.Windows.Forms.GroupBox outputGroupBox;
|
||||||
|
private System.Windows.Forms.Button histogramBtn;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,4 +1,7 @@
|
|||||||
using System;
|
///
|
||||||
|
/// Copyright (c) 2016-2019 Sensus Slovensko a.s.
|
||||||
|
///
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
@ -489,7 +492,7 @@ namespace ResultsBrowser
|
|||||||
IList<Results.WMeterRsltItemSpec> items = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems);
|
IList<Results.WMeterRsltItemSpec> items = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Enter options
|
/// Statistics options
|
||||||
///
|
///
|
||||||
Forms.StatisticsOptionsDlg optionsDlg = new Forms.StatisticsOptionsDlg(items);
|
Forms.StatisticsOptionsDlg optionsDlg = new Forms.StatisticsOptionsDlg(items);
|
||||||
if (optionsDlg.ShowDialog() != DialogResult.OK) return;
|
if (optionsDlg.ShowDialog() != DialogResult.OK) return;
|
||||||
@ -497,16 +500,31 @@ namespace ResultsBrowser
|
|||||||
///
|
///
|
||||||
/// Calculate statistics
|
/// Calculate statistics
|
||||||
///
|
///
|
||||||
Forms.StatisticsDlg statisticsDlg = new Forms.StatisticsDlg(waterMeters, optionsDlg.TwoDim,
|
Forms.StatisticsDlg statisticsDlg = new Forms.StatisticsDlg(waterMeters, optionsDlg, timePeriodStart, timePeriodEnd);
|
||||||
optionsDlg.RowItem, optionsDlg.RowItem2, optionsDlg.RowItem3,
|
|
||||||
optionsDlg.ColumnItem, optionsDlg.ColumnItem2, optionsDlg.ColumnItem3,
|
|
||||||
optionsDlg.RowTestSpecifier, optionsDlg.RowTestSpecifier2, optionsDlg.RowTestSpecifier3,
|
|
||||||
optionsDlg.ColumnTestSpecifier, optionsDlg.ColumnTestSpecifier2, optionsDlg.ColumnTestSpecifier3,
|
|
||||||
timePeriodStart, timePeriodEnd);
|
|
||||||
statisticsDlg.ShowDialog();
|
statisticsDlg.ShowDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void histogramBtn_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (waterMeters == null || waterMeters.Count == 0) return;
|
||||||
|
|
||||||
|
IList<Results.WMeterRsltItemSpec> items = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems);
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Histogram options
|
||||||
|
///
|
||||||
|
Forms.HistogramOptionsDlg optionsDlg = new Forms.HistogramOptionsDlg(items);
|
||||||
|
if (optionsDlg.ShowDialog() != DialogResult.OK) return;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Calculate and display histograms
|
||||||
|
///
|
||||||
|
Forms.HistogramDlg histogramDlg = new Forms.HistogramDlg(waterMeters, optionsDlg, "Histogramy");
|
||||||
|
histogramDlg.ShowDialog();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Updates component factory
|
/// Updates component factory
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user