Results screen fixed for compound meters, ver.2.7.285
This commit is contained in:
@@ -250,8 +250,10 @@ namespace TBF.Screens
|
||||
|
||||
foreach (var mtr in wMtr.MeterTestRslts)
|
||||
{
|
||||
if (mtr.TestDone && (mtr.Publish() != Config.Entities.Publish.Never)
|
||||
&& (mtr.Publish() != Config.Entities.Publish.Internal))
|
||||
if ( (mtr.CompoundMeterId == (byte)CompoundMeterId.Single || mtr.CompoundMeterId == (byte)CompoundMeterId.Compound)
|
||||
&& mtr.TestDone
|
||||
&& (mtr.Publish() != Config.Entities.Publish.Never)
|
||||
&& (mtr.Publish() != Config.Entities.Publish.Internal))
|
||||
{
|
||||
testNames.Add(mtr.Name());
|
||||
}
|
||||
@@ -290,23 +292,25 @@ namespace TBF.Screens
|
||||
int ix = 0;
|
||||
foreach (var mtr in wMtr.MeterTestRslts)
|
||||
{
|
||||
if (mtr.TestDone && (mtr.Publish() != Config.Entities.Publish.Never)
|
||||
&& (mtr.Publish() != Config.Entities.Publish.Internal))
|
||||
{
|
||||
if ((mtr.CompoundMeterId == (byte)CompoundMeterId.Single || mtr.CompoundMeterId == (byte)CompoundMeterId.Compound)
|
||||
&& mtr.TestDone
|
||||
&& (mtr.Publish() != Config.Entities.Publish.Never)
|
||||
&& (mtr.Publish() != Config.Entities.Publish.Internal))
|
||||
{
|
||||
ListViewItem lvi = new ListViewItem(testNames[ix++]);
|
||||
|
||||
foreach (var item in items)
|
||||
{
|
||||
string str;
|
||||
/// TODO: Reimplement
|
||||
//if (compound)
|
||||
//{
|
||||
// str = item.CanPrintCombined ? item.PrintCombined(testRslt.Meters[2 * mtr - 2],
|
||||
// testRslt.Meters[2 * mtr - 1],
|
||||
// testRslt.CombinedMeters[mtr - 1])
|
||||
// : string.Empty;
|
||||
//}
|
||||
//else
|
||||
if (compound)
|
||||
{
|
||||
var main = wMtr.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
|
||||
var aux = wMtr.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux);
|
||||
str = (item.CanPrintCombined && main != null && aux != null)
|
||||
? item.PrintCombined(main, aux, mtr)
|
||||
: string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
str = item.CanPrintSingle ? item.Print(mtr) : string.Empty;
|
||||
}
|
||||
@@ -366,30 +370,37 @@ namespace TBF.Screens
|
||||
ListViewItem lvi = new ListViewItem(item.ClmnHeaderText);
|
||||
if (compound)
|
||||
{
|
||||
/// TODO: Reimplement
|
||||
//foreach (var mtr in wMtr.MeterTestRslts)
|
||||
//{
|
||||
// string str = (!item.CanPrintCombined || (tr == null) || (2 * mtr > tr.Meters.Count) || (mtr > tr.CombinedMeters.Count))
|
||||
// ? 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)
|
||||
// {
|
||||
// lvi.SubItems.Add(str);
|
||||
// }
|
||||
// else if (texts.Length == 2)
|
||||
// {
|
||||
// Color color = texts[1].Equals("Green") ? Color.Green : (texts[1].Equals("Red") ? Color.Red : Color.White);
|
||||
// lvi.UseItemStyleForSubItems = false;
|
||||
// lvi.SubItems.Add(texts[0]);
|
||||
// lvi.SubItems[lvi.SubItems.Count - 1].BackColor = color;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// lvi.SubItems.Add(string.Empty);
|
||||
// }
|
||||
//}
|
||||
foreach (var mtr in wMtr.MeterTestRslts)
|
||||
{
|
||||
if (mtr.CompoundMeterId == (byte)CompoundMeterId.Compound && mtr.TestDone
|
||||
&& (mtr.Publish() != Config.Entities.Publish.Never)
|
||||
&& (mtr.Publish() != Config.Entities.Publish.Internal))
|
||||
{
|
||||
var main = wMtr.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
|
||||
var aux = wMtr.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux);
|
||||
|
||||
string str = (item.CanPrintCombined && main != null && aux != null)
|
||||
? item.PrintCombined(main, aux, mtr)
|
||||
: string.Empty;
|
||||
|
||||
string[] texts = str.Split(new char[] { '|' });
|
||||
if (texts.Length == 1)
|
||||
{
|
||||
lvi.SubItems.Add(str);
|
||||
}
|
||||
else if (texts.Length == 2)
|
||||
{
|
||||
Color color = texts[1].Equals("Green") ? Color.Green : (texts[1].Equals("Red") ? Color.Red : Color.White);
|
||||
lvi.UseItemStyleForSubItems = false;
|
||||
lvi.SubItems.Add(texts[0]);
|
||||
lvi.SubItems[lvi.SubItems.Count - 1].BackColor = color;
|
||||
}
|
||||
else
|
||||
{
|
||||
lvi.SubItems.Add(string.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user