diff --git a/Results/Forms/BatchResultsDlg.cs b/Results/Forms/BatchResultsDlg.cs index c7160a1d3..a1a35575c 100644 --- a/Results/Forms/BatchResultsDlg.cs +++ b/Results/Forms/BatchResultsDlg.cs @@ -45,7 +45,7 @@ namespace Results.Forms Results.BatchResults results; MetersKind metersKind; - ListView firstListView; + OneWMResultsCtrl firstListView; public int[] rsltsClmnWidths; int rsltsClmnCount { get { return (rsltsClmnWidths != null) ? rsltsClmnWidths.Length : 0; } } @@ -150,9 +150,9 @@ namespace Results.Forms { if (results.WaterMeters[i] != null && !results.WaterMeters[i].Disabled) { - ListView lview = (TestsArrangement == TestsArrangement.Rows) - ? GetResultsTestsAreRows(results.WaterMeters[i], i + 1) - : GetResultsTestsAreColumns(results.WaterMeters[i], i + 1); + OneWMResultsCtrl lview = (TestsArrangement == TestsArrangement.Rows) + ? GetResultsTestsAreRows(results.WaterMeters[i], i + 1) + : GetResultsTestsAreColumns(results.WaterMeters[i], i + 1); if (lview != null) { flowLayoutPanel.Controls.Add(lview); @@ -182,19 +182,9 @@ namespace Results.Forms /// Get an empty ListView control with appropriate parameters. /// /// ListView control - ListView GetListView() + OneWMResultsCtrl GetListView() { - ListView lview = new ListView(); - lview.AllowColumnReorder = false; - lview.Dock = System.Windows.Forms.DockStyle.None; - lview.FullRowSelect = true; - lview.GridLines = true; - lview.Location = new System.Drawing.Point(0, 0); - lview.Size = new System.Drawing.Size(lvWidth, lvHeight); - lview.TabIndex = 0; - lview.UseCompatibleStateImageBehavior = false; - lview.View = System.Windows.Forms.View.Details; - return lview; + return new OneWMResultsCtrl(Color.White, lvWidth, lvHeight); } @@ -225,11 +215,16 @@ namespace Results.Forms /// /// Water meter number (1-based): 1 .. Config.Data.WMsCount /// ListView object - ListView GetResultsTestsAreRows(Results.Entities.WaterMeter wMtr, int printedWMNr) + OneWMResultsCtrl GetResultsTestsAreRows(Results.Entities.WaterMeter wMtr, int printedWMNr) { metersKind = wMtr.Compound() ? MetersKind.Combined : (wMtr.HeatMeter() ? MetersKind.HeatMeter : MetersKind.Single); - ListView lview = GetListView(); + OneWMResultsCtrl lview = GetListView(); +#if ORACLE_DB + lview.Caption = string.Format("PCB {0} {1} {2}", (string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr), Strings.repetition, (wMtr.Pruefindex % 100)); +#else + lview.Caption = string.Format("s/n = {0}", string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr); +#endif IList items = GetRsltItems(metersKind); @@ -290,11 +285,16 @@ namespace Results.Forms /// /// Water meter number (1-based): 1 .. Config.Data.WMsCount /// ListView object - ListView GetResultsTestsAreColumns(Results.Entities.WaterMeter wMtr, int printedWMNr) + OneWMResultsCtrl GetResultsTestsAreColumns(Results.Entities.WaterMeter wMtr, int printedWMNr) { metersKind = wMtr.Compound() ? MetersKind.Combined : (wMtr.HeatMeter() ? MetersKind.HeatMeter : MetersKind.Single); - ListView lview = GetListView(); + OneWMResultsCtrl lview = GetListView(); +#if ORACLE_DB + lview.Caption = string.Format("PCB {0} {1} {2}", (string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr), Strings.repetition, (wMtr.Pruefindex % 100)); +#else + lview.Caption = string.Format("s/n = {0}", string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr); +#endif IList items = GetRsltItems(metersKind); diff --git a/Results/Forms/OneWMResultsCtrl.Designer.cs b/Results/Forms/OneWMResultsCtrl.Designer.cs new file mode 100644 index 000000000..8518c834a --- /dev/null +++ b/Results/Forms/OneWMResultsCtrl.Designer.cs @@ -0,0 +1,102 @@ +namespace Results.Forms +{ + partial class OneWMResultsCtrl + { + /// + /// 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.tBox = new System.Windows.Forms.TextBox(); + this.lView = new System.Windows.Forms.ListView(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + this.SuspendLayout(); + // + // splitContainer1 + // + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; + 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.tBox); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.lView); + this.splitContainer1.Size = new System.Drawing.Size(352, 318); + this.splitContainer1.SplitterDistance = 25; + this.splitContainer1.SplitterWidth = 1; + this.splitContainer1.TabIndex = 0; + // + // tBox + // + this.tBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.tBox.Location = new System.Drawing.Point(0, 0); + this.tBox.Name = "tBox"; + this.tBox.Size = new System.Drawing.Size(352, 20); + this.tBox.TabIndex = 0; + // + // lView + // + this.lView.Dock = System.Windows.Forms.DockStyle.Fill; + this.lView.FullRowSelect = true; + this.lView.GridLines = true; + this.lView.Location = new System.Drawing.Point(0, 0); + this.lView.Name = "lView"; + this.lView.Size = new System.Drawing.Size(352, 292); + this.lView.TabIndex = 0; + this.lView.UseCompatibleStateImageBehavior = false; + this.lView.View = System.Windows.Forms.View.Details; + // + // OneWMResultsCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.splitContainer1); + this.Name = "OneWMResultsCtrl"; + this.Size = new System.Drawing.Size(352, 318); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel1.PerformLayout(); + this.splitContainer1.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); + this.splitContainer1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.SplitContainer splitContainer1; + private System.Windows.Forms.TextBox tBox; + private System.Windows.Forms.ListView lView; + } +} diff --git a/Results/Forms/OneWMResultsCtrl.cs b/Results/Forms/OneWMResultsCtrl.cs new file mode 100644 index 000000000..1189aaa5b --- /dev/null +++ b/Results/Forms/OneWMResultsCtrl.cs @@ -0,0 +1,26 @@ +using System.Drawing; +using System.Windows.Forms; + +namespace Results.Forms +{ + public partial class OneWMResultsCtrl : UserControl + { + public OneWMResultsCtrl() + { + InitializeComponent(); + } + + public OneWMResultsCtrl(Color backColor, int lvWidth, int lvHeight) + : this() + { + lView.BackColor = backColor; + tBox.BackColor = backColor; + Size = new System.Drawing.Size(lvWidth, lvHeight); + } + + public string Caption { get { return tBox.Text; } set { tBox.Text = value; } } + public ListView.ColumnHeaderCollection Columns { get { return lView.Columns; } } + public ListView.ListViewItemCollection Items { get { return lView.Items; } } + public Color BColor { set { lView.BackColor = value; tBox.BackColor = value; } } + } +} diff --git a/Results/Forms/OneWMResultsCtrl.resx b/Results/Forms/OneWMResultsCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/Results/Forms/OneWMResultsCtrl.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/Results/Resources/Strings.Designer.cs b/Results/Resources/Strings.Designer.cs index 6428c450a..d99b31db2 100644 --- a/Results/Resources/Strings.Designer.cs +++ b/Results/Resources/Strings.Designer.cs @@ -798,6 +798,15 @@ namespace Results.Resources { } } + /// + /// Looks up a localized string similar to repetition. + /// + internal static string repetition { + get { + return ResourceManager.GetString("repetition", resourceCulture); + } + } + /// /// Looks up a localized string similar to Result. /// diff --git a/Results/Resources/Strings.cs.resx b/Results/Resources/Strings.cs.resx index 8ca32d212..b19d3bf94 100644 --- a/Results/Resources/Strings.cs.resx +++ b/Results/Resources/Strings.cs.resx @@ -255,4 +255,7 @@ Dávka + + opakování + \ No newline at end of file diff --git a/Results/Resources/Strings.resx b/Results/Resources/Strings.resx index e76c6f850..8506411f4 100644 --- a/Results/Resources/Strings.resx +++ b/Results/Resources/Strings.resx @@ -741,4 +741,7 @@ Batch + + repetition + \ No newline at end of file diff --git a/Results/Results.csproj b/Results/Results.csproj index d2e6be048..106ac4193 100644 --- a/Results/Results.csproj +++ b/Results/Results.csproj @@ -80,6 +80,12 @@ + + UserControl + + + OneWMResultsCtrl.cs + UserControl @@ -159,6 +165,9 @@ ListViewEx.cs + + OneWMResultsCtrl.cs + ResultsConfigCtrl.cs diff --git a/TBF/Resources/Strings.Designer.cs b/TBF/Resources/Strings.Designer.cs index c98d09427..aa0311f05 100644 --- a/TBF/Resources/Strings.Designer.cs +++ b/TBF/Resources/Strings.Designer.cs @@ -3777,6 +3777,15 @@ namespace TBF.Resources { } } + /// + /// Looks up a localized string similar to repetition. + /// + internal static string repetition { + get { + return ResourceManager.GetString("repetition", resourceCulture); + } + } + /// /// Looks up a localized string similar to Required temperature [°C]. /// diff --git a/TBF/Resources/Strings.cs.resx b/TBF/Resources/Strings.cs.resx index b73a33ff6..d461e73a0 100644 --- a/TBF/Resources/Strings.cs.resx +++ b/TBF/Resources/Strings.cs.resx @@ -1365,4 +1365,7 @@ Předešlé + + opakování + \ No newline at end of file diff --git a/TBF/Resources/Strings.resx b/TBF/Resources/Strings.resx index 098dab46b..39b7ffe4a 100644 --- a/TBF/Resources/Strings.resx +++ b/TBF/Resources/Strings.resx @@ -1927,4 +1927,7 @@ Import + + repetition + \ No newline at end of file diff --git a/TBF/Screens/ResultsTabPageCtrl.cs b/TBF/Screens/ResultsTabPageCtrl.cs index d29c75616..15bc2daf5 100644 --- a/TBF/Screens/ResultsTabPageCtrl.cs +++ b/TBF/Screens/ResultsTabPageCtrl.cs @@ -12,6 +12,7 @@ using Config; using Config.Entities; using TBF.Resources; using TBF.UiBridge; +using Results.Forms; namespace TBF.Screens { @@ -30,7 +31,7 @@ namespace TBF.Screens public IList RsltItems_Screen_HeatM; MetersKind metersKind; - ListView firstListView; + OneWMResultsCtrl firstListView; int lvWidth; int lvHeight; @@ -238,7 +239,7 @@ namespace TBF.Screens { if (results.WaterMeters[i] != null && !results.WaterMeters[i].Disabled) { - ListView lview = (TestsArrangement == TestsArrangement.Rows) + OneWMResultsCtrl lview = (TestsArrangement == TestsArrangement.Rows) ? GetResultsTestsAreRows(results.WaterMeters[i], i + 1) : GetResultsTestsAreColumns(results.WaterMeters[i], i + 1); if (lview != null) @@ -270,20 +271,9 @@ namespace TBF.Screens /// Get an empty ListView control with appropriate parameters. /// /// ListView control - ListView GetListView(Color backColor) + OneWMResultsCtrl GetListView(Color backColor) { - ListView lview = new ListView(); - lview.AllowColumnReorder = false; - lview.Dock = System.Windows.Forms.DockStyle.None; - lview.FullRowSelect = true; - lview.GridLines = true; - lview.Location = new System.Drawing.Point(0, 0); - lview.Size = new System.Drawing.Size(lvWidth, lvHeight); - lview.TabIndex = 0; - lview.UseCompatibleStateImageBehavior = false; - lview.View = System.Windows.Forms.View.Details; - lview.BackColor = backColor; - return lview; + return new OneWMResultsCtrl(backColor, lvWidth, lvHeight); } @@ -316,7 +306,7 @@ namespace TBF.Screens /// /// Water meter number (1-based): 1 .. Config.Data.WMsCount /// ListView object - ListView GetResultsTestsAreRows(Results.Entities.WaterMeter wMtr, int printedWMNr) + OneWMResultsCtrl GetResultsTestsAreRows(Results.Entities.WaterMeter wMtr, int printedWMNr) { metersKind = wMtr.Compound() ? MetersKind.Combined : (wMtr.HeatMeter() ? MetersKind.HeatMeter : MetersKind.Single); bool wmtrCompleted = wMtr.CompletedFromTests(); @@ -330,7 +320,12 @@ namespace TBF.Screens if (wmtrCompleted && !wmtrPassed && ((wMtr.Pruefindex % 100) >= maxTrials)) commonBackColor = Color.DarkOrange; } #endif - ListView lview = GetListView(commonBackColor); + OneWMResultsCtrl lview = GetListView(commonBackColor); +#if ORACLE_DB + lview.Caption = string.Format("PCB {0} {1} {2}", (string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr), Strings.repetition, (wMtr.Pruefindex % 100)); +#else + lview.Caption = string.Format("s/n = {0}", string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr); +#endif IList items = GetRsltItems(metersKind); @@ -397,11 +392,16 @@ namespace TBF.Screens /// /// Water meter number (1-based): 1 .. Config.Data.WMsCount /// ListView object - ListView GetResultsTestsAreColumns(Results.Entities.WaterMeter wMtr, int printedWMNr) + OneWMResultsCtrl GetResultsTestsAreColumns(Results.Entities.WaterMeter wMtr, int printedWMNr) { metersKind = wMtr.Compound() ? MetersKind.Combined : (wMtr.HeatMeter() ? MetersKind.HeatMeter : MetersKind.Single); Color commonBackColor = wMtr.PassedFromTests() ? Color.LightGreen : (wMtr.CompletedFromTests() ? Color.LightPink : Color.White); - ListView lview = GetListView(commonBackColor); + OneWMResultsCtrl lview = GetListView(commonBackColor); +#if ORACLE_DB + lview.Caption = string.Format("PCB {0} {1} {2}", (string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr), Strings.repetition, (wMtr.Pruefindex % 100)); +#else + lview.Caption = string.Format("s/n = {0}", string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr); +#endif IList items = GetRsltItems(metersKind);