From 695cca65094953f7bb8e398028fa8bca006a4d87 Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Mon, 10 Dec 2018 21:17:00 +0100 Subject: [PATCH] Statistics project added, ver. 2.18.1088 --- .gitignore | 2 + Statistics/Program.cs | 21 + Statistics/Properties/AssemblyInfo.cs | 36 + Statistics/Properties/Resources.Designer.cs | 63 ++ Statistics/Properties/Resources.resx | 117 ++++ Statistics/Properties/Settings.Designer.cs | 26 + Statistics/Properties/Settings.settings | 7 + Statistics/Resources/Strings.Designer.cs | 117 ++++ Statistics/Resources/Strings.resx | 138 ++++ Statistics/Resources/Strings.sk.resx | 138 ++++ Statistics/Statistics.csproj | 137 ++++ Statistics/StatisticsDlg.Designer.cs | 294 +++++++++ Statistics/StatisticsDlg.cs | 162 +++++ Statistics/StatisticsDlg.resx | 120 ++++ Statistics/UserControls/Enums.cs | 18 + .../MidOrWaterMetersCtrl.Designer.cs | 619 ++++++++++++++++++ .../UserControls/MidOrWaterMetersCtrl.cs | 171 +++++ .../UserControls/MidOrWaterMetersCtrl.resx | 120 ++++ .../UserControls/StatisticsCtrl.Designer.cs | 60 ++ Statistics/UserControls/StatisticsCtrl.cs | 27 + Statistics/UserControls/StatisticsCtrl.resx | 120 ++++ Statistics/app.config | 3 + TBF.sln | 12 + clean.bat | 2 + 24 files changed, 2530 insertions(+) create mode 100644 Statistics/Program.cs create mode 100644 Statistics/Properties/AssemblyInfo.cs create mode 100644 Statistics/Properties/Resources.Designer.cs create mode 100644 Statistics/Properties/Resources.resx create mode 100644 Statistics/Properties/Settings.Designer.cs create mode 100644 Statistics/Properties/Settings.settings create mode 100644 Statistics/Resources/Strings.Designer.cs create mode 100644 Statistics/Resources/Strings.resx create mode 100644 Statistics/Resources/Strings.sk.resx create mode 100644 Statistics/Statistics.csproj create mode 100644 Statistics/StatisticsDlg.Designer.cs create mode 100644 Statistics/StatisticsDlg.cs create mode 100644 Statistics/StatisticsDlg.resx create mode 100644 Statistics/UserControls/Enums.cs create mode 100644 Statistics/UserControls/MidOrWaterMetersCtrl.Designer.cs create mode 100644 Statistics/UserControls/MidOrWaterMetersCtrl.cs create mode 100644 Statistics/UserControls/MidOrWaterMetersCtrl.resx create mode 100644 Statistics/UserControls/StatisticsCtrl.Designer.cs create mode 100644 Statistics/UserControls/StatisticsCtrl.cs create mode 100644 Statistics/UserControls/StatisticsCtrl.resx create mode 100644 Statistics/app.config diff --git a/.gitignore b/.gitignore index 7cf29ff13..1518643da 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,8 @@ Results/bin/ Results/obj/ ResultsBrowser/bin/ ResultsBrowser/obj/ +Statistics/bin/ +Statistics/obj/ TBF/bin/ TBF/obj/ TBFSetup/Debug/ diff --git a/Statistics/Program.cs b/Statistics/Program.cs new file mode 100644 index 000000000..2d85674a1 --- /dev/null +++ b/Statistics/Program.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; + +namespace Statistics +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new StatisticsDlg()); + } + } +} diff --git a/Statistics/Properties/AssemblyInfo.cs b/Statistics/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..83d980846 --- /dev/null +++ b/Statistics/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Statistics")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Statistics")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("9e674819-ed89-4d9a-a4e8-3bf2cc69cfc2")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("2.18.1088.0")] +[assembly: AssemblyFileVersion("2.18.1088.0")] diff --git a/Statistics/Properties/Resources.Designer.cs b/Statistics/Properties/Resources.Designer.cs new file mode 100644 index 000000000..0d3adebfe --- /dev/null +++ b/Statistics/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Statistics.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Statistics.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/Statistics/Properties/Resources.resx b/Statistics/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Statistics/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Statistics/Properties/Settings.Designer.cs b/Statistics/Properties/Settings.Designer.cs new file mode 100644 index 000000000..3497f209a --- /dev/null +++ b/Statistics/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Statistics.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/Statistics/Properties/Settings.settings b/Statistics/Properties/Settings.settings new file mode 100644 index 000000000..39645652a --- /dev/null +++ b/Statistics/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Statistics/Resources/Strings.Designer.cs b/Statistics/Resources/Strings.Designer.cs new file mode 100644 index 000000000..97bc318c9 --- /dev/null +++ b/Statistics/Resources/Strings.Designer.cs @@ -0,0 +1,117 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Statistics.Resources { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Strings { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Strings() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Statistics.Resources.Strings", typeof(Strings).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Flow. + /// + internal static string Flow { + get { + return ResourceManager.GetString("Flow", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to From. + /// + internal static string From { + get { + return ResourceManager.GetString("From", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Statistics. + /// + internal static string Statistics { + get { + return ResourceManager.GetString("Statistics", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Time period. + /// + internal static string Time_period { + get { + return ResourceManager.GetString("Time_period", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To. + /// + internal static string To { + get { + return ResourceManager.GetString("To", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Water meters. + /// + internal static string Water_meters { + get { + return ResourceManager.GetString("Water_meters", resourceCulture); + } + } + } +} diff --git a/Statistics/Resources/Strings.resx b/Statistics/Resources/Strings.resx new file mode 100644 index 000000000..e96134330 --- /dev/null +++ b/Statistics/Resources/Strings.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Flow + + + From + + + Statistics + + + Time period + + + To + + + Water meters + + \ No newline at end of file diff --git a/Statistics/Resources/Strings.sk.resx b/Statistics/Resources/Strings.sk.resx new file mode 100644 index 000000000..c2c26104c --- /dev/null +++ b/Statistics/Resources/Strings.sk.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Prietok + + + Od + + + Štatistiky + + + Časový úsek + + + Do + + + Vodomery + + \ No newline at end of file diff --git a/Statistics/Statistics.csproj b/Statistics/Statistics.csproj new file mode 100644 index 000000000..269a1da18 --- /dev/null +++ b/Statistics/Statistics.csproj @@ -0,0 +1,137 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {36755E1D-6FC3-4D9C-8DD3-0250D51532E0} + WinExe + Properties + Statistics + Statistics + v4.0 + + + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll + + + ..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll + + + ..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll + + + ..\packages\NHibernate.4.0.4.4000\lib\net40\NHibernate.dll + + + + + + + + + + + + + + + True + True + Strings.resx + + + Form + + + StatisticsDlg.cs + + + + + + UserControl + + + MidOrWaterMetersCtrl.cs + + + UserControl + + + StatisticsCtrl.cs + + + ResXFileCodeGenerator + Strings.Designer.cs + + + + StatisticsDlg.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + MidOrWaterMetersCtrl.cs + + + StatisticsCtrl.cs + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + {9D0DCC88-DC81-47EB-9FDD-4C3907871BFB} + Results + + + + + \ No newline at end of file diff --git a/Statistics/StatisticsDlg.Designer.cs b/Statistics/StatisticsDlg.Designer.cs new file mode 100644 index 000000000..7001f4342 --- /dev/null +++ b/Statistics/StatisticsDlg.Designer.cs @@ -0,0 +1,294 @@ +namespace Statistics +{ + partial class StatisticsDlg + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.timePeriodGroupBox = new System.Windows.Forms.GroupBox(); + this.timePeriodCheckBox = new System.Windows.Forms.CheckBox(); + this.toLabel1 = new System.Windows.Forms.Label(); + this.fromLabel1 = new System.Windows.Forms.Label(); + this.dateTimeFromPicker = new System.Windows.Forms.DateTimePicker(); + this.dateTimeToPicker = new System.Windows.Forms.DateTimePicker(); + this.midsTabControl = new System.Windows.Forms.TabControl(); + this.wr10TabPage = new System.Windows.Forms.TabPage(); + this.wr11TabPage = new System.Windows.Forms.TabPage(); + this.wr13TabPage = new System.Windows.Forms.TabPage(); + this.wr14TabPage = new System.Windows.Forms.TabPage(); + this.wr15TabPage = new System.Windows.Forms.TabPage(); + this.wmsBenchesControl = new Statistics.UserControls.MidOrWaterMetersCtrl(); + this.i1BenchesControl = new Statistics.UserControls.MidOrWaterMetersCtrl(); + this.i2BbenchesControl = new Statistics.UserControls.MidOrWaterMetersCtrl(); + this.i3BenchesControl = new Statistics.UserControls.MidOrWaterMetersCtrl(); + this.i4BenchesControl = new Statistics.UserControls.MidOrWaterMetersCtrl(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + this.timePeriodGroupBox.SuspendLayout(); + this.midsTabControl.SuspendLayout(); + this.wr10TabPage.SuspendLayout(); + this.wr11TabPage.SuspendLayout(); + this.wr13TabPage.SuspendLayout(); + this.wr14TabPage.SuspendLayout(); + this.wr15TabPage.SuspendLayout(); + this.SuspendLayout(); + // + // splitContainer1 + // + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; + this.splitContainer1.IsSplitterFixed = true; + 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.timePeriodGroupBox); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.midsTabControl); + this.splitContainer1.Size = new System.Drawing.Size(1368, 826); + this.splitContainer1.SplitterDistance = 90; + this.splitContainer1.TabIndex = 0; + // + // timePeriodGroupBox + // + this.timePeriodGroupBox.Controls.Add(this.timePeriodCheckBox); + this.timePeriodGroupBox.Controls.Add(this.toLabel1); + this.timePeriodGroupBox.Controls.Add(this.fromLabel1); + this.timePeriodGroupBox.Controls.Add(this.dateTimeFromPicker); + this.timePeriodGroupBox.Controls.Add(this.dateTimeToPicker); + this.timePeriodGroupBox.Location = new System.Drawing.Point(12, 10); + this.timePeriodGroupBox.Name = "timePeriodGroupBox"; + this.timePeriodGroupBox.Size = new System.Drawing.Size(296, 74); + this.timePeriodGroupBox.TabIndex = 2; + this.timePeriodGroupBox.TabStop = false; + // + // timePeriodCheckBox + // + this.timePeriodCheckBox.AutoSize = true; + this.timePeriodCheckBox.Location = new System.Drawing.Point(6, -2); + this.timePeriodCheckBox.Name = "timePeriodCheckBox"; + this.timePeriodCheckBox.Size = new System.Drawing.Size(81, 17); + this.timePeriodCheckBox.TabIndex = 4; + this.timePeriodCheckBox.Text = "Time period"; + this.timePeriodCheckBox.UseVisualStyleBackColor = true; + this.timePeriodCheckBox.CheckedChanged += new System.EventHandler(this.timePeriodCheckBox_CheckedChanged); + // + // toLabel1 + // + this.toLabel1.AutoSize = true; + this.toLabel1.Location = new System.Drawing.Point(31, 48); + this.toLabel1.Name = "toLabel1"; + this.toLabel1.Size = new System.Drawing.Size(20, 13); + this.toLabel1.TabIndex = 3; + this.toLabel1.Text = "To"; + // + // fromLabel1 + // + this.fromLabel1.AutoSize = true; + this.fromLabel1.Location = new System.Drawing.Point(31, 23); + this.fromLabel1.Name = "fromLabel1"; + this.fromLabel1.Size = new System.Drawing.Size(30, 13); + this.fromLabel1.TabIndex = 2; + this.fromLabel1.Text = "From"; + // + // dateTimeFromPicker + // + this.dateTimeFromPicker.Location = new System.Drawing.Point(81, 19); + this.dateTimeFromPicker.Name = "dateTimeFromPicker"; + this.dateTimeFromPicker.Size = new System.Drawing.Size(200, 20); + this.dateTimeFromPicker.TabIndex = 0; + // + // dateTimeToPicker + // + this.dateTimeToPicker.Location = new System.Drawing.Point(81, 44); + this.dateTimeToPicker.Name = "dateTimeToPicker"; + this.dateTimeToPicker.Size = new System.Drawing.Size(200, 20); + this.dateTimeToPicker.TabIndex = 1; + // + // midsTabControl + // + this.midsTabControl.Controls.Add(this.wr10TabPage); + this.midsTabControl.Controls.Add(this.wr11TabPage); + this.midsTabControl.Controls.Add(this.wr13TabPage); + this.midsTabControl.Controls.Add(this.wr14TabPage); + this.midsTabControl.Controls.Add(this.wr15TabPage); + this.midsTabControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.midsTabControl.Location = new System.Drawing.Point(0, 0); + this.midsTabControl.Name = "midsTabControl"; + this.midsTabControl.SelectedIndex = 0; + this.midsTabControl.Size = new System.Drawing.Size(1368, 732); + this.midsTabControl.TabIndex = 0; + // + // wr10TabPage + // + this.wr10TabPage.Controls.Add(this.wmsBenchesControl); + this.wr10TabPage.Location = new System.Drawing.Point(4, 22); + this.wr10TabPage.Name = "wr10TabPage"; + this.wr10TabPage.Padding = new System.Windows.Forms.Padding(3); + this.wr10TabPage.Size = new System.Drawing.Size(1360, 706); + this.wr10TabPage.TabIndex = 0; + this.wr10TabPage.Text = "Water meters"; + this.wr10TabPage.UseVisualStyleBackColor = true; + // + // wr11TabPage + // + this.wr11TabPage.Controls.Add(this.i1BenchesControl); + this.wr11TabPage.Location = new System.Drawing.Point(4, 22); + this.wr11TabPage.Name = "wr11TabPage"; + this.wr11TabPage.Padding = new System.Windows.Forms.Padding(3); + this.wr11TabPage.Size = new System.Drawing.Size(1360, 706); + this.wr11TabPage.TabIndex = 1; + this.wr11TabPage.Text = "I1"; + this.wr11TabPage.UseVisualStyleBackColor = true; + // + // wr13TabPage + // + this.wr13TabPage.Controls.Add(this.i2BbenchesControl); + this.wr13TabPage.Location = new System.Drawing.Point(4, 22); + this.wr13TabPage.Name = "wr13TabPage"; + this.wr13TabPage.Padding = new System.Windows.Forms.Padding(3); + this.wr13TabPage.Size = new System.Drawing.Size(1360, 706); + this.wr13TabPage.TabIndex = 2; + this.wr13TabPage.Text = "I2"; + this.wr13TabPage.UseVisualStyleBackColor = true; + // + // wr14TabPage + // + this.wr14TabPage.Controls.Add(this.i3BenchesControl); + this.wr14TabPage.Location = new System.Drawing.Point(4, 22); + this.wr14TabPage.Name = "wr14TabPage"; + this.wr14TabPage.Padding = new System.Windows.Forms.Padding(3); + this.wr14TabPage.Size = new System.Drawing.Size(1360, 706); + this.wr14TabPage.TabIndex = 3; + this.wr14TabPage.Text = "I3"; + this.wr14TabPage.UseVisualStyleBackColor = true; + // + // wr15TabPage + // + this.wr15TabPage.Controls.Add(this.i4BenchesControl); + this.wr15TabPage.Location = new System.Drawing.Point(4, 22); + this.wr15TabPage.Name = "wr15TabPage"; + this.wr15TabPage.Padding = new System.Windows.Forms.Padding(3); + this.wr15TabPage.Size = new System.Drawing.Size(1360, 706); + this.wr15TabPage.TabIndex = 4; + this.wr15TabPage.Text = "I4"; + this.wr15TabPage.UseVisualStyleBackColor = true; + // + // wmsBenchesControl + // + this.wmsBenchesControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.wmsBenchesControl.Location = new System.Drawing.Point(3, 3); + this.wmsBenchesControl.Name = "wmsBenchesControl"; + this.wmsBenchesControl.Size = new System.Drawing.Size(1354, 700); + this.wmsBenchesControl.TabIndex = 0; + // + // i1BenchesControl + // + this.i1BenchesControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.i1BenchesControl.Location = new System.Drawing.Point(3, 3); + this.i1BenchesControl.Name = "i1BenchesControl"; + this.i1BenchesControl.Size = new System.Drawing.Size(1354, 700); + this.i1BenchesControl.TabIndex = 0; + // + // i2BbenchesControl + // + this.i2BbenchesControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.i2BbenchesControl.Location = new System.Drawing.Point(3, 3); + this.i2BbenchesControl.Name = "i2BbenchesControl"; + this.i2BbenchesControl.Size = new System.Drawing.Size(1354, 700); + this.i2BbenchesControl.TabIndex = 0; + // + // i3BenchesControl + // + this.i3BenchesControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.i3BenchesControl.Location = new System.Drawing.Point(3, 3); + this.i3BenchesControl.Name = "i3BenchesControl"; + this.i3BenchesControl.Size = new System.Drawing.Size(1354, 700); + this.i3BenchesControl.TabIndex = 0; + // + // i4BenchesControl + // + this.i4BenchesControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.i4BenchesControl.Location = new System.Drawing.Point(3, 3); + this.i4BenchesControl.Name = "i4BenchesControl"; + this.i4BenchesControl.Size = new System.Drawing.Size(1354, 700); + this.i4BenchesControl.TabIndex = 0; + // + // StatisticsDlg + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1368, 826); + this.Controls.Add(this.splitContainer1); + this.Name = "StatisticsDlg"; + this.Text = "Statistics"; + 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.timePeriodGroupBox.ResumeLayout(false); + this.timePeriodGroupBox.PerformLayout(); + this.midsTabControl.ResumeLayout(false); + this.wr10TabPage.ResumeLayout(false); + this.wr11TabPage.ResumeLayout(false); + this.wr13TabPage.ResumeLayout(false); + this.wr14TabPage.ResumeLayout(false); + this.wr15TabPage.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.SplitContainer splitContainer1; + private System.Windows.Forms.TabControl midsTabControl; + private System.Windows.Forms.TabPage wr10TabPage; + private System.Windows.Forms.TabPage wr11TabPage; + private System.Windows.Forms.TabPage wr13TabPage; + private System.Windows.Forms.TabPage wr14TabPage; + private System.Windows.Forms.TabPage wr15TabPage; + private System.Windows.Forms.GroupBox timePeriodGroupBox; + private System.Windows.Forms.DateTimePicker dateTimeFromPicker; + private System.Windows.Forms.DateTimePicker dateTimeToPicker; + private System.Windows.Forms.Label toLabel1; + private System.Windows.Forms.Label fromLabel1; + private System.Windows.Forms.CheckBox timePeriodCheckBox; + private UserControls.MidOrWaterMetersCtrl wmsBenchesControl; + private UserControls.MidOrWaterMetersCtrl i1BenchesControl; + private UserControls.MidOrWaterMetersCtrl i2BbenchesControl; + private UserControls.MidOrWaterMetersCtrl i3BenchesControl; + private UserControls.MidOrWaterMetersCtrl i4BenchesControl; + } +} + diff --git a/Statistics/StatisticsDlg.cs b/Statistics/StatisticsDlg.cs new file mode 100644 index 000000000..d82359f61 --- /dev/null +++ b/Statistics/StatisticsDlg.cs @@ -0,0 +1,162 @@ +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 NHibernate; +using FluentNHibernate; +using FluentNHibernate.Cfg; +using FluentNHibernate.Cfg.Db; +using Results; +using Results.Entities; +using Statistics.Resources; +using Statistics.UserControls; + +namespace Statistics +{ + public partial class StatisticsDlg : Form + { + static string[] testBenchNames = new string[] { "WR10", "WR11", "WR13", "WR14", "WR15", "PT7" }; + /// +#if false + static string[] connectionStrings = new string[] { + "SERVER=10.42.128.197; DATABASE=st-wr10-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CHARSET=utf8;", /// WR10 + "SERVER=10.42.128.98; DATABASE=st-wr11-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CHARSET=utf8;", /// WR11 + "SERVER=10.42.128.152; DATABASE=st-wr13-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CHARSET=utf8;", /// WR13 + "SERVER=10.42.128.143; DATABASE=st-wr14-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CHARSET=utf8;", /// WR14 + "SERVER=10.42.128.63; DATABASE=st-wr15-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CHARSET=utf8;", /// WR15 + "" /// PT7 + }; +#else + static string[] connectionStrings = new string[] { + "SERVER=localhost; DATABASE=st-wr10-r; UID=root; PASSWORD=; CHARSET=utf8;", /// WR10 + "SERVER=localhost; DATABASE=st-wr11-r; UID=root; PASSWORD=; CHARSET=utf8;", /// WR11 + "SERVER=localhost; DATABASE=st-wr13-r; UID=root; PASSWORD=; CHARSET=utf8;", /// WR13 + "SERVER=localhost; DATABASE=st-wr14-r; UID=root; PASSWORD=; CHARSET=utf8;", /// WR14 + "SERVER=localhost; DATABASE=st-wr15-r; UID=root; PASSWORD=; CHARSET=utf8;", /// WR15 + "" /// PT7 + }; +#endif + /// + static ISessionFactory[] sessionFactories = new ISessionFactory[6]; + + + + public StatisticsDlg() + { + InitializeComponent(); + + ManageCheckGroupBox(timePeriodCheckBox, timePeriodGroupBox); + + for (MidId midId = 0; midId < MidId.Count; midId++) + { + int i = (int)midId; + midsTabControl.TabPages[i].Text = midId.ToString(); + (midsTabControl.TabPages[i].Controls[0] as MidOrWaterMetersCtrl).MidId = midId; + (midsTabControl.TabPages[i].Controls[0] as MidOrWaterMetersCtrl).Parent = this; + } + midsTabControl.TabPages[0].Text = Strings.Water_meters; + + Localize(); + } + + void Localize() + { + Text = Strings.Statistics; + timePeriodCheckBox.Text = Strings.Time_period; + fromLabel1.Text = Strings.From; + toLabel1.Text = Strings.To; + } + + private void StatisticsDlg_Load(object sender, EventArgs e) + { + for (int i = 0; i < testBenchNames.Length; i++) + { + if ((i < connectionStrings.Length) && !string.IsNullOrEmpty(connectionStrings[i])) + { + sessionFactories[i] = null; + try + { + sessionFactories[i] = Fluently.Configure() + .Database(MySQLConfiguration.Standard.ConnectionString(connectionStrings[i])) + .Mappings(m => m.FluentMappings.AddFromAssemblyOf()) + .ExposeConfiguration(BuildSchema) + .BuildSessionFactory(); + } + catch (Exception) + { + MessageBox.Show(string.Format("Cannot open one of database of {0}", testBenchNames[i]), "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + } + } + } + } + + void BuildSchema(NHibernate.Cfg.Configuration config) + { + /// This NHibernate tool takes a configuration with mapping info and exports a database schema + new NHibernate.Tool.hbm2ddl.SchemaExport(config).SetOutputFile("db_schema"); + } + + private void ManageCheckGroupBox(CheckBox chk, GroupBox grp) + { + /// Make sure the CheckBox isn't in the GroupBox. This will only happen the first time. + if (chk.Parent == grp) + { + grp.Parent.Controls.Add(chk); /// Reparent the CheckBox so it's not in the GroupBox. + chk.Location = new Point(chk.Left + grp.Left, chk.Top + grp.Top); /// Adjust the CheckBox's location. + chk.BringToFront(); /// Move the CheckBox to the top of the stacking order. + } + + /// Enable or disable the GroupBox. + grp.Enabled = chk.Checked; + } + + private void timePeriodCheckBox_CheckedChanged(object sender, EventArgs e) + { + ManageCheckGroupBox(timePeriodCheckBox, timePeriodGroupBox); + } + + + public void UpdateRequest(int benchId, MidId midId) + { + if (benchId >= sessionFactories.Length || sessionFactories[benchId] == null || (midId == MidId.WaterMeters)) + { + if (midId == MidId.WaterMeters) + { + MessageBox.Show("Loading statistics of water meters is not implemented yet"); + } + else + { + MessageBox.Show(string.Format("Cannot load statistics of {0}", (benchId < testBenchNames.Length) ? testBenchNames[benchId] : "XY")); + } + return; + } + + try + { + ISession session = sessionFactories[benchId].OpenSession(); + var listOfComponentsWithFlowmeter = session.QueryOver() + .Where(x => (x.Flowmeter == midId.ToString())) + .List(); + IList testRslts = new List(); + foreach (var cmpnts in listOfComponentsWithFlowmeter) + { + var listOfRslts = session.QueryOver() + .Where(x => ((x.EndTime >= dateTimeFromPicker.Value) && (x.EndTime <= dateTimeToPicker.Value))) + .And(x => (x.Components == cmpnts)) + .List(); + foreach (var tr in listOfRslts) testRslts.Add(tr); + } + + session.Close(); + } + catch (Exception exc) + { + MessageBox.Show(string.Format("Error loading statistics of {0}\r\n{1}", (benchId < testBenchNames.Length) ? testBenchNames[benchId] : "XY", exc.Message)); + } + } + } +} diff --git a/Statistics/StatisticsDlg.resx b/Statistics/StatisticsDlg.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/Statistics/StatisticsDlg.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Statistics/UserControls/Enums.cs b/Statistics/UserControls/Enums.cs new file mode 100644 index 000000000..d9bb5cd37 --- /dev/null +++ b/Statistics/UserControls/Enums.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Statistics.UserControls +{ + public enum MidId + { + /// When converted to 'int' it's the MID number, 0 = water meters + WaterMeters, + I1, + I2, + I3, + I4, + Count + } +} diff --git a/Statistics/UserControls/MidOrWaterMetersCtrl.Designer.cs b/Statistics/UserControls/MidOrWaterMetersCtrl.Designer.cs new file mode 100644 index 000000000..e6df15e24 --- /dev/null +++ b/Statistics/UserControls/MidOrWaterMetersCtrl.Designer.cs @@ -0,0 +1,619 @@ +namespace Statistics.UserControls +{ + partial class MidOrWaterMetersCtrl + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.flow3GroupBox = new System.Windows.Forms.GroupBox(); + this.flow3ToExclamation = new System.Windows.Forms.Label(); + this.flow3FromExclamation = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.toLabel4 = new System.Windows.Forms.Label(); + this.fromLabel4 = new System.Windows.Forms.Label(); + this.flow3ToTextBox = new System.Windows.Forms.TextBox(); + this.flow3FromTextBox = new System.Windows.Forms.TextBox(); + this.flow3CheckBox = new System.Windows.Forms.CheckBox(); + this.flow2GroupBox = new System.Windows.Forms.GroupBox(); + this.flow2ToExclamation = new System.Windows.Forms.Label(); + this.flow2FromExclamation = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.toLabel3 = new System.Windows.Forms.Label(); + this.fromLabel3 = new System.Windows.Forms.Label(); + this.flow2ToTextBox = new System.Windows.Forms.TextBox(); + this.flow2FromTextBox = new System.Windows.Forms.TextBox(); + this.flow2CheckBox = new System.Windows.Forms.CheckBox(); + this.flow1GroupBox = new System.Windows.Forms.GroupBox(); + this.flow1ToExclamation = new System.Windows.Forms.Label(); + this.flow1FromExclamation = new System.Windows.Forms.Label(); + this.m3hLabel2 = new System.Windows.Forms.Label(); + this.m3hLabel1 = new System.Windows.Forms.Label(); + this.toLabel2 = new System.Windows.Forms.Label(); + this.fromLabel2 = new System.Windows.Forms.Label(); + this.flow1ToTextBox = new System.Windows.Forms.TextBox(); + this.flow1FromTextBox = new System.Windows.Forms.TextBox(); + this.flow1CheckBox = new System.Windows.Forms.CheckBox(); + this.benchesTabControl = new System.Windows.Forms.TabControl(); + this.tabPage1 = new System.Windows.Forms.TabPage(); + this.wr10StatisticsCtrl1 = new Statistics.UserControls.StatisticsCtrl(); + this.tabPage2 = new System.Windows.Forms.TabPage(); + this.wr11StatisticsCtrl = new Statistics.UserControls.StatisticsCtrl(); + this.tabPage3 = new System.Windows.Forms.TabPage(); + this.wr13StatisticsCtrl = new Statistics.UserControls.StatisticsCtrl(); + this.tabPage4 = new System.Windows.Forms.TabPage(); + this.wr14StatisticsCtrl = new Statistics.UserControls.StatisticsCtrl(); + this.tabPage5 = new System.Windows.Forms.TabPage(); + this.wr15StatisticsCtrl = new Statistics.UserControls.StatisticsCtrl(); + this.tabPage6 = new System.Windows.Forms.TabPage(); + this.pt7StatisticsCtrl = new Statistics.UserControls.StatisticsCtrl(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + this.flow3GroupBox.SuspendLayout(); + this.flow2GroupBox.SuspendLayout(); + this.flow1GroupBox.SuspendLayout(); + this.benchesTabControl.SuspendLayout(); + this.tabPage1.SuspendLayout(); + this.tabPage2.SuspendLayout(); + this.tabPage3.SuspendLayout(); + this.tabPage4.SuspendLayout(); + this.tabPage5.SuspendLayout(); + this.tabPage6.SuspendLayout(); + this.SuspendLayout(); + // + // splitContainer1 + // + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; + this.splitContainer1.IsSplitterFixed = true; + 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.flow3GroupBox); + this.splitContainer1.Panel1.Controls.Add(this.flow2GroupBox); + this.splitContainer1.Panel1.Controls.Add(this.flow1GroupBox); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.benchesTabControl); + this.splitContainer1.Size = new System.Drawing.Size(800, 450); + this.splitContainer1.SplitterDistance = 90; + this.splitContainer1.TabIndex = 0; + // + // flow3GroupBox + // + this.flow3GroupBox.Controls.Add(this.flow3ToExclamation); + this.flow3GroupBox.Controls.Add(this.flow3FromExclamation); + this.flow3GroupBox.Controls.Add(this.label3); + this.flow3GroupBox.Controls.Add(this.label4); + this.flow3GroupBox.Controls.Add(this.toLabel4); + this.flow3GroupBox.Controls.Add(this.fromLabel4); + this.flow3GroupBox.Controls.Add(this.flow3ToTextBox); + this.flow3GroupBox.Controls.Add(this.flow3FromTextBox); + this.flow3GroupBox.Controls.Add(this.flow3CheckBox); + this.flow3GroupBox.Location = new System.Drawing.Point(473, 7); + this.flow3GroupBox.Name = "flow3GroupBox"; + this.flow3GroupBox.Size = new System.Drawing.Size(221, 77); + this.flow3GroupBox.TabIndex = 6; + this.flow3GroupBox.TabStop = false; + // + // flow3ToExclamation + // + this.flow3ToExclamation.AutoSize = true; + this.flow3ToExclamation.ForeColor = System.Drawing.Color.Red; + this.flow3ToExclamation.Location = new System.Drawing.Point(167, 48); + this.flow3ToExclamation.Name = "flow3ToExclamation"; + this.flow3ToExclamation.Size = new System.Drawing.Size(10, 13); + this.flow3ToExclamation.TabIndex = 9; + this.flow3ToExclamation.Text = "!"; + this.flow3ToExclamation.Visible = false; + // + // flow3FromExclamation + // + this.flow3FromExclamation.AutoSize = true; + this.flow3FromExclamation.ForeColor = System.Drawing.Color.Red; + this.flow3FromExclamation.Location = new System.Drawing.Point(167, 24); + this.flow3FromExclamation.Name = "flow3FromExclamation"; + this.flow3FromExclamation.Size = new System.Drawing.Size(10, 13); + this.flow3FromExclamation.TabIndex = 8; + this.flow3FromExclamation.Text = "!"; + this.flow3FromExclamation.Visible = false; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(178, 48); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(32, 13); + this.label3.TabIndex = 6; + this.label3.Text = "m3/h"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(177, 23); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(32, 13); + this.label4.TabIndex = 5; + this.label4.Text = "m3/h"; + // + // toLabel4 + // + this.toLabel4.AutoSize = true; + this.toLabel4.Location = new System.Drawing.Point(14, 48); + this.toLabel4.Name = "toLabel4"; + this.toLabel4.Size = new System.Drawing.Size(20, 13); + this.toLabel4.TabIndex = 4; + this.toLabel4.Text = "To"; + // + // fromLabel4 + // + this.fromLabel4.AutoSize = true; + this.fromLabel4.Location = new System.Drawing.Point(14, 23); + this.fromLabel4.Name = "fromLabel4"; + this.fromLabel4.Size = new System.Drawing.Size(30, 13); + this.fromLabel4.TabIndex = 3; + this.fromLabel4.Text = "From"; + // + // flow3ToTextBox + // + this.flow3ToTextBox.Location = new System.Drawing.Point(65, 45); + this.flow3ToTextBox.Name = "flow3ToTextBox"; + this.flow3ToTextBox.Size = new System.Drawing.Size(100, 20); + this.flow3ToTextBox.TabIndex = 2; + this.flow3ToTextBox.TextChanged += new System.EventHandler(this.flow3ToTextBox_TextChanged); + // + // flow3FromTextBox + // + this.flow3FromTextBox.Location = new System.Drawing.Point(65, 20); + this.flow3FromTextBox.Name = "flow3FromTextBox"; + this.flow3FromTextBox.Size = new System.Drawing.Size(100, 20); + this.flow3FromTextBox.TabIndex = 1; + this.flow3FromTextBox.TextChanged += new System.EventHandler(this.flow3FromTextBox_TextChanged); + // + // flow3CheckBox + // + this.flow3CheckBox.AutoSize = true; + this.flow3CheckBox.Location = new System.Drawing.Point(10, 0); + this.flow3CheckBox.Name = "flow3CheckBox"; + this.flow3CheckBox.Size = new System.Drawing.Size(57, 17); + this.flow3CheckBox.TabIndex = 0; + this.flow3CheckBox.Text = "Flow 3"; + this.flow3CheckBox.UseVisualStyleBackColor = true; + this.flow3CheckBox.CheckedChanged += new System.EventHandler(this.flow3CheckBox_CheckedChanged); + // + // flow2GroupBox + // + this.flow2GroupBox.Controls.Add(this.flow2ToExclamation); + this.flow2GroupBox.Controls.Add(this.flow2FromExclamation); + this.flow2GroupBox.Controls.Add(this.label1); + this.flow2GroupBox.Controls.Add(this.label2); + this.flow2GroupBox.Controls.Add(this.toLabel3); + this.flow2GroupBox.Controls.Add(this.fromLabel3); + this.flow2GroupBox.Controls.Add(this.flow2ToTextBox); + this.flow2GroupBox.Controls.Add(this.flow2FromTextBox); + this.flow2GroupBox.Controls.Add(this.flow2CheckBox); + this.flow2GroupBox.Location = new System.Drawing.Point(240, 7); + this.flow2GroupBox.Name = "flow2GroupBox"; + this.flow2GroupBox.Size = new System.Drawing.Size(221, 77); + this.flow2GroupBox.TabIndex = 5; + this.flow2GroupBox.TabStop = false; + // + // flow2ToExclamation + // + this.flow2ToExclamation.AutoSize = true; + this.flow2ToExclamation.ForeColor = System.Drawing.Color.Red; + this.flow2ToExclamation.Location = new System.Drawing.Point(167, 49); + this.flow2ToExclamation.Name = "flow2ToExclamation"; + this.flow2ToExclamation.Size = new System.Drawing.Size(10, 13); + this.flow2ToExclamation.TabIndex = 9; + this.flow2ToExclamation.Text = "!"; + this.flow2ToExclamation.Visible = false; + // + // flow2FromExclamation + // + this.flow2FromExclamation.AutoSize = true; + this.flow2FromExclamation.ForeColor = System.Drawing.Color.Red; + this.flow2FromExclamation.Location = new System.Drawing.Point(167, 24); + this.flow2FromExclamation.Name = "flow2FromExclamation"; + this.flow2FromExclamation.Size = new System.Drawing.Size(10, 13); + this.flow2FromExclamation.TabIndex = 8; + this.flow2FromExclamation.Text = "!"; + this.flow2FromExclamation.Visible = false; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(178, 48); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(32, 13); + this.label1.TabIndex = 6; + this.label1.Text = "m3/h"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(177, 23); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(32, 13); + this.label2.TabIndex = 5; + this.label2.Text = "m3/h"; + // + // toLabel3 + // + this.toLabel3.AutoSize = true; + this.toLabel3.Location = new System.Drawing.Point(14, 48); + this.toLabel3.Name = "toLabel3"; + this.toLabel3.Size = new System.Drawing.Size(20, 13); + this.toLabel3.TabIndex = 4; + this.toLabel3.Text = "To"; + // + // fromLabel3 + // + this.fromLabel3.AutoSize = true; + this.fromLabel3.Location = new System.Drawing.Point(14, 23); + this.fromLabel3.Name = "fromLabel3"; + this.fromLabel3.Size = new System.Drawing.Size(30, 13); + this.fromLabel3.TabIndex = 3; + this.fromLabel3.Text = "From"; + // + // flow2ToTextBox + // + this.flow2ToTextBox.Location = new System.Drawing.Point(65, 45); + this.flow2ToTextBox.Name = "flow2ToTextBox"; + this.flow2ToTextBox.Size = new System.Drawing.Size(100, 20); + this.flow2ToTextBox.TabIndex = 2; + this.flow2ToTextBox.TextChanged += new System.EventHandler(this.flow2ToTextBox_TextChanged); + // + // flow2FromTextBox + // + this.flow2FromTextBox.Location = new System.Drawing.Point(65, 20); + this.flow2FromTextBox.Name = "flow2FromTextBox"; + this.flow2FromTextBox.Size = new System.Drawing.Size(100, 20); + this.flow2FromTextBox.TabIndex = 1; + this.flow2FromTextBox.TextChanged += new System.EventHandler(this.flow2FromTextBox_TextChanged); + // + // flow2CheckBox + // + this.flow2CheckBox.AutoSize = true; + this.flow2CheckBox.Location = new System.Drawing.Point(6, 0); + this.flow2CheckBox.Name = "flow2CheckBox"; + this.flow2CheckBox.Size = new System.Drawing.Size(57, 17); + this.flow2CheckBox.TabIndex = 0; + this.flow2CheckBox.Text = "Flow 2"; + this.flow2CheckBox.UseVisualStyleBackColor = true; + this.flow2CheckBox.CheckedChanged += new System.EventHandler(this.flow2CheckBox_CheckedChanged); + // + // flow1GroupBox + // + this.flow1GroupBox.Controls.Add(this.flow1ToExclamation); + this.flow1GroupBox.Controls.Add(this.flow1FromExclamation); + this.flow1GroupBox.Controls.Add(this.m3hLabel2); + this.flow1GroupBox.Controls.Add(this.m3hLabel1); + this.flow1GroupBox.Controls.Add(this.toLabel2); + this.flow1GroupBox.Controls.Add(this.fromLabel2); + this.flow1GroupBox.Controls.Add(this.flow1ToTextBox); + this.flow1GroupBox.Controls.Add(this.flow1FromTextBox); + this.flow1GroupBox.Controls.Add(this.flow1CheckBox); + this.flow1GroupBox.Location = new System.Drawing.Point(7, 7); + this.flow1GroupBox.Name = "flow1GroupBox"; + this.flow1GroupBox.Size = new System.Drawing.Size(221, 77); + this.flow1GroupBox.TabIndex = 4; + this.flow1GroupBox.TabStop = false; + // + // flow1ToExclamation + // + this.flow1ToExclamation.AutoSize = true; + this.flow1ToExclamation.ForeColor = System.Drawing.Color.Red; + this.flow1ToExclamation.Location = new System.Drawing.Point(167, 49); + this.flow1ToExclamation.Name = "flow1ToExclamation"; + this.flow1ToExclamation.Size = new System.Drawing.Size(10, 13); + this.flow1ToExclamation.TabIndex = 8; + this.flow1ToExclamation.Text = "!"; + this.flow1ToExclamation.Visible = false; + // + // flow1FromExclamation + // + this.flow1FromExclamation.AutoSize = true; + this.flow1FromExclamation.ForeColor = System.Drawing.Color.Red; + this.flow1FromExclamation.Location = new System.Drawing.Point(167, 24); + this.flow1FromExclamation.Name = "flow1FromExclamation"; + this.flow1FromExclamation.Size = new System.Drawing.Size(10, 13); + this.flow1FromExclamation.TabIndex = 7; + this.flow1FromExclamation.Text = "!"; + this.flow1FromExclamation.Visible = false; + // + // m3hLabel2 + // + this.m3hLabel2.AutoSize = true; + this.m3hLabel2.Location = new System.Drawing.Point(178, 48); + this.m3hLabel2.Name = "m3hLabel2"; + this.m3hLabel2.Size = new System.Drawing.Size(32, 13); + this.m3hLabel2.TabIndex = 6; + this.m3hLabel2.Text = "m3/h"; + // + // m3hLabel1 + // + this.m3hLabel1.AutoSize = true; + this.m3hLabel1.Location = new System.Drawing.Point(177, 23); + this.m3hLabel1.Name = "m3hLabel1"; + this.m3hLabel1.Size = new System.Drawing.Size(32, 13); + this.m3hLabel1.TabIndex = 5; + this.m3hLabel1.Text = "m3/h"; + // + // toLabel2 + // + this.toLabel2.AutoSize = true; + this.toLabel2.Location = new System.Drawing.Point(14, 48); + this.toLabel2.Name = "toLabel2"; + this.toLabel2.Size = new System.Drawing.Size(20, 13); + this.toLabel2.TabIndex = 4; + this.toLabel2.Text = "To"; + // + // fromLabel2 + // + this.fromLabel2.AutoSize = true; + this.fromLabel2.Location = new System.Drawing.Point(14, 23); + this.fromLabel2.Name = "fromLabel2"; + this.fromLabel2.Size = new System.Drawing.Size(30, 13); + this.fromLabel2.TabIndex = 3; + this.fromLabel2.Text = "From"; + // + // flow1ToTextBox + // + this.flow1ToTextBox.Location = new System.Drawing.Point(65, 45); + this.flow1ToTextBox.Name = "flow1ToTextBox"; + this.flow1ToTextBox.Size = new System.Drawing.Size(100, 20); + this.flow1ToTextBox.TabIndex = 2; + this.flow1ToTextBox.TextChanged += new System.EventHandler(this.flow1ToTextBox_TextChanged); + // + // flow1FromTextBox + // + this.flow1FromTextBox.Location = new System.Drawing.Point(65, 20); + this.flow1FromTextBox.Name = "flow1FromTextBox"; + this.flow1FromTextBox.Size = new System.Drawing.Size(100, 20); + this.flow1FromTextBox.TabIndex = 1; + this.flow1FromTextBox.TextChanged += new System.EventHandler(this.flow1FromTextBox_TextChanged); + // + // flow1CheckBox + // + this.flow1CheckBox.AutoSize = true; + this.flow1CheckBox.Location = new System.Drawing.Point(6, 0); + this.flow1CheckBox.Name = "flow1CheckBox"; + this.flow1CheckBox.Size = new System.Drawing.Size(57, 17); + this.flow1CheckBox.TabIndex = 0; + this.flow1CheckBox.Text = "Flow 1"; + this.flow1CheckBox.UseVisualStyleBackColor = true; + this.flow1CheckBox.CheckedChanged += new System.EventHandler(this.flow1CheckBox_CheckedChanged); + // + // benchesTabControl + // + this.benchesTabControl.Controls.Add(this.tabPage1); + this.benchesTabControl.Controls.Add(this.tabPage2); + this.benchesTabControl.Controls.Add(this.tabPage3); + this.benchesTabControl.Controls.Add(this.tabPage4); + this.benchesTabControl.Controls.Add(this.tabPage5); + this.benchesTabControl.Controls.Add(this.tabPage6); + this.benchesTabControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.benchesTabControl.Location = new System.Drawing.Point(0, 0); + this.benchesTabControl.Name = "benchesTabControl"; + this.benchesTabControl.SelectedIndex = 0; + this.benchesTabControl.Size = new System.Drawing.Size(800, 356); + this.benchesTabControl.TabIndex = 0; + // + // tabPage1 + // + this.tabPage1.Controls.Add(this.wr10StatisticsCtrl1); + this.tabPage1.Location = new System.Drawing.Point(4, 22); + this.tabPage1.Name = "tabPage1"; + this.tabPage1.Padding = new System.Windows.Forms.Padding(3); + this.tabPage1.Size = new System.Drawing.Size(792, 330); + this.tabPage1.TabIndex = 0; + this.tabPage1.Text = "WR10"; + this.tabPage1.UseVisualStyleBackColor = true; + // + // wr10StatisticsCtrl1 + // + this.wr10StatisticsCtrl1.Dock = System.Windows.Forms.DockStyle.Fill; + this.wr10StatisticsCtrl1.Location = new System.Drawing.Point(3, 3); + this.wr10StatisticsCtrl1.Name = "wr10StatisticsCtrl1"; + this.wr10StatisticsCtrl1.Size = new System.Drawing.Size(786, 324); + this.wr10StatisticsCtrl1.TabIndex = 0; + // + // tabPage2 + // + this.tabPage2.Controls.Add(this.wr11StatisticsCtrl); + this.tabPage2.Location = new System.Drawing.Point(4, 22); + this.tabPage2.Name = "tabPage2"; + this.tabPage2.Padding = new System.Windows.Forms.Padding(3); + this.tabPage2.Size = new System.Drawing.Size(792, 320); + this.tabPage2.TabIndex = 1; + this.tabPage2.Text = "WR11"; + this.tabPage2.UseVisualStyleBackColor = true; + // + // wr11StatisticsCtrl + // + this.wr11StatisticsCtrl.Dock = System.Windows.Forms.DockStyle.Fill; + this.wr11StatisticsCtrl.Location = new System.Drawing.Point(3, 3); + this.wr11StatisticsCtrl.Name = "wr11StatisticsCtrl"; + this.wr11StatisticsCtrl.Size = new System.Drawing.Size(786, 314); + this.wr11StatisticsCtrl.TabIndex = 0; + // + // tabPage3 + // + this.tabPage3.Controls.Add(this.wr13StatisticsCtrl); + this.tabPage3.Location = new System.Drawing.Point(4, 22); + this.tabPage3.Name = "tabPage3"; + this.tabPage3.Size = new System.Drawing.Size(792, 320); + this.tabPage3.TabIndex = 2; + this.tabPage3.Text = "WR13"; + this.tabPage3.UseVisualStyleBackColor = true; + // + // wr13StatisticsCtrl + // + this.wr13StatisticsCtrl.Dock = System.Windows.Forms.DockStyle.Fill; + this.wr13StatisticsCtrl.Location = new System.Drawing.Point(0, 0); + this.wr13StatisticsCtrl.Name = "wr13StatisticsCtrl"; + this.wr13StatisticsCtrl.Size = new System.Drawing.Size(792, 320); + this.wr13StatisticsCtrl.TabIndex = 0; + // + // tabPage4 + // + this.tabPage4.Controls.Add(this.wr14StatisticsCtrl); + this.tabPage4.Location = new System.Drawing.Point(4, 22); + this.tabPage4.Name = "tabPage4"; + this.tabPage4.Size = new System.Drawing.Size(792, 320); + this.tabPage4.TabIndex = 3; + this.tabPage4.Text = "WR14"; + this.tabPage4.UseVisualStyleBackColor = true; + // + // wr14StatisticsCtrl + // + this.wr14StatisticsCtrl.Dock = System.Windows.Forms.DockStyle.Fill; + this.wr14StatisticsCtrl.Location = new System.Drawing.Point(0, 0); + this.wr14StatisticsCtrl.Name = "wr14StatisticsCtrl"; + this.wr14StatisticsCtrl.Size = new System.Drawing.Size(792, 320); + this.wr14StatisticsCtrl.TabIndex = 0; + // + // tabPage5 + // + this.tabPage5.Controls.Add(this.wr15StatisticsCtrl); + this.tabPage5.Location = new System.Drawing.Point(4, 22); + this.tabPage5.Name = "tabPage5"; + this.tabPage5.Size = new System.Drawing.Size(792, 320); + this.tabPage5.TabIndex = 4; + this.tabPage5.Text = "WR15"; + this.tabPage5.UseVisualStyleBackColor = true; + // + // wr15StatisticsCtrl + // + this.wr15StatisticsCtrl.Dock = System.Windows.Forms.DockStyle.Fill; + this.wr15StatisticsCtrl.Location = new System.Drawing.Point(0, 0); + this.wr15StatisticsCtrl.Name = "wr15StatisticsCtrl"; + this.wr15StatisticsCtrl.Size = new System.Drawing.Size(792, 320); + this.wr15StatisticsCtrl.TabIndex = 0; + // + // tabPage6 + // + this.tabPage6.Controls.Add(this.pt7StatisticsCtrl); + this.tabPage6.Location = new System.Drawing.Point(4, 22); + this.tabPage6.Name = "tabPage6"; + this.tabPage6.Size = new System.Drawing.Size(792, 320); + this.tabPage6.TabIndex = 5; + this.tabPage6.Text = "PT7"; + this.tabPage6.UseVisualStyleBackColor = true; + // + // pt7StatisticsCtrl + // + this.pt7StatisticsCtrl.Dock = System.Windows.Forms.DockStyle.Fill; + this.pt7StatisticsCtrl.Location = new System.Drawing.Point(0, 0); + this.pt7StatisticsCtrl.Name = "pt7StatisticsCtrl"; + this.pt7StatisticsCtrl.Size = new System.Drawing.Size(792, 320); + this.pt7StatisticsCtrl.TabIndex = 0; + // + // MidOrWaterMetersCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.splitContainer1); + this.Name = "MidOrWaterMetersCtrl"; + this.Size = new System.Drawing.Size(800, 450); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); + this.splitContainer1.ResumeLayout(false); + this.flow3GroupBox.ResumeLayout(false); + this.flow3GroupBox.PerformLayout(); + this.flow2GroupBox.ResumeLayout(false); + this.flow2GroupBox.PerformLayout(); + this.flow1GroupBox.ResumeLayout(false); + this.flow1GroupBox.PerformLayout(); + this.benchesTabControl.ResumeLayout(false); + this.tabPage1.ResumeLayout(false); + this.tabPage2.ResumeLayout(false); + this.tabPage3.ResumeLayout(false); + this.tabPage4.ResumeLayout(false); + this.tabPage5.ResumeLayout(false); + this.tabPage6.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.SplitContainer splitContainer1; + private System.Windows.Forms.TabControl benchesTabControl; + private System.Windows.Forms.TabPage tabPage1; + private System.Windows.Forms.TabPage tabPage2; + private System.Windows.Forms.TabPage tabPage3; + private System.Windows.Forms.TabPage tabPage4; + private System.Windows.Forms.TabPage tabPage5; + private System.Windows.Forms.TabPage tabPage6; + private StatisticsCtrl wr10StatisticsCtrl1; + private StatisticsCtrl wr11StatisticsCtrl; + private StatisticsCtrl wr13StatisticsCtrl; + private StatisticsCtrl wr14StatisticsCtrl; + private StatisticsCtrl wr15StatisticsCtrl; + private StatisticsCtrl pt7StatisticsCtrl; + private System.Windows.Forms.GroupBox flow3GroupBox; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label toLabel4; + private System.Windows.Forms.Label fromLabel4; + private System.Windows.Forms.TextBox flow3ToTextBox; + private System.Windows.Forms.TextBox flow3FromTextBox; + private System.Windows.Forms.CheckBox flow3CheckBox; + private System.Windows.Forms.GroupBox flow2GroupBox; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label toLabel3; + private System.Windows.Forms.Label fromLabel3; + private System.Windows.Forms.TextBox flow2ToTextBox; + private System.Windows.Forms.TextBox flow2FromTextBox; + private System.Windows.Forms.CheckBox flow2CheckBox; + private System.Windows.Forms.GroupBox flow1GroupBox; + private System.Windows.Forms.Label m3hLabel2; + private System.Windows.Forms.Label m3hLabel1; + private System.Windows.Forms.Label toLabel2; + private System.Windows.Forms.Label fromLabel2; + private System.Windows.Forms.TextBox flow1ToTextBox; + private System.Windows.Forms.TextBox flow1FromTextBox; + private System.Windows.Forms.CheckBox flow1CheckBox; + private System.Windows.Forms.Label flow1ToExclamation; + private System.Windows.Forms.Label flow1FromExclamation; + private System.Windows.Forms.Label flow3ToExclamation; + private System.Windows.Forms.Label flow3FromExclamation; + private System.Windows.Forms.Label flow2ToExclamation; + private System.Windows.Forms.Label flow2FromExclamation; + } +} diff --git a/Statistics/UserControls/MidOrWaterMetersCtrl.cs b/Statistics/UserControls/MidOrWaterMetersCtrl.cs new file mode 100644 index 000000000..863bb75ee --- /dev/null +++ b/Statistics/UserControls/MidOrWaterMetersCtrl.cs @@ -0,0 +1,171 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using Statistics.Resources; + +namespace Statistics.UserControls +{ + public partial class MidOrWaterMetersCtrl : UserControl + { + public MidId MidId; + public StatisticsDlg Parent; + + public bool Flow1Enabled { get { return flow1CheckBox.Checked; } } + public double Flow1From { get { return flow1From; } } + public double Flow1To { get { return flow1To; } } + + public bool Flow2Enabled { get { return flow2CheckBox.Checked; } } + public double Flow2From { get { return flow2From; } } + public double Flow2To { get { return flow2To; } } + + public bool Flow3Enabled { get { return flow3CheckBox.Checked; } } + public double Flow3From { get { return flow3From; } } + public double Flow3To { get { return flow3To; } } + + /// All flows are in m3/h + double flow1From; + double flow1To; + double flow2From; + double flow2To; + double flow3From; + double flow3To; + + + StatisticsCtrl GetStatistics(int i) + { + if ((i >= 0) && (i < benchesTabControl.TabPages.Count) && benchesTabControl.TabPages[i].Controls.Count > 0) + { + return benchesTabControl.TabPages[i].Controls[0] as StatisticsCtrl; + } + else return null; + } + + + public void UpdateRequest(int benchId) + { + Parent.UpdateRequest(benchId, MidId); + } + + + public MidOrWaterMetersCtrl() + { + InitializeComponent(); + + ManageCheckGroupBox(flow1CheckBox, flow1GroupBox); + ManageCheckGroupBox(flow2CheckBox, flow2GroupBox); + ManageCheckGroupBox(flow3CheckBox, flow3GroupBox); + + for (int i = 0; i < benchesTabControl.TabPages.Count; i++ ) + { + TabPage tp = benchesTabControl.TabPages[i]; + if ((tp.Controls.Count > 0) && (tp.Controls[0] is StatisticsCtrl)) + { + (tp.Controls[0] as StatisticsCtrl).Id = i; + (tp.Controls[0] as StatisticsCtrl).BenchesCtrl = this; + } + } + } + + void Localize() + { + flow1CheckBox.Text = string.Format("{0} 1", Strings.Flow); + flow2CheckBox.Text = string.Format("{0} 2", Strings.Flow); + flow3CheckBox.Text = string.Format("{0} 3", Strings.Flow); + fromLabel2.Text = Strings.From; + fromLabel3.Text = Strings.From; + fromLabel4.Text = Strings.From; + toLabel2.Text = Strings.To; + toLabel3.Text = Strings.To; + toLabel4.Text = Strings.To; + } + + private void flow1CheckBox_CheckedChanged(object sender, EventArgs e) { ManageCheckGroupBox(flow1CheckBox, flow1GroupBox); } + private void flow2CheckBox_CheckedChanged(object sender, EventArgs e) { ManageCheckGroupBox(flow2CheckBox, flow2GroupBox); } + private void flow3CheckBox_CheckedChanged(object sender, EventArgs e) { ManageCheckGroupBox(flow3CheckBox, flow3GroupBox); } + + private void ManageCheckGroupBox(CheckBox chk, GroupBox grp) + { + /// Make sure the CheckBox isn't in the GroupBox. This will only happen the first time. + if (chk.Parent == grp) + { + grp.Parent.Controls.Add(chk); /// Reparent the CheckBox so it's not in the GroupBox. + chk.Location = new Point(chk.Left + grp.Left, chk.Top + grp.Top); /// Adjust the CheckBox's location. + chk.BringToFront(); /// Move the CheckBox to the top of the stacking order. + } + + /// Enable or disable the GroupBox. + grp.Enabled = chk.Checked; + } + + private void flow1FromTextBox_TextChanged(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(flow1FromTextBox.Text)) + { + flow1From = 0; + flow1FromExclamation.Visible = false; + } + else + flow1FromExclamation.Visible = !(double.TryParse(flow1FromTextBox.Text, out flow1From) && (flow1From >= 0)); + } + + private void flow1ToTextBox_TextChanged(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(flow1ToTextBox.Text)) + { + flow1To = 0; + flow1ToExclamation.Visible = false; + } + else + flow1ToExclamation.Visible = !(double.TryParse(flow1ToTextBox.Text, out flow1To) && (flow1To >= 0)); + } + + private void flow2FromTextBox_TextChanged(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(flow2FromTextBox.Text)) + { + flow2From = 0; + flow2FromExclamation.Visible = false; + } + else + flow2FromExclamation.Visible = !(double.TryParse(flow2FromTextBox.Text, out flow2From) && (flow2From >= 0)); + } + + private void flow2ToTextBox_TextChanged(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(flow2ToTextBox.Text)) + { + flow2To = 0; + flow2ToExclamation.Visible = false; + } + else + flow2ToExclamation.Visible = !(double.TryParse(flow2ToTextBox.Text, out flow2To) && (flow2To >= 0)); + } + + private void flow3FromTextBox_TextChanged(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(flow3FromTextBox.Text)) + { + flow3From = 0; + flow3FromExclamation.Visible = false; + } + else + flow3FromExclamation.Visible = !(double.TryParse(flow3FromTextBox.Text, out flow3From) && (flow3From >= 0)); + } + + private void flow3ToTextBox_TextChanged(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(flow3ToTextBox.Text)) + { + flow3To = 0; + flow3ToExclamation.Visible = false; + } + else + flow3ToExclamation.Visible = !(double.TryParse(flow3ToTextBox.Text, out flow3To) && (flow3To >= 0)); + } + } +} diff --git a/Statistics/UserControls/MidOrWaterMetersCtrl.resx b/Statistics/UserControls/MidOrWaterMetersCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/Statistics/UserControls/MidOrWaterMetersCtrl.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Statistics/UserControls/StatisticsCtrl.Designer.cs b/Statistics/UserControls/StatisticsCtrl.Designer.cs new file mode 100644 index 000000000..f58153ea1 --- /dev/null +++ b/Statistics/UserControls/StatisticsCtrl.Designer.cs @@ -0,0 +1,60 @@ +namespace Statistics.UserControls +{ + partial class StatisticsCtrl + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.updateButton = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // updateButton + // + this.updateButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.updateButton.Location = new System.Drawing.Point(255, 11); + this.updateButton.Name = "updateButton"; + this.updateButton.Size = new System.Drawing.Size(122, 43); + this.updateButton.TabIndex = 4; + this.updateButton.Text = "Update"; + this.updateButton.UseVisualStyleBackColor = true; + this.updateButton.Click += new System.EventHandler(this.updateButton_Click); + // + // StatisticsCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.updateButton); + this.Name = "StatisticsCtrl"; + this.Size = new System.Drawing.Size(388, 242); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button updateButton; + } +} diff --git a/Statistics/UserControls/StatisticsCtrl.cs b/Statistics/UserControls/StatisticsCtrl.cs new file mode 100644 index 000000000..d50a09909 --- /dev/null +++ b/Statistics/UserControls/StatisticsCtrl.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace Statistics.UserControls +{ + public partial class StatisticsCtrl : UserControl + { + public int Id; /// Index of the tab page + public MidOrWaterMetersCtrl BenchesCtrl; /// Reference to the parent control + + public StatisticsCtrl() + { + InitializeComponent(); + } + + private void updateButton_Click(object sender, EventArgs e) + { + if (BenchesCtrl != null) BenchesCtrl.UpdateRequest(Id); + } + } +} diff --git a/Statistics/UserControls/StatisticsCtrl.resx b/Statistics/UserControls/StatisticsCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/Statistics/UserControls/StatisticsCtrl.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Statistics/app.config b/Statistics/app.config new file mode 100644 index 000000000..e36560333 --- /dev/null +++ b/Statistics/app.config @@ -0,0 +1,3 @@ + + + diff --git a/TBF.sln b/TBF.sln index 108c3a6ed..138a654b2 100644 --- a/TBF.sln +++ b/TBF.sln @@ -46,6 +46,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TracingDB", "TracingDB\Trac EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GemCard", "GemCard\GemCard.csproj", "{8B10D15A-39DE-4B56-8DD1-710C1EB3A697}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Statistics", "Statistics\Statistics.csproj", "{36755E1D-6FC3-4D9C-8DD3-0250D51532E0}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -174,6 +176,16 @@ Global {8B10D15A-39DE-4B56-8DD1-710C1EB3A697}.Release|Mixed Platforms.Build.0 = Release|x86 {8B10D15A-39DE-4B56-8DD1-710C1EB3A697}.Release|x86.ActiveCfg = Release|x86 {8B10D15A-39DE-4B56-8DD1-710C1EB3A697}.Release|x86.Build.0 = Release|x86 + {36755E1D-6FC3-4D9C-8DD3-0250D51532E0}.Debug|Any CPU.ActiveCfg = Debug|x86 + {36755E1D-6FC3-4D9C-8DD3-0250D51532E0}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {36755E1D-6FC3-4D9C-8DD3-0250D51532E0}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {36755E1D-6FC3-4D9C-8DD3-0250D51532E0}.Debug|x86.ActiveCfg = Debug|x86 + {36755E1D-6FC3-4D9C-8DD3-0250D51532E0}.Debug|x86.Build.0 = Debug|x86 + {36755E1D-6FC3-4D9C-8DD3-0250D51532E0}.Release|Any CPU.ActiveCfg = Release|x86 + {36755E1D-6FC3-4D9C-8DD3-0250D51532E0}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {36755E1D-6FC3-4D9C-8DD3-0250D51532E0}.Release|Mixed Platforms.Build.0 = Release|x86 + {36755E1D-6FC3-4D9C-8DD3-0250D51532E0}.Release|x86.ActiveCfg = Release|x86 + {36755E1D-6FC3-4D9C-8DD3-0250D51532E0}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/clean.bat b/clean.bat index a4fabfcc9..697ba63cf 100644 --- a/clean.bat +++ b/clean.bat @@ -14,6 +14,8 @@ rmdir /s /q Results\bin rmdir /s /q Results\obj rmdir /s /q ResultsBrowser\bin rmdir /s /q ResultsBrowser\obj +rmdir /s /q Statistics\bin +rmdir /s /q Statistics\obj rmdir /s /q TBF\bin rmdir /s /q TBF\obj rmdir /s /q TBFSetup\Debug