DataEntry.HeatMeters12 keeps the 'Units' selection while the software is running, restores default on start-up, ver. 2.01.342
This commit is contained in:
parent
1dbe9890f3
commit
fc0bdda553
@ -21,6 +21,9 @@ namespace TBF.BenchControl.DataEntry.HeatMeters12
|
||||
public bool ShowCycleEndForm;
|
||||
public bool SensusExtensions;
|
||||
|
||||
[XmlIgnore]
|
||||
public Config.Unit Units;
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
EntryFormCfg()
|
||||
{
|
||||
|
||||
@ -23,7 +23,9 @@ namespace TBF.BenchControl.DataEntry.HeatMeters12
|
||||
|
||||
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
|
||||
{
|
||||
return ComponentCfgBase.CreateFromDbEntity(typeof(EntryFormCfg), component, this);
|
||||
IComponentCfg cfg = ComponentCfgBase.CreateFromDbEntity(typeof(EntryFormCfg), component, this);
|
||||
(cfg as EntryFormCfg).Units = (cfg as EntryFormCfg).DefaultUnits;
|
||||
return cfg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -204,7 +204,7 @@ namespace TBF.BenchControl.DataEntry.HeatMeters12
|
||||
{
|
||||
if (Config.Units.IsEnergy(units)) unitsComboBox.Items.Add(units.ToString());
|
||||
}
|
||||
unitsComboBox.Text = entryFormCfg.DefaultUnits.ToString();
|
||||
unitsComboBox.Text = entryFormCfg.Units.ToString();
|
||||
|
||||
//Height = 115 + 90 * WaterMetersCount;
|
||||
|
||||
@ -279,12 +279,11 @@ namespace TBF.BenchControl.DataEntry.HeatMeters12
|
||||
|
||||
private void okButton_Click(object sender, EventArgs eArgs)
|
||||
{
|
||||
Config.Unit units = entryFormCfg.DefaultUnits;
|
||||
for (Config.Unit u = 0; u < Config.Unit.Count; u++)
|
||||
{
|
||||
if (u.ToString() == unitsComboBox.Text)
|
||||
{
|
||||
units = u;
|
||||
entryFormCfg.Units = u;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -298,7 +297,7 @@ namespace TBF.BenchControl.DataEntry.HeatMeters12
|
||||
if (endTextBoxes[i].Visible && endTextBoxes[i].Enabled)
|
||||
{
|
||||
WMEndState[i] = Utils.ParseUFloat(endTextBoxes[i].Text);
|
||||
EnergyEndState[i] = Config.Units.ConvertFrom(units, Utils.ParseUFloat(energyEndTextBoxes[i].Text));
|
||||
EnergyEndState[i] = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUFloat(energyEndTextBoxes[i].Text));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -311,7 +310,7 @@ namespace TBF.BenchControl.DataEntry.HeatMeters12
|
||||
WMStartStateStr[i] = startTextBoxes[i].Text;
|
||||
WMStartState[i] = Utils.ParseUFloat(startTextBoxes[i].Text);
|
||||
EnergyStartStateStr[i] = energyStartTextBoxes[i].Text;
|
||||
EnergyStartState[i] = Config.Units.ConvertFrom(units, Utils.ParseUFloat(energyStartTextBoxes[i].Text));
|
||||
EnergyStartState[i] = Config.Units.ConvertFrom(entryFormCfg.Units, Utils.ParseUFloat(energyStartTextBoxes[i].Text));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("2.10.341.1")]
|
||||
[assembly: AssemblyFileVersion("2.10.341.1")]
|
||||
[assembly: AssemblyVersion("2.10.342.1")]
|
||||
[assembly: AssemblyFileVersion("2.10.342.1")]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user