iPerlSpecial: Changes done on the system while testing Output.FileWriters.Enhanced protocol, ver.2.7.296

This commit is contained in:
Milan Hanajik
2016-05-26 17:14:55 +02:00
parent 6e418b1fc4
commit 5c93b55f58
13 changed files with 113 additions and 87 deletions
+2 -2
View File
@@ -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.7.283.0")]
[assembly: AssemblyFileVersion("2.7.283.0")]
[assembly: AssemblyVersion("2.7.296.0")]
[assembly: AssemblyFileVersion("2.7.296.0")]
+11 -11
View File
@@ -113,10 +113,8 @@ namespace Results
AllItems.Add(new WMeterRsltItemSpec(11, "Uncertainty", "Uncertainty()", (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Uncertainty().ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
/// Test results
AllItems.Add(new WMeterRsltItemSpec(12, "Test start time", "Test start date/time()",(w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : (string.IsNullOrEmpty(p) ? w.GetTestRslt(t).StartTime.ToShortTimeString()
: w.GetTestRslt(t).StartTime.ToString(p))));
AllItems.Add(new WMeterRsltItemSpec(13, "Test end time", "Test end date/time()", (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : (string.IsNullOrEmpty(p) ? w.GetTestRslt(t).EndTime.ToShortTimeString()
: w.GetTestRslt(t).EndTime.ToString(p))));
AllItems.Add(new WMeterRsltItemSpec(12, "Test start time", "Test start date/time()",(w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : (string.IsNullOrEmpty(f) ? w.GetTestRslt(t).StartTime.ToString() : string.Format(f, w.GetTestRslt(t).StartTime))));
AllItems.Add(new WMeterRsltItemSpec(13, "Test end time", "Test end date/time()", (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : (string.IsNullOrEmpty(f) ? w.GetTestRslt(t).EndTime.ToString() : string.Format(f, w.GetTestRslt(t).EndTime))));
AllItems.Add(new WMeterRsltItemSpec(14, "Test time", "Test time()", (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).TestTime.ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
AllItems.Add(new WMeterRsltItemSpec(15, "Flow", "Flow()", (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Utils.DoubleToStr(Config.Units.ConvertTo(u, w.GetTestRslt(t).FlowVolume), 4)));
AllItems.Add(new WMeterRsltItemSpec(16, "T in", "T in()", (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempInAvrg).ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
@@ -129,14 +127,18 @@ namespace Results
AllItems.Add(new WMeterRsltItemSpec(23, "P down start", "P down start()", (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDownStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(24, "P down end", "P down end()", (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDownEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(25, "Reference error", "Reference error()", (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).ErrorMaster).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(26, "Ambient temperature","Ambient temperature()",(w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbientTempAve).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(27, "Ambient pressure", "Ambient pressure()", (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbientPressAve).ToString(string.IsNullOrEmpty(p) ? "F0" : p)));
AllItems.Add(new WMeterRsltItemSpec(28, "Ambient humidity", "Ambient humidity()", (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbientHumiAve).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(26, "Ambient temperature","Ambient temperature()",(w, t, u, f, p) => (w.GetTestRslt(t) == null) ? Config.Units.ConvertTo(u, w.Batch.AmbientTempAve()).ToString(string.IsNullOrEmpty(p) ? "F1" : p) : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbientTempAve).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(27, "Ambient pressure", "Ambient pressure()", (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? Config.Units.ConvertTo(u, w.Batch.AmbientPressAve()).ToString(string.IsNullOrEmpty(p) ? "F0" : p) : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbientPressAve).ToString(string.IsNullOrEmpty(p) ? "F0" : p)));
AllItems.Add(new WMeterRsltItemSpec(28, "Ambient humidity", "Ambient humidity()", (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? Config.Units.ConvertTo(u, w.Batch.AmbientHumiAve()).ToString(string.IsNullOrEmpty(p) ? "F1" : p) : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbientHumiAve).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
/// Single and combined meter results
AllItems.Add(new WMeterRsltItemSpec(29, "Volume", "Volume()", (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeMeter).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(30, "Reference volume", "Reference volume()", (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeRef).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
#if IPERLST || IPERLST_SPECIAL
AllItems.Add(new WMeterRsltItemSpec(31, "Error", "Error()", (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "0" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).Error).ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
#else
AllItems.Add(new WMeterRsltItemSpec(31, "Error", "Error()", (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).Error).ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
#endif
AllItems.Add(new WMeterRsltItemSpec(32, "Passed", "Passed()", (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : w.GetMeterTestRslt(t).PassedColorStr()));
/// Water meter info
@@ -208,10 +210,8 @@ namespace Results
AllItems.Add(new WMeterRsltItemSpec(68, "Procedure name", "Procedure name", (w, t, u, f, p) => w.Batch.ProcedureName));
AllItems.Add(new WMeterRsltItemSpec(69, "Watermeters", "Watermeters", (w, t, u, f, p) => w.Batch.WatermetersStr));
AllItems.Add(new WMeterRsltItemSpec(70, "Protocol title", "Protocol title", (w, t, u, f, p) => w.Batch.ProtocolTitle));
AllItems.Add(new WMeterRsltItemSpec(71, "Batch start time", "Batch start date/time", (w, t, u, f, p) => string.IsNullOrEmpty(p) ? w.Batch.StartTime.ToShortDateString()
: w.Batch.StartTime.ToString(p)));
AllItems.Add(new WMeterRsltItemSpec(72, "Batch end time", "Batch end date/time", (w, t, u, f, p) => string.IsNullOrEmpty(p) ? w.Batch.EndTime.ToShortDateString()
: w.Batch.EndTime.ToString(p)));
AllItems.Add(new WMeterRsltItemSpec(71, "Batch start time", "Batch start date/time", (w, t, u, f, p) => string.IsNullOrEmpty(f) ? w.Batch.StartTime.ToString() : string.Format(f, w.Batch.StartTime)));
AllItems.Add(new WMeterRsltItemSpec(72, "Batch end time", "Batch end date/time", (w, t, u, f, p) => string.IsNullOrEmpty(f) ? w.Batch.EndTime.ToString() : string.Format(f, w.Batch.EndTime)));
AllItems.Add(new WMeterRsltItemSpec(73, null, "1 / PlsPerLtr_Read", (w, t, u, f, p) => string.IsNullOrEmpty(p) ? ((w.WaterMeterData.PulsesPerLtr != 0) ? 1 / w.WaterMeterData.PulsesPerLtr : 0).ToString()
: ((w.WaterMeterData.PulsesPerLtr != 0) ? 1 / w.WaterMeterData.PulsesPerLtr : 0).ToString(p)));
}
@@ -56,12 +56,12 @@ namespace TBF.BenchControl.DataEntry.WMStates
groupBox4.Text = Strings.Water_Meter + " 4";
groupBox5.Text = Strings.Water_Meter + " 5";
groupBox6.Text = Strings.Water_Meter + " 6";
snLabel1.Text = Strings.WMSN;
snLabel2.Text = Strings.WMSN;
snLabel3.Text = Strings.WMSN;
snLabel4.Text = Strings.WMSN;
snLabel5.Text = Strings.WMSN;
snLabel6.Text = Strings.WMSN;
snLabel1.Text = Strings.SerialNr;
snLabel2.Text = Strings.SerialNr;
snLabel3.Text = Strings.SerialNr;
snLabel4.Text = Strings.SerialNr;
snLabel5.Text = Strings.SerialNr;
snLabel6.Text = Strings.SerialNr;
wmStateLabel1.Text = Strings.WMState;
wmStateLabel2.Text = Strings.WMState;
wmStateLabel3.Text = Strings.WMState;
@@ -125,7 +125,7 @@ namespace TBF.BenchControl.Output.FileWriters.Basic
}
catch
{
return string.Format("{0}{1:yyMMdd}-{1:hhss}.txt", directory, time);
return string.Format("{0}{1:yyMMdd-HHmm}.txt", directory, time);
}
}
@@ -148,7 +148,7 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced
}
catch
{
return string.Format("{0}{1:yyMMdd}-{1:hhss}.txt", directory, time);
return string.Format("{0}{1:yyMMdd-HHmm}.txt", directory, time);
}
}
@@ -189,14 +189,18 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced
/// <summary>Start this operation</summary>
public void Start()
{
if (writer == null) return;
if (writer != null) WriteRslts(writer);
if (writer2 != null) WriteRslts(writer2);
}
void WriteRslts(StreamWriter wr)
{
///----------
/// Header
///----------
if (!string.IsNullOrEmpty(writerCfg.Header)) writer.Write(writerCfg.Header);
writer.WriteLine(batch.ProtocolTitle);
writer.WriteLine(string.Empty);
if (!string.IsNullOrEmpty(writerCfg.Header)) wr.Write(header);
wr.WriteLine(batch.ProtocolTitle);
wr.WriteLine(string.Empty);
///----------------
/// Common items
@@ -207,7 +211,7 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced
int cnt = 0;
foreach (var v in commonItems)
{
leftColumn[cnt] = v.Caption + ": ";
leftColumn[cnt] = v.Caption;
rightColumn[cnt] = v.Print(batch.WaterMeters[0]);
cnt++;
}
@@ -219,29 +223,43 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced
/// Write aligned columns
for (int i = 0; i < Math.Min(leftColumn.Length, rightColumn.Length); i++)
{
writer.Write(leftColumn[i]);
writer.Write(new string(' ', maxLen - leftColumn[i].Length + 3));
writer.WriteLine(rightColumn[i]);
wr.Write(leftColumn[i]);
wr.Write(new string(' ', maxLen - leftColumn[i].Length + 3));
wr.WriteLine(rightColumn[i]);
}
writer.WriteLine(string.Empty);
///--------
/// Body
///--------
foreach (var wm in batch.WaterMeters) WriteWM(wm);
foreach (var wm in batch.WaterMeters) WriteWM(wr, wm);
///----------
/// Footer
///----------
if (!string.IsNullOrEmpty(writerCfg.Footer)) writer.Write(writerCfg.Footer);
if (!string.IsNullOrEmpty(writerCfg.Footer)) wr.Write(footer);
}
/// <summary>
/// Write one water meter results
/// </summary>
/// <param name="wmNr">Water meter number (0-based)</param>
void WriteWM(Results.Entities.WaterMeter wm)
void WriteWM(StreamWriter wr, Results.Entities.WaterMeter wm)
{
wr.WriteLine(string.Empty);
/// Write water meter number and s/n
wr.Write(string.Format(Strings.Water_Meter_nr, wm.WMPosition));
if (!wm.Compound())
{
if (!string.IsNullOrEmpty(wm.SerialNr)) wr.Write(string.Format(", {0} {1}", Strings.SerialNr, wm.SerialNr));
}
else
{
if (!string.IsNullOrEmpty(wm.SerialNr)) wr.Write(string.Format(", {0} {1}", Strings.Main_WM_SerialNr, wm.SerialNr));
if (!string.IsNullOrEmpty(wm.SerialNrAux)) wr.Write(string.Format(", {0} {1}", Strings.Aux_WM_SerialNr, wm.SerialNrAux));
}
wr.WriteLine(string.Empty);
/// Determine column widths
int[] columnWidths = new int[testItems.Count];
int totalWidth = 0;
@@ -283,44 +301,30 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced
totalWidth += 3 * (testItems.Count - 1);
if (totalWidth < 0) totalWidth = 0;
/// Write water meter number and s/n
writer.Write(string.Format("Water meter {0}", wm.WMPosition));
if (!wm.Compound())
{
if (!string.IsNullOrEmpty(wm.SerialNr)) writer.Write(string.Format(", s/n: {0}", wm.SerialNr));
}
else
{
if (!string.IsNullOrEmpty(wm.SerialNr)) writer.Write(string.Format(", Main s/n: {0}", wm.SerialNr));
if (!string.IsNullOrEmpty(wm.SerialNrAux)) writer.Write(string.Format(", Aux s/n: {0}", wm.SerialNrAux));
}
writer.WriteLine(string.Empty);
writer.WriteLine(new String('-', totalWidth)); /// Horizontal line above the header
wr.WriteLine(new String('-', totalWidth)); /// Horizontal line above the header
/// Write column headers
for (int i = 0; i < testItems.Count; i++)
{
writer.Write(ElSpaces(testItems[i].ClmnHeaderText));
wr.Write(ElSpaces(testItems[i].ClmnHeaderText));
if (i < testItems.Count - 1)
{
if (!writerCfg.EliminateSpaces)
{
writer.Write(new string(' ', columnWidths[i] - testItems[i].ClmnHeaderText.Length + 3));
wr.Write(new string(' ', columnWidths[i] - testItems[i].ClmnHeaderText.Length + 3));
}
writer.Write(separatorStr);
wr.Write(separatorStr);
}
else
{
writer.WriteLine(string.Empty);
wr.WriteLine(string.Empty);
}
}
writer.WriteLine(new String('-', totalWidth)); /// Horizontal line between the header and the body
wr.WriteLine(new String('-', totalWidth)); /// Horizontal line between the header and the body
/// Write table data
@@ -357,27 +361,25 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced
string[] texts = itemText.Split(new char[] { '|' });
if (texts.Length == 2) { itemText = texts[0]; } /// Strip color information
writer.Write(ElSpaces(itemText));
wr.Write(ElSpaces(itemText));
if (i < testItems.Count - 1)
{
if (!writerCfg.EliminateSpaces)
{
writer.Write(new string(' ', columnWidths[i] - itemText.Length + 3));
wr.Write(new string(' ', columnWidths[i] - itemText.Length + 3));
}
writer.Write(separatorStr);
wr.Write(separatorStr);
}
else
{
writer.WriteLine(string.Empty);
wr.WriteLine(string.Empty);
}
}
}
}
writer.WriteLine(new String('-', totalWidth)); /// Horizontal line below the body
writer.WriteLine(string.Empty);
wr.WriteLine(new String('-', totalWidth)); /// Horizontal line below the body
}
@@ -393,7 +395,7 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced
public void Stop()
{
if (writer != null) writer.Close();
writer = null;
if (writer2 != null) writer2.Close();
}
}
}
@@ -73,7 +73,7 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced
YearFolders = YearFolders.FourDigit;
MonthFolders = MonthFolders.Digit;
DayFolders = DayFolders.Digit;
FileNameFormat = "{0:yyMMdd}-{0:hhss}.txt";
FileNameFormat = "{0:yyMMdd-HHmm}.txt";
Separator = Separator.None;
EliminateSpaces = false;
Header = string.Empty;
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.7.293.1")]
[assembly: AssemblyFileVersion("2.7.293.1")]
[assembly: AssemblyVersion("2.7.296.1")]
[assembly: AssemblyFileVersion("2.7.296.1")]
+28 -10
View File
@@ -277,7 +277,7 @@ namespace TBF.Resources {
}
/// <summary>
/// Looks up a localized string similar to @temperature [degC].
/// Looks up a localized string similar to @temperature [°C].
/// </summary>
internal static string AtTemperature_C {
get {
@@ -285,6 +285,15 @@ namespace TBF.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Aux.
/// </summary>
internal static string Aux {
get {
return ResourceManager.GetString("Aux", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Aux:.
/// </summary>
@@ -1437,6 +1446,15 @@ namespace TBF.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Main.
/// </summary>
internal static string Main {
get {
return ResourceManager.GetString("Main", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Main:.
/// </summary>
@@ -2787,6 +2805,15 @@ namespace TBF.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Serial Nr..
/// </summary>
internal static string SerialNr {
get {
return ResourceManager.GetString("SerialNr", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Set flow.
/// </summary>
@@ -3717,15 +3744,6 @@ namespace TBF.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to S/N:.
/// </summary>
internal static string WMSN {
get {
return ResourceManager.GetString("WMSN", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to State [liter].
/// </summary>
+1 -1
View File
@@ -1143,7 +1143,7 @@
<data name="Water_meters" xml:space="preserve">
<value>Vodoměry</value>
</data>
<data name="WMSN" xml:space="preserve">
<data name="SerialNr" xml:space="preserve">
<value>S/N</value>
</data>
<data name="WMState" xml:space="preserve">
+2 -2
View File
@@ -933,8 +933,8 @@
<data name="Water_Meter_SNs_States" xml:space="preserve">
<value>WZ-Serienummer_Stand</value>
</data>
<data name="WMSN" xml:space="preserve">
<value>WZ-Typ</value>
<data name="SerialNr" xml:space="preserve">
<value>Seriennummer</value>
</data>
<data name="WMState" xml:space="preserve">
<value>WZ_Stand</value>
+1 -1
View File
@@ -1044,7 +1044,7 @@
<data name="Water_meters" xml:space="preserve">
<value>Wodomierze</value>
</data>
<data name="WMSN" xml:space="preserve">
<data name="SerialNr" xml:space="preserve">
<value>S / N:</value>
</data>
<data name="WMState" xml:space="preserve">
+9 -3
View File
@@ -835,8 +835,8 @@
<data name="Water_Meter_States" xml:space="preserve">
<value>Water Meter States</value>
</data>
<data name="WMSN" xml:space="preserve">
<value>S/N:</value>
<data name="SerialNr" xml:space="preserve">
<value>Serial Nr.</value>
</data>
<data name="WMState" xml:space="preserve">
<value>State [liter]</value>
@@ -1031,7 +1031,7 @@
<value>Start</value>
</data>
<data name="AtTemperature_C" xml:space="preserve">
<value>@temperature [degC]</value>
<value>@temperature [°C]</value>
</data>
<data name="Density_kg_m3" xml:space="preserve">
<value>Density [kg/m3]</value>
@@ -1354,4 +1354,10 @@
<data name="Year_of_production" xml:space="preserve">
<value>Year of production</value>
</data>
<data name="Aux" xml:space="preserve">
<value>Aux</value>
</data>
<data name="Main" xml:space="preserve">
<value>Main</value>
</data>
</root>
@@ -1140,7 +1140,7 @@
<data name="Water_meters" xml:space="preserve">
<value>水表</value>
</data>
<data name="WMSN" xml:space="preserve">
<data name="SerialNr" xml:space="preserve">
<value>序列号:</value>
</data>
<data name="WMState" xml:space="preserve">