(1) Opraw DEWY disabled, (2) Upgrade DB 2.16->2.17 button, (3) minor fixes in IPERL related things, ver. 2.17.717
This commit is contained in:
parent
82da9bc2e7
commit
4e9748f4dc
@ -251,7 +251,7 @@ namespace Results
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Uncertainty, Strings.Uncertainty + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetTestRslt(t).Uncertainty())));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_error, string.Format("{0} rel.ref. ()", Strings.VName_Error), Strings.Tooltip_E_rel_ref, Quantity.Error, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).ErrorMaster)));
|
||||
#if TURA_IPERL || TURA_SPECIAL
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error, string.Format("{0} rel. ()", Strings.VName_Error), Strings.Tooltip_E_rel, Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "0" : DblFormat(u, f, p, "V3", w.GetMeterTestRslt(t).Error)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error, string.Format("{0} rel. ()", Strings.VName_Error), Strings.Tooltip_E_rel, Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "0" : FormatDbl(u, f, p, "V3", w.GetMeterTestRslt(t).Error)));
|
||||
#else
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error, string.Format("{0} rel. ()", Strings.VName_Error), Strings.Tooltip_E_rel, Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetMeterTestRslt(t).Error)));
|
||||
#endif
|
||||
@ -336,9 +336,9 @@ namespace Results
|
||||
#endif
|
||||
|
||||
#if IPERL
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.OrigCalibFactor, "iPerl OrigCalibFactor", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => DblFormat(u, f, p, "V3", w.OrigCalibFactor)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.CalibFactor, "iPerl CalibFactor", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => DblFormat(u, f, p, "V3", w.CalibFactor)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2ErrWOCorrection, "iPerl Q2ErrWOCorrection", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => DblFormat(u, f, p, "V3", w.Q2ErrWOCorrection)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.OrigCalibFactor, "iPerl OrigCalibFactor", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.OrigCalibFactor)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.CalibFactor, "iPerl CalibFactor", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.CalibFactor)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2ErrWOCorrection, "iPerl Q2ErrWOCorrection", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.Q2ErrWOCorrection)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrectionDone, "iPerl Q2CorrectionDone", Quantity.Boolean, ItemCategory.MeterResult, (w, t, u, f, p) => (w.Q2CorrectionDone ? Strings.Yes : Strings.No)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrRFlow, "iPerl Q2CorrRFlow", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrRFlow)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrLFlow, "iPerl Q2CorrLFlow", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrLFlow)));
|
||||
|
||||
@ -29,6 +29,7 @@
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.upgradeDbButton = new System.Windows.Forms.Button();
|
||||
this.upgradeDb_216_217_Button = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// upgradeDbButton
|
||||
@ -41,11 +42,22 @@
|
||||
this.upgradeDbButton.UseVisualStyleBackColor = true;
|
||||
this.upgradeDbButton.Click += new System.EventHandler(this.upgradeDbButton_Click);
|
||||
//
|
||||
// upgradeDb_216_217_Button
|
||||
//
|
||||
this.upgradeDb_216_217_Button.Location = new System.Drawing.Point(12, 52);
|
||||
this.upgradeDb_216_217_Button.Name = "upgradeDb_216_217_Button";
|
||||
this.upgradeDb_216_217_Button.Size = new System.Drawing.Size(260, 34);
|
||||
this.upgradeDb_216_217_Button.TabIndex = 1;
|
||||
this.upgradeDb_216_217_Button.Text = "Upgrade database from ver. 2.16 to ver. 2.17";
|
||||
this.upgradeDb_216_217_Button.UseVisualStyleBackColor = true;
|
||||
this.upgradeDb_216_217_Button.Click += new System.EventHandler(this.upgradeDb_216_217_Button_Click);
|
||||
//
|
||||
// UpgradeSelectionDlg
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(284, 262);
|
||||
this.Controls.Add(this.upgradeDb_216_217_Button);
|
||||
this.Controls.Add(this.upgradeDbButton);
|
||||
this.Name = "UpgradeSelectionDlg";
|
||||
this.Text = "Upgrade selection";
|
||||
@ -56,6 +68,7 @@
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button upgradeDbButton;
|
||||
private System.Windows.Forms.Button upgradeDb_216_217_Button;
|
||||
|
||||
}
|
||||
}
|
||||
@ -19,13 +19,36 @@ namespace TBF.Forms
|
||||
|
||||
private void upgradeDbButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
MySqlConnection dbConn = new MySqlConnection(Results.DB.ConnectionString);
|
||||
string[] commands = new string[]
|
||||
{
|
||||
"ALTER TABLE `testrslt` ADD `ErrorFlagsMd` TINYINT( 4 ) NOT NULL DEFAULT '0' AFTER `ErrorMaster`, ADD `ErrorFlags` INT NOT NULL DEFAULT '0' AFTER `ErrorFlagsMd`, ADD `DiverterStart` FLOAT NOT NULL DEFAULT '0.001' AFTER `ErrorMaster`, ADD `DiverterEnd` FLOAT NOT NULL DEFAULT '0.001' AFTER `DiverterStart`;",
|
||||
"ALTER TABLE `watermeter` ADD `ErrorFlags` INT NOT NULL DEFAULT '0' AFTER `QFall`;",
|
||||
};
|
||||
|
||||
if (Common(new MySqlConnection(Results.DB.ConnectionString), commands))
|
||||
{
|
||||
upgradeDbButton.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void upgradeDb_216_217_Button_Click(object sender, EventArgs e)
|
||||
{
|
||||
string[] commands = new string[]
|
||||
{
|
||||
"ALTER TABLE `testrslt` ADD `DiverterStart` FLOAT NOT NULL DEFAULT '0.001' AFTER `ErrorMaster`, ADD `DiverterEnd` FLOAT NOT NULL DEFAULT '0.001' AFTER `DiverterStart`;",
|
||||
"ALTER TABLE `watermeter` ADD `ErrorFlags` INT NOT NULL DEFAULT '0' AFTER `QFall`;",
|
||||
};
|
||||
|
||||
if (Common(new MySqlConnection(Results.DB.ConnectionString), commands))
|
||||
{
|
||||
upgradeDb_216_217_Button.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
bool Common(MySqlConnection dbConn, string[] commands)
|
||||
{
|
||||
bool success = false;
|
||||
|
||||
try
|
||||
{
|
||||
dbConn.Open();
|
||||
@ -38,7 +61,7 @@ namespace TBF.Forms
|
||||
}
|
||||
|
||||
MessageBox.Show("DB succesfully upgraded", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
upgradeDbButton.Enabled = false;
|
||||
success = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
@ -48,6 +71,8 @@ namespace TBF.Forms
|
||||
{
|
||||
dbConn.Close();
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("2.17.714.1")]
|
||||
[assembly: AssemblyFileVersion("2.17.714.1")]
|
||||
[assembly: AssemblyVersion("2.17.717.1")]
|
||||
[assembly: AssemblyFileVersion("2.17.717.1")]
|
||||
|
||||
@ -341,7 +341,7 @@ namespace TBF.UiControls
|
||||
startCycleBtn.Enabled = ((args.Flags & ButtonsEtc.StartCycleBtnEn) != 0);
|
||||
startCycleBtn.BackColor = startCycleBtn.Enabled ? colorCycleEn : colorCycleDis;
|
||||
|
||||
#if TURA_IPERL || TURA_SPECIAL
|
||||
#if OPRAV_DEWY
|
||||
customButton.Visible = ((args.Flags & ButtonsEtc.StartCycleBtnEn) != 0);
|
||||
customButton.BackColor = customButton.Visible ? colorCycleEn : colorCycleDis;
|
||||
#endif
|
||||
|
||||
Loading…
Reference in New Issue
Block a user