Conductivity bug fixes, DB import/export works OK with root user password.
This commit is contained in:
parent
3cbc845183
commit
435261831a
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.26.1447.0")]
|
||||
[assembly: AssemblyFileVersion("2.26.1447.0")]
|
||||
[assembly: AssemblyVersion("2.26.1458.0")]
|
||||
[assembly: AssemblyFileVersion("2.26.1458.0")]
|
||||
|
||||
@ -68,6 +68,8 @@ namespace Config
|
||||
[Description("kWh")] kWh, /// 1 kWh = 3600000 J
|
||||
[Description("MWh")] MWh, /// 1 MWh = 3600000000 J
|
||||
|
||||
[Description("uS/cm")] uSpcm, /// * 1 uS/cm
|
||||
|
||||
#if LANG_PL
|
||||
[Description("imp/l")] ppl, /// * 1 pulse/l
|
||||
[Description("imp/dm3")] ppdm3, /// * 1 pulse/dm3
|
||||
@ -112,6 +114,7 @@ namespace Config
|
||||
[Description("Impulse")] Pulses,
|
||||
[Description("Impulse/l")] PulsePerLtr,
|
||||
[Description("Impulse/kWh")] PulsePerKWh,
|
||||
[Description("Leitfähigkeit")] Conductivity,
|
||||
|
||||
/// Quantities without units and conversions
|
||||
[Description("Nummer")] Number,
|
||||
@ -133,6 +136,7 @@ namespace Config
|
||||
[Description("Impulsy")] Pulses,
|
||||
[Description("Impulsy/litr")] PulsePerLtr,
|
||||
[Description("Impulsy/kWh")] PulsePerKWh,
|
||||
[Description("Przewodność")] Conductivity,
|
||||
|
||||
/// Quantities without units and conversions
|
||||
[Description("Numer")] Number,
|
||||
@ -154,6 +158,7 @@ namespace Config
|
||||
[Description("Pulzy")] Pulses,
|
||||
[Description("Pulzy/litr")] PulsePerLtr,
|
||||
[Description("Pulzy/kWh")] PulsePerKWh,
|
||||
[Description("Vodivost")] Conductivity,
|
||||
|
||||
/// Quantities without units and conversions
|
||||
[Description("Počet")] Number,
|
||||
@ -175,6 +180,7 @@ namespace Config
|
||||
[Description("Impulso")] Pulses,
|
||||
[Description("Impulso/litro")] PulsePerLtr,
|
||||
[Description("Impulso/kWh")] PulsePerKWh,
|
||||
[Description("Conduttività")] Conductivity,
|
||||
|
||||
/// Quantities without units and conversions
|
||||
[Description("Numero")] Number,
|
||||
@ -196,6 +202,7 @@ namespace Config
|
||||
[Description("Pulses")] Pulses,
|
||||
[Description("Pulses/liter")] PulsePerLtr,
|
||||
[Description("Pulses/kWh")] PulsePerKWh,
|
||||
[Description("Conductivity")] Conductivity,
|
||||
|
||||
/// Quantities without units and conversions
|
||||
[Description("Number")] Number,
|
||||
@ -217,7 +224,7 @@ namespace Config
|
||||
public static bool IsDefaultUnit(Unit unit)
|
||||
{
|
||||
return unit == Unit.l || unit == Unit.m3ph || unit == Unit.kg || unit == Unit.s || unit == Unit.C || unit == Unit.bar || unit == Unit.RPct ||
|
||||
unit == Unit.Pct || unit == Unit.mm || unit == Unit.kgpm3 || unit == Unit.J || unit == Unit.ppl || unit == Unit.ppkWh;
|
||||
unit == Unit.Pct || unit == Unit.mm || unit == Unit.kgpm3 || unit == Unit.J || unit == Unit.ppl || unit == Unit.ppkWh || unit == Unit.uSpcm;
|
||||
}
|
||||
|
||||
public static bool IsQuantity(Unit units, Quantity quantity)
|
||||
@ -309,6 +316,9 @@ namespace Config
|
||||
case Unit.kWhpp:
|
||||
return Config.Quantity.PulsePerKWh;
|
||||
|
||||
case Unit.uSpcm:
|
||||
return Config.Quantity.Conductivity;
|
||||
|
||||
default:
|
||||
return Config.Quantity.Number;
|
||||
}
|
||||
@ -328,6 +338,8 @@ namespace Config
|
||||
public static bool IsPulses(Unit units) { return IsQuantity(units, Config.Quantity.Pulses); }
|
||||
public static bool IsPulsePerLtr(Unit units) { return IsQuantity(units, Config.Quantity.PulsePerLtr); }
|
||||
public static bool IsPulsePerKWh(Unit units) { return IsQuantity(units, Config.Quantity.PulsePerKWh); }
|
||||
public static bool IsConductivity(Unit units) { return IsQuantity(units, Config.Quantity.Conductivity); }
|
||||
|
||||
|
||||
|
||||
public static double ConvertTo(Unit units, double v)
|
||||
|
||||
@ -320,6 +320,13 @@ namespace Results
|
||||
|
||||
ThreeState, /// 272
|
||||
|
||||
Conduct, /// 273
|
||||
Conduct_start, /// 274
|
||||
Conduct_end, /// 275
|
||||
Conduct_avg, /// 276
|
||||
Conduct_min, /// 277
|
||||
Conduct_max, /// 278
|
||||
|
||||
Count,
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.26.1447.0")]
|
||||
[assembly: AssemblyFileVersion("2.26.1447.0")]
|
||||
[assembly: AssemblyVersion("2.26.1458.0")]
|
||||
[assembly: AssemblyFileVersion("2.26.1458.0")]
|
||||
|
||||
9
Results/Resources/Strings.Designer.cs
generated
9
Results/Resources/Strings.Designer.cs
generated
@ -1977,6 +1977,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Conduct..
|
||||
/// </summary>
|
||||
internal static string VName_Conduct {
|
||||
get {
|
||||
return ResourceManager.GetString("VName_Conduct", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Ro.
|
||||
/// </summary>
|
||||
|
||||
@ -825,4 +825,7 @@
|
||||
<data name="Selected_items" xml:space="preserve">
|
||||
<value>Selected item</value>
|
||||
</data>
|
||||
<data name="VName_Conduct" xml:space="preserve">
|
||||
<value>Conduct.</value>
|
||||
</data>
|
||||
</root>
|
||||
@ -297,6 +297,16 @@ namespace Results
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_mean_from_up_down_per_mtr, string.Format("{0} UP-DW ME per mtr ()", Strings.VName_Press), "P delta mean from UP/DW per one meter", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).PressUpMean - w.GetTestRslt(t).PressDownMean) / Math.Max(1, w.GetTestRslt(t).Batch.WaterMeters.Count))));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_PMax_test_mean, string.Format("{0} PMax mean ()", Strings.VName_Press), "Mean PMax test pressure", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsPMaxTest()) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).PressUpMean + w.GetTestRslt(t).PressDownMean) / 2)));
|
||||
|
||||
///
|
||||
/// Electrical conductivity of water
|
||||
///
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Conduct, string.Format("{0} ME ()", Strings.VName_Conduct), Quantity.Conductivity, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).ConductMean)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Conduct_start, string.Format("{0} ST ()", Strings.VName_Conduct), Quantity.Conductivity, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).ConductStart)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Conduct_end, string.Format("{0} EN ()", Strings.VName_Conduct), Quantity.Conductivity, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).ConductEnd)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Conduct_avg, string.Format("{0} avg ()", Strings.VName_Conduct), Quantity.Conductivity, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).ConductStart + w.GetTestRslt(t).ConductEnd) / 2)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Conduct_min, string.Format("{0} min ()", Strings.VName_Conduct), Quantity.Conductivity, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).ConductMin)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Conduct_max, string.Format("{0} max ()", Strings.VName_Conduct), Quantity.Conductivity, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).ConductMax)));
|
||||
|
||||
///
|
||||
/// Ambient temperature/pressure/humidity/Buoyancy
|
||||
///
|
||||
|
||||
@ -57,12 +57,12 @@ namespace TBF.BenchControl.Output.EventTriggers.Standard
|
||||
public bool E15;
|
||||
public bool E16;
|
||||
public bool E21;
|
||||
public bool E36;
|
||||
#if TURA_IPERL || TURA_SPECIAL
|
||||
public bool E26;
|
||||
public bool E27;
|
||||
public bool E28;
|
||||
#endif
|
||||
public bool E36;
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
TriggerCfg() {}
|
||||
@ -80,7 +80,7 @@ namespace TBF.BenchControl.Output.EventTriggers.Standard
|
||||
|
||||
public void InitializeAll()
|
||||
{
|
||||
EventSource = "Results"; /// 0
|
||||
EventSource = "Výsledky"; /// 0
|
||||
FailedWMsPct = 20; /// 1
|
||||
Mid1Name = "I1"; /// 2
|
||||
Mid1ErrAfterCorr = 0.3; /// 3
|
||||
@ -114,12 +114,12 @@ namespace TBF.BenchControl.Output.EventTriggers.Standard
|
||||
E15 = false; /// 31
|
||||
E16 = false; /// 32
|
||||
E21 = false; /// 33
|
||||
E36 = true; /// 34
|
||||
#if TURA_IPERL || TURA_SPECIAL
|
||||
E26 = false; /// 35
|
||||
E27 = false; /// 36
|
||||
E28 = false; /// 37
|
||||
E26 = false; /// 34
|
||||
E27 = false; /// 35
|
||||
E28 = false; /// 36
|
||||
#endif
|
||||
E36 = true; /// 34 or 37
|
||||
}
|
||||
|
||||
string[] paramNames = new string[]
|
||||
@ -158,12 +158,12 @@ namespace TBF.BenchControl.Output.EventTriggers.Standard
|
||||
"E15", /// 31
|
||||
"E16", /// 32
|
||||
"E21", /// 33
|
||||
"E36", /// 34
|
||||
#if TURA_IPERL || TURA_SPECIAL
|
||||
"E26", /// 35
|
||||
"E27", /// 36
|
||||
"E28", /// 37
|
||||
"E26", /// 34
|
||||
"E27", /// 35
|
||||
"E28", /// 36
|
||||
#endif
|
||||
"E36", /// 34 or 37
|
||||
};
|
||||
public string ParamName(int i) { return paramNames[i]; }
|
||||
public int ParamsCount() { return paramNames.Length; }
|
||||
@ -222,11 +222,13 @@ namespace TBF.BenchControl.Output.EventTriggers.Standard
|
||||
case 31: return E15 ? Strings.yes : Strings.no;
|
||||
case 32: return E16 ? Strings.yes : Strings.no;
|
||||
case 33: return E21 ? Strings.yes : Strings.no;
|
||||
case 34: return E36 ? Strings.yes : Strings.no;
|
||||
#if TURA_IPERL || TURA_SPECIAL
|
||||
case 35: return E26 ? Strings.yes : Strings.no;
|
||||
case 36: return E27 ? Strings.yes : Strings.no;
|
||||
case 37: return E28 ? Strings.yes : Strings.no;
|
||||
case 34: return E26 ? Strings.yes : Strings.no;
|
||||
case 35: return E27 ? Strings.yes : Strings.no;
|
||||
case 36: return E28 ? Strings.yes : Strings.no;
|
||||
case 37: return E36 ? Strings.yes : Strings.no;
|
||||
#else
|
||||
case 34: return E36 ? Strings.yes : Strings.no;
|
||||
#endif
|
||||
default: return string.Empty;
|
||||
}
|
||||
@ -270,11 +272,13 @@ namespace TBF.BenchControl.Output.EventTriggers.Standard
|
||||
case 31: E15 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
|
||||
case 32: E16 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
|
||||
case 33: E21 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
|
||||
case 34: E36 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
|
||||
#if TURA_IPERL || TURA_SPECIAL
|
||||
case 35: E26 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
|
||||
case 36: E27 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
|
||||
case 37: E28 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
|
||||
case 34: E26 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
|
||||
case 35: E27 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
|
||||
case 36: E28 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
|
||||
case 37: E36 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
|
||||
#else
|
||||
case 34: E36 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
|
||||
#endif
|
||||
default: return CfgUpdateFlags.None;
|
||||
}
|
||||
@ -390,12 +394,12 @@ namespace TBF.BenchControl.Output.EventTriggers.Standard
|
||||
prms.E15 = this.E15; /// 31
|
||||
prms.E16 = this.E16; /// 32
|
||||
prms.E21 = this.E21; /// 33
|
||||
prms.E36 = this.E36; /// 34
|
||||
#if TURA_IPERL || TURA_SPECIAL
|
||||
prms.E26 = this.E26; /// 35
|
||||
prms.E27 = this.E27; /// 36
|
||||
prms.E28 = this.E28; /// 37
|
||||
prms.E26 = this.E26; /// 34
|
||||
prms.E27 = this.E27; /// 35
|
||||
prms.E28 = this.E28; /// 36
|
||||
#endif
|
||||
prms.E36 = this.E36; /// 34 or 37
|
||||
}
|
||||
|
||||
public Config.Entities.IParamsProvider Clone()
|
||||
|
||||
@ -182,7 +182,7 @@ namespace TBF.BenchControl.Sequences
|
||||
public static FloatBox PressUp = new FloatBox() { Name = "Pressure Up", Format = "F2" }; /// [bar]
|
||||
public static FloatBox PressDown = new FloatBox() { Name = "Pressure Dn", Format = "F2" }; /// [bar]
|
||||
public static FloatBox PressDelta = new FloatBox() { Name = "Pressure Delta", Format = "F2" }; /// [bar]
|
||||
public static FloatBox Conductivity = new FloatBox() { Name = "Conductivity", Format = "F0" }; /// [uS/cm]
|
||||
public static FloatBox Conductivity = new FloatBox(750) { Name = "Conductivity", Format = "F0" }; /// [uS/cm], default is 750
|
||||
|
||||
public static double LtrPerRefPulse; /// to calculate the ref.volume
|
||||
public static int RefPulses;
|
||||
|
||||
@ -1503,6 +1503,8 @@ namespace TBF.BenchControl.Sequences
|
||||
tstRslt.TempUpMax = 20.0f;
|
||||
tstRslt.TempDownMax = 20.0f;
|
||||
tstRslt.TempDivMax = 20.0f;
|
||||
tstRslt.ConductMin = Conductivity.Val;
|
||||
tstRslt.ConductMax = Conductivity.Val;
|
||||
|
||||
tstRslt.DensityIn = Config.Formulas.RealDensity();
|
||||
tstRslt.DensityLine = Config.Formulas.RealDensity();
|
||||
@ -1638,6 +1640,8 @@ namespace TBF.BenchControl.Sequences
|
||||
tstRslt.TempUpMax = 20.0f;
|
||||
tstRslt.TempDownMax = 20.0f;
|
||||
tstRslt.TempDivMax = 20.0f;
|
||||
tstRslt.ConductMin = Conductivity.Val;
|
||||
tstRslt.ConductMax = Conductivity.Val;
|
||||
|
||||
tstRslt.FlowMean = (float)RefFlowStat.Average;
|
||||
tstRslt.FlowStart = (float)RefFlowStat.First;
|
||||
@ -1767,6 +1771,8 @@ namespace TBF.BenchControl.Sequences
|
||||
tstRslt.TempUpMax = 20.0f;
|
||||
tstRslt.TempDownMax = 20.0f;
|
||||
tstRslt.TempDivMax = 20.0f;
|
||||
tstRslt.ConductMin = Conductivity.Val;
|
||||
tstRslt.ConductMax = Conductivity.Val;
|
||||
|
||||
tstRslt.FlowMean = 0; /// TODO
|
||||
tstRslt.FlowMax = 0; /// TODO
|
||||
|
||||
@ -964,41 +964,28 @@ namespace TBF.UI
|
||||
{
|
||||
string databaseName = Config.Utils.GetDBName(connectionString);
|
||||
string userName = Config.Utils.GetDBUser(connectionString);
|
||||
string password = Config.Utils.GetDBPassword(connectionString); /// TODO: Use password
|
||||
string password = Config.Utils.GetDBPassword(connectionString);
|
||||
|
||||
try
|
||||
{
|
||||
string credFileName = "tempfile";
|
||||
using (TextWriter writer = new StreamWriter(credFileName))
|
||||
const string CredFileName = "tempfile";
|
||||
using (TextWriter writer = new StreamWriter(CredFileName))
|
||||
{
|
||||
writer.WriteLine("[mysqldump]");
|
||||
writer.WriteLine(string.Format("user={0}", userName));
|
||||
writer.WriteLine(string.Format("password={0}", password));
|
||||
writer.WriteLine("host=localhost");
|
||||
writer.WriteLine("default-character-set=utf8");
|
||||
writer.WriteLine("[client]");
|
||||
writer.WriteLine(string.Format("password=\"{0}\"", password));
|
||||
}
|
||||
|
||||
System.Diagnostics.Process proc = new System.Diagnostics.Process();
|
||||
proc.StartInfo.FileName = @"C:\xampp\mysql\bin\mysqldump";
|
||||
///proc.StartInfo.Arguments = string.Format("--defaults-file={0} --quick -- {1} -r {2}", credFileName, databaseName, outputFileName);
|
||||
proc.StartInfo.Arguments = string.Format("--defaults-file={0} --quick -- {1}", credFileName, databaseName);
|
||||
proc.StartInfo.Arguments = string.Format("--defaults-file={0} --user={1} --host=localhost --protocol=tcp --port=3306 --default-character-set=utf8 --skip-triggers \"{2}\" -r {3}",
|
||||
CredFileName, userName, databaseName, outputFileName);
|
||||
proc.StartInfo.RedirectStandardOutput = true;
|
||||
proc.StartInfo.UseShellExecute = false;
|
||||
proc.StartInfo.CreateNoWindow = true;
|
||||
//proc.StartInfo.Verb = "runas"; /// To run mysqldump.exe as administrator
|
||||
proc.Start();
|
||||
proc.WaitForExit();
|
||||
|
||||
using (TextWriter writer = new StreamWriter(File.OpenWrite(outputFileName)))
|
||||
{
|
||||
proc.Start();
|
||||
while (!proc.StandardOutput.EndOfStream)
|
||||
{
|
||||
string line = proc.StandardOutput.ReadLine();
|
||||
writer.WriteLine(line);
|
||||
}
|
||||
proc.WaitForExit();
|
||||
}
|
||||
|
||||
File.Delete(credFileName);
|
||||
File.Delete(CredFileName);
|
||||
|
||||
log.ErrorFormat("Database {0} exported into file {1}", databaseName, outputFileName);
|
||||
return true;
|
||||
|
||||
@ -489,11 +489,8 @@ namespace TBF.UI.Settings
|
||||
{
|
||||
using (TextWriter writer = new StreamWriter(CredFileName))
|
||||
{
|
||||
writer.WriteLine("[mysql]");
|
||||
writer.WriteLine(string.Format("user={0}", userName));
|
||||
writer.WriteLine(string.Format("password={0}", password));
|
||||
writer.WriteLine("host=localhost");
|
||||
writer.WriteLine("default-character-set=utf8");
|
||||
writer.WriteLine("[client]");
|
||||
writer.WriteLine(string.Format("password=\"{0}\"", password));
|
||||
}
|
||||
|
||||
System.Diagnostics.Process proc = new System.Diagnostics.Process();
|
||||
@ -501,11 +498,11 @@ namespace TBF.UI.Settings
|
||||
proc.StartInfo.FileName = @"C:\xampp\mysql\bin\mysql.exe";
|
||||
if (string.IsNullOrEmpty(databaseToBeUsed))
|
||||
{
|
||||
proc.StartInfo.Arguments = string.Format("--defaults-file={0}", CredFileName);
|
||||
proc.StartInfo.Arguments = string.Format("--defaults-file={0} --user={1} --host=localhost --protocol=tcp --port=3306 --default-character-set=utf8", CredFileName, userName);
|
||||
}
|
||||
else
|
||||
{
|
||||
proc.StartInfo.Arguments = string.Format("--defaults-file={0} --database={1}", CredFileName, databaseToBeUsed);
|
||||
proc.StartInfo.Arguments = string.Format("--defaults-file={0} --user={1} --host=localhost --protocol=tcp --port=3306 --default-character-set=utf8 --database={2}", CredFileName, userName, databaseToBeUsed);
|
||||
}
|
||||
proc.StartInfo.UseShellExecute = false; /// Must be false to redirect standard input or standard output
|
||||
proc.StartInfo.RedirectStandardOutput = false;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user