TBF.Rig.DataEntry.Double24

This commit is contained in:
Milan Hanajik
2021-11-15 15:32:10 +01:00
parent 284feb73dc
commit 71517b6cdb
22 changed files with 1627 additions and 758 deletions
@@ -14,12 +14,15 @@ namespace TBF.Rig.DataContainers.BenchInfo.Extended
/// <summary>
/// Holds information identifying the test bench - serializable configuration.
/// </summary>
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg, Config.Entities.IParamsProvider
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg, IParamsProvider
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ComponentCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities) { return new Configs.ParamsProvider.ComponentCfgCtrl(this, null); }
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities)
{
return new Configs.ParamsProvider.ComponentCfgCtrl(this, null);
}
///
/// Serialized parameters
@@ -151,11 +154,6 @@ namespace TBF.Rig.DataContainers.BenchInfo.Extended
public string ToString(int i)
{
if (i == -1)
{
return string.Format("{0}: Bench name={1}, Bench Id={2}, Procedures={3}", Name, TestBenchName, TestBenchId, RemoteDBUse.ToDescription());
}
switch (i)
{
case 0: return TestBenchName;
@@ -175,7 +173,8 @@ namespace TBF.Rig.DataContainers.BenchInfo.Extended
case 14: return TempUnit.ToDescription();
case 15: return PressUnit.ToDescription();
case 16: return LenghtUnit.ToDescription();
default: return string.Empty;
default:
return string.Format("{0}: Bench name={1}, Bench Id={2}, Procedures={3}", Name, TestBenchName, TestBenchId, RemoteDBUse.ToDescription());
}
}
@@ -1,7 +1,7 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
namespace TBF.Rig.DataEntry.Fewa
namespace TBF.Rig.DataEntry.Double24
{
partial class CycleBeginningForm
{
@@ -134,6 +134,10 @@ namespace TBF.Rig.DataEntry.Fewa
this.suffixComboBox15 = new System.Windows.Forms.ComboBox();
this.suffixComboBox14 = new System.Windows.Forms.ComboBox();
this.suffixComboBox13 = new System.Windows.Forms.ComboBox();
this.snLabel = new System.Windows.Forms.Label();
this.snLabel2 = new System.Windows.Forms.Label();
this.column2Label = new System.Windows.Forms.Label();
this.columnm2Label2 = new System.Windows.Forms.Label();
this.orderGroupBox.SuspendLayout();
this.prefixGroupBox.SuspendLayout();
this.SuspendLayout();
@@ -877,11 +881,35 @@ namespace TBF.Rig.DataEntry.Fewa
this.suffixComboBox13.TextChanged += new System.EventHandler(this.suffixComboBox13_TextChanged);
this.suffixComboBox13.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.suffixComboBox13_KeyPress);
//
// snLabel
//
resources.ApplyResources(this.snLabel, "snLabel");
this.snLabel.Name = "snLabel";
//
// snLabel2
//
resources.ApplyResources(this.snLabel2, "snLabel2");
this.snLabel2.Name = "snLabel2";
//
// column2Label
//
resources.ApplyResources(this.column2Label, "column2Label");
this.column2Label.Name = "column2Label";
//
// columnm2Label2
//
resources.ApplyResources(this.columnm2Label2, "columnm2Label2");
this.columnm2Label2.Name = "columnm2Label2";
//
// CycleBeginningForm
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.DarkGray;
this.Controls.Add(this.columnm2Label2);
this.Controls.Add(this.column2Label);
this.Controls.Add(this.snLabel2);
this.Controls.Add(this.snLabel);
this.Controls.Add(this.suffixComboBox24);
this.Controls.Add(this.suffixComboBox23);
this.Controls.Add(this.suffixComboBox22);
@@ -1098,5 +1126,9 @@ namespace TBF.Rig.DataEntry.Fewa
private System.Windows.Forms.ComboBox suffixComboBox15;
private System.Windows.Forms.ComboBox suffixComboBox14;
private System.Windows.Forms.ComboBox suffixComboBox13;
private System.Windows.Forms.Label snLabel;
private System.Windows.Forms.Label snLabel2;
private System.Windows.Forms.Label column2Label;
private System.Windows.Forms.Label columnm2Label2;
}
}
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
/// Copyright (c) 2021 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -7,7 +7,7 @@ using System.Windows.Forms;
using log4net;
using TBF.Resources;
namespace TBF.Rig.DataEntry.Fewa
namespace TBF.Rig.DataEntry.Double24
{
public partial class CycleBeginningForm : Form, GenericDevices.IHasCompleted
{
@@ -15,12 +15,14 @@ namespace TBF.Rig.DataEntry.Fewa
/// <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[] SN2Text;
string[] suffixText;
public string[] Column2Text;
public string[] suffixText;
public bool[] Disabled;
/// Set to 'true' when the form closes
@@ -31,7 +33,7 @@ namespace TBF.Rig.DataEntry.Fewa
int textBoxesCount;
Label[] labels;
ComboBox[] comboBoxes;
ComboBox[] suffixComboBoxes;
ComboBox[] column2ComboBoxes;
CheckBox[] checkBoxes;
IList<ComboBox> enabledComboBoxes;
@@ -56,7 +58,7 @@ namespace TBF.Rig.DataEntry.Fewa
comboBox13, comboBox14, comboBox15, comboBox16, comboBox17, comboBox18,
comboBox19, comboBox20, comboBox21, comboBox22, comboBox23, comboBox24,
};
suffixComboBoxes = new ComboBox[]
column2ComboBoxes = new ComboBox[]
{
suffixComboBox1, suffixComboBox2, suffixComboBox3, suffixComboBox4, suffixComboBox5, suffixComboBox6,
suffixComboBox7, suffixComboBox8, suffixComboBox9, suffixComboBox10, suffixComboBox11, suffixComboBox12,
@@ -80,15 +82,27 @@ namespace TBF.Rig.DataEntry.Fewa
/// Constructor
/// </summary>
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
public CycleBeginningForm(int waterMetersCount)
public CycleBeginningForm(int waterMetersCount, EntryFormCfg entryFormCfg)
: this()
{
this.WMsCount = waterMetersCount;
this.entryFormCfg = entryFormCfg;
SNText = new string[WMsCount];
SN2Text = 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;
@@ -114,7 +128,7 @@ namespace TBF.Rig.DataEntry.Fewa
{
labels[dest] = labels[l * lineSize + l * gap + i];
comboBoxes[dest] = comboBoxes[l * lineSize + l * gap + i];
suffixComboBoxes[dest] = suffixComboBoxes[l * lineSize + l * gap + i];
column2ComboBoxes[dest] = column2ComboBoxes[l * lineSize + l * gap + i];
checkBoxes[dest] = checkBoxes[l * lineSize + l * gap + i];
dest++;
}
@@ -127,21 +141,18 @@ namespace TBF.Rig.DataEntry.Fewa
{
Localize();
PrepareOrderCombo(orderComboBox);
PreparePrefixCombo(prefixComboBox);
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]);
suffixComboBoxes[i].Items.Add((Program.LocalSettings.LastAuxSNTexts[i] == null) ? string.Empty : Program.LocalSettings.LastAuxSNTexts[i]);
column2ComboBoxes[i].Items.Add((Program.LocalSettings.LastAuxSNTexts[i] == null) ? string.Empty : Program.LocalSettings.LastAuxSNTexts[i]);
}
labels[i].Visible = comboBoxes[i].Visible = suffixComboBoxes[i].Visible = checkBoxes[i].Visible = true;
labels[i].Visible = comboBoxes[i].Visible = column2ComboBoxes[i].Visible = checkBoxes[i].Visible = true;
enabledComboBoxes.Add(comboBoxes[i]);
enabledComboBoxes.Add(suffixComboBoxes[i]);
enabledComboBoxes.Add(column2ComboBoxes[i]);
}
}
@@ -149,12 +160,11 @@ namespace TBF.Rig.DataEntry.Fewa
{
Text = Strings.Data;
orderGroupBox.Text = Strings.Purchase_order;
for (int i = 0; i < textBoxesCount; i++)
{
labels[i].Text = Strings.Serial_Number + " " + (i + 1).ToString();
}
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>
@@ -190,12 +200,13 @@ namespace TBF.Rig.DataEntry.Fewa
for (int i = 0; i < Math.Min(WMsCount, textBoxesCount); i++)
{
SNText[i] = comboBoxes[i].Text;
suffixText[i] = suffixComboBoxes[i].Text;
SN2Text[i] = string.Format("{0}{1}", prefixComboBox.Text, suffixComboBoxes[i].Text);
suffixText[i] = column2ComboBoxes[i].Text;
Column2Text[i] = string.Format("{0}{1}", prefixComboBox.Text, column2ComboBoxes[i].Text);
Disabled[i] = !checkBoxes[i].Checked;
}
PurchaseOrder = orderComboBox.Text;
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;
@@ -273,8 +284,8 @@ namespace TBF.Rig.DataEntry.Fewa
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) suffixComboBoxes[i].Text = Program.LocalSettings.LastAuxSNTexts[i];
checkBoxes[i].Checked = !string.IsNullOrEmpty(comboBoxes[i].Text) || !string.IsNullOrEmpty(suffixComboBoxes[i].Text);
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);
}
}
@@ -1,7 +1,7 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
namespace TBF.Rig.DataEntry.Fewa
namespace TBF.Rig.DataEntry.Double24
{
partial class CycleEndForm
{
@@ -1,12 +1,12 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
/// Copyright (c) 2021 Sensus Slovensko a.s.
///
using System;
using System.Windows.Forms;
using log4net;
using TBF.Resources;
namespace TBF.Rig.DataEntry.Fewa
namespace TBF.Rig.DataEntry.Double24
{
public partial class CycleEndForm : Form, GenericDevices.IHasCompleted
{
@@ -1,9 +1,9 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
/// Copyright (c) 2021 Sensus Slovensko a.s.
///
using TBF.Rig.GenericDevices;
namespace TBF.Rig.DataEntry.Fewa
namespace TBF.Rig.DataEntry.Double24
{
public class EntryForm : EntryFormNoStartEnd, IHasWMStatesForm
{
+206
View 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 Config.Entities.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
}
}
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
/// Copyright (c) 2021 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -8,7 +8,7 @@ using Config.Entities;
using TBF.Rig;
using TBF.Rig.GenericDevices;
namespace TBF.Rig.DataEntry.Fewa
namespace TBF.Rig.DataEntry.Double24
{
public class EntryFormNoStartEnd : ComponentBase, IOperation, IDataEntry, IHasCycleBeginForm, IHasCycleEndForm
{
@@ -123,7 +123,7 @@ namespace TBF.Rig.DataEntry.Fewa
///
void OpenBeginningDlg(EntryFormNoStartEnd myRef)
{
myRef.modelessDlg = new CycleBeginningForm(TBF.Data.WMsCount);
myRef.modelessDlg = new CycleBeginningForm(TBF.Data.WMsCount, entryFormCfg);
modelessDlg.Show();
}
///
@@ -199,8 +199,39 @@ namespace TBF.Rig.DataEntry.Fewa
{
waterMeters[i].Disabled = disabled[i] = dlg.Disabled[i];
waterMeters[i].SerialNr = dlg.SNText[i];
waterMeters[i].SerialNrAux = dlg.SN2Text[i];
if (dlg.PurchaseOrder != null) waterMeters[i].PurchaseOrder = dlg.PurchaseOrder;
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
}
}
}
@@ -1,20 +1,20 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
/// Copyright (c) 2021 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.Rig.Generic;
namespace TBF.Rig.DataEntry.Fewa
namespace TBF.Rig.DataEntry.Double24
{
public class Factory : IComponentFactory
{
public string ClassName { get { return "DataEntry.Fewa"; } }
public string ClassName { get { return GetType().Namespace.Substring(8); } }
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); }
public IComponentCfg DefaultConfig() { return new EntryFormCfg(this, GetType().Namespace.Substring(8)); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
@@ -1,20 +1,20 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
/// Copyright (c) 2021 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.Rig.Generic;
namespace TBF.Rig.DataEntry.Fewa
namespace TBF.Rig.DataEntry.Double24
{
public class FactoryNoStartEnd : IComponentFactory
{
public string ClassName { get { return "DataEntry.Fewa.NoStartEnd"; } }
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); }
public IComponentCfg DefaultConfig() { return new EntryFormCfg(this, GetType().Namespace.Substring(8) + "-NoStartEnd"); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
/// Copyright (c) 2021 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -8,7 +8,7 @@ using log4net;
using TBF.Rig.GenericDevices;
using TBF.Resources;
namespace TBF.Rig.DataEntry.Fewa
namespace TBF.Rig.DataEntry.Double24
{
public partial class TestStartEndForm : Form, GenericDevices.IHasCompleted
{
@@ -1,7 +1,7 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
namespace TBF.Rig.DataEntry.Fewa
namespace TBF.Rig.DataEntry.Double24
{
partial class TestStartEndForm
{
-45
View File
@@ -1,45 +0,0 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using TBF.Rig.Generic;
namespace TBF.Rig.DataEntry.Fewa
{
public class EntryFormCfg : ComponentCfgBase, Generic.IComponentCfg
{
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 EntryFormCfgCtrl(); }
///
/// Serialized parameters
///
public bool EnterSerialNrsAtTheEnd;
public bool ShowCycleEndForm;
/// Private parameterless constructor invoked by all other (public) constructors
EntryFormCfg()
{
Name = "DataEntry-FEWA";
ParentName = string.Empty;
EnterSerialNrsAtTheEnd = false;
ShowCycleEndForm = false;
}
public EntryFormCfg(IComponentFactory factory)
: this()
{
this.Factory = factory;
}
public string ToString(int i)
{
return string.Format("Name={0}, EnterSNsAtTheEnd={1}, ShowEndForm={2}", Name, EnterSerialNrsAtTheEnd, ShowCycleEndForm);
}
}
}
@@ -1,84 +0,0 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System;
using System.Windows.Forms;
using Common;
using Config.Entities;
using TBF.Rig.Generic;
using TBF.Resources;
namespace TBF.Rig.DataEntry.Fewa
{
public partial class EntryFormCfgCtrl : UserControl, IComponentCfgCtrl
{
public bool ShowMore { get { return false; } }
EntryFormCfg config;
public IComponentCfg Config
{
get { return config as IComponentCfg; }
set
{
config = value as EntryFormCfg;
Redraw();
}
}
public EntryFormCfgCtrl()
{
InitializeComponent();
}
private void EntryFormCfgCtrl_Load(object sender, EventArgs e)
{
Localize();
Redraw();
}
void Localize()
{
enterSNsAtTheEndCheckBox.Text = Strings.Enter_SNs_at_the_end;
showEndStateFormCheckBox.Text = Strings.Show_cycle_end_form;
}
public void Closing()
{
}
void Redraw()
{
if (config == null) return; /// Control was not loaded, settings were not changed
classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name;
enterSNsAtTheEndCheckBox.Checked = config.EnterSerialNrsAtTheEnd;
showEndStateFormCheckBox.Checked = config.ShowCycleEndForm;
}
public void Unlock()
{
nameTextBox.Enabled = true;
enterSNsAtTheEndCheckBox.Enabled = true;
showEndStateFormCheckBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
return flags;
}
public CfgUpdateFlags UpdateCfg()
{
CfgUpdateFlags flags = CfgUpdateFlags.RestartRqrd;
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
config.Name = nameTextBox.Text;
config.EnterSerialNrsAtTheEnd = enterSNsAtTheEndCheckBox.Checked;
config.ShowCycleEndForm = showEndStateFormCheckBox.Checked;
return flags;
}
}
}
-114
View File
@@ -1,114 +0,0 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
namespace TBF.Rig.DataEntry.Fewa
{
partial class EntryFormCfgCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label();
this.showEndStateFormCheckBox = new System.Windows.Forms.CheckBox();
this.enterSNsAtTheEndCheckBox = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(99, 57);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(130, 20);
this.nameTextBox.TabIndex = 2;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(35, 60);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(35, 13);
this.nameLabel.TabIndex = 1;
this.nameLabel.Text = "Name";
//
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(96, 33);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 0;
this.classNameLabel.Text = "ComonentName";
//
// showEndStateFormCheckBox
//
this.showEndStateFormCheckBox.AutoSize = true;
this.showEndStateFormCheckBox.Enabled = false;
this.showEndStateFormCheckBox.Location = new System.Drawing.Point(99, 112);
this.showEndStateFormCheckBox.Name = "showEndStateFormCheckBox";
this.showEndStateFormCheckBox.Size = new System.Drawing.Size(151, 17);
this.showEndStateFormCheckBox.TabIndex = 4;
this.showEndStateFormCheckBox.Text = "Watermeter end state form";
this.showEndStateFormCheckBox.UseVisualStyleBackColor = true;
//
// enterSNsAtTheEndCheckBox
//
this.enterSNsAtTheEndCheckBox.AutoSize = true;
this.enterSNsAtTheEndCheckBox.Enabled = false;
this.enterSNsAtTheEndCheckBox.Location = new System.Drawing.Point(99, 89);
this.enterSNsAtTheEndCheckBox.Name = "enterSNsAtTheEndCheckBox";
this.enterSNsAtTheEndCheckBox.Size = new System.Drawing.Size(167, 17);
this.enterSNsAtTheEndCheckBox.TabIndex = 3;
this.enterSNsAtTheEndCheckBox.Text = "Enter serial number at the end";
this.enterSNsAtTheEndCheckBox.UseVisualStyleBackColor = true;
//
// EntryFormCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.enterSNsAtTheEndCheckBox);
this.Controls.Add(this.showEndStateFormCheckBox);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Name = "EntryFormCfgCtrl";
this.Size = new System.Drawing.Size(300, 200);
this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox nameTextBox;
private System.Windows.Forms.Label nameLabel;
private System.Windows.Forms.Label classNameLabel;
private System.Windows.Forms.CheckBox showEndStateFormCheckBox;
private System.Windows.Forms.CheckBox enterSNsAtTheEndCheckBox;
}
}
@@ -1,120 +0,0 @@
<?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>
+2 -2
View File
@@ -25,8 +25,8 @@ namespace TBF.Rig
Factories.Add(new Elde.CoverTest.Factory());
Factories.Add(new DataEntry.Combined.EntryFormFactory());
Factories.Add(new DataEntry.DataStream.Factory());
Factories.Add(new DataEntry.Fewa.Factory());
Factories.Add(new DataEntry.Fewa.FactoryNoStartEnd());
Factories.Add(new DataEntry.Double24.Factory());
Factories.Add(new DataEntry.Double24.FactoryNoStartEnd());
Factories.Add(new DataEntry.HeatMeters6.Factory());
Factories.Add(new DataEntry.HeatMeters12.Factory());
Factories.Add(new DataEntry.Munich3.EntryFormFactory());