DataEntry.Uni.CycleBgEnForm : 1. autoSNButton --> multiPurposeButton, 2. Initial configuration : Order : Ac.HistoryLast, ver. 2.33.2138
This commit is contained in:
parent
e0d10bed71
commit
4bff6f33de
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("2.33.2134.0")]
|
||||
[assembly: AssemblyFileVersion("2.33.2134.0")]
|
||||
[assembly: AssemblyVersion("2.33.2138.0")]
|
||||
[assembly: AssemblyFileVersion("2.33.2138.0")]
|
||||
|
||||
@ -1213,7 +1213,7 @@
|
||||
<value>Objem</value>
|
||||
</data>
|
||||
<data name="PrintBtnText" xml:space="preserve">
|
||||
<value>Vytisknout</value>
|
||||
<value>Tisknout</value>
|
||||
</data>
|
||||
<data name="Do_you_want_to_save_changes" xml:space="preserve">
|
||||
<value>Chcete uložit změny?</value>
|
||||
@ -1675,7 +1675,7 @@
|
||||
<value>Konfigurace testu {0} : chybí {1}</value>
|
||||
</data>
|
||||
<data name="Print" xml:space="preserve">
|
||||
<value>Vytisknout</value>
|
||||
<value>Tisknout</value>
|
||||
</data>
|
||||
<data name="Printer_selection" xml:space="preserve">
|
||||
<value>Výběr tiskárny</value>
|
||||
|
||||
@ -6,9 +6,9 @@ using Common;
|
||||
|
||||
namespace TBF.Rig.DataEntry
|
||||
{
|
||||
///
|
||||
/// Ac = Action
|
||||
///
|
||||
/// <summary>
|
||||
/// Action of a DataEntry field
|
||||
/// </summary>
|
||||
public enum Ac
|
||||
{
|
||||
[Description("Clear")] Clear, /// Clear when the form is open, save on OK
|
||||
@ -19,9 +19,9 @@ namespace TBF.Rig.DataEntry
|
||||
Count,
|
||||
}
|
||||
|
||||
///
|
||||
/// Ct = Content
|
||||
///
|
||||
/// <summary>
|
||||
/// Content of a DataEntry field
|
||||
/// </summary>
|
||||
public enum Ct
|
||||
{
|
||||
[Description("None")] None,
|
||||
@ -48,6 +48,16 @@ namespace TBF.Rig.DataEntry
|
||||
Count
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Function of the multi purpose button
|
||||
/// </summary>
|
||||
public enum MultiPurposeBtnFunction
|
||||
{
|
||||
None,
|
||||
AutoSN,
|
||||
PrintLabelsOnOff,
|
||||
}
|
||||
|
||||
///
|
||||
/// Identifies image instance
|
||||
///
|
||||
|
||||
@ -50,6 +50,9 @@ namespace TBF.Rig.DataEntry.Uni
|
||||
readonly ComboBox[,] comboBoxes; /// Combo boxes for values in columns
|
||||
readonly CheckBox[] checkBoxes; /// Check boxes for water meter enable/disable
|
||||
|
||||
readonly MultiPurposeBtnFunction multiPurposeButtonFn;
|
||||
bool multiPurposeButtonFlag;
|
||||
|
||||
readonly LocalSettings ls;
|
||||
|
||||
bool isHandlersEnabled; /// Initially false, set to true after ComboBoxes are filled with data
|
||||
@ -124,13 +127,29 @@ namespace TBF.Rig.DataEntry.Uni
|
||||
comboBoxes = new ComboBox[colItems.Count, wmsCount];
|
||||
checkBoxes = new CheckBox[wmsCount];
|
||||
|
||||
/// Make Auto s/n button visible if there is either Ct.SerialNr or Ct.SerialNrAux column
|
||||
///
|
||||
/// Determine the multi purpose button function
|
||||
///
|
||||
multiPurposeButton.Visible = false;
|
||||
multiPurposeButtonFn = MultiPurposeBtnFunction.None;
|
||||
int buttonsWidth = 350;
|
||||
for (int k = 0; k < colItems.Count; k++)
|
||||
{
|
||||
if ((colItems[k].Content == Ct.SerialNr || colItems[k].Content == Ct.SerialNrAux) && colItems[k].Action != Ac.LoadReadOnly)
|
||||
{
|
||||
autoSNButton.Visible = true;
|
||||
multiPurposeButton.Visible = true;
|
||||
multiPurposeButton.Text = "Auto s/n";
|
||||
multiPurposeButtonFn = MultiPurposeBtnFunction.AutoSN;
|
||||
buttonsWidth += 147;
|
||||
break;
|
||||
}
|
||||
|
||||
if (colItems[k].Content == Ct.PrintLabel)
|
||||
{
|
||||
multiPurposeButton.Visible = true;
|
||||
multiPurposeButton.Text = string.Format("{0} ({1}/{2})", Strings.Print, Strings.yes, Strings.no);
|
||||
multiPurposeButtonFn = MultiPurposeBtnFunction.PrintLabelsOnOff;
|
||||
multiPurposeButtonFlag = false;
|
||||
buttonsWidth += 147;
|
||||
break;
|
||||
}
|
||||
@ -518,7 +537,7 @@ namespace TBF.Rig.DataEntry.Uni
|
||||
case Ac.Set:
|
||||
for (int i = 0; i < wmsCount; i++)
|
||||
{
|
||||
comboBoxes[k, i].Text = Strings.yes;
|
||||
comboBoxes[k, i].Text = (WaterMeters[i] != null && !WaterMeters[i].Disabled) ? Strings.yes : Strings.no;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -648,7 +667,11 @@ namespace TBF.Rig.DataEntry.Uni
|
||||
InitializeBoxes();
|
||||
}
|
||||
|
||||
private void autoSNButton_Click(object sender, EventArgs e)
|
||||
private void multiPurposeButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (multiPurposeButtonFn == MultiPurposeBtnFunction.None) return;
|
||||
|
||||
if (multiPurposeButtonFn == MultiPurposeBtnFunction.AutoSN)
|
||||
{
|
||||
///
|
||||
/// Find the 1st enabled water meter
|
||||
@ -714,6 +737,28 @@ namespace TBF.Rig.DataEntry.Uni
|
||||
}
|
||||
}
|
||||
|
||||
if (multiPurposeButtonFn == MultiPurposeBtnFunction.PrintLabelsOnOff)
|
||||
{
|
||||
///
|
||||
/// Find a column with Ct.PrintLabel
|
||||
///
|
||||
for (int k = 0; k < colItems.Count; k++)
|
||||
{
|
||||
if (colItems[k].Content == Ct.PrintLabel)
|
||||
{
|
||||
for (int ix = 0; ix < wmsCount; ix++)
|
||||
{
|
||||
if (WaterMeters[ix] != null && !WaterMeters[ix].Disabled)
|
||||
{
|
||||
comboBoxes[k, ix].Text = multiPurposeButtonFlag ? Strings.yes : Strings.no;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
multiPurposeButtonFlag = !multiPurposeButtonFlag;
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox_SelectedIndexChanged(object sndr, EventArgs e)
|
||||
{
|
||||
if (!isHandlersEnabled) return;
|
||||
|
||||
18
TBF/Rig/DataEntry/Uni/CycleBgEnForm.designer.cs
generated
18
TBF/Rig/DataEntry/Uni/CycleBgEnForm.designer.cs
generated
@ -34,7 +34,7 @@ namespace TBF.Rig.DataEntry.Uni
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CycleBgEnForm));
|
||||
this.okButton = new System.Windows.Forms.Button();
|
||||
this.clearButton = new System.Windows.Forms.Button();
|
||||
this.autoSNButton = new System.Windows.Forms.Button();
|
||||
this.multiPurposeButton = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// okButton
|
||||
@ -53,20 +53,20 @@ namespace TBF.Rig.DataEntry.Uni
|
||||
this.clearButton.UseVisualStyleBackColor = true;
|
||||
this.clearButton.Click += new System.EventHandler(this.clearButton_Click);
|
||||
//
|
||||
// autoSNButton
|
||||
// multiPurposeButton
|
||||
//
|
||||
resources.ApplyResources(this.autoSNButton, "autoSNButton");
|
||||
this.autoSNButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.autoSNButton.Name = "autoSNButton";
|
||||
this.autoSNButton.UseVisualStyleBackColor = true;
|
||||
this.autoSNButton.Click += new System.EventHandler(this.autoSNButton_Click);
|
||||
resources.ApplyResources(this.multiPurposeButton, "multiPurposeButton");
|
||||
this.multiPurposeButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.multiPurposeButton.Name = "multiPurposeButton";
|
||||
this.multiPurposeButton.UseVisualStyleBackColor = true;
|
||||
this.multiPurposeButton.Click += new System.EventHandler(this.multiPurposeButton_Click);
|
||||
//
|
||||
// CycleBgEnForm
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.DarkGray;
|
||||
this.Controls.Add(this.autoSNButton);
|
||||
this.Controls.Add(this.multiPurposeButton);
|
||||
this.Controls.Add(this.clearButton);
|
||||
this.Controls.Add(this.okButton);
|
||||
this.ForeColor = System.Drawing.Color.Black;
|
||||
@ -81,6 +81,6 @@ namespace TBF.Rig.DataEntry.Uni
|
||||
|
||||
private System.Windows.Forms.Button okButton;
|
||||
private System.Windows.Forms.Button clearButton;
|
||||
private System.Windows.Forms.Button autoSNButton;
|
||||
private System.Windows.Forms.Button multiPurposeButton;
|
||||
}
|
||||
}
|
||||
@ -183,40 +183,40 @@
|
||||
<data name=">>clearButton.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="autoSNButton.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<data name="multiPurposeButton.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Right</value>
|
||||
</data>
|
||||
<data name="autoSNButton.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<data name="multiPurposeButton.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Verdana, 14.25pt</value>
|
||||
</data>
|
||||
<data name="autoSNButton.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<data name="multiPurposeButton.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="autoSNButton.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<data name="multiPurposeButton.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>648, 26</value>
|
||||
</data>
|
||||
<data name="autoSNButton.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<data name="multiPurposeButton.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>112, 63</value>
|
||||
</data>
|
||||
<data name="autoSNButton.TabIndex" type="System.Int32, mscorlib">
|
||||
<data name="multiPurposeButton.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>9</value>
|
||||
</data>
|
||||
<data name="autoSNButton.Text" xml:space="preserve">
|
||||
<value>Auto s/n</value>
|
||||
<data name="multiPurposeButton.Text" xml:space="preserve">
|
||||
<value>Multi purpose</value>
|
||||
</data>
|
||||
<data name="autoSNButton.Visible" type="System.Boolean, mscorlib">
|
||||
<data name="multiPurposeButton.Visible" type="System.Boolean, mscorlib">
|
||||
<value>False</value>
|
||||
</data>
|
||||
<data name=">>autoSNButton.Name" xml:space="preserve">
|
||||
<value>autoSNButton</value>
|
||||
<data name=">>multiPurposeButton.Name" xml:space="preserve">
|
||||
<value>multiPurposeButton</value>
|
||||
</data>
|
||||
<data name=">>autoSNButton.Type" xml:space="preserve">
|
||||
<data name=">>multiPurposeButton.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>autoSNButton.Parent" xml:space="preserve">
|
||||
<data name=">>multiPurposeButton.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>autoSNButton.ZOrder" xml:space="preserve">
|
||||
<data name=">>multiPurposeButton.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
|
||||
@ -347,7 +347,7 @@ namespace TBF.Rig.DataEntry.Uni
|
||||
|
||||
BgItemContent = new Ct[1] { Ct.BatchAndWmOrder };
|
||||
BgItemCaption = new string[1] { "Order nr." };
|
||||
BgItemAction = new Ac[1] { Ac.Clear };
|
||||
BgItemAction = new Ac[1] { Ac.HistoryLast };
|
||||
BgItemWidth = new int[1] { 200 };
|
||||
|
||||
BgColumnContent = new Ct[1] { Ct.SerialNr };
|
||||
|
||||
Loading…
Reference in New Issue
Block a user