HART communication : IHart,Hart, Nivotrack changes, sending/receiving works OK. Todo: Interface the level, ver. 2.18.1044
This commit is contained in:
@@ -10,7 +10,7 @@ using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Hart.Nivotrack
|
||||
{
|
||||
public class NivotrackCfg : ComponentCfgBase, Generic.IComponentCfg, Config.Entities.IParamsProvider
|
||||
public class NivotrackCfg : ComponentCfgBase, Generic.IChildComponentCfg, Config.Entities.IParamsProvider
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(NivotrackCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
@@ -21,7 +21,10 @@ namespace TBF.BenchControl.Hart.Nivotrack
|
||||
|
||||
public IComponentCfgCtrl GetControl()
|
||||
{
|
||||
return new Configs.ParamsProvider.ComponentCfgCtrl(this, null);
|
||||
IList<string> parents = new List<string>();
|
||||
parents.Add("Hart");
|
||||
|
||||
return new Configs.ParamsProvider.ComponentCfgCtrl(this, parents);
|
||||
}
|
||||
|
||||
///
|
||||
@@ -32,16 +35,14 @@ namespace TBF.BenchControl.Hart.Nivotrack
|
||||
public int Par2;
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
NivotrackCfg()
|
||||
{
|
||||
}
|
||||
NivotrackCfg() { }
|
||||
|
||||
public NivotrackCfg(string name, IComponentFactory factory)
|
||||
: this()
|
||||
{
|
||||
Name = name;
|
||||
Factory = factory;
|
||||
ParentName = string.Empty;
|
||||
ParentName = "Hart";
|
||||
InitializeAll();
|
||||
}
|
||||
|
||||
@@ -141,8 +142,8 @@ namespace TBF.BenchControl.Hart.Nivotrack
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
int comPortNr;
|
||||
if (int.TryParse(strValue, out comPortNr) && comPortNr > 0 && comPortNr <= 999) return true;
|
||||
int address;
|
||||
if (int.TryParse(strValue, out address) && address >= 0 && address <= 15) return true;
|
||||
break;
|
||||
case 1:
|
||||
foreach (var v in Par1Values) if (strValue == v.ToString()) return true;
|
||||
|
||||
Reference in New Issue
Block a user