- all components, componentCfg-s and parameter providers use base classes - less boilerplate code, simpler access to test/procedure parameters from code - CreateTestParams(test), CreateProcedureParams(procedure) methods added - TestBenchSim class is made static, it is not inheritted by any device anymore
110 lines
2.3 KiB
C#
110 lines
2.3 KiB
C#
using System.IO;
|
|
using System.Text;
|
|
using System.Xml.Serialization;
|
|
using TBF.BenchControl.Generic;
|
|
using TBF.Resources;
|
|
|
|
namespace TBF.BenchControl.ResultsPrinters.Munich
|
|
{
|
|
public class ProcParams : ProcedureParamsBase, IParamsProvider, IProcedureParams
|
|
{
|
|
public string Version;
|
|
public string Zaehlertyp;
|
|
public string Pruefvorlage;
|
|
public string Eichjahr;
|
|
|
|
public override void InitializeAll()
|
|
{
|
|
Version = "4/13";
|
|
Zaehlertyp = "";
|
|
Pruefvorlage = "";
|
|
Eichjahr = "2014";
|
|
}
|
|
|
|
string[] paramNames = new string[]
|
|
{
|
|
Strings.Version,
|
|
"Zählertyp",
|
|
"Prüfvorlage",
|
|
"Eichjahr",
|
|
};
|
|
public override string ParamName(int i) { return paramNames[i]; }
|
|
public override int ParamsCount() { return paramNames.Length; }
|
|
|
|
public override string ToString(int i)
|
|
{
|
|
switch (i)
|
|
{
|
|
case 0: return Version;
|
|
case 1: return Zaehlertyp;
|
|
case 2: return Pruefvorlage;
|
|
case 3: return Eichjahr;
|
|
default: return string.Empty;
|
|
}
|
|
}
|
|
|
|
public void UpdateParam(int i, string strValue)
|
|
{
|
|
switch (i)
|
|
{
|
|
case 0: Version = strValue; return;
|
|
case 1: Zaehlertyp = strValue; return;
|
|
case 2: Pruefvorlage = strValue; return;
|
|
case 3: Eichjahr = strValue; return;
|
|
default: return;
|
|
}
|
|
}
|
|
|
|
public bool ValidateParam(int i, string strValue, out string message)
|
|
{
|
|
message = string.Empty;
|
|
|
|
switch (i)
|
|
{
|
|
case 0:
|
|
case 1:
|
|
case 2:
|
|
case 3:
|
|
return true;
|
|
default:
|
|
message = "Invalid index";
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public override void UpdateProcedureParams(Entities.ComponentProcedure dbEntity)
|
|
{
|
|
if (dbEntity == null) return;
|
|
try
|
|
{
|
|
ProcParams tmp = (ProcParams)(new XmlSerializer(typeof(ProcParams)))
|
|
.Deserialize(new StringReader(dbEntity.Parameters));
|
|
|
|
procedureParamsEntity = dbEntity;
|
|
componentName = dbEntity.CmpntName;
|
|
procedure = dbEntity.Procedure;
|
|
|
|
Version = tmp.Version;
|
|
Zaehlertyp = tmp.Zaehlertyp;
|
|
Pruefvorlage = tmp.Pruefvorlage;
|
|
Eichjahr = tmp.Eichjahr;
|
|
}
|
|
catch
|
|
{
|
|
}
|
|
}
|
|
|
|
|
|
public ProcParams()
|
|
{
|
|
}
|
|
|
|
public ProcParams(Entities.ComponentProcedure procParamsEntity, string componentName, Entities.Procedure procedure)
|
|
{
|
|
this.procedureParamsEntity = procParamsEntity;
|
|
this.componentName = componentName;
|
|
this.procedure = procedure;
|
|
}
|
|
}
|
|
}
|