Bug fixes in MetrologyDlgDensityTab and MetrologyDlgBuoyancyTab.
This commit is contained in:
parent
c1860ab31c
commit
adf7a44a54
@ -62,6 +62,7 @@ namespace TBF.UI.Bench.Metrology
|
||||
this.buoyancyTextBox.Name = "buoyancyTextBox";
|
||||
this.buoyancyTextBox.Size = new System.Drawing.Size(110, 20);
|
||||
this.buoyancyTextBox.TabIndex = 1;
|
||||
this.buoyancyTextBox.TextChanged += new System.EventHandler(this.buoyancyTextBox_TextChanged);
|
||||
//
|
||||
// buoyancyLabel
|
||||
//
|
||||
|
||||
@ -18,12 +18,7 @@ namespace TBF.UI.Bench.Metrology
|
||||
/// Component entity that has a list of 'measurement-correction' pairs
|
||||
/// to be updated in the database on OK.
|
||||
/// </summary>
|
||||
public Component MeterEntity
|
||||
{
|
||||
get { return meterEntity; }
|
||||
set { meterEntity = value; }
|
||||
}
|
||||
Component meterEntity;
|
||||
public Component MeterEntity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Buoyancy configuration
|
||||
@ -33,26 +28,21 @@ namespace TBF.UI.Bench.Metrology
|
||||
/// <summary>
|
||||
/// A list of 'measurement-correction' pairs to be deleted from the database on OK.
|
||||
/// </summary>
|
||||
public IList<MeasurementCorrection> ToBeRemoved
|
||||
{
|
||||
get { return toBeRemoved; }
|
||||
set { toBeRemoved = value; }
|
||||
}
|
||||
IList<MeasurementCorrection> toBeRemoved;
|
||||
public IList<MeasurementCorrection> ToBeRemoved { get; set; }
|
||||
|
||||
MetrologyDlg parent;
|
||||
bool unlocked;
|
||||
bool valuesModified;
|
||||
|
||||
public MetrologyDlgBuoyancyTab()
|
||||
{
|
||||
InitializeComponent();
|
||||
toBeRemoved = new List<MeasurementCorrection>();
|
||||
unlocked = false;
|
||||
ToBeRemoved = new List<MeasurementCorrection>();
|
||||
valuesModified = false;
|
||||
}
|
||||
|
||||
private void MetrologyDlgBuoyancyTab_Load(object sender, System.EventArgs e)
|
||||
{
|
||||
if (meterEntity == null) return;
|
||||
if (MeterEntity == null) return;
|
||||
|
||||
parent = ParentForm as MetrologyDlg;
|
||||
|
||||
@ -66,13 +56,11 @@ namespace TBF.UI.Bench.Metrology
|
||||
|
||||
void RefreshAll()
|
||||
{
|
||||
buoyancyTextBox.Text = Config.Data.Buoyancy.ToString("F5");
|
||||
buoyancyTextBox.Text = BuoyancyCfg.Buoyancy.ToString();
|
||||
}
|
||||
|
||||
public void Unlock()
|
||||
{
|
||||
unlocked = true;
|
||||
|
||||
buoyancyTextBox.Enabled = true;
|
||||
}
|
||||
|
||||
@ -82,9 +70,10 @@ namespace TBF.UI.Bench.Metrology
|
||||
{
|
||||
try
|
||||
{
|
||||
double buoyancy = Utils.ParseUDouble(buoyancyTextBox.Text);
|
||||
|
||||
Config.Data.Buoyancy = BuoyancyCfg.Buoyancy = buoyancy;
|
||||
if (valuesModified)
|
||||
{
|
||||
Config.Data.Buoyancy = BuoyancyCfg.Buoyancy = Utils.ParseUDouble(buoyancyTextBox.Text);
|
||||
}
|
||||
|
||||
Component modified = BuoyancyCfg.CreateDbEntity();
|
||||
MeterEntity.Parameters = modified.Parameters;
|
||||
@ -99,25 +88,11 @@ namespace TBF.UI.Bench.Metrology
|
||||
}
|
||||
}
|
||||
|
||||
public void CancelBtnClicked()
|
||||
{
|
||||
}
|
||||
|
||||
public void AddOne()
|
||||
{
|
||||
}
|
||||
|
||||
public void RemoveSelected()
|
||||
{
|
||||
}
|
||||
|
||||
public void MoveUpSelected()
|
||||
{
|
||||
}
|
||||
|
||||
public void MoveDownSelected()
|
||||
{
|
||||
}
|
||||
public void CancelBtnClicked() { }
|
||||
public void AddOne() { }
|
||||
public void RemoveSelected() { }
|
||||
public void MoveUpSelected() { }
|
||||
public void MoveDownSelected() { }
|
||||
|
||||
public string GetWarningsBeforeSaving(ref Dictionary<string, string> renmInfo)
|
||||
{
|
||||
@ -128,6 +103,11 @@ namespace TBF.UI.Bench.Metrology
|
||||
{
|
||||
}
|
||||
|
||||
private void buoyancyTextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
valuesModified = true;
|
||||
}
|
||||
|
||||
public void SaveEntityToDB(NHibernate.ISession session)
|
||||
{
|
||||
session.SaveOrUpdate(MeterEntity);
|
||||
|
||||
@ -18,12 +18,7 @@ namespace TBF.UI.Bench.Metrology
|
||||
/// Component entity that has a list of 'measurement-correction' pairs
|
||||
/// to be updated in the database on OK.
|
||||
/// </summary>
|
||||
public Component MeterEntity
|
||||
{
|
||||
get { return meterEntity; }
|
||||
set { meterEntity = value; }
|
||||
}
|
||||
Component meterEntity;
|
||||
public Component MeterEntity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Density configuration
|
||||
@ -33,15 +28,11 @@ namespace TBF.UI.Bench.Metrology
|
||||
/// <summary>
|
||||
/// A list of 'measurement-correction' pairs to be deleted from the database on OK.
|
||||
/// </summary>
|
||||
public IList<MeasurementCorrection> ToBeRemoved
|
||||
{
|
||||
get { return toBeRemoved; }
|
||||
set { toBeRemoved = value; }
|
||||
}
|
||||
IList<MeasurementCorrection> toBeRemoved;
|
||||
public IList<MeasurementCorrection> ToBeRemoved { get; set; }
|
||||
|
||||
MetrologyDlg parent;
|
||||
bool unlocked;
|
||||
bool valuesModified;
|
||||
|
||||
public MetrologyDlgDensityTab()
|
||||
{
|
||||
@ -50,13 +41,13 @@ namespace TBF.UI.Bench.Metrology
|
||||
calibDateTimePicker.MinDate = Constants.MinDate;
|
||||
calibExpirationDateTimePicker.CustomFormat = Constants.DateFormat;
|
||||
calibExpirationDateTimePicker.MinDate = Constants.MinDate;
|
||||
toBeRemoved = new List<MeasurementCorrection>();
|
||||
unlocked = false;
|
||||
ToBeRemoved = new List<MeasurementCorrection>();
|
||||
valuesModified = false;
|
||||
}
|
||||
|
||||
private void MetrologyDlgDensityTab_Load(object sender, System.EventArgs e)
|
||||
{
|
||||
if (meterEntity == null) return;
|
||||
if (MeterEntity == null) return;
|
||||
|
||||
parent = ParentForm as MetrologyDlg;
|
||||
|
||||
@ -84,9 +75,9 @@ namespace TBF.UI.Bench.Metrology
|
||||
{
|
||||
if (DensityCfg != null)
|
||||
{
|
||||
densityTextBox.Text = Config.Data.RealDensity.ToString("F4");
|
||||
temperatureTextBox.Text = Config.Data.AtTemperature.ToString("F2");
|
||||
densityCorrTextBox.Text = Config.Formulas.DensityCorrection(Config.Data.RealDensity, Config.Data.AtTemperature).ToString("F5");
|
||||
densityTextBox.Text = DensityCfg.RealDensity.ToString();
|
||||
temperatureTextBox.Text = DensityCfg.AtTemperature.ToString();
|
||||
densityCorrTextBox.Text = Config.Formulas.DensityCorrection(DensityCfg.RealDensity, DensityCfg.AtTemperature).ToString("F5");
|
||||
calibCertificateNrTextBox.Text = DensityCfg.CalibCertificateNr;
|
||||
calibDateTimePicker.Value = (DensityCfg.CalibDate < Constants.MinDate) ? Constants.MinDate : DensityCfg.CalibDate;
|
||||
calibExpirationDateTimePicker.Value = (DensityCfg.CalibValidDate < Constants.MinDate) ? Constants.MinDate : DensityCfg.CalibValidDate;
|
||||
@ -95,8 +86,6 @@ namespace TBF.UI.Bench.Metrology
|
||||
|
||||
public void Unlock()
|
||||
{
|
||||
unlocked = true;
|
||||
|
||||
densityTextBox.Enabled = true;
|
||||
temperatureTextBox.Enabled = true;
|
||||
calibCertificateNrTextBox.Enabled = true;
|
||||
@ -110,11 +99,11 @@ namespace TBF.UI.Bench.Metrology
|
||||
{
|
||||
try
|
||||
{
|
||||
double realDensity = Utils.ParseUDouble(densityTextBox.Text);
|
||||
double atTemperature = Utils.ParseUDouble(temperatureTextBox.Text);
|
||||
|
||||
Config.Data.RealDensity = DensityCfg.RealDensity = realDensity;
|
||||
Config.Data.AtTemperature = DensityCfg.AtTemperature = atTemperature;
|
||||
if (valuesModified)
|
||||
{
|
||||
Config.Data.RealDensity = DensityCfg.RealDensity = Utils.ParseUDouble(densityTextBox.Text);
|
||||
Config.Data.AtTemperature = DensityCfg.AtTemperature = Utils.ParseUDouble(temperatureTextBox.Text);
|
||||
}
|
||||
|
||||
DensityCfg.CalibCertificateNr = calibCertificateNrTextBox.Text;
|
||||
DensityCfg.CalibDate = calibDateTimePicker.Value.Date;
|
||||
@ -133,25 +122,11 @@ namespace TBF.UI.Bench.Metrology
|
||||
}
|
||||
}
|
||||
|
||||
public void CancelBtnClicked()
|
||||
{
|
||||
}
|
||||
|
||||
public void AddOne()
|
||||
{
|
||||
}
|
||||
|
||||
public void RemoveSelected()
|
||||
{
|
||||
}
|
||||
|
||||
public void MoveUpSelected()
|
||||
{
|
||||
}
|
||||
|
||||
public void MoveDownSelected()
|
||||
{
|
||||
}
|
||||
public void CancelBtnClicked() { }
|
||||
public void AddOne() { }
|
||||
public void RemoveSelected() { }
|
||||
public void MoveUpSelected() { }
|
||||
public void MoveDownSelected() { }
|
||||
|
||||
public string GetWarningsBeforeSaving(ref Dictionary<string, string> renmInfo)
|
||||
{
|
||||
@ -165,12 +140,14 @@ namespace TBF.UI.Bench.Metrology
|
||||
private void densityTextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
UpdateDensityCorrectionDisplay();
|
||||
valuesModified = true;
|
||||
}
|
||||
|
||||
private void temperatureTextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
UpdateDensityCorrectionDisplay();
|
||||
}
|
||||
valuesModified = true;
|
||||
}
|
||||
|
||||
void UpdateDensityCorrectionDisplay()
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user