Results to database consolidated, 1-based WMNr used in printing, saving
This commit is contained in:
@@ -153,7 +153,7 @@ namespace TBF.Screens
|
||||
(testResults[0].MetersKind == Entities.MetersKind.Combined));
|
||||
|
||||
bool first = true;
|
||||
for (int mtr = 0; mtr < (combined ? Program.WMsCount / 2 : Program.WMsCount); mtr++)
|
||||
for (int mtr = 1; mtr <= (combined ? Program.WMsCount / 2 : Program.WMsCount); mtr++)
|
||||
{
|
||||
if (TestsArrangement == Forms.ResultsConfig.TestsAre.Rows)
|
||||
{
|
||||
@@ -191,6 +191,12 @@ namespace TBF.Screens
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get decorated test names for the specified watermeter
|
||||
/// The parameter meterNr is used in the same way as the parameter meterNr of Utils.GetSortedTestResults
|
||||
/// </summary>
|
||||
/// <param name="meterNr">Water meter nr (1-based): 1 .. Program.WMsCount</param>
|
||||
/// <returns>A list of strings</returns>
|
||||
IList<string> GetAllDecoratedTestNames(int meterNr)
|
||||
{
|
||||
IList<string> rslt = new List<string>();
|
||||
@@ -200,7 +206,7 @@ namespace TBF.Screens
|
||||
BenchControl.GenericDevices.ITestMethod method =
|
||||
BenchControl.TbfComponents.FindComponent(test.Method) as BenchControl.GenericDevices.ITestMethod;
|
||||
|
||||
if ((method != null) && method.Publish && ((test.Part == 0) || (test.Part == meterNr + 1)))
|
||||
if ((method != null) && method.Publish && ((test.Part == 0) || (meterNr == 0) || (test.Part == meterNr)))
|
||||
{
|
||||
if (test.Repeats == 1)
|
||||
{
|
||||
@@ -219,7 +225,7 @@ namespace TBF.Screens
|
||||
/// <summary>
|
||||
/// Get a ListView control filled with results of the meter 'mtr'
|
||||
/// </summary>
|
||||
/// <param name="mtr">Water meter number: 0..Program.WMsCount</param>
|
||||
/// <param name="mtr">Water meter number (1-based): 1 .. Program.WMsCount</param>
|
||||
/// <returns>ListView object</returns>
|
||||
ListView GetResultsTestsAreRows(int mtr)
|
||||
{
|
||||
@@ -232,7 +238,7 @@ namespace TBF.Screens
|
||||
TBF.LocalSettings ls = Program.LocalSettings;
|
||||
if (combined)
|
||||
{
|
||||
lview.Columns.Add((mtr + 1).ToString(), (ls.RsltsCombinedClmnCount > 0) ? ls.RsltsCombinedClmnWdths[0] : 40);
|
||||
lview.Columns.Add(mtr.ToString(), (ls.RsltsCombinedClmnCount > 0) ? ls.RsltsCombinedClmnWdths[0] : 40);
|
||||
int i = 1;
|
||||
foreach (var item in items)
|
||||
{
|
||||
@@ -242,7 +248,7 @@ namespace TBF.Screens
|
||||
}
|
||||
else
|
||||
{
|
||||
lview.Columns.Add((mtr + 1).ToString(), (ls.RsltsSingleClmnCount > 0) ? ls.RsltsSingleClmnWdths[0] : 40);
|
||||
lview.Columns.Add(mtr.ToString(), (ls.RsltsSingleClmnCount > 0) ? ls.RsltsSingleClmnWdths[0] : 40);
|
||||
int i = 1;
|
||||
foreach (var item in items)
|
||||
{
|
||||
@@ -263,13 +269,13 @@ namespace TBF.Screens
|
||||
string str;
|
||||
if (combined)
|
||||
{
|
||||
str = (item.PrintCombined == null) ? string.Empty : item.PrintCombined(testRslt.Meters[2 * mtr],
|
||||
testRslt.Meters[2 * mtr + 1],
|
||||
testRslt.CombinedMeters[mtr]);
|
||||
str = (item.PrintCombined == null) ? string.Empty : item.PrintCombined(testRslt.Meters[2 * mtr - 2],
|
||||
testRslt.Meters[2 * mtr - 1],
|
||||
testRslt.CombinedMeters[mtr - 1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
str = (item.Print == null) ? string.Empty : item.Print(testRslt.Meters[mtr]);
|
||||
str = (item.Print == null) ? string.Empty : item.Print(testRslt.Meters[mtr - 1]);
|
||||
}
|
||||
|
||||
string[] texts = str.Split(new char[] { '|' });
|
||||
@@ -299,7 +305,7 @@ namespace TBF.Screens
|
||||
/// <summary>
|
||||
/// Get a ListView control filled with results of the meter 'mtr'
|
||||
/// </summary>
|
||||
/// <param name="mtr">Water meter number: 0..Program.WMsCount</param>
|
||||
/// <param name="mtr">Water meter number (1-based): 1 .. Program.WMsCount</param>
|
||||
/// <returns>ListView object</returns>
|
||||
ListView GetResultsTestsAreColumns(int mtr)
|
||||
{
|
||||
@@ -312,7 +318,7 @@ namespace TBF.Screens
|
||||
TBF.LocalSettings ls = Program.LocalSettings;
|
||||
if (combined)
|
||||
{
|
||||
lview.Columns.Add((mtr + 1).ToString(), (ls.RsltsCombinedClmnCount > 0) ? ls.RsltsCombinedClmnWdths[0] : 40);
|
||||
lview.Columns.Add(mtr.ToString(), (ls.RsltsCombinedClmnCount > 0) ? ls.RsltsCombinedClmnWdths[0] : 40);
|
||||
int i = 1;
|
||||
foreach (var str in GetAllDecoratedTestNames(mtr))
|
||||
{
|
||||
@@ -322,7 +328,7 @@ namespace TBF.Screens
|
||||
}
|
||||
else
|
||||
{
|
||||
lview.Columns.Add((mtr + 1).ToString(), (ls.RsltsSingleClmnCount > 0) ? ls.RsltsSingleClmnWdths[0] : 40);
|
||||
lview.Columns.Add(mtr.ToString(), (ls.RsltsSingleClmnCount > 0) ? ls.RsltsSingleClmnWdths[0] : 40);
|
||||
int i = 1;
|
||||
foreach (var str in GetAllDecoratedTestNames(mtr))
|
||||
{
|
||||
@@ -340,9 +346,9 @@ namespace TBF.Screens
|
||||
{
|
||||
foreach (var tr in trs)
|
||||
{
|
||||
string str = (item.PrintCombined == null || tr == null) ? string.Empty : item.PrintCombined(tr.Meters[2 * mtr],
|
||||
tr.Meters[2 * mtr + 1],
|
||||
tr.CombinedMeters[mtr]);
|
||||
string str = (item.PrintCombined == null || tr == null) ? string.Empty : item.PrintCombined(tr.Meters[2 * mtr - 2],
|
||||
tr.Meters[2 * mtr - 1],
|
||||
tr.CombinedMeters[mtr - 1]);
|
||||
string[] texts = str.Split(new char[] { '|' });
|
||||
if (texts.Length == 1)
|
||||
{
|
||||
@@ -365,7 +371,7 @@ namespace TBF.Screens
|
||||
{
|
||||
foreach (var tr in trs)
|
||||
{
|
||||
string str = (item.Print == null || tr == null) ? string.Empty : item.Print(tr.Meters[mtr]);
|
||||
string str = (item.Print == null || tr == null) ? string.Empty : item.Print(tr.Meters[mtr - 1]);
|
||||
|
||||
string[] texts = str.Split(new char[] { '|' });
|
||||
if (texts.Length == 1)
|
||||
|
||||
Reference in New Issue
Block a user