(1) iperl_check with Continue/Abort (2) MeterTestRslt.ErrorIndicators (not in DB) (3) ErrorFlags.Errors modif. (4) ResultsTabPage commonBackColor, etc.

This commit is contained in:
Milan Hanajik
2019-03-12 11:15:59 +01:00
parent d45c3f96d6
commit 70cba76ffd
22 changed files with 650 additions and 584 deletions
@@ -1,18 +1,20 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using Config.Entities;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Various.ErrorFlags
{
public class ErrorsCfg : ComponentCfgBase, IComponentCfg
public class ErrorsCfg : ComponentCfgBase, IComponentCfg, Config.Entities.IParamsProvider
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ErrorsCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new ErrorsCfgCtrl(); }
public IComponentCfgCtrl GetControl() { return new Configs.ParamsProvider.ComponentCfgCtrl(this, null); }
///
/// Serialized parameters
@@ -37,12 +39,97 @@ namespace TBF.BenchControl.Various.ErrorFlags
: this()
{
Name = name;
Factory = factory;
ParentName = string.Empty;
Factory = factory;
InitializeAll();
}
public string ComponentName { get { return Name; } }
public void InitializeAll()
{
Q3Names = "Q3";
Q2Names = "Q2";
Q1Names = "Q1";
}
public string ToString(int i)
string[] paramNames = new string[]
{
return string.Format("{0}", Name);
}
}
"1st test name for E15,E16 (Q3)",
"2nd test name for E15,E16 (Q2)",
"3rd test name for E15,E16 (Q1)",
};
public string ParamName(int i) { return paramNames[i]; }
public int ParamsCount() { return paramNames.Length; }
public IList<string> ParamValues(int i)
{
return null;
}
public string ToString(int i)
{
if (i == -1)
{
return string.Format("{0}", Name);
}
switch (i)
{
case 0: return Q3Names;
case 1: return Q2Names;
case 2: return Q1Names;
default: return string.Empty;
}
}
public CfgUpdateFlags UpdateParam(int i, string strValue)
{
switch (i)
{
case 0: Q3Names = strValue; return CfgUpdateFlags.RestartRqrd;
case 1: Q1Names = strValue; return CfgUpdateFlags.RestartRqrd;
case 2: Q1Names = strValue; return CfgUpdateFlags.RestartRqrd;
default: return CfgUpdateFlags.None;
}
}
public bool ValidateParam(int i, string strValue, out string message)
{
message = string.Empty;
switch (i)
{
case 0:
case 1:
case 2:
return true;
default:
message = "Invalid index";
return false;
}
//message = ParamName(i) + " is invalid";
//return false;
}
void CopyContentTo(ErrorsCfg prms)
{
prms.Q3Names = this.Q3Names;
prms.Q2Names = this.Q2Names;
prms.Q1Names = this.Q1Names;
}
public Config.Entities.IParamsProvider Clone()
{
ErrorsCfg pars = new ErrorsCfg();
CopyContentTo(pars);
return pars;
}
public bool UpdateEmbeddedDbEntity()
{
return true; /// =OK, do nothing
}
}
}