ParamValues() retval IList->ICollection, GetControl() arg. is a list of components, ver. 3.1.1598
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
using Config;
|
||||
using Config.Entities;
|
||||
@@ -17,9 +18,10 @@ namespace TBF.BenchControl.Modbus.Ambient.Comet
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
|
||||
public IComponentCfgCtrl GetControl()
|
||||
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities)
|
||||
{
|
||||
return new Configs.ParamsProvider.ComponentCfgCtrl(this, new List<string>(new string[] { "Modbus" }));
|
||||
var parents = cmpntEntities.Where(x => x.ClassName == "Modbus.Common");
|
||||
return new Configs.ParamsProvider.ComponentCfgCtrl(this, parents);
|
||||
}
|
||||
|
||||
///
|
||||
@@ -126,16 +128,16 @@ namespace TBF.BenchControl.Modbus.Ambient.Comet
|
||||
public string ParamName(int i) { return paramNames[i]; }
|
||||
public int ParamsCount() { return paramNames.Length; }
|
||||
|
||||
public IList<string> ParamValues(int i)
|
||||
public ICollection<string> ParamValues(int i)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 1:
|
||||
return new List<string>(new string[] { "°C", "°F", "K" });
|
||||
return new string[] { "°C", "°F", "K" };
|
||||
case 5:
|
||||
return new List<string>(new string[] { "Pa", "hPa", "mbar", "kPa", "inHg", "psi", "bar", "MPa" });
|
||||
return new string[] { "Pa", "hPa", "mbar", "kPa", "inHg", "psi", "bar", "MPa" };
|
||||
case 9:
|
||||
return new List<string>(new string[] { "R%" });
|
||||
return new string[] { "R%" };
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace TBF.BenchControl.Modbus.Common
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ModbusCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new Configs.ParamsProvider.ComponentCfgCtrl(this, null); }
|
||||
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities) { return new Configs.ParamsProvider.ComponentCfgCtrl(this, null); }
|
||||
|
||||
///
|
||||
/// Serialized parameters
|
||||
@@ -62,35 +62,27 @@ namespace TBF.BenchControl.Modbus.Common
|
||||
public string ParamName(int i) { return paramNames[i]; }
|
||||
public int ParamsCount() { return paramNames.Length; }
|
||||
|
||||
public IList<string> ParamValues(int i)
|
||||
public ICollection<string> ParamValues(int i)
|
||||
{
|
||||
IList<string> values = new List<string>();
|
||||
switch (i)
|
||||
{
|
||||
case 1:
|
||||
return new List<string>(new string[] { "150", "300", "600", "1200", "2400", "4800", "9600",
|
||||
"19200", "38400", "57600", "76800", "115200"});
|
||||
return new string[] { "150", "300", "600", "1200", "2400", "4800", "9600",
|
||||
"19200", "38400", "57600", "76800", "115200"};
|
||||
case 2:
|
||||
values.Add(Parity.None.ToString());
|
||||
values.Add(Parity.Odd.ToString());
|
||||
values.Add(Parity.Even.ToString());
|
||||
return values;
|
||||
return new string[] { Parity.None.ToString(), Parity.Odd.ToString(), Parity.Even.ToString() };
|
||||
case 3:
|
||||
values.Add(7.ToString());
|
||||
values.Add(8.ToString());
|
||||
return values;
|
||||
return new string[] { "7", "8" };
|
||||
case 4:
|
||||
values.Add(StopBits.None.ToString());
|
||||
values.Add(StopBits.One.ToString());
|
||||
values.Add(StopBits.OnePointFive.ToString());
|
||||
values.Add(StopBits.Two.ToString());
|
||||
return values;
|
||||
return new string[] { StopBits.None.ToString(),
|
||||
StopBits.One.ToString(),
|
||||
StopBits.OnePointFive.ToString(),
|
||||
StopBits.Two.ToString() };
|
||||
case 5:
|
||||
values.Add(Handshake.None.ToString());
|
||||
values.Add(Handshake.XOnXOff.ToString());
|
||||
values.Add(Handshake.RequestToSend.ToString());
|
||||
values.Add(Handshake.RequestToSendXOnXOff.ToString());
|
||||
return values;
|
||||
return new string[] { Handshake.None.ToString(),
|
||||
Handshake.XOnXOff.ToString(),
|
||||
Handshake.RequestToSend.ToString(),
|
||||
Handshake.RequestToSendXOnXOff.ToString() };
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
@@ -13,7 +13,7 @@ namespace TBF.BenchControl.Modbus.Easytherm
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(EasythermCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new EasythermCfgCtrl(); }
|
||||
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities) { return new EasythermCfgCtrl(); }
|
||||
|
||||
///
|
||||
/// Serialized parameters
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
using Config;
|
||||
using Config.Entities;
|
||||
@@ -17,9 +18,10 @@ namespace TBF.BenchControl.Modbus.PressureMeter.Meret
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(PressureMeterCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl()
|
||||
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities)
|
||||
{
|
||||
return new Configs.ParamsProvider.ComponentCfgCtrl(this, new List<string>(new string[] { "Modbus" }));
|
||||
var parents = cmpntEntities.Where(x => x.ClassName == "Modbus.Common");
|
||||
return new Configs.ParamsProvider.ComponentCfgCtrl(this, parents);
|
||||
}
|
||||
|
||||
///
|
||||
@@ -97,12 +99,12 @@ namespace TBF.BenchControl.Modbus.PressureMeter.Meret
|
||||
public string ParamName(int i) { return paramNames[i]; }
|
||||
public int ParamsCount() { return paramNames.Length; }
|
||||
|
||||
public IList<string> ParamValues(int i)
|
||||
public ICollection<string> ParamValues(int i)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 3:
|
||||
return new List<string>(new string[] { "Pa", "hPa", "mbar", "kPa", "inHg", "psi", "bar", "MPa" });
|
||||
return new string[] { "Pa", "hPa", "mbar", "kPa", "inHg", "psi", "bar", "MPa" };
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
/// Copyright (c) 2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
using Config.Entities;
|
||||
using SchematicDrawing;
|
||||
using TBF.BenchControl.Generic;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Modbus.PumpFM.DanfossVLT
|
||||
{
|
||||
@@ -14,7 +15,7 @@ namespace TBF.BenchControl.Modbus.PumpFM.DanfossVLT
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(PumpCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new PumpCfgCtrl(); }
|
||||
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities) { return new PumpCfgCtrl(); }
|
||||
|
||||
///
|
||||
/// Serialized parameters
|
||||
|
||||
@@ -5,6 +5,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Xml.Serialization;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Modbus.QuidoRS
|
||||
@@ -23,7 +24,7 @@ namespace TBF.BenchControl.Modbus.QuidoRS
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(QuidoRSCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new QuidoRSCfgCtrl(); }
|
||||
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities) { return new QuidoRSCfgCtrl(); }
|
||||
|
||||
///
|
||||
/// Serialized parameters
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Modbus.TankSelector
|
||||
@@ -11,7 +14,7 @@ namespace TBF.BenchControl.Modbus.TankSelector
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TankSelectorCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new TankSelectorCfgCtrl(); }
|
||||
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities) { return new TankSelectorCfgCtrl(); }
|
||||
|
||||
///
|
||||
/// Serialized parameters
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
using Config;
|
||||
using Config.Entities;
|
||||
@@ -17,9 +18,10 @@ namespace TBF.BenchControl.Modbus.TempMeter.Groch
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TempMeterCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl()
|
||||
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities)
|
||||
{
|
||||
return new Configs.ParamsProvider.ComponentCfgCtrl(this, new List<string>(new string[]{ "Modbus" }));
|
||||
var parents = cmpntEntities.Where(x => x.ClassName == "Modbus.Common");
|
||||
return new Configs.ParamsProvider.ComponentCfgCtrl(this, parents);
|
||||
}
|
||||
|
||||
///
|
||||
@@ -112,7 +114,7 @@ namespace TBF.BenchControl.Modbus.TempMeter.Groch
|
||||
public string ParamName(int i) { return paramNames[i]; }
|
||||
public int ParamsCount() { return paramNames.Length; }
|
||||
|
||||
public IList<string> ParamValues(int i)
|
||||
public ICollection<string> ParamValues(int i)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
@@ -121,7 +123,7 @@ namespace TBF.BenchControl.Modbus.TempMeter.Groch
|
||||
for (int j = 0; j < 16; j++) values.Add(j.ToString());
|
||||
return values;
|
||||
case 8:
|
||||
return new List<string>(new string[] { "°C", "°F", "K" });
|
||||
return new string[] { "°C", "°F", "K" };
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
using Config;
|
||||
using Config.Entities;
|
||||
@@ -17,9 +18,10 @@ namespace TBF.BenchControl.Modbus.TempMeter.Meret
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TempMeterCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl()
|
||||
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities)
|
||||
{
|
||||
return new Configs.ParamsProvider.ComponentCfgCtrl(this, new List<string>(new string[] { "Modbus" }));
|
||||
var parents = cmpntEntities.Where(x => x.ClassName == "Modbus.Common");
|
||||
return new Configs.ParamsProvider.ComponentCfgCtrl(this, parents);
|
||||
}
|
||||
|
||||
///
|
||||
@@ -98,12 +100,12 @@ namespace TBF.BenchControl.Modbus.TempMeter.Meret
|
||||
public string ParamName(int i) { return paramNames[i]; }
|
||||
public int ParamsCount() { return paramNames.Length; }
|
||||
|
||||
public IList<string> ParamValues(int i)
|
||||
public ICollection<string> ParamValues(int i)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 3:
|
||||
return new List<string>(new string[] { "°C", "°F", "K" });
|
||||
return new string[] { "°C", "°F", "K" };
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
@@ -15,22 +16,9 @@ namespace TBF.BenchControl.Modbus.UltrasoundLevelMeter
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(LevelMeterCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl()
|
||||
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities)
|
||||
{
|
||||
IList<string> parents = new List<string>();
|
||||
// TODO:
|
||||
//if (StateMachine.Components != null)
|
||||
//{
|
||||
// foreach (var cmpnt in StateMachine.Components)
|
||||
// {
|
||||
// if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is TBF.BenchControl.Modbus.Common.Factory)
|
||||
// {
|
||||
// parents.Add(cmpnt.Name);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
parents.Add("Modbus");
|
||||
|
||||
var parents = cmpntEntities.Where(x => x.ClassName == "Modbus.Common");
|
||||
return new Configs.ParamsProvider.ComponentCfgCtrl(this, parents);
|
||||
}
|
||||
|
||||
@@ -65,7 +53,7 @@ namespace TBF.BenchControl.Modbus.UltrasoundLevelMeter
|
||||
};
|
||||
public string ParamName(int i) { return paramNames[i]; }
|
||||
public int ParamsCount() { return paramNames.Length; }
|
||||
public IList<string> ParamValues(int i) { return null; }
|
||||
public ICollection<string> ParamValues(int i) { return null; }
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
@@ -15,23 +16,9 @@ namespace TBF.BenchControl.Modbus.WaterAnalyzer
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(AnalyzerCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl()
|
||||
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities)
|
||||
{
|
||||
IList<string> parents = new List<string>();
|
||||
// TODO:
|
||||
//if (StateMachine.Components != null)
|
||||
//{
|
||||
// foreach (var cmpnt in StateMachine.Components)
|
||||
// {
|
||||
// if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is TBF.BenchControl.Modbus.Common.Factory)
|
||||
// {
|
||||
// parents.Add(cmpnt.Name);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
parents.Add("Modbus");
|
||||
parents.Add("ModbusUSB");
|
||||
|
||||
var parents = cmpntEntities.Where(x => x.ClassName == "Modbus.Common");
|
||||
return new Configs.ParamsProvider.ComponentCfgCtrl(this, parents);
|
||||
}
|
||||
|
||||
@@ -66,7 +53,7 @@ namespace TBF.BenchControl.Modbus.WaterAnalyzer
|
||||
};
|
||||
public string ParamName(int i) { return paramNames[i]; }
|
||||
public int ParamsCount() { return paramNames.Length; }
|
||||
public IList<string> ParamValues(int i) { return null; }
|
||||
public ICollection<string> ParamValues(int i) { return null; }
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user