Calibration certificate nr., date, validity, etc. added to Metrology UI, BalanceCfg, ver.2.5.275
This commit is contained in:
@@ -87,6 +87,8 @@ namespace TBF.UiControls
|
||||
buoyancyTempLabel.Text = Strings.Ambient_temperature_;
|
||||
buoyancyPressLabel.Text = Strings.Ambient_pressure_;
|
||||
buoyancyHumiLabel.Text = Strings.Ambient_humidity_;
|
||||
/// airDensityLabel.Text =
|
||||
/// weightStandardDensityLabel =
|
||||
|
||||
testGroupBox.Text = Strings.Test_measured_corrected;
|
||||
measuredLabel.Text = Strings.Measured;
|
||||
@@ -97,9 +99,15 @@ namespace TBF.UiControls
|
||||
{
|
||||
if (BalanceCfg != null)
|
||||
{
|
||||
calibCertificateNrTextBox.Text = BalanceCfg.CalibCertificateNr;
|
||||
calibDateTextBox.Text = BalanceCfg.CalibDate.ToShortDateString();
|
||||
calibValidDateTextBox.Text = BalanceCfg.CalibValidDate.ToShortDateString();
|
||||
|
||||
buoyancyTempTextBox.Text = BalanceCfg.BuoyancyTemp.ToString("F2");
|
||||
buoyancyPressTextBox.Text = BalanceCfg.BuoyancyPress.ToString("F4");
|
||||
buoyancyHumiTextBox.Text = BalanceCfg.BuoyancyHumi.ToString("F1");
|
||||
/// airDensityTextBox.Text = //calculate air density
|
||||
weightStandardDensityTextBox.Text = BalanceCfg.WeightStandardDensity.ToString("F1");
|
||||
}
|
||||
|
||||
listViewEx.Items.Clear();
|
||||
@@ -150,9 +158,13 @@ namespace TBF.UiControls
|
||||
{
|
||||
unlocked = true;
|
||||
|
||||
calibCertificateNrTextBox.Enabled = true;
|
||||
calibDateTextBox.Enabled = true;
|
||||
calibValidDateTextBox.Enabled = true;
|
||||
buoyancyTempTextBox.Enabled = true;
|
||||
buoyancyPressTextBox.Enabled = true;
|
||||
buoyancyHumiTextBox.Enabled = true;
|
||||
weightStandardDensityTextBox.Enabled = true;
|
||||
|
||||
if (listViewEx.SelectedItems.Count == 1)
|
||||
{
|
||||
@@ -165,18 +177,26 @@ namespace TBF.UiControls
|
||||
|
||||
public void OkBtnClicked()
|
||||
{
|
||||
try
|
||||
if (BalanceCfg != null)
|
||||
{
|
||||
BalanceCfg.BuoyancyTemp = Utils.ParseSFloat(buoyancyTempTextBox.Text);
|
||||
BalanceCfg.BuoyancyPress = Utils.ParseUFloat(buoyancyPressTextBox.Text);
|
||||
BalanceCfg.BuoyancyHumi = Utils.ParseUFloat(buoyancyHumiTextBox.Text);
|
||||
try
|
||||
{
|
||||
BalanceCfg.CalibCertificateNr = calibCertificateNrTextBox.Text;
|
||||
BalanceCfg.CalibDate = DateTime.Parse(calibDateTextBox.Text);
|
||||
BalanceCfg.CalibValidDate = DateTime.Parse(calibValidDateTextBox.Text);
|
||||
|
||||
Component modified = BalanceCfg.CreateDbEntity();
|
||||
MeterEntity.Parameters = modified.Parameters;
|
||||
}
|
||||
catch
|
||||
{
|
||||
MessageBox.Show(Strings.Invalid_buoyancy_parameter_Correct_pls, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
BalanceCfg.BuoyancyTemp = Utils.ParseSFloat(buoyancyTempTextBox.Text);
|
||||
BalanceCfg.BuoyancyPress = Utils.ParseUFloat(buoyancyPressTextBox.Text);
|
||||
BalanceCfg.BuoyancyHumi = Utils.ParseUFloat(buoyancyHumiTextBox.Text);
|
||||
BalanceCfg.WeightStandardDensity = Utils.ParseUFloat(weightStandardDensityTextBox.Text);
|
||||
|
||||
Component modified = BalanceCfg.CreateDbEntity();
|
||||
MeterEntity.Parameters = modified.Parameters;
|
||||
}
|
||||
catch
|
||||
{
|
||||
MessageBox.Show(Strings.Invalid_buoyancy_parameter_Correct_pls, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user