DataEntry.Double24 component added.
This commit is contained in:
parent
57e413d6ff
commit
f20acf0e11
1134
TBF/Rig/DataEntry/Double24/CycleBeginningForm.Designer.cs
generated
Normal file
1134
TBF/Rig/DataEntry/Double24/CycleBeginningForm.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
442
TBF/Rig/DataEntry/Double24/CycleBeginningForm.cs
Normal file
442
TBF/Rig/DataEntry/Double24/CycleBeginningForm.cs
Normal file
@ -0,0 +1,442 @@
|
||||
///
|
||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.Rig.DataEntry.Double24
|
||||
{
|
||||
public partial class CycleBeginningForm : Form, GenericDevices.IHasCompleted
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(CycleBeginningForm));
|
||||
|
||||
/// <summary> Number of water meters </summary>
|
||||
public readonly int WMsCount;
|
||||
readonly EntryFormCfg entryFormCfg;
|
||||
|
||||
/// To be retrieved after the form is closed
|
||||
public string PurchaseOrder;
|
||||
public string Prefix;
|
||||
public string[] SNText;
|
||||
public string[] Column2Text;
|
||||
public string[] suffixText;
|
||||
public bool[] Disabled;
|
||||
|
||||
/// Set to 'true' when the form closes
|
||||
public bool Completed { get { return completed; } }
|
||||
bool completed;
|
||||
|
||||
/// <summary> Number of text boxes for serial numbers </summary>
|
||||
int textBoxesCount;
|
||||
Label[] labels;
|
||||
ComboBox[] comboBoxes;
|
||||
ComboBox[] column2ComboBoxes;
|
||||
CheckBox[] checkBoxes;
|
||||
IList<ComboBox> enabledComboBoxes;
|
||||
|
||||
|
||||
/// <summary> Parameterless constructor for common functionality </summary>
|
||||
public CycleBeginningForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
ControlBox = false;
|
||||
|
||||
textBoxesCount = 24;
|
||||
labels = new Label[]
|
||||
{
|
||||
label1, label2, label3, label4, label5, label6, label7, label8, label9, label10,
|
||||
label11, label12, label13, label14, label15, label16, label17, label18, label19, label20,
|
||||
label21, label22, label23, label24,
|
||||
};
|
||||
comboBoxes = new ComboBox[]
|
||||
{
|
||||
comboBox1, comboBox2, comboBox3, comboBox4, comboBox5, comboBox6,
|
||||
comboBox7, comboBox8, comboBox9, comboBox10, comboBox11, comboBox12,
|
||||
comboBox13, comboBox14, comboBox15, comboBox16, comboBox17, comboBox18,
|
||||
comboBox19, comboBox20, comboBox21, comboBox22, comboBox23, comboBox24,
|
||||
};
|
||||
column2ComboBoxes = new ComboBox[]
|
||||
{
|
||||
suffixComboBox1, suffixComboBox2, suffixComboBox3, suffixComboBox4, suffixComboBox5, suffixComboBox6,
|
||||
suffixComboBox7, suffixComboBox8, suffixComboBox9, suffixComboBox10, suffixComboBox11, suffixComboBox12,
|
||||
suffixComboBox13, suffixComboBox14, suffixComboBox15, suffixComboBox16, suffixComboBox17, suffixComboBox18,
|
||||
suffixComboBox19, suffixComboBox20, suffixComboBox21, suffixComboBox22, suffixComboBox23, suffixComboBox24,
|
||||
};
|
||||
checkBoxes = new CheckBox[]
|
||||
{
|
||||
checkBox1, checkBox2, checkBox3, checkBox4, checkBox5, checkBox6,
|
||||
checkBox7, checkBox8, checkBox9, checkBox10, checkBox11, checkBox12,
|
||||
checkBox13, checkBox14, checkBox15, checkBox16, checkBox17, checkBox18,
|
||||
checkBox19, checkBox20, checkBox21, checkBox22, checkBox23, checkBox24,
|
||||
};
|
||||
enabledComboBoxes = new List<ComboBox>();
|
||||
|
||||
completed = false;
|
||||
StartForceCloseHandler();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
|
||||
public CycleBeginningForm(int waterMetersCount, EntryFormCfg entryFormCfg)
|
||||
: this()
|
||||
{
|
||||
this.WMsCount = waterMetersCount;
|
||||
this.entryFormCfg = entryFormCfg;
|
||||
|
||||
SNText = new string[WMsCount];
|
||||
Column2Text = new string[WMsCount];
|
||||
suffixText = new string[WMsCount];
|
||||
Disabled = new bool[WMsCount];
|
||||
|
||||
if (entryFormCfg.HideOrderSelection)
|
||||
orderGroupBox.Visible = false;
|
||||
else
|
||||
PrepareOrderCombo(orderComboBox);
|
||||
|
||||
if (entryFormCfg.HidePrefix)
|
||||
prefixGroupBox.Visible = false;
|
||||
else
|
||||
PreparePrefixCombo(prefixComboBox);
|
||||
|
||||
ShuffleTextBoxes(TBF.Data.WMsCount, TBF.Data.LineSize);
|
||||
|
||||
//Height = 147 + WaterMetersCount * 90;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Make sure the layout of labels/text boxes on the screen
|
||||
/// corresponds to the layout of watermeters of the test bench.
|
||||
/// </summary>
|
||||
/// <param name="wmsCount">Number of watermeters</param>
|
||||
/// <param name="lineSize">Number of watermeters in one line</param>
|
||||
void ShuffleTextBoxes(int wmsCount, int lineSize)
|
||||
{
|
||||
if (wmsCount < textBoxesCount && lineSize > 0)
|
||||
{
|
||||
int nrLines = (wmsCount + lineSize - 1) / lineSize;
|
||||
int gap = (textBoxesCount - wmsCount) / nrLines;
|
||||
|
||||
int dest = 0;
|
||||
for (int l = 0; l < nrLines; l++)
|
||||
{
|
||||
for (int i = 0; i < lineSize; i++)
|
||||
{
|
||||
labels[dest] = labels[l * lineSize + l * gap + i];
|
||||
comboBoxes[dest] = comboBoxes[l * lineSize + l * gap + i];
|
||||
column2ComboBoxes[dest] = column2ComboBoxes[l * lineSize + l * gap + i];
|
||||
checkBoxes[dest] = checkBoxes[l * lineSize + l * gap + i];
|
||||
dest++;
|
||||
}
|
||||
}
|
||||
textBoxesCount = wmsCount;
|
||||
}
|
||||
}
|
||||
|
||||
private void CycleBeginningForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
Localize();
|
||||
|
||||
for (int i = 0; i < textBoxesCount; i++)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == textBoxesCount)
|
||||
{
|
||||
comboBoxes[i].Items.Add((Program.LocalSettings.LastSNTexts[i] == null) ? string.Empty : Program.LocalSettings.LastSNTexts[i]);
|
||||
column2ComboBoxes[i].Items.Add((Program.LocalSettings.LastAuxSNTexts[i] == null) ? string.Empty : Program.LocalSettings.LastAuxSNTexts[i]);
|
||||
}
|
||||
|
||||
labels[i].Visible = comboBoxes[i].Visible = column2ComboBoxes[i].Visible = checkBoxes[i].Visible = true;
|
||||
|
||||
enabledComboBoxes.Add(comboBoxes[i]);
|
||||
enabledComboBoxes.Add(column2ComboBoxes[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
Text = Strings.Data;
|
||||
orderGroupBox.Text = Strings.Purchase_order;
|
||||
for (int i = 0; i < textBoxesCount; i++) labels[i].Text = (i + 1).ToString();
|
||||
okButton.Text = Strings.OkBtnText;
|
||||
clearButton.Text = Strings.ClearBtnText;
|
||||
|
||||
column2Label.Text = columnm2Label2.Text = entryFormCfg.Column2Caption;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Load Purchase order combo box items from the LocalSettings PurchaseOrderHistory array
|
||||
/// </summary>
|
||||
/// <param name="orderComboBox">Puchase order ComboBox</param>
|
||||
void PrepareOrderCombo(ComboBox orderComboBox)
|
||||
{
|
||||
for (int i = 0; i < Program.LocalSettings.PurchaseOrderHistoryCount; i++)
|
||||
{
|
||||
orderComboBox.Items.Add(Program.LocalSettings.PurchaseOrderHistory[i]);
|
||||
}
|
||||
|
||||
if (orderComboBox.Items.Count > 0) orderComboBox.Text = orderComboBox.Items[0].ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Load Prefix combo box items from the LocalSettings PrefixHistory array
|
||||
/// </summary>
|
||||
/// <param name="orderComboBox">Prefix ComboBox</param>
|
||||
void PreparePrefixCombo(ComboBox prefixComboBox)
|
||||
{
|
||||
for (int i = 0; i < Program.LocalSettings.PrefixHistoryCount; i++)
|
||||
{
|
||||
prefixComboBox.Items.Add(Program.LocalSettings.PrefixHistory[i]);
|
||||
}
|
||||
|
||||
if (prefixComboBox.Items.Count > 0) prefixComboBox.Text = prefixComboBox.Items[0].ToString();
|
||||
}
|
||||
|
||||
private void okButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
for (int i = 0; i < Math.Min(WMsCount, textBoxesCount); i++)
|
||||
{
|
||||
SNText[i] = comboBoxes[i].Text;
|
||||
suffixText[i] = column2ComboBoxes[i].Text;
|
||||
Column2Text[i] = string.Format("{0}{1}", prefixComboBox.Text, column2ComboBoxes[i].Text);
|
||||
Disabled[i] = !checkBoxes[i].Checked;
|
||||
}
|
||||
|
||||
PurchaseOrder = entryFormCfg.HideOrderSelection ? string.Empty : orderComboBox.Text;
|
||||
Prefix = entryFormCfg.HidePrefix ? string.Empty : prefixComboBox.Text;
|
||||
Program.LocalSettings.UpdateHistory(orderComboBox.Text, ref Program.LocalSettings.PurchaseOrderHistory);
|
||||
Program.LocalSettings.UpdateHistory(prefixComboBox.Text, ref Program.LocalSettings.PrefixHistory);
|
||||
Program.LocalSettings.LastSNTexts = SNText;
|
||||
Program.LocalSettings.LastAuxSNTexts = suffixText;
|
||||
|
||||
completed = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void clearButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
for (int i = 0; i < Math.Min(WMsCount, textBoxesCount); i++)
|
||||
{
|
||||
comboBoxes[i].Text = string.Empty;
|
||||
checkBoxes[i].Checked = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void comboBox1_SelectedIndexChanged(object s, EventArgs e) { if (comboBox1.Text.Equals(comboBox1.Items[0])) UpdateAllCombos(); }
|
||||
private void comboBox2_SelectedIndexChanged(object s, EventArgs e) { if (comboBox2.Text.Equals(comboBox2.Items[0])) UpdateAllCombos(); }
|
||||
private void comboBox3_SelectedIndexChanged(object s, EventArgs e) { if (comboBox3.Text.Equals(comboBox3.Items[0])) UpdateAllCombos(); }
|
||||
private void comboBox4_SelectedIndexChanged(object s, EventArgs e) { if (comboBox4.Text.Equals(comboBox4.Items[0])) UpdateAllCombos(); }
|
||||
private void comboBox5_SelectedIndexChanged(object s, EventArgs e) { if (comboBox5.Text.Equals(comboBox5.Items[0])) UpdateAllCombos(); }
|
||||
private void comboBox6_SelectedIndexChanged(object s, EventArgs e) { if (comboBox6.Text.Equals(comboBox6.Items[0])) UpdateAllCombos(); }
|
||||
private void comboBox7_SelectedIndexChanged(object s, EventArgs e) { if (comboBox7.Text.Equals(comboBox7.Items[0])) UpdateAllCombos(); }
|
||||
private void comboBox8_SelectedIndexChanged(object s, EventArgs e) { if (comboBox8.Text.Equals(comboBox8.Items[0])) UpdateAllCombos(); }
|
||||
private void comboBox9_SelectedIndexChanged(object s, EventArgs e) { if (comboBox9.Text.Equals(comboBox9.Items[0])) UpdateAllCombos(); }
|
||||
private void comboBox10_SelectedIndexChanged(object s, EventArgs e) { if (comboBox10.Text.Equals(comboBox10.Items[0])) UpdateAllCombos(); }
|
||||
private void comboBox11_SelectedIndexChanged(object s, EventArgs e) { if (comboBox11.Text.Equals(comboBox11.Items[0])) UpdateAllCombos(); }
|
||||
private void comboBox12_SelectedIndexChanged(object s, EventArgs e) { if (comboBox12.Text.Equals(comboBox12.Items[0])) UpdateAllCombos(); }
|
||||
private void comboBox13_SelectedIndexChanged(object s, EventArgs e) { if (comboBox13.Text.Equals(comboBox13.Items[0])) UpdateAllCombos(); }
|
||||
private void comboBox14_SelectedIndexChanged(object s, EventArgs e) { if (comboBox14.Text.Equals(comboBox14.Items[0])) UpdateAllCombos(); }
|
||||
private void comboBox15_SelectedIndexChanged(object s, EventArgs e) { if (comboBox15.Text.Equals(comboBox15.Items[0])) UpdateAllCombos(); }
|
||||
private void comboBox16_SelectedIndexChanged(object s, EventArgs e) { if (comboBox16.Text.Equals(comboBox16.Items[0])) UpdateAllCombos(); }
|
||||
private void comboBox17_SelectedIndexChanged(object s, EventArgs e) { if (comboBox17.Text.Equals(comboBox17.Items[0])) UpdateAllCombos(); }
|
||||
private void comboBox18_SelectedIndexChanged(object s, EventArgs e) { if (comboBox18.Text.Equals(comboBox18.Items[0])) UpdateAllCombos(); }
|
||||
private void comboBox19_SelectedIndexChanged(object s, EventArgs e) { if (comboBox19.Text.Equals(comboBox19.Items[0])) UpdateAllCombos(); }
|
||||
private void comboBox20_SelectedIndexChanged(object s, EventArgs e) { if (comboBox20.Text.Equals(comboBox20.Items[0])) UpdateAllCombos(); }
|
||||
private void comboBox21_SelectedIndexChanged(object s, EventArgs e) { if (comboBox21.Text.Equals(comboBox21.Items[0])) UpdateAllCombos(); }
|
||||
private void comboBox22_SelectedIndexChanged(object s, EventArgs e) { if (comboBox22.Text.Equals(comboBox22.Items[0])) UpdateAllCombos(); }
|
||||
private void comboBox23_SelectedIndexChanged(object s, EventArgs e) { if (comboBox23.Text.Equals(comboBox23.Items[0])) UpdateAllCombos(); }
|
||||
private void comboBox24_SelectedIndexChanged(object s, EventArgs e) { if (comboBox24.Text.Equals(comboBox24.Items[0])) UpdateAllCombos(); }
|
||||
private void suffixComboBox1_SelectedIndexChanged(object s, EventArgs e) { if (suffixComboBox1.Text.Equals(suffixComboBox1.Items[0])) UpdateAllCombos(); }
|
||||
private void suffixComboBox2_SelectedIndexChanged(object s, EventArgs e) { if (suffixComboBox2.Text.Equals(suffixComboBox2.Items[0])) UpdateAllCombos(); }
|
||||
private void suffixComboBox3_SelectedIndexChanged(object s, EventArgs e) { if (suffixComboBox3.Text.Equals(suffixComboBox3.Items[0])) UpdateAllCombos(); }
|
||||
private void suffixComboBox4_SelectedIndexChanged(object s, EventArgs e) { if (suffixComboBox4.Text.Equals(suffixComboBox4.Items[0])) UpdateAllCombos(); }
|
||||
private void suffixComboBox5_SelectedIndexChanged(object s, EventArgs e) { if (suffixComboBox5.Text.Equals(suffixComboBox5.Items[0])) UpdateAllCombos(); }
|
||||
private void suffixComboBox6_SelectedIndexChanged(object s, EventArgs e) { if (suffixComboBox6.Text.Equals(suffixComboBox6.Items[0])) UpdateAllCombos(); }
|
||||
private void suffixComboBox7_SelectedIndexChanged(object s, EventArgs e) { if (suffixComboBox7.Text.Equals(suffixComboBox7.Items[0])) UpdateAllCombos(); }
|
||||
private void suffixComboBox8_SelectedIndexChanged(object s, EventArgs e) { if (suffixComboBox8.Text.Equals(suffixComboBox8.Items[0])) UpdateAllCombos(); }
|
||||
private void suffixComboBox9_SelectedIndexChanged(object s, EventArgs e) { if (suffixComboBox9.Text.Equals(suffixComboBox9.Items[0])) UpdateAllCombos(); }
|
||||
private void suffixComboBox10_SelectedIndexChanged(object s, EventArgs e) { if (suffixComboBox10.Text.Equals(suffixComboBox10.Items[0])) UpdateAllCombos(); }
|
||||
private void suffixComboBox11_SelectedIndexChanged(object s, EventArgs e) { if (suffixComboBox11.Text.Equals(suffixComboBox11.Items[0])) UpdateAllCombos(); }
|
||||
private void suffixComboBox12_SelectedIndexChanged(object s, EventArgs e) { if (suffixComboBox12.Text.Equals(suffixComboBox12.Items[0])) UpdateAllCombos(); }
|
||||
private void suffixComboBox13_SelectedIndexChanged(object s, EventArgs e) { if (suffixComboBox13.Text.Equals(suffixComboBox13.Items[0])) UpdateAllCombos(); }
|
||||
private void suffixComboBox14_SelectedIndexChanged(object s, EventArgs e) { if (suffixComboBox14.Text.Equals(suffixComboBox14.Items[0])) UpdateAllCombos(); }
|
||||
private void suffixComboBox15_SelectedIndexChanged(object s, EventArgs e) { if (suffixComboBox15.Text.Equals(suffixComboBox15.Items[0])) UpdateAllCombos(); }
|
||||
private void suffixComboBox16_SelectedIndexChanged(object s, EventArgs e) { if (suffixComboBox16.Text.Equals(suffixComboBox16.Items[0])) UpdateAllCombos(); }
|
||||
private void suffixComboBox17_SelectedIndexChanged(object s, EventArgs e) { if (suffixComboBox17.Text.Equals(suffixComboBox17.Items[0])) UpdateAllCombos(); }
|
||||
private void suffixComboBox18_SelectedIndexChanged(object s, EventArgs e) { if (suffixComboBox18.Text.Equals(suffixComboBox18.Items[0])) UpdateAllCombos(); }
|
||||
private void suffixComboBox19_SelectedIndexChanged(object s, EventArgs e) { if (suffixComboBox19.Text.Equals(suffixComboBox19.Items[0])) UpdateAllCombos(); }
|
||||
private void suffixComboBox20_SelectedIndexChanged(object s, EventArgs e) { if (suffixComboBox20.Text.Equals(suffixComboBox20.Items[0])) UpdateAllCombos(); }
|
||||
private void suffixComboBox21_SelectedIndexChanged(object s, EventArgs e) { if (suffixComboBox21.Text.Equals(suffixComboBox21.Items[0])) UpdateAllCombos(); }
|
||||
private void suffixComboBox22_SelectedIndexChanged(object s, EventArgs e) { if (suffixComboBox22.Text.Equals(suffixComboBox22.Items[0])) UpdateAllCombos(); }
|
||||
private void suffixComboBox23_SelectedIndexChanged(object s, EventArgs e) { if (suffixComboBox23.Text.Equals(suffixComboBox23.Items[0])) UpdateAllCombos(); }
|
||||
private void suffixComboBox24_SelectedIndexChanged(object s, EventArgs e) { if (suffixComboBox24.Text.Equals(suffixComboBox24.Items[0])) UpdateAllCombos(); }
|
||||
|
||||
/// <summary>
|
||||
/// When one combo box is updated using drop-down menu, all combo boxes
|
||||
/// are updated by this function.
|
||||
/// </summary>
|
||||
private void UpdateAllCombos()
|
||||
{
|
||||
for (int i = 0; i < Math.Min(WMsCount, textBoxesCount); i++)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount > i) comboBoxes[i].Text = Program.LocalSettings.LastSNTexts[i];
|
||||
if (Program.LocalSettings.LastAuxSNTextsCount > i) column2ComboBoxes[i].Text = Program.LocalSettings.LastAuxSNTexts[i];
|
||||
checkBoxes[i].Checked = !string.IsNullOrEmpty(comboBoxes[i].Text) || !string.IsNullOrEmpty(column2ComboBoxes[i].Text);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void comboBox1_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox1); }
|
||||
private void comboBox2_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox2); }
|
||||
private void comboBox3_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox3); }
|
||||
private void comboBox4_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox4); }
|
||||
private void comboBox5_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox5); }
|
||||
private void comboBox6_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox6); }
|
||||
private void comboBox7_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox7); }
|
||||
private void comboBox8_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox8); }
|
||||
private void comboBox9_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox9); }
|
||||
private void comboBox10_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox10); }
|
||||
private void comboBox11_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox11); }
|
||||
private void comboBox12_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox12); }
|
||||
private void comboBox13_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox13); }
|
||||
private void comboBox14_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox14); }
|
||||
private void comboBox15_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox15); }
|
||||
private void comboBox16_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox16); }
|
||||
private void comboBox17_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox17); }
|
||||
private void comboBox18_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox18); }
|
||||
private void comboBox19_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox19); }
|
||||
private void comboBox20_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox20); }
|
||||
private void comboBox21_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox21); }
|
||||
private void comboBox22_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox22); }
|
||||
private void comboBox23_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox23); }
|
||||
private void comboBox24_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox24); }
|
||||
private void suffixComboBox1_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, suffixComboBox1); }
|
||||
private void suffixComboBox2_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, suffixComboBox2); }
|
||||
private void suffixComboBox3_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, suffixComboBox3); }
|
||||
private void suffixComboBox4_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, suffixComboBox4); }
|
||||
private void suffixComboBox5_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, suffixComboBox5); }
|
||||
private void suffixComboBox6_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, suffixComboBox6); }
|
||||
private void suffixComboBox7_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, suffixComboBox7); }
|
||||
private void suffixComboBox8_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, suffixComboBox8); }
|
||||
private void suffixComboBox9_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, suffixComboBox9); }
|
||||
private void suffixComboBox10_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, suffixComboBox10); }
|
||||
private void suffixComboBox11_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, suffixComboBox11); }
|
||||
private void suffixComboBox12_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, suffixComboBox12); }
|
||||
private void suffixComboBox13_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, suffixComboBox13); }
|
||||
private void suffixComboBox14_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, suffixComboBox14); }
|
||||
private void suffixComboBox15_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, suffixComboBox15); }
|
||||
private void suffixComboBox16_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, suffixComboBox16); }
|
||||
private void suffixComboBox17_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, suffixComboBox17); }
|
||||
private void suffixComboBox18_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, suffixComboBox18); }
|
||||
private void suffixComboBox19_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, suffixComboBox19); }
|
||||
private void suffixComboBox20_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, suffixComboBox20); }
|
||||
private void suffixComboBox21_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, suffixComboBox21); }
|
||||
private void suffixComboBox22_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, suffixComboBox22); }
|
||||
private void suffixComboBox23_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, suffixComboBox23); }
|
||||
private void suffixComboBox24_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, suffixComboBox24); }
|
||||
|
||||
/// <summary>
|
||||
/// Process a key press within any enabled text boxe
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
/// <param name="currentFocusOwner">TextBox control which received the event</param>
|
||||
private void ProcKeyPress(object sender, KeyPressEventArgs e, ComboBox currentFocusOwner)
|
||||
{
|
||||
if (e.KeyChar == '+')
|
||||
{
|
||||
/// Process '+' key ..... Form completed
|
||||
okButton_Click(sender, e);
|
||||
}
|
||||
if (e.KeyChar == '\r')
|
||||
{
|
||||
/// Process <enter> key ..... Next text field
|
||||
if (enabledComboBoxes.Count < 2) return; /// There is just one enabled textbox
|
||||
|
||||
for (int i = 0; i < enabledComboBoxes.Count; i++)
|
||||
{
|
||||
if (enabledComboBoxes[i] == currentFocusOwner)
|
||||
{
|
||||
/// Change focus to the next enabled text box
|
||||
enabledComboBoxes[(i + 1) % enabledComboBoxes.Count].Focus();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void comboBox1_TextChanged(object sender, EventArgs e) { checkBox1.Checked = true; }
|
||||
private void comboBox2_TextChanged(object sender, EventArgs e) { checkBox2.Checked = true; }
|
||||
private void comboBox3_TextChanged(object sender, EventArgs e) { checkBox3.Checked = true; }
|
||||
private void comboBox4_TextChanged(object sender, EventArgs e) { checkBox4.Checked = true; }
|
||||
private void comboBox5_TextChanged(object sender, EventArgs e) { checkBox5.Checked = true; }
|
||||
private void comboBox6_TextChanged(object sender, EventArgs e) { checkBox6.Checked = true; }
|
||||
private void comboBox7_TextChanged(object sender, EventArgs e) { checkBox7.Checked = true; }
|
||||
private void comboBox8_TextChanged(object sender, EventArgs e) { checkBox8.Checked = true; }
|
||||
private void comboBox9_TextChanged(object sender, EventArgs e) { checkBox9.Checked = true; }
|
||||
private void comboBox10_TextChanged(object sender, EventArgs e) { checkBox10.Checked = true; }
|
||||
private void comboBox11_TextChanged(object sender, EventArgs e) { checkBox11.Checked = true; }
|
||||
private void comboBox12_TextChanged(object sender, EventArgs e) { checkBox12.Checked = true; }
|
||||
private void comboBox13_TextChanged(object sender, EventArgs e) { checkBox13.Checked = true; }
|
||||
private void comboBox14_TextChanged(object sender, EventArgs e) { checkBox14.Checked = true; }
|
||||
private void comboBox15_TextChanged(object sender, EventArgs e) { checkBox15.Checked = true; }
|
||||
private void comboBox16_TextChanged(object sender, EventArgs e) { checkBox16.Checked = true; }
|
||||
private void comboBox17_TextChanged(object sender, EventArgs e) { checkBox17.Checked = true; }
|
||||
private void comboBox18_TextChanged(object sender, EventArgs e) { checkBox18.Checked = true; }
|
||||
private void comboBox19_TextChanged(object sender, EventArgs e) { checkBox19.Checked = true; }
|
||||
private void comboBox20_TextChanged(object sender, EventArgs e) { checkBox20.Checked = true; }
|
||||
private void comboBox21_TextChanged(object sender, EventArgs e) { checkBox21.Checked = true; }
|
||||
private void comboBox22_TextChanged(object sender, EventArgs e) { checkBox22.Checked = true; }
|
||||
private void comboBox23_TextChanged(object sender, EventArgs e) { checkBox23.Checked = true; }
|
||||
private void comboBox24_TextChanged(object sender, EventArgs e) { checkBox24.Checked = true; }
|
||||
private void suffixComboBox1_TextChanged(object sender, EventArgs e) { checkBox1.Checked = true; }
|
||||
private void suffixComboBox2_TextChanged(object sender, EventArgs e) { checkBox2.Checked = true; }
|
||||
private void suffixComboBox3_TextChanged(object sender, EventArgs e) { checkBox3.Checked = true; }
|
||||
private void suffixComboBox4_TextChanged(object sender, EventArgs e) { checkBox4.Checked = true; }
|
||||
private void suffixComboBox5_TextChanged(object sender, EventArgs e) { checkBox5.Checked = true; }
|
||||
private void suffixComboBox6_TextChanged(object sender, EventArgs e) { checkBox6.Checked = true; }
|
||||
private void suffixComboBox7_TextChanged(object sender, EventArgs e) { checkBox7.Checked = true; }
|
||||
private void suffixComboBox8_TextChanged(object sender, EventArgs e) { checkBox8.Checked = true; }
|
||||
private void suffixComboBox9_TextChanged(object sender, EventArgs e) { checkBox9.Checked = true; }
|
||||
private void suffixComboBox10_TextChanged(object sender, EventArgs e) { checkBox10.Checked = true; }
|
||||
private void suffixComboBox11_TextChanged(object sender, EventArgs e) { checkBox11.Checked = true; }
|
||||
private void suffixComboBox12_TextChanged(object sender, EventArgs e) { checkBox12.Checked = true; }
|
||||
private void suffixComboBox13_TextChanged(object sender, EventArgs e) { checkBox13.Checked = true; }
|
||||
private void suffixComboBox14_TextChanged(object sender, EventArgs e) { checkBox14.Checked = true; }
|
||||
private void suffixComboBox15_TextChanged(object sender, EventArgs e) { checkBox15.Checked = true; }
|
||||
private void suffixComboBox16_TextChanged(object sender, EventArgs e) { checkBox16.Checked = true; }
|
||||
private void suffixComboBox17_TextChanged(object sender, EventArgs e) { checkBox17.Checked = true; }
|
||||
private void suffixComboBox18_TextChanged(object sender, EventArgs e) { checkBox18.Checked = true; }
|
||||
private void suffixComboBox19_TextChanged(object sender, EventArgs e) { checkBox19.Checked = true; }
|
||||
private void suffixComboBox20_TextChanged(object sender, EventArgs e) { checkBox20.Checked = true; }
|
||||
private void suffixComboBox21_TextChanged(object sender, EventArgs e) { checkBox21.Checked = true; }
|
||||
private void suffixComboBox22_TextChanged(object sender, EventArgs e) { checkBox22.Checked = true; }
|
||||
private void suffixComboBox23_TextChanged(object sender, EventArgs e) { checkBox23.Checked = true; }
|
||||
private void suffixComboBox24_TextChanged(object sender, EventArgs e) { checkBox24.Checked = true; }
|
||||
|
||||
|
||||
#region Forced close handling
|
||||
|
||||
public void StartForceCloseHandler()
|
||||
{
|
||||
UiBridge.Bridge.CloseModelessFormHandler += delegate(object sender, EventArgs args)
|
||||
{
|
||||
if (InvokeRequired) { Invoke(new EventHandler<EventArgs>(OnForceClose), sender, args); }
|
||||
else OnForceClose(sender, args);
|
||||
};
|
||||
}
|
||||
|
||||
private void OnForceClose(object sender, EventArgs args)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
3306
TBF/Rig/DataEntry/Double24/CycleBeginningForm.resx
Normal file
3306
TBF/Rig/DataEntry/Double24/CycleBeginningForm.resx
Normal file
File diff suppressed because it is too large
Load Diff
652
TBF/Rig/DataEntry/Double24/CycleEndForm.Designer.cs
generated
Normal file
652
TBF/Rig/DataEntry/Double24/CycleEndForm.Designer.cs
generated
Normal file
@ -0,0 +1,652 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
namespace TBF.Rig.DataEntry.Double24
|
||||
{
|
||||
partial class CycleEndForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.textBox2 = new System.Windows.Forms.TextBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.okButton = new System.Windows.Forms.Button();
|
||||
this.textBox3 = new System.Windows.Forms.TextBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.textBox4 = new System.Windows.Forms.TextBox();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.textBox5 = new System.Windows.Forms.TextBox();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.textBox6 = new System.Windows.Forms.TextBox();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.textBox7 = new System.Windows.Forms.TextBox();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.textBox8 = new System.Windows.Forms.TextBox();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.textBox9 = new System.Windows.Forms.TextBox();
|
||||
this.label9 = new System.Windows.Forms.Label();
|
||||
this.textBox10 = new System.Windows.Forms.TextBox();
|
||||
this.label10 = new System.Windows.Forms.Label();
|
||||
this.textBox11 = new System.Windows.Forms.TextBox();
|
||||
this.label11 = new System.Windows.Forms.Label();
|
||||
this.textBox12 = new System.Windows.Forms.TextBox();
|
||||
this.label12 = new System.Windows.Forms.Label();
|
||||
this.textBox13 = new System.Windows.Forms.TextBox();
|
||||
this.label13 = new System.Windows.Forms.Label();
|
||||
this.textBox14 = new System.Windows.Forms.TextBox();
|
||||
this.label14 = new System.Windows.Forms.Label();
|
||||
this.textBox15 = new System.Windows.Forms.TextBox();
|
||||
this.label15 = new System.Windows.Forms.Label();
|
||||
this.textBox16 = new System.Windows.Forms.TextBox();
|
||||
this.label16 = new System.Windows.Forms.Label();
|
||||
this.textBox17 = new System.Windows.Forms.TextBox();
|
||||
this.label17 = new System.Windows.Forms.Label();
|
||||
this.textBox18 = new System.Windows.Forms.TextBox();
|
||||
this.label18 = new System.Windows.Forms.Label();
|
||||
this.textBox19 = new System.Windows.Forms.TextBox();
|
||||
this.label19 = new System.Windows.Forms.Label();
|
||||
this.textBox20 = new System.Windows.Forms.TextBox();
|
||||
this.label20 = new System.Windows.Forms.Label();
|
||||
this.textBox21 = new System.Windows.Forms.TextBox();
|
||||
this.label21 = new System.Windows.Forms.Label();
|
||||
this.textBox22 = new System.Windows.Forms.TextBox();
|
||||
this.label22 = new System.Windows.Forms.Label();
|
||||
this.textBox23 = new System.Windows.Forms.TextBox();
|
||||
this.label23 = new System.Windows.Forms.Label();
|
||||
this.textBox24 = new System.Windows.Forms.TextBox();
|
||||
this.label24 = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// textBox2
|
||||
//
|
||||
this.textBox2.Location = new System.Drawing.Point(205, 66);
|
||||
this.textBox2.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
|
||||
this.textBox2.Name = "textBox2";
|
||||
this.textBox2.Size = new System.Drawing.Size(169, 27);
|
||||
this.textBox2.TabIndex = 1;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(38, 71);
|
||||
this.label2.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(62, 18);
|
||||
this.label2.TabIndex = 0;
|
||||
this.label2.Text = "Stand:";
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.Location = new System.Drawing.Point(205, 30);
|
||||
this.textBox1.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(169, 27);
|
||||
this.textBox1.TabIndex = 1;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(38, 35);
|
||||
this.label1.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(62, 18);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "Stand:";
|
||||
//
|
||||
// okButton
|
||||
//
|
||||
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.okButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.okButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.okButton.Location = new System.Drawing.Point(832, 30);
|
||||
this.okButton.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
|
||||
this.okButton.Name = "okButton";
|
||||
this.okButton.Size = new System.Drawing.Size(90, 60);
|
||||
this.okButton.TabIndex = 7;
|
||||
this.okButton.Text = "OK";
|
||||
this.okButton.UseVisualStyleBackColor = true;
|
||||
this.okButton.Click += new System.EventHandler(this.okButton_Click);
|
||||
//
|
||||
// textBox3
|
||||
//
|
||||
this.textBox3.Location = new System.Drawing.Point(205, 102);
|
||||
this.textBox3.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
|
||||
this.textBox3.Name = "textBox3";
|
||||
this.textBox3.Size = new System.Drawing.Size(169, 27);
|
||||
this.textBox3.TabIndex = 1;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(38, 107);
|
||||
this.label3.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(62, 18);
|
||||
this.label3.TabIndex = 0;
|
||||
this.label3.Text = "Stand:";
|
||||
//
|
||||
// textBox4
|
||||
//
|
||||
this.textBox4.Location = new System.Drawing.Point(205, 138);
|
||||
this.textBox4.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
|
||||
this.textBox4.Name = "textBox4";
|
||||
this.textBox4.Size = new System.Drawing.Size(169, 27);
|
||||
this.textBox4.TabIndex = 1;
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(38, 143);
|
||||
this.label4.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(62, 18);
|
||||
this.label4.TabIndex = 0;
|
||||
this.label4.Text = "Stand:";
|
||||
//
|
||||
// textBox5
|
||||
//
|
||||
this.textBox5.Location = new System.Drawing.Point(205, 174);
|
||||
this.textBox5.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
|
||||
this.textBox5.Name = "textBox5";
|
||||
this.textBox5.Size = new System.Drawing.Size(169, 27);
|
||||
this.textBox5.TabIndex = 1;
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(38, 179);
|
||||
this.label5.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(62, 18);
|
||||
this.label5.TabIndex = 0;
|
||||
this.label5.Text = "Stand:";
|
||||
//
|
||||
// textBox6
|
||||
//
|
||||
this.textBox6.Location = new System.Drawing.Point(205, 210);
|
||||
this.textBox6.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
|
||||
this.textBox6.Name = "textBox6";
|
||||
this.textBox6.Size = new System.Drawing.Size(169, 27);
|
||||
this.textBox6.TabIndex = 1;
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(38, 215);
|
||||
this.label6.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(62, 18);
|
||||
this.label6.TabIndex = 0;
|
||||
this.label6.Text = "Stand:";
|
||||
//
|
||||
// textBox7
|
||||
//
|
||||
this.textBox7.Location = new System.Drawing.Point(205, 246);
|
||||
this.textBox7.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
|
||||
this.textBox7.Name = "textBox7";
|
||||
this.textBox7.Size = new System.Drawing.Size(169, 27);
|
||||
this.textBox7.TabIndex = 9;
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(38, 251);
|
||||
this.label7.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(62, 18);
|
||||
this.label7.TabIndex = 8;
|
||||
this.label7.Text = "Stand:";
|
||||
//
|
||||
// textBox8
|
||||
//
|
||||
this.textBox8.Location = new System.Drawing.Point(205, 282);
|
||||
this.textBox8.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
|
||||
this.textBox8.Name = "textBox8";
|
||||
this.textBox8.Size = new System.Drawing.Size(169, 27);
|
||||
this.textBox8.TabIndex = 11;
|
||||
//
|
||||
// label8
|
||||
//
|
||||
this.label8.AutoSize = true;
|
||||
this.label8.Location = new System.Drawing.Point(38, 287);
|
||||
this.label8.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
|
||||
this.label8.Name = "label8";
|
||||
this.label8.Size = new System.Drawing.Size(62, 18);
|
||||
this.label8.TabIndex = 10;
|
||||
this.label8.Text = "Stand:";
|
||||
//
|
||||
// textBox9
|
||||
//
|
||||
this.textBox9.Location = new System.Drawing.Point(205, 318);
|
||||
this.textBox9.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
|
||||
this.textBox9.Name = "textBox9";
|
||||
this.textBox9.Size = new System.Drawing.Size(169, 27);
|
||||
this.textBox9.TabIndex = 13;
|
||||
//
|
||||
// label9
|
||||
//
|
||||
this.label9.AutoSize = true;
|
||||
this.label9.Location = new System.Drawing.Point(38, 323);
|
||||
this.label9.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
|
||||
this.label9.Name = "label9";
|
||||
this.label9.Size = new System.Drawing.Size(62, 18);
|
||||
this.label9.TabIndex = 12;
|
||||
this.label9.Text = "Stand:";
|
||||
//
|
||||
// textBox10
|
||||
//
|
||||
this.textBox10.Location = new System.Drawing.Point(205, 354);
|
||||
this.textBox10.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
|
||||
this.textBox10.Name = "textBox10";
|
||||
this.textBox10.Size = new System.Drawing.Size(169, 27);
|
||||
this.textBox10.TabIndex = 15;
|
||||
//
|
||||
// label10
|
||||
//
|
||||
this.label10.AutoSize = true;
|
||||
this.label10.Location = new System.Drawing.Point(38, 359);
|
||||
this.label10.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
|
||||
this.label10.Name = "label10";
|
||||
this.label10.Size = new System.Drawing.Size(62, 18);
|
||||
this.label10.TabIndex = 14;
|
||||
this.label10.Text = "Stand:";
|
||||
//
|
||||
// textBox11
|
||||
//
|
||||
this.textBox11.Location = new System.Drawing.Point(205, 390);
|
||||
this.textBox11.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
|
||||
this.textBox11.Name = "textBox11";
|
||||
this.textBox11.Size = new System.Drawing.Size(169, 27);
|
||||
this.textBox11.TabIndex = 17;
|
||||
//
|
||||
// label11
|
||||
//
|
||||
this.label11.AutoSize = true;
|
||||
this.label11.Location = new System.Drawing.Point(38, 395);
|
||||
this.label11.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
|
||||
this.label11.Name = "label11";
|
||||
this.label11.Size = new System.Drawing.Size(62, 18);
|
||||
this.label11.TabIndex = 16;
|
||||
this.label11.Text = "Stand:";
|
||||
//
|
||||
// textBox12
|
||||
//
|
||||
this.textBox12.Location = new System.Drawing.Point(205, 426);
|
||||
this.textBox12.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
|
||||
this.textBox12.Name = "textBox12";
|
||||
this.textBox12.Size = new System.Drawing.Size(169, 27);
|
||||
this.textBox12.TabIndex = 19;
|
||||
//
|
||||
// label12
|
||||
//
|
||||
this.label12.AutoSize = true;
|
||||
this.label12.Location = new System.Drawing.Point(38, 431);
|
||||
this.label12.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
|
||||
this.label12.Name = "label12";
|
||||
this.label12.Size = new System.Drawing.Size(62, 18);
|
||||
this.label12.TabIndex = 18;
|
||||
this.label12.Text = "Stand:";
|
||||
//
|
||||
// textBox13
|
||||
//
|
||||
this.textBox13.Location = new System.Drawing.Point(623, 30);
|
||||
this.textBox13.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
|
||||
this.textBox13.Name = "textBox13";
|
||||
this.textBox13.Size = new System.Drawing.Size(169, 27);
|
||||
this.textBox13.TabIndex = 21;
|
||||
//
|
||||
// label13
|
||||
//
|
||||
this.label13.AutoSize = true;
|
||||
this.label13.Location = new System.Drawing.Point(456, 35);
|
||||
this.label13.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
|
||||
this.label13.Name = "label13";
|
||||
this.label13.Size = new System.Drawing.Size(62, 18);
|
||||
this.label13.TabIndex = 20;
|
||||
this.label13.Text = "Stand:";
|
||||
//
|
||||
// textBox14
|
||||
//
|
||||
this.textBox14.Location = new System.Drawing.Point(623, 66);
|
||||
this.textBox14.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
|
||||
this.textBox14.Name = "textBox14";
|
||||
this.textBox14.Size = new System.Drawing.Size(169, 27);
|
||||
this.textBox14.TabIndex = 23;
|
||||
//
|
||||
// label14
|
||||
//
|
||||
this.label14.AutoSize = true;
|
||||
this.label14.Location = new System.Drawing.Point(456, 71);
|
||||
this.label14.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
|
||||
this.label14.Name = "label14";
|
||||
this.label14.Size = new System.Drawing.Size(62, 18);
|
||||
this.label14.TabIndex = 22;
|
||||
this.label14.Text = "Stand:";
|
||||
//
|
||||
// textBox15
|
||||
//
|
||||
this.textBox15.Location = new System.Drawing.Point(623, 102);
|
||||
this.textBox15.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
|
||||
this.textBox15.Name = "textBox15";
|
||||
this.textBox15.Size = new System.Drawing.Size(169, 27);
|
||||
this.textBox15.TabIndex = 25;
|
||||
//
|
||||
// label15
|
||||
//
|
||||
this.label15.AutoSize = true;
|
||||
this.label15.Location = new System.Drawing.Point(456, 107);
|
||||
this.label15.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
|
||||
this.label15.Name = "label15";
|
||||
this.label15.Size = new System.Drawing.Size(62, 18);
|
||||
this.label15.TabIndex = 24;
|
||||
this.label15.Text = "Stand:";
|
||||
//
|
||||
// textBox16
|
||||
//
|
||||
this.textBox16.Location = new System.Drawing.Point(623, 138);
|
||||
this.textBox16.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
|
||||
this.textBox16.Name = "textBox16";
|
||||
this.textBox16.Size = new System.Drawing.Size(169, 27);
|
||||
this.textBox16.TabIndex = 27;
|
||||
//
|
||||
// label16
|
||||
//
|
||||
this.label16.AutoSize = true;
|
||||
this.label16.Location = new System.Drawing.Point(456, 143);
|
||||
this.label16.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
|
||||
this.label16.Name = "label16";
|
||||
this.label16.Size = new System.Drawing.Size(62, 18);
|
||||
this.label16.TabIndex = 26;
|
||||
this.label16.Text = "Stand:";
|
||||
//
|
||||
// textBox17
|
||||
//
|
||||
this.textBox17.Location = new System.Drawing.Point(623, 174);
|
||||
this.textBox17.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
|
||||
this.textBox17.Name = "textBox17";
|
||||
this.textBox17.Size = new System.Drawing.Size(169, 27);
|
||||
this.textBox17.TabIndex = 29;
|
||||
//
|
||||
// label17
|
||||
//
|
||||
this.label17.AutoSize = true;
|
||||
this.label17.Location = new System.Drawing.Point(456, 179);
|
||||
this.label17.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
|
||||
this.label17.Name = "label17";
|
||||
this.label17.Size = new System.Drawing.Size(62, 18);
|
||||
this.label17.TabIndex = 28;
|
||||
this.label17.Text = "Stand:";
|
||||
//
|
||||
// textBox18
|
||||
//
|
||||
this.textBox18.Location = new System.Drawing.Point(623, 210);
|
||||
this.textBox18.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
|
||||
this.textBox18.Name = "textBox18";
|
||||
this.textBox18.Size = new System.Drawing.Size(169, 27);
|
||||
this.textBox18.TabIndex = 31;
|
||||
//
|
||||
// label18
|
||||
//
|
||||
this.label18.AutoSize = true;
|
||||
this.label18.Location = new System.Drawing.Point(456, 215);
|
||||
this.label18.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
|
||||
this.label18.Name = "label18";
|
||||
this.label18.Size = new System.Drawing.Size(62, 18);
|
||||
this.label18.TabIndex = 30;
|
||||
this.label18.Text = "Stand:";
|
||||
//
|
||||
// textBox19
|
||||
//
|
||||
this.textBox19.Location = new System.Drawing.Point(623, 246);
|
||||
this.textBox19.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
|
||||
this.textBox19.Name = "textBox19";
|
||||
this.textBox19.Size = new System.Drawing.Size(169, 27);
|
||||
this.textBox19.TabIndex = 33;
|
||||
//
|
||||
// label19
|
||||
//
|
||||
this.label19.AutoSize = true;
|
||||
this.label19.Location = new System.Drawing.Point(456, 251);
|
||||
this.label19.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
|
||||
this.label19.Name = "label19";
|
||||
this.label19.Size = new System.Drawing.Size(62, 18);
|
||||
this.label19.TabIndex = 32;
|
||||
this.label19.Text = "Stand:";
|
||||
//
|
||||
// textBox20
|
||||
//
|
||||
this.textBox20.Location = new System.Drawing.Point(623, 282);
|
||||
this.textBox20.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
|
||||
this.textBox20.Name = "textBox20";
|
||||
this.textBox20.Size = new System.Drawing.Size(169, 27);
|
||||
this.textBox20.TabIndex = 35;
|
||||
//
|
||||
// label20
|
||||
//
|
||||
this.label20.AutoSize = true;
|
||||
this.label20.Location = new System.Drawing.Point(456, 287);
|
||||
this.label20.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
|
||||
this.label20.Name = "label20";
|
||||
this.label20.Size = new System.Drawing.Size(62, 18);
|
||||
this.label20.TabIndex = 34;
|
||||
this.label20.Text = "Stand:";
|
||||
//
|
||||
// textBox21
|
||||
//
|
||||
this.textBox21.Location = new System.Drawing.Point(623, 318);
|
||||
this.textBox21.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
|
||||
this.textBox21.Name = "textBox21";
|
||||
this.textBox21.Size = new System.Drawing.Size(169, 27);
|
||||
this.textBox21.TabIndex = 37;
|
||||
//
|
||||
// label21
|
||||
//
|
||||
this.label21.AutoSize = true;
|
||||
this.label21.Location = new System.Drawing.Point(456, 323);
|
||||
this.label21.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
|
||||
this.label21.Name = "label21";
|
||||
this.label21.Size = new System.Drawing.Size(62, 18);
|
||||
this.label21.TabIndex = 36;
|
||||
this.label21.Text = "Stand:";
|
||||
//
|
||||
// textBox22
|
||||
//
|
||||
this.textBox22.Location = new System.Drawing.Point(623, 354);
|
||||
this.textBox22.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
|
||||
this.textBox22.Name = "textBox22";
|
||||
this.textBox22.Size = new System.Drawing.Size(169, 27);
|
||||
this.textBox22.TabIndex = 39;
|
||||
//
|
||||
// label22
|
||||
//
|
||||
this.label22.AutoSize = true;
|
||||
this.label22.Location = new System.Drawing.Point(456, 359);
|
||||
this.label22.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
|
||||
this.label22.Name = "label22";
|
||||
this.label22.Size = new System.Drawing.Size(62, 18);
|
||||
this.label22.TabIndex = 38;
|
||||
this.label22.Text = "Stand:";
|
||||
//
|
||||
// textBox23
|
||||
//
|
||||
this.textBox23.Location = new System.Drawing.Point(623, 390);
|
||||
this.textBox23.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
|
||||
this.textBox23.Name = "textBox23";
|
||||
this.textBox23.Size = new System.Drawing.Size(169, 27);
|
||||
this.textBox23.TabIndex = 41;
|
||||
//
|
||||
// label23
|
||||
//
|
||||
this.label23.AutoSize = true;
|
||||
this.label23.Location = new System.Drawing.Point(456, 395);
|
||||
this.label23.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
|
||||
this.label23.Name = "label23";
|
||||
this.label23.Size = new System.Drawing.Size(62, 18);
|
||||
this.label23.TabIndex = 40;
|
||||
this.label23.Text = "Stand:";
|
||||
//
|
||||
// textBox24
|
||||
//
|
||||
this.textBox24.Location = new System.Drawing.Point(623, 426);
|
||||
this.textBox24.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
|
||||
this.textBox24.Name = "textBox24";
|
||||
this.textBox24.Size = new System.Drawing.Size(169, 27);
|
||||
this.textBox24.TabIndex = 43;
|
||||
//
|
||||
// label24
|
||||
//
|
||||
this.label24.AutoSize = true;
|
||||
this.label24.Location = new System.Drawing.Point(456, 431);
|
||||
this.label24.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
|
||||
this.label24.Name = "label24";
|
||||
this.label24.Size = new System.Drawing.Size(62, 18);
|
||||
this.label24.TabIndex = 42;
|
||||
this.label24.Text = "Stand:";
|
||||
//
|
||||
// CycleEndForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 18F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.DarkGray;
|
||||
this.ClientSize = new System.Drawing.Size(959, 489);
|
||||
this.Controls.Add(this.textBox24);
|
||||
this.Controls.Add(this.label24);
|
||||
this.Controls.Add(this.textBox23);
|
||||
this.Controls.Add(this.label23);
|
||||
this.Controls.Add(this.textBox22);
|
||||
this.Controls.Add(this.label22);
|
||||
this.Controls.Add(this.textBox21);
|
||||
this.Controls.Add(this.label21);
|
||||
this.Controls.Add(this.textBox20);
|
||||
this.Controls.Add(this.label20);
|
||||
this.Controls.Add(this.textBox19);
|
||||
this.Controls.Add(this.label19);
|
||||
this.Controls.Add(this.textBox18);
|
||||
this.Controls.Add(this.label18);
|
||||
this.Controls.Add(this.textBox17);
|
||||
this.Controls.Add(this.label17);
|
||||
this.Controls.Add(this.textBox16);
|
||||
this.Controls.Add(this.label16);
|
||||
this.Controls.Add(this.textBox15);
|
||||
this.Controls.Add(this.label15);
|
||||
this.Controls.Add(this.textBox14);
|
||||
this.Controls.Add(this.label14);
|
||||
this.Controls.Add(this.textBox13);
|
||||
this.Controls.Add(this.label13);
|
||||
this.Controls.Add(this.textBox12);
|
||||
this.Controls.Add(this.label12);
|
||||
this.Controls.Add(this.textBox11);
|
||||
this.Controls.Add(this.label11);
|
||||
this.Controls.Add(this.textBox10);
|
||||
this.Controls.Add(this.label10);
|
||||
this.Controls.Add(this.textBox9);
|
||||
this.Controls.Add(this.label9);
|
||||
this.Controls.Add(this.textBox8);
|
||||
this.Controls.Add(this.label8);
|
||||
this.Controls.Add(this.textBox7);
|
||||
this.Controls.Add(this.label7);
|
||||
this.Controls.Add(this.textBox6);
|
||||
this.Controls.Add(this.label6);
|
||||
this.Controls.Add(this.textBox5);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.textBox4);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.textBox3);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.textBox2);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.textBox1);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.okButton);
|
||||
this.Font = new System.Drawing.Font("Verdana", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
|
||||
this.Name = "CycleEndForm";
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.Text = "Daten";
|
||||
this.TopMost = true;
|
||||
this.Load += new System.EventHandler(this.CycleEndForm_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox textBox2;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Button okButton;
|
||||
private System.Windows.Forms.TextBox textBox3;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.TextBox textBox4;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.TextBox textBox5;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.TextBox textBox6;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.TextBox textBox7;
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.TextBox textBox8;
|
||||
private System.Windows.Forms.Label label8;
|
||||
private System.Windows.Forms.TextBox textBox9;
|
||||
private System.Windows.Forms.Label label9;
|
||||
private System.Windows.Forms.TextBox textBox10;
|
||||
private System.Windows.Forms.Label label10;
|
||||
private System.Windows.Forms.TextBox textBox11;
|
||||
private System.Windows.Forms.Label label11;
|
||||
private System.Windows.Forms.TextBox textBox12;
|
||||
private System.Windows.Forms.Label label12;
|
||||
private System.Windows.Forms.TextBox textBox13;
|
||||
private System.Windows.Forms.Label label13;
|
||||
private System.Windows.Forms.TextBox textBox14;
|
||||
private System.Windows.Forms.Label label14;
|
||||
private System.Windows.Forms.TextBox textBox15;
|
||||
private System.Windows.Forms.Label label15;
|
||||
private System.Windows.Forms.TextBox textBox16;
|
||||
private System.Windows.Forms.Label label16;
|
||||
private System.Windows.Forms.TextBox textBox17;
|
||||
private System.Windows.Forms.Label label17;
|
||||
private System.Windows.Forms.TextBox textBox18;
|
||||
private System.Windows.Forms.Label label18;
|
||||
private System.Windows.Forms.TextBox textBox19;
|
||||
private System.Windows.Forms.Label label19;
|
||||
private System.Windows.Forms.TextBox textBox20;
|
||||
private System.Windows.Forms.Label label20;
|
||||
private System.Windows.Forms.TextBox textBox21;
|
||||
private System.Windows.Forms.Label label21;
|
||||
private System.Windows.Forms.TextBox textBox22;
|
||||
private System.Windows.Forms.Label label22;
|
||||
private System.Windows.Forms.TextBox textBox23;
|
||||
private System.Windows.Forms.Label label23;
|
||||
private System.Windows.Forms.TextBox textBox24;
|
||||
private System.Windows.Forms.Label label24;
|
||||
|
||||
}
|
||||
}
|
||||
155
TBF/Rig/DataEntry/Double24/CycleEndForm.cs
Normal file
155
TBF/Rig/DataEntry/Double24/CycleEndForm.cs
Normal file
@ -0,0 +1,155 @@
|
||||
///
|
||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.Rig.DataEntry.Double24
|
||||
{
|
||||
public partial class CycleEndForm : Form, GenericDevices.IHasCompleted
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(CycleEndForm));
|
||||
|
||||
/// <summary> Number of text boxes for serial numbers </summary>
|
||||
public readonly int WMsCount;
|
||||
readonly int lineSize;
|
||||
|
||||
// To be retrieved after the form closes
|
||||
public string[] EndStateText;
|
||||
|
||||
// Set to 'true' when the form closes
|
||||
public bool Completed { get { return completed; } }
|
||||
bool completed;
|
||||
|
||||
int textBoxesCount;
|
||||
Label[] labels;
|
||||
TextBox[] textBoxes;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
|
||||
public CycleEndForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
ControlBox = false;
|
||||
|
||||
labels = new Label[]
|
||||
{
|
||||
label1, label2, label3, label4, label5, label6, label7, label8, label9, label10,
|
||||
label11, label12, label13, label14, label15, label16, label17, label18, label19, label20,
|
||||
label21, label22, label23, label24,
|
||||
};
|
||||
textBoxes = new TextBox[]
|
||||
{
|
||||
textBox1, textBox2, textBox3, textBox4, textBox5, textBox6,
|
||||
textBox7, textBox8, textBox9, textBox10, textBox11, textBox12,
|
||||
textBox13, textBox14, textBox15, textBox16, textBox17, textBox18,
|
||||
textBox19, textBox20, textBox21, textBox22, textBox23, textBox24,
|
||||
};
|
||||
textBoxesCount = textBoxes.Length;
|
||||
this.WMsCount = textBoxesCount;
|
||||
this.lineSize = textBoxesCount / 2;
|
||||
|
||||
completed = false;
|
||||
StartForceCloseHandler();
|
||||
}
|
||||
|
||||
/// <summary> Parameterless constructor for 3 watermeters </summary>
|
||||
public CycleEndForm(int waterMetersCount, int lineSize)
|
||||
: this()
|
||||
{
|
||||
this.WMsCount = waterMetersCount;
|
||||
this.lineSize = lineSize;
|
||||
ShuffleTextBoxes(waterMetersCount, lineSize);
|
||||
EndStateText = new string[WMsCount];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Make sure the layout of labels/text boxes on the screen
|
||||
/// corresponds to the layout of watermeters of the test bench.
|
||||
/// </summary>
|
||||
/// <param name="wmsCount">Number of watermeters</param>
|
||||
/// <param name="lineSize">Number of watermeters in one line</param>
|
||||
void ShuffleTextBoxes(int wmsCount, int lineSize)
|
||||
{
|
||||
if (wmsCount < textBoxesCount && lineSize > 0)
|
||||
{
|
||||
int nrLines = (wmsCount + lineSize - 1) / lineSize;
|
||||
int gap = (textBoxesCount - wmsCount) / nrLines;
|
||||
|
||||
int dest = 0;
|
||||
for (int l = 0; l < nrLines; l++)
|
||||
{
|
||||
for (int i = 0; i < lineSize; i++)
|
||||
{
|
||||
labels[dest] = labels[l * lineSize + l * gap + i];
|
||||
textBoxes[dest] = textBoxes[l * lineSize + l * gap + i];
|
||||
dest++;
|
||||
}
|
||||
}
|
||||
textBoxesCount = wmsCount;
|
||||
}
|
||||
}
|
||||
|
||||
private void CycleEndForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
Localize();
|
||||
|
||||
Height = 60 + 36 * lineSize;
|
||||
|
||||
for (int i = 0; i < textBoxesCount; i++)
|
||||
{
|
||||
if (i >= WMsCount)
|
||||
{
|
||||
labels[i].Visible = false;
|
||||
textBoxes[i].Visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
Text = Strings.Data;
|
||||
okButton.Text = Strings.OkBtnText;
|
||||
|
||||
for (int i = 0; i < WMsCount; i++)
|
||||
{
|
||||
labels[i].Text = string.Format("{0} {1}:", Strings.Water_Meter, (i + 1).ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private void okButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
for (int i = 0; i < WMsCount; i++)
|
||||
{
|
||||
EndStateText[i] = textBoxes[i].Text;
|
||||
}
|
||||
|
||||
completed = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
#region Forced close handling
|
||||
|
||||
public void StartForceCloseHandler()
|
||||
{
|
||||
UiBridge.Bridge.CloseModelessFormHandler += delegate(object sender, EventArgs args)
|
||||
{
|
||||
if (InvokeRequired) { Invoke(new EventHandler<EventArgs>(OnForceClose), sender, args); }
|
||||
else OnForceClose(sender, args);
|
||||
};
|
||||
}
|
||||
|
||||
void OnForceClose(object sender, EventArgs args)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
120
TBF/Rig/DataEntry/Double24/CycleEndForm.resx
Normal file
120
TBF/Rig/DataEntry/Double24/CycleEndForm.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
20
TBF/Rig/DataEntry/Double24/EntryForm.cs
Normal file
20
TBF/Rig/DataEntry/Double24/EntryForm.cs
Normal file
@ -0,0 +1,20 @@
|
||||
///
|
||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using TBF.Rig.GenericDevices;
|
||||
|
||||
namespace TBF.Rig.DataEntry.Double24
|
||||
{
|
||||
public class EntryForm : EntryFormNoStartEnd, IHasWMStatesForm
|
||||
{
|
||||
public EntryForm()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
public EntryForm(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
206
TBF/Rig/DataEntry/Double24/EntryFormCfg.cs
Normal file
206
TBF/Rig/DataEntry/Double24/EntryFormCfg.cs
Normal file
@ -0,0 +1,206 @@
|
||||
///
|
||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
using Common;
|
||||
using Config;
|
||||
using Config.Entities;
|
||||
using TBF.Resources;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
namespace TBF.Rig.DataEntry.Double24
|
||||
{
|
||||
public class EntryFormCfg : ComponentCfgBase, Generic.IComponentCfg, IParamsProvider
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(EntryFormCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities)
|
||||
{
|
||||
return new Configs.ParamsProvider.ComponentCfgCtrl(this, null);
|
||||
}
|
||||
|
||||
///
|
||||
/// Serialized parameters
|
||||
///
|
||||
public bool EnterSerialNrsAtTheEnd;
|
||||
public bool ShowCycleEndForm;
|
||||
public bool HideOrderSelection;
|
||||
public bool HidePrefix;
|
||||
public string Column2Caption;
|
||||
public Col2Dest Column2Destination;
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
EntryFormCfg() { }
|
||||
|
||||
public EntryFormCfg(IComponentFactory factory, string name)
|
||||
: this()
|
||||
{
|
||||
this.Factory = factory;
|
||||
this.Name = name;
|
||||
ParentName = string.Empty;
|
||||
InitializeAll();
|
||||
}
|
||||
|
||||
public string ComponentName { get { return Name; } }
|
||||
|
||||
public void InitializeAll()
|
||||
{
|
||||
EnterSerialNrsAtTheEnd = false;
|
||||
ShowCycleEndForm = false;
|
||||
HideOrderSelection = false;
|
||||
HidePrefix = true;
|
||||
Column2Caption = "Radio address";
|
||||
Column2Destination = Col2Dest.RadioAddress;
|
||||
}
|
||||
|
||||
string[] paramNames = new string[]
|
||||
{
|
||||
Strings.Enter_SNs_at_the_end,
|
||||
Strings.Show_cycle_end_form,
|
||||
"Hide order selection",
|
||||
"Hide prefix selection",
|
||||
"Column 2 caption",
|
||||
"Column 2 destination",
|
||||
};
|
||||
public string ParamName(int i) { return paramNames[i]; }
|
||||
public int ParamsCount() { return paramNames.Length; }
|
||||
|
||||
public ICollection<string> ParamValues(int i)
|
||||
{
|
||||
var list = new List<string>();
|
||||
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
return new string[] { Strings.yes, Strings.no };
|
||||
case 4:
|
||||
return null;
|
||||
case 5:
|
||||
for (Col2Dest c2d = 0; c2d < Col2Dest.Count; c2d++) list.Add(c2d.ToDescription());
|
||||
return list;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
return EnterSerialNrsAtTheEnd ? Strings.yes : Strings.no;
|
||||
case 1:
|
||||
return ShowCycleEndForm ? Strings.yes : Strings.no;
|
||||
case 2:
|
||||
return HideOrderSelection ? Strings.yes : Strings.no;
|
||||
case 3:
|
||||
return HidePrefix ? Strings.yes : Strings.no;
|
||||
case 4:
|
||||
return Column2Caption;
|
||||
case 5:
|
||||
return Column2Destination.ToDescription();
|
||||
default:
|
||||
return string.Format("Name={0}, Enter SNs at the end={1}, Show cycle end form={2}", Name, EnterSerialNrsAtTheEnd, ShowCycleEndForm);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public CfgUpdateFlags UpdateParam(int i, string str)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
EnterSerialNrsAtTheEnd = (str == Strings.yes);
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
case 1:
|
||||
ShowCycleEndForm = (str == Strings.yes);
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
case 2:
|
||||
HideOrderSelection = (str == Strings.yes);
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
case 3:
|
||||
HidePrefix = (str == Strings.yes);
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
case 4:
|
||||
Column2Caption = str;
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
case 5:
|
||||
for (Col2Dest c2d = 0; c2d < Col2Dest.Count; c2d++)
|
||||
{
|
||||
if (str == c2d.ToDescription())
|
||||
{
|
||||
Column2Destination = c2d;
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
}
|
||||
}
|
||||
return CfgUpdateFlags.None;
|
||||
default:
|
||||
return CfgUpdateFlags.None;
|
||||
}
|
||||
}
|
||||
|
||||
public bool ValidateParam(int i, string str, out string message)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 5:
|
||||
message = string.Empty;
|
||||
if (ParamValues(i).Contains(str)) return true;
|
||||
break;
|
||||
case 4:
|
||||
message = string.Empty;
|
||||
return true;
|
||||
default:
|
||||
message = "Invalid index";
|
||||
return false;
|
||||
}
|
||||
|
||||
message = string.Format(Strings.Invalid_0, ParamName(i)) ;
|
||||
return false;
|
||||
}
|
||||
|
||||
void CopyContentTo(EntryFormCfg prms)
|
||||
{
|
||||
prms.EnterSerialNrsAtTheEnd = EnterSerialNrsAtTheEnd;
|
||||
prms.ShowCycleEndForm = ShowCycleEndForm;
|
||||
prms.HideOrderSelection = HideOrderSelection;
|
||||
prms.HidePrefix = HidePrefix;
|
||||
prms.Column2Caption = Column2Caption;
|
||||
prms.Column2Destination = Column2Destination;
|
||||
}
|
||||
|
||||
public IParamsProvider Clone()
|
||||
{
|
||||
EntryFormCfg pars = new EntryFormCfg();
|
||||
CopyContentTo(pars);
|
||||
return pars;
|
||||
}
|
||||
|
||||
public bool UpdateEmbeddedDbEntity()
|
||||
{
|
||||
return true; /// =OK, do nothing
|
||||
}
|
||||
}
|
||||
|
||||
public enum Col2Dest
|
||||
{
|
||||
[Description("Radio address")] RadioAddress,
|
||||
[Description("Serial nr. Aux")] SerialNrAux,
|
||||
[Description("Purchase order")] OrderNr,
|
||||
[Description("Remark")] Remark,
|
||||
#if ORACLE_DB
|
||||
[Description("Suffix")] Suffix,
|
||||
#endif
|
||||
Count
|
||||
}
|
||||
}
|
||||
308
TBF/Rig/DataEntry/Double24/EntryFormNoStartEnd.cs
Normal file
308
TBF/Rig/DataEntry/Double24/EntryFormNoStartEnd.cs
Normal file
@ -0,0 +1,308 @@
|
||||
///
|
||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.Rig;
|
||||
using TBF.Rig.GenericDevices;
|
||||
|
||||
namespace TBF.Rig.DataEntry.Double24
|
||||
{
|
||||
public class EntryFormNoStartEnd : ComponentBase, IOperation, IDataEntry, IHasCycleBeginForm, IHasCycleEndForm
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(EntryFormNoStartEnd));
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
public bool UsesCameras() { return false; }
|
||||
|
||||
readonly EntryFormCfg entryFormCfg;
|
||||
IRegReader[] regReaders;
|
||||
|
||||
/// <summary>
|
||||
/// Properties set by the Begin, End and WMStates form
|
||||
/// </summary>
|
||||
bool[] disabled; /// This array is shared between forms
|
||||
|
||||
string[] wmCycleEndState;
|
||||
public string WMCycleEndState(int wmNr) { return (wmNr >= 0 && wmNr < wmCycleEndState.Length) ? wmCycleEndState[wmNr] : string.Empty; }
|
||||
|
||||
double[] wmStartState;
|
||||
public double WMStartState(int wmNr) { return (wmNr >= 0 && wmNr < wmStartState.Length) ? wmStartState[wmNr] : 0; }
|
||||
|
||||
double[] wmEndState;
|
||||
public double WMEndState(int wmNr) { return (wmNr >= 0 && wmNr < wmEndState.Length) ? wmEndState[wmNr] : 0; }
|
||||
|
||||
string[] wmStartStateStr;
|
||||
|
||||
|
||||
System.Windows.Forms.Form modelessDlg;
|
||||
public bool Completed { get { return (modelessDlg is IHasCompleted) ? (modelessDlg as IHasCompleted).Completed : true; } }
|
||||
|
||||
double refVolume;
|
||||
double errLimLo;
|
||||
double errLimHi;
|
||||
|
||||
bool resultSaved; /// Set in Run() when results are saved
|
||||
|
||||
IList<Results.Entities.WaterMeter> waterMeters; /// Reference to ...ProcessData.BatchRslts.WaterMeters[]
|
||||
|
||||
public enum CurrentOp
|
||||
{
|
||||
None,
|
||||
ShowFormAtCycleBeginning,
|
||||
ShowFormAtCycleEnd,
|
||||
EnterTestStartStates,
|
||||
EnterTestEndStates,
|
||||
}
|
||||
|
||||
CurrentOp currentOp;
|
||||
|
||||
|
||||
public EntryFormNoStartEnd() { }
|
||||
|
||||
public EntryFormNoStartEnd(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
entryFormCfg = cfg as EntryFormCfg;
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
disabled = new bool[TBF.Data.WMsCount];
|
||||
wmStartState = new double[TBF.Data.WMsCount];
|
||||
wmStartStateStr = new string[TBF.Data.WMsCount];
|
||||
wmEndState = new double[TBF.Data.WMsCount];
|
||||
wmCycleEndState = new string[TBF.Data.WMsCount];
|
||||
currentOp = CurrentOp.None;
|
||||
log.FatalFormat("{0} initialized: {1}", Name, this);
|
||||
}
|
||||
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleBeginFormOp()
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.ShowFormAtCycleBeginning;
|
||||
this.waterMeters = TBF.Rig.Sequences.ProcessData.BatchRslts.Batch.WaterMeters;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleEndFormOp(IList<Results.Entities.WaterMeter> waterMeters)
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.ShowFormAtCycleEnd;
|
||||
this.waterMeters = waterMeters;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowTestStartFormOp(IRegReader[] regReaders)
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.EnterTestStartStates;
|
||||
this.regReaders = regReaders;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowTestEndFormOp(IRegReader[] regReaders, double refVolume, double errLimLo, double errLimHi)
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.EnterTestEndStates;
|
||||
this.regReaders = regReaders;
|
||||
this.refVolume = refVolume;
|
||||
this.errLimLo = errLimLo;
|
||||
this.errLimHi = errLimHi;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IOperation ShowAdvancedTestStartFormOp(IRegReader[] regReaders, IList<Results.Entities.WaterMeter> waterMeters, bool isCondOp = false)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
delegate void EntryFormDlgt(EntryFormNoStartEnd myRef);
|
||||
///
|
||||
void OpenBeginningDlg(EntryFormNoStartEnd myRef)
|
||||
{
|
||||
myRef.modelessDlg = new CycleBeginningForm(TBF.Data.WMsCount, entryFormCfg);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenEndDlg(EntryFormNoStartEnd myRef)
|
||||
{
|
||||
myRef.modelessDlg = new CycleEndForm(TBF.Data.WMsCount, TBF.Data.LineSize);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenTestStartStatesDlg(EntryFormNoStartEnd myRef)
|
||||
{
|
||||
myRef.modelessDlg = new TestStartEndForm(TBF.Data.WMsCount, myRef.regReaders, myRef.disabled);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
///
|
||||
void OpenTestEndStatesDlg(EntryFormNoStartEnd myRef)
|
||||
{
|
||||
myRef.modelessDlg = new TestStartEndForm(TBF.Data.WMsCount, myRef.regReaders, wmStartStateStr, disabled, refVolume, errLimLo, errLimHi);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
{
|
||||
resultSaved = false;
|
||||
switch (currentOp)
|
||||
{
|
||||
case CurrentOp.ShowFormAtCycleBeginning:
|
||||
if (!entryFormCfg.EnterSerialNrsAtTheEnd)
|
||||
{
|
||||
Program.MainWnd.Invoke(new EntryFormDlgt(OpenBeginningDlg), this);
|
||||
}
|
||||
break;
|
||||
case CurrentOp.ShowFormAtCycleEnd:
|
||||
if (entryFormCfg.EnterSerialNrsAtTheEnd)
|
||||
{
|
||||
Program.MainWnd.Invoke(new EntryFormDlgt(OpenBeginningDlg), this);
|
||||
}
|
||||
else if (entryFormCfg.ShowCycleEndForm)
|
||||
{
|
||||
Program.MainWnd.Invoke(new EntryFormDlgt(OpenEndDlg), this);
|
||||
}
|
||||
break;
|
||||
case CurrentOp.EnterTestStartStates:
|
||||
Program.MainWnd.Invoke(new EntryFormDlgt(OpenTestStartStatesDlg), this);
|
||||
break;
|
||||
case CurrentOp.EnterTestEndStates:
|
||||
Program.MainWnd.Invoke(new EntryFormDlgt(OpenTestEndStatesDlg), this);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
/// <returns>Event.ResultsPrinted</returns>
|
||||
public Event Run()
|
||||
{
|
||||
if ((modelessDlg is IHasCompleted) && !(modelessDlg as IHasCompleted).Completed)
|
||||
{
|
||||
return Event.ModelessFormIsOpen;
|
||||
}
|
||||
|
||||
if (!resultSaved) /// This is to save the result only once
|
||||
{
|
||||
if ((!entryFormCfg.EnterSerialNrsAtTheEnd && currentOp == CurrentOp.ShowFormAtCycleBeginning) ||
|
||||
(entryFormCfg.EnterSerialNrsAtTheEnd && currentOp == CurrentOp.ShowFormAtCycleEnd))
|
||||
{
|
||||
CycleBeginningForm dlg = (modelessDlg as CycleBeginningForm);
|
||||
if (dlg != null)
|
||||
{
|
||||
for (int i = 0; i < Math.Min(dlg.WMsCount, waterMeters.Count); i++)
|
||||
{
|
||||
if (waterMeters[i] != null)
|
||||
{
|
||||
waterMeters[i].Disabled = disabled[i] = dlg.Disabled[i];
|
||||
waterMeters[i].SerialNr = dlg.SNText[i];
|
||||
switch (entryFormCfg.Column2Destination)
|
||||
{
|
||||
case Col2Dest.RadioAddress:
|
||||
waterMeters[i].RadioAddress = dlg.Column2Text[i];
|
||||
break;
|
||||
case Col2Dest.SerialNrAux:
|
||||
waterMeters[i].SerialNrAux = dlg.Column2Text[i];
|
||||
break;
|
||||
case Col2Dest.OrderNr:
|
||||
waterMeters[i].PurchaseOrder = dlg.Column2Text[i];
|
||||
break;
|
||||
#if ORACLE_DB
|
||||
case Col2Dest.Suffix:
|
||||
waterMeters[i].Suffix = dlg.Column2Text[i];
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
case Col2Dest.Remark:
|
||||
waterMeters[i].Remark = dlg.Column2Text[i];
|
||||
break;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(dlg.PurchaseOrder) && !entryFormCfg.HideOrderSelection)
|
||||
{
|
||||
waterMeters[i].PurchaseOrder = dlg.PurchaseOrder;
|
||||
}
|
||||
|
||||
#if ORACLE_DB
|
||||
if (!string.IsNullOrEmpty(dlg.Prefix) && !entryFormCfg.HidePrefix)
|
||||
{
|
||||
waterMeters[i].Prefix = dlg.PurchaseOrder;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (entryFormCfg.ShowCycleEndForm && currentOp == CurrentOp.ShowFormAtCycleEnd)
|
||||
{
|
||||
CycleEndForm dlg = (modelessDlg as CycleEndForm);
|
||||
int count = waterMeters.Count;
|
||||
if ((dlg != null) && (count > dlg.WMsCount)) count = dlg.WMsCount;
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
if (waterMeters[i] != null)
|
||||
{
|
||||
/// In case entryFormCfg.ShowCycleEndForm == false dlg would be null, values would be string.Empty
|
||||
wmCycleEndState[i] = waterMeters[i].EndState = (dlg != null) ? dlg.EndStateText[i] : string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (modelessDlg is TestStartEndForm && currentOp == CurrentOp.EnterTestStartStates)
|
||||
{
|
||||
/// Fixed start test - start
|
||||
TestStartEndForm dlg = (modelessDlg as TestStartEndForm);
|
||||
if (dlg != null)
|
||||
{
|
||||
for (int i = 0; i < dlg.WMsCount; i++)
|
||||
{
|
||||
if (!(((i < disabled.Length) && disabled[i]) || ((i < regReaders.Length) && (regReaders[i] == null))))
|
||||
{
|
||||
wmStartState[i] = dlg.WMStartState[i];
|
||||
wmStartStateStr[i] = dlg.WMStartStateStr[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (modelessDlg is TestStartEndForm && currentOp == CurrentOp.EnterTestEndStates)
|
||||
{
|
||||
/// Fixed start test - end
|
||||
TestStartEndForm dlg = (modelessDlg as TestStartEndForm);
|
||||
if (dlg != null)
|
||||
{
|
||||
for (int i = 0; i < dlg.WMsCount; i++)
|
||||
{
|
||||
if (!(((i < disabled.Length) && disabled[i]) || ((i < regReaders.Length) && (regReaders[i] == null))))
|
||||
{
|
||||
wmEndState[i] = dlg.WMEndState[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
resultSaved = true;
|
||||
modelessDlg = null;
|
||||
}
|
||||
|
||||
return Event.ModelessFormClosed; /// Form closed
|
||||
}
|
||||
|
||||
/// <summary>Stop this operation</summary>
|
||||
public void Stop()
|
||||
{
|
||||
if (modelessDlg is IHasCompleted)
|
||||
{
|
||||
UiBridge.Bridge.OnCloseModelessForm(this, null);
|
||||
modelessDlg = null;
|
||||
}
|
||||
currentOp = CurrentOp.None;
|
||||
}
|
||||
}
|
||||
}
|
||||
25
TBF/Rig/DataEntry/Double24/Factory.cs
Normal file
25
TBF/Rig/DataEntry/Double24/Factory.cs
Normal file
@ -0,0 +1,25 @@
|
||||
///
|
||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
namespace TBF.Rig.DataEntry.Double24
|
||||
{
|
||||
public class Factory : IComponentFactory
|
||||
{
|
||||
public string ClassName { get { return GetType().Namespace.Substring(8); } }
|
||||
public override string ToString() { return ClassName; }
|
||||
|
||||
public IComponent DummyComponent() { return new EntryFormNoStartEnd(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new EntryForm(cfg); }
|
||||
|
||||
public IComponentCfg DefaultConfig() { return new EntryFormCfg(this, GetType().Namespace.Substring(8)); }
|
||||
|
||||
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
|
||||
{
|
||||
return ComponentCfgBase.CreateFromDbEntity(EntryFormCfg.Serializer, component, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
24
TBF/Rig/DataEntry/Double24/FactoryNoStartEnd.cs
Normal file
24
TBF/Rig/DataEntry/Double24/FactoryNoStartEnd.cs
Normal file
@ -0,0 +1,24 @@
|
||||
///
|
||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
namespace TBF.Rig.DataEntry.Double24
|
||||
{
|
||||
public class FactoryNoStartEnd : IComponentFactory
|
||||
{
|
||||
public string ClassName { get { return GetType().Namespace.Substring(8) + "-NoStartEnd"; } }
|
||||
|
||||
public IComponent DummyComponent() { return new EntryFormNoStartEnd(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new EntryFormNoStartEnd(cfg); }
|
||||
|
||||
public IComponentCfg DefaultConfig() { return new EntryFormCfg(this, GetType().Namespace.Substring(8) + "-NoStartEnd"); }
|
||||
|
||||
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
|
||||
{
|
||||
return ComponentCfgBase.CreateFromDbEntity(EntryFormCfg.Serializer, component, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
533
TBF/Rig/DataEntry/Double24/TestStartEndForm.cs
Normal file
533
TBF/Rig/DataEntry/Double24/TestStartEndForm.cs
Normal file
@ -0,0 +1,533 @@
|
||||
///
|
||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using TBF.Rig.GenericDevices;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.Rig.DataEntry.Double24
|
||||
{
|
||||
public partial class TestStartEndForm : Form, GenericDevices.IHasCompleted
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(TestStartEndForm));
|
||||
|
||||
// Set to 'true' when the form closes
|
||||
public bool Completed { get { return completed; } }
|
||||
bool completed;
|
||||
|
||||
/// <summary> Number of text boxes for serial numbers </summary>
|
||||
public readonly int WMsCount;
|
||||
readonly IRegReader[] regReaders;
|
||||
readonly bool[] disabled;
|
||||
|
||||
// To be retrieved after the form closes
|
||||
public double[] WMStartState;
|
||||
|
||||
// To be retrieved after the form closes
|
||||
public readonly string[] WMStartStateStr;
|
||||
|
||||
// To be retrieved after the form closes
|
||||
public double[] WMEndState;
|
||||
|
||||
bool endStates; /// false=start states, true=end states
|
||||
double refVolume;
|
||||
double warningLimLo; /// limit to display exclamation mark, typically 2x errLimLo
|
||||
double warningLimHi; /// limit to display exclamation mark, typically 2x errLimHi
|
||||
bool fixedErrorLimits; /// false in case of calculated error limits
|
||||
|
||||
int TextBoxesCount;
|
||||
///
|
||||
Label[] labels;
|
||||
TextBox[] startTextBoxes;
|
||||
TextBox[] endTextBoxes;
|
||||
Label[] exclamations;
|
||||
|
||||
IList<TextBox> activeTextBoxes;
|
||||
IList<int> activeWmNrs;
|
||||
|
||||
/// <summary>
|
||||
/// Parameterless constructor initializing common part for start and endstate form
|
||||
/// </summary>
|
||||
public TestStartEndForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
ControlBox = false;
|
||||
|
||||
TextBoxesCount = 24;
|
||||
|
||||
labels = new Label[]
|
||||
{
|
||||
label1, label2, label3, label4, label5, label6, label7, label8, label9, label10,
|
||||
label11, label12, label13, label14, label15, label16, label17, label18, label19, label20,
|
||||
label21, label22, label23, label24,
|
||||
};
|
||||
startTextBoxes = new TextBox[]
|
||||
{
|
||||
startTextBox1, startTextBox2, startTextBox3, startTextBox4, startTextBox5, startTextBox6,
|
||||
startTextBox7, startTextBox8, startTextBox9, startTextBox10, startTextBox11, startTextBox12,
|
||||
startTextBox13, startTextBox14, startTextBox15, startTextBox16, startTextBox17, startTextBox18,
|
||||
startTextBox19, startTextBox20, startTextBox21, startTextBox22, startTextBox23, startTextBox24,
|
||||
};
|
||||
endTextBoxes = new TextBox[]
|
||||
{
|
||||
endTextBox1, endTextBox2, endTextBox3, endTextBox4, endTextBox5, endTextBox6,
|
||||
endTextBox7, endTextBox8, endTextBox9, endTextBox10, endTextBox11, endTextBox12,
|
||||
endTextBox13, endTextBox14, endTextBox15, endTextBox16, endTextBox17, endTextBox18,
|
||||
endTextBox19, endTextBox20, endTextBox21, endTextBox22, endTextBox23, endTextBox24,
|
||||
};
|
||||
exclamations = new Label[]
|
||||
{
|
||||
exclamation1, exclamation2, exclamation3, exclamation4, exclamation5, exclamation6,
|
||||
exclamation7, exclamation8, exclamation9, exclamation10, exclamation11, exclamation12,
|
||||
exclamation13, exclamation14, exclamation15, exclamation16, exclamation17, exclamation18,
|
||||
exclamation19, exclamation20, exclamation21, exclamation22, exclamation23, exclamation24,
|
||||
};
|
||||
|
||||
activeTextBoxes = new List<TextBox>();
|
||||
activeWmNrs = new List<int>();
|
||||
|
||||
completed = false;
|
||||
StartForceCloseHandler();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor to fill in start states
|
||||
/// </summary>
|
||||
/// <param name="waterMetersCount">Number of water meters</param>
|
||||
/// <param name="disabled">Information from CycleBeginningForm about availability of water meters</param>
|
||||
public TestStartEndForm(int waterMetersCount, IRegReader[] regReaders, bool[] disabled)
|
||||
: this()
|
||||
{
|
||||
endStates = false;
|
||||
|
||||
this.WMsCount = waterMetersCount;
|
||||
this.regReaders = regReaders;
|
||||
this.disabled = disabled;
|
||||
|
||||
ShuffleTextBoxes();
|
||||
|
||||
WMStartState = new double[waterMetersCount];
|
||||
WMStartStateStr = new string[waterMetersCount];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor to fill in end states
|
||||
/// </summary>
|
||||
/// <param name="waterMetersCount">Number of water meters</param>
|
||||
/// <param name="wmStartStateStr">Information entered on test start</param>
|
||||
/// <param name="disabled">Information from CycleBeginningForm about availability of water meters</param>
|
||||
/// <param name="refVolume">Reference volume, it is used to verify the end state, show/hide exclamation if necessary</param>
|
||||
/// <param name="errLimLo">Error limit low, it is used to verify the end state, show/hide exclamation if necessary</param>
|
||||
/// <param name="errLimHi">Error limit high, it is used to verify the end state, show/hide exclamation if necessary</param>
|
||||
public TestStartEndForm(int waterMetersCount, IRegReader[] regReaders, string[] wmStartStateStr, bool[] disabled,
|
||||
double refVolume, double errLimLo, double errLimHi)
|
||||
: this()
|
||||
{
|
||||
endStates = true;
|
||||
|
||||
this.WMsCount = waterMetersCount;
|
||||
this.regReaders = regReaders;
|
||||
if (wmStartStateStr == null || wmStartStateStr.Length != waterMetersCount)
|
||||
throw (new Exception("Invalid 'wmStartStateStr' argument"));
|
||||
this.WMStartStateStr = wmStartStateStr;
|
||||
this.disabled = disabled;
|
||||
this.refVolume = refVolume;
|
||||
this.warningLimLo = 2 * errLimLo;
|
||||
this.warningLimHi = 2 * errLimHi;
|
||||
this.fixedErrorLimits = (errLimHi > errLimLo);
|
||||
|
||||
ShuffleTextBoxes();
|
||||
|
||||
WMEndState = new double[waterMetersCount];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Make sure the layout of labels/text boxes on the screen
|
||||
/// corresponds to the layout of watermeters of the test bench.
|
||||
/// </summary>
|
||||
void ShuffleTextBoxes()
|
||||
{
|
||||
if (TextBoxesCount > WMsCount)
|
||||
{
|
||||
int nrLines = WMsCount / TBF.Data.LineSize;
|
||||
int gap = (TextBoxesCount - WMsCount) / nrLines;
|
||||
|
||||
int dest = 0;
|
||||
for (int l = 0; l < nrLines; l++)
|
||||
{
|
||||
for (int i = 0; i < TBF.Data.LineSize; i++)
|
||||
{
|
||||
labels[dest] = labels[l * TBF.Data.LineSize + l * gap + i];
|
||||
startTextBoxes[dest] = startTextBoxes[l * TBF.Data.LineSize + l * gap + i];
|
||||
endTextBoxes[dest] = endTextBoxes[l * TBF.Data.LineSize + l * gap + i];
|
||||
exclamations[dest] = exclamations[l * TBF.Data.LineSize + l * gap + i];
|
||||
dest++;
|
||||
}
|
||||
}
|
||||
TextBoxesCount = WMsCount;
|
||||
}
|
||||
}
|
||||
|
||||
private void CycleEndForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
Localize();
|
||||
|
||||
//Height = 115 + 90 * WaterMetersCount;
|
||||
|
||||
for (int i = 0; i < TextBoxesCount; i++)
|
||||
{
|
||||
if (i < WMsCount)
|
||||
{
|
||||
labels[i].Visible = startTextBoxes[i].Visible = endTextBoxes[i].Visible = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (endStates)
|
||||
{
|
||||
/// End of test
|
||||
for (int i = 0; i < TextBoxesCount; i++)
|
||||
{
|
||||
if (WMStartStateStr != null && i < WMStartStateStr.Length)
|
||||
{
|
||||
startTextBoxes[i].Text = WMStartStateStr[i];
|
||||
}
|
||||
|
||||
if (((i < disabled.Length) && disabled[i]) || ((i < regReaders.Length) && (regReaders[i] == null)))
|
||||
{
|
||||
endTextBoxes[i].Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
endTextBoxes[i].Enabled = true;
|
||||
activeTextBoxes.Add(endTextBoxes[i]);
|
||||
activeWmNrs.Add(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Start of test
|
||||
for (int i = 0; i < TextBoxesCount; i++)
|
||||
{
|
||||
if (((i < disabled.Length) && disabled[i]) || ((i < regReaders.Length) && (regReaders[i] == null)))
|
||||
{
|
||||
startTextBoxes[i].Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
startTextBoxes[i].Enabled = true;
|
||||
activeTextBoxes.Add(startTextBoxes[i]);
|
||||
activeWmNrs.Add(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((activeTextBoxes.Count > 0) && (activeWmNrs.Count > 0))
|
||||
{
|
||||
activeTextBoxes[0].Focus();
|
||||
largeTextBox.Text = string.Format("{0} {1}: {2}", Strings.Water_Meter, activeWmNrs[0] + 1, string.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
Text = Strings.Water_Meter_States;
|
||||
for (int i = 0; i < TextBoxesCount; i++)
|
||||
{
|
||||
labels[i].Text = string.Format("{0} {1}", Strings.Water_Meter, i + 1);
|
||||
}
|
||||
startLabel.Text = startLabel2.Text = Strings.Start;
|
||||
endLabel.Text = endLabel2.Text = Strings.End;
|
||||
okButton.Text = Strings.OkBtnText;
|
||||
}
|
||||
|
||||
private void okButton_Click(object sender, EventArgs eArgs)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (endStates)
|
||||
{
|
||||
for (int i = 0; i < Math.Min(WMsCount, TextBoxesCount); i++)
|
||||
{
|
||||
if (endTextBoxes[i].Visible && endTextBoxes[i].Enabled)
|
||||
{
|
||||
WMEndState[i] = Utils.ParseUDouble(endTextBoxes[i].Text);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < Math.Min(WMsCount, TextBoxesCount); i++)
|
||||
{
|
||||
if (startTextBoxes[i].Visible && startTextBoxes[i].Enabled)
|
||||
{
|
||||
WMStartStateStr[i] = startTextBoxes[i].Text;
|
||||
WMStartState[i] = Utils.ParseUDouble(startTextBoxes[i].Text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
log.ErrorFormat("Exception: {0}", e.Message);
|
||||
return;
|
||||
}
|
||||
|
||||
completed = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
#region Forced close handling
|
||||
|
||||
public void StartForceCloseHandler()
|
||||
{
|
||||
UiBridge.Bridge.CloseModelessFormHandler += delegate(object sender, EventArgs args)
|
||||
{
|
||||
if (InvokeRequired) { Invoke(new EventHandler<EventArgs>(OnForceClose), sender, args); }
|
||||
else OnForceClose(sender, args);
|
||||
};
|
||||
}
|
||||
|
||||
void OnForceClose(object sender, EventArgs args)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Calculate the approximate error and verify whether it is within limits.
|
||||
/// Make an exclamation mark visible if out of range.
|
||||
/// Similar event handler is implemented for all endTextBoxes (1..24).
|
||||
/// </summary>
|
||||
private void ProcEndTextChanged(object sender, EventArgs e, TextBox endTBox)
|
||||
{
|
||||
int wmIx = -1;
|
||||
for (int i = 0; i < endTextBoxes.Length; i++)
|
||||
{
|
||||
if (endTextBoxes[i] == endTBox)
|
||||
{
|
||||
wmIx = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
double err = 0;
|
||||
try
|
||||
{
|
||||
double endState = Utils.ParseUDouble(endTextBoxes[wmIx].Text);
|
||||
double startState = Utils.ParseUDouble(startTextBoxes[wmIx].Text);
|
||||
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||
}
|
||||
catch { err = 1000.0f; };
|
||||
|
||||
bool errorOoR = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
|
||||
exclamations[wmIx].Visible = errorOoR;
|
||||
largeExclamationLabel.Visible = errorOoR;
|
||||
largeTextBox.Text = string.Format("{0} {1}: {2}", Strings.Water_Meter, wmIx + 1, endTextBoxes[wmIx].Text);
|
||||
}
|
||||
|
||||
private void endTextBox1_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox1); }
|
||||
private void endTextBox2_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox2); }
|
||||
private void endTextBox3_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox3); }
|
||||
private void endTextBox4_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox4); }
|
||||
private void endTextBox5_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox5); }
|
||||
private void endTextBox6_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox6); }
|
||||
private void endTextBox7_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox7); }
|
||||
private void endTextBox8_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox8); }
|
||||
private void endTextBox9_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox9); }
|
||||
private void endTextBox10_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox10); }
|
||||
private void endTextBox11_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox11); }
|
||||
private void endTextBox12_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox12); }
|
||||
private void endTextBox13_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox13); }
|
||||
private void endTextBox14_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox14); }
|
||||
private void endTextBox15_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox15); }
|
||||
private void endTextBox16_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox16); }
|
||||
private void endTextBox17_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox17); }
|
||||
private void endTextBox18_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox18); }
|
||||
private void endTextBox19_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox19); }
|
||||
private void endTextBox20_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox20); }
|
||||
private void endTextBox21_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox21); }
|
||||
private void endTextBox22_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox22); }
|
||||
private void endTextBox23_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox23); }
|
||||
private void endTextBox24_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox24); }
|
||||
|
||||
private void endTextBox1_MouseClick(object sender, MouseEventArgs e) { ProcEndTextChanged(sender, e, endTextBox1); }
|
||||
private void endTextBox2_MouseClick(object sender, MouseEventArgs e) { ProcEndTextChanged(sender, e, endTextBox2); }
|
||||
private void endTextBox3_MouseClick(object sender, MouseEventArgs e) { ProcEndTextChanged(sender, e, endTextBox3); }
|
||||
private void endTextBox4_MouseClick(object sender, MouseEventArgs e) { ProcEndTextChanged(sender, e, endTextBox4); }
|
||||
private void endTextBox5_MouseClick(object sender, MouseEventArgs e) { ProcEndTextChanged(sender, e, endTextBox5); }
|
||||
private void endTextBox6_MouseClick(object sender, MouseEventArgs e) { ProcEndTextChanged(sender, e, endTextBox6); }
|
||||
private void endTextBox7_MouseClick(object sender, MouseEventArgs e) { ProcEndTextChanged(sender, e, endTextBox7); }
|
||||
private void endTextBox8_MouseClick(object sender, MouseEventArgs e) { ProcEndTextChanged(sender, e, endTextBox8); }
|
||||
private void endTextBox9_MouseClick(object sender, MouseEventArgs e) { ProcEndTextChanged(sender, e, endTextBox9); }
|
||||
private void endTextBox10_MouseClick(object sender, MouseEventArgs e) { ProcEndTextChanged(sender, e, endTextBox10); }
|
||||
private void endTextBox11_MouseClick(object sender, MouseEventArgs e) { ProcEndTextChanged(sender, e, endTextBox11); }
|
||||
private void endTextBox12_MouseClick(object sender, MouseEventArgs e) { ProcEndTextChanged(sender, e, endTextBox12); }
|
||||
private void endTextBox13_MouseClick(object sender, MouseEventArgs e) { ProcEndTextChanged(sender, e, endTextBox13); }
|
||||
private void endTextBox14_MouseClick(object sender, MouseEventArgs e) { ProcEndTextChanged(sender, e, endTextBox14); }
|
||||
private void endTextBox15_MouseClick(object sender, MouseEventArgs e) { ProcEndTextChanged(sender, e, endTextBox15); }
|
||||
private void endTextBox16_MouseClick(object sender, MouseEventArgs e) { ProcEndTextChanged(sender, e, endTextBox16); }
|
||||
private void endTextBox17_MouseClick(object sender, MouseEventArgs e) { ProcEndTextChanged(sender, e, endTextBox17); }
|
||||
private void endTextBox18_MouseClick(object sender, MouseEventArgs e) { ProcEndTextChanged(sender, e, endTextBox18); }
|
||||
private void endTextBox19_MouseClick(object sender, MouseEventArgs e) { ProcEndTextChanged(sender, e, endTextBox19); }
|
||||
private void endTextBox20_MouseClick(object sender, MouseEventArgs e) { ProcEndTextChanged(sender, e, endTextBox20); }
|
||||
private void endTextBox21_MouseClick(object sender, MouseEventArgs e) { ProcEndTextChanged(sender, e, endTextBox21); }
|
||||
private void endTextBox22_MouseClick(object sender, MouseEventArgs e) { ProcEndTextChanged(sender, e, endTextBox22); }
|
||||
private void endTextBox23_MouseClick(object sender, MouseEventArgs e) { ProcEndTextChanged(sender, e, endTextBox23); }
|
||||
private void endTextBox24_MouseClick(object sender, MouseEventArgs e) { ProcEndTextChanged(sender, e, endTextBox24); }
|
||||
|
||||
/// <summary>
|
||||
/// Process a key press within any enabled text boxe
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
/// <param name="currentFocusOwner">TextBox control which received the event</param>
|
||||
private void ProcKeyPress(object sender, KeyPressEventArgs e, TextBox currentFocusOwner)
|
||||
{
|
||||
if (e.KeyChar == '+')
|
||||
{
|
||||
/// Process '+' key ..... Form completed
|
||||
okButton_Click(sender, e);
|
||||
}
|
||||
|
||||
if (e.KeyChar == '\r')
|
||||
{
|
||||
/// Process <enter> key ..... Next text field
|
||||
if (activeTextBoxes.Count < 2) return; /// There is just one enabled textbox
|
||||
|
||||
for (int i = 0; i < activeTextBoxes.Count; i++)
|
||||
{
|
||||
if (activeTextBoxes[i] == currentFocusOwner)
|
||||
{
|
||||
/// Change focus to the next enabled text box
|
||||
int newTBIdx = (i + 1) % activeTextBoxes.Count;
|
||||
activeTextBoxes[newTBIdx].Focus();
|
||||
largeTextBox.Text = string.Format("{0} {1}: {2}", Strings.Water_Meter, activeWmNrs[newTBIdx] + 1, activeTextBoxes[newTBIdx].Text);
|
||||
largeExclamationLabel.Visible = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void startTextBox1_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox1); }
|
||||
private void startTextBox2_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox2); }
|
||||
private void startTextBox3_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox3); }
|
||||
private void startTextBox4_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox4); }
|
||||
private void startTextBox5_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox5); }
|
||||
private void startTextBox6_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox6); }
|
||||
private void startTextBox7_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox7); }
|
||||
private void startTextBox8_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox8); }
|
||||
private void startTextBox9_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox9); }
|
||||
private void startTextBox10_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox10); }
|
||||
private void startTextBox11_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox11); }
|
||||
private void startTextBox12_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox12); }
|
||||
private void startTextBox13_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox13); }
|
||||
private void startTextBox14_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox14); }
|
||||
private void startTextBox15_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox15); }
|
||||
private void startTextBox16_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox16); }
|
||||
private void startTextBox17_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox17); }
|
||||
private void startTextBox18_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox18); }
|
||||
private void startTextBox19_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox19); }
|
||||
private void startTextBox20_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox20); }
|
||||
private void startTextBox21_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox21); }
|
||||
private void startTextBox22_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox22); }
|
||||
private void startTextBox23_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox23); }
|
||||
private void startTextBox24_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox24); }
|
||||
|
||||
private void endTextBox1_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox1); }
|
||||
private void endTextBox2_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox2); }
|
||||
private void endTextBox3_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox3); }
|
||||
private void endTextBox4_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox4); }
|
||||
private void endTextBox5_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox5); }
|
||||
private void endTextBox6_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox6); }
|
||||
private void endTextBox7_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox7); }
|
||||
private void endTextBox8_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox8); }
|
||||
private void endTextBox9_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox9); }
|
||||
private void endTextBox10_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox10); }
|
||||
private void endTextBox11_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox11); }
|
||||
private void endTextBox12_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox12); }
|
||||
private void endTextBox13_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox13); }
|
||||
private void endTextBox14_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox14); }
|
||||
private void endTextBox15_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox15); }
|
||||
private void endTextBox16_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox16); }
|
||||
private void endTextBox17_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox17); }
|
||||
private void endTextBox18_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox18); }
|
||||
private void endTextBox19_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox19); }
|
||||
private void endTextBox20_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox20); }
|
||||
private void endTextBox21_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox21); }
|
||||
private void endTextBox22_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox22); }
|
||||
private void endTextBox23_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox23); }
|
||||
private void endTextBox24_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox24); }
|
||||
|
||||
|
||||
private void ProcStartTextChanged(object sender, EventArgs e, TextBox startTBox)
|
||||
{
|
||||
for (int i = 0; i < startTextBoxes.Length; i++)
|
||||
{
|
||||
if (startTextBoxes[i] == startTBox)
|
||||
{
|
||||
largeTextBox.Text = string.Format("{0} {1}: {2}", Strings.Water_Meter, i + 1, startTextBoxes[i].Text);
|
||||
largeExclamationLabel.Visible = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void startTextBox1_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox1); }
|
||||
private void startTextBox2_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox2); }
|
||||
private void startTextBox3_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox3); }
|
||||
private void startTextBox4_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox4); }
|
||||
private void startTextBox5_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox5); }
|
||||
private void startTextBox6_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox6); }
|
||||
private void startTextBox7_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox7); }
|
||||
private void startTextBox8_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox8); }
|
||||
private void startTextBox9_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox9); }
|
||||
private void startTextBox10_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox10); }
|
||||
private void startTextBox11_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox11); }
|
||||
private void startTextBox12_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox12); }
|
||||
private void startTextBox13_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox13); }
|
||||
private void startTextBox14_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox14); }
|
||||
private void startTextBox15_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox15); }
|
||||
private void startTextBox16_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox16); }
|
||||
private void startTextBox17_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox17); }
|
||||
private void startTextBox18_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox18); }
|
||||
private void startTextBox19_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox19); }
|
||||
private void startTextBox20_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox20); }
|
||||
private void startTextBox21_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox21); }
|
||||
private void startTextBox22_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox22); }
|
||||
private void startTextBox23_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox23); }
|
||||
private void startTextBox24_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox24); }
|
||||
|
||||
private void startTextBox1_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox1); }
|
||||
private void startTextBox2_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox2); }
|
||||
private void startTextBox3_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox3); }
|
||||
private void startTextBox4_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox4); }
|
||||
private void startTextBox5_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox5); }
|
||||
private void startTextBox6_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox6); }
|
||||
private void startTextBox7_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox7); }
|
||||
private void startTextBox8_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox8); }
|
||||
private void startTextBox9_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox9); }
|
||||
private void startTextBox10_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox10); }
|
||||
private void startTextBox11_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox11); }
|
||||
private void startTextBox12_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox12); }
|
||||
private void startTextBox13_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox13); }
|
||||
private void startTextBox14_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox14); }
|
||||
private void startTextBox15_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox15); }
|
||||
private void startTextBox16_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox16); }
|
||||
private void startTextBox17_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox17); }
|
||||
private void startTextBox18_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox18); }
|
||||
private void startTextBox19_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox19); }
|
||||
private void startTextBox20_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox20); }
|
||||
private void startTextBox21_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox21); }
|
||||
private void startTextBox22_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox22); }
|
||||
private void startTextBox23_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox23); }
|
||||
private void startTextBox24_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox24); }
|
||||
}
|
||||
}
|
||||
1614
TBF/Rig/DataEntry/Double24/TestStartEndForm.designer.cs
generated
Normal file
1614
TBF/Rig/DataEntry/Double24/TestStartEndForm.designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
120
TBF/Rig/DataEntry/Double24/TestStartEndForm.resx
Normal file
120
TBF/Rig/DataEntry/Double24/TestStartEndForm.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@ -27,6 +27,7 @@ namespace TBF.Rig
|
||||
Factories.Add(new DataContainer.Evaporation.Factory());
|
||||
Factories.Add(new DataContainer.iPerlBenchInfo.Factory());
|
||||
Factories.Add(new DataEntry.Combined.EntryFormFactory());
|
||||
Factories.Add(new DataEntry.Double24.Factory());
|
||||
Factories.Add(new DataEntry.HeatMeters6.Factory());
|
||||
Factories.Add(new DataEntry.HeatMeters12.Factory());
|
||||
Factories.Add(new DataEntry.Fewa.Factory());
|
||||
|
||||
@ -253,6 +253,29 @@
|
||||
<Compile Include="Rig\DataEntry\Combined\TestStartEndForm.designer.cs">
|
||||
<DependentUpon>TestStartEndForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Rig\DataEntry\Double24\CycleBeginningForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Rig\DataEntry\Double24\CycleBeginningForm.designer.cs">
|
||||
<DependentUpon>CycleBeginningForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Rig\DataEntry\Double24\CycleEndForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Rig\DataEntry\Double24\CycleEndForm.designer.cs">
|
||||
<DependentUpon>CycleEndForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Rig\DataEntry\Double24\EntryForm.cs" />
|
||||
<Compile Include="Rig\DataEntry\Double24\EntryFormCfg.cs" />
|
||||
<Compile Include="Rig\DataEntry\Double24\EntryFormNoStartEnd.cs" />
|
||||
<Compile Include="Rig\DataEntry\Double24\Factory.cs" />
|
||||
<Compile Include="Rig\DataEntry\Double24\FactoryNoStartEnd.cs" />
|
||||
<Compile Include="Rig\DataEntry\Double24\TestStartEndForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Rig\DataEntry\Double24\TestStartEndForm.designer.cs">
|
||||
<DependentUpon>TestStartEndForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Rig\DataEntry\Fewa\CycleBeginningForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@ -2543,6 +2566,15 @@
|
||||
<EmbeddedResource Include="Rig\DataEntry\Combined\TestStartEndForm.resx">
|
||||
<DependentUpon>TestStartEndForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Rig\DataEntry\Double24\CycleBeginningForm.resx">
|
||||
<DependentUpon>CycleBeginningForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Rig\DataEntry\Double24\CycleEndForm.resx">
|
||||
<DependentUpon>CycleEndForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Rig\DataEntry\Double24\TestStartEndForm.resx">
|
||||
<DependentUpon>TestStartEndForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Rig\DataEntry\Fewa\CycleBeginningForm.resx">
|
||||
<DependentUpon>CycleBeginningForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user