aggiunti assi
generato CONF XML adapter demo completo
This commit is contained in:
Binary file not shown.
@@ -31,8 +31,7 @@ namespace MTC_Sim
|
||||
element[] _Temp;
|
||||
element[] _Path;
|
||||
element[] _UnOp;
|
||||
|
||||
int nAxis;
|
||||
element[] _Axis;
|
||||
|
||||
/// <summary>
|
||||
/// init conf adapter
|
||||
@@ -41,8 +40,6 @@ namespace MTC_Sim
|
||||
{
|
||||
sNomeAdapt = "";
|
||||
etipoAdapt = tipoAdapter.Demo;
|
||||
|
||||
nAxis = 0;
|
||||
}
|
||||
/// <summary>
|
||||
/// Serializzazione XML dell'oggetto conf dell'adapter
|
||||
@@ -125,6 +122,11 @@ namespace MTC_Sim
|
||||
get { return _UnOp; }
|
||||
set { _UnOp = value; }
|
||||
}
|
||||
public element[] Axis
|
||||
{
|
||||
get { return _Axis; }
|
||||
set { _Axis= value; }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,589 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<AdapterConf xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<etipoAdapt>Demo</etipoAdapt>
|
||||
<Version>1</Version>
|
||||
<StringItem>CMS_ADAPTER_ABC</StringItem>
|
||||
<IntItem>2456</IntItem>
|
||||
<NomeAdapt>CMS_ADAPTER_00</NomeAdapt>
|
||||
<TipoAdapt>Demo</TipoAdapt>
|
||||
<VacuumPump>
|
||||
<element>
|
||||
<ident>VacPump_01</ident>
|
||||
<alias>Pompa 1</alias>
|
||||
<fonte>Random</fonte>
|
||||
<dataRefList>
|
||||
<dataRef>
|
||||
<Key>Status</Key>
|
||||
<Value>0#7</Value>
|
||||
</dataRef>
|
||||
</dataRefList>
|
||||
</element>
|
||||
<element>
|
||||
<ident>VacPump_02</ident>
|
||||
<alias>Pompa 2</alias>
|
||||
<fonte>Random</fonte>
|
||||
<dataRefList>
|
||||
<dataRef>
|
||||
<Key>Status</Key>
|
||||
<Value>0#7</Value>
|
||||
</dataRef>
|
||||
</dataRefList>
|
||||
</element>
|
||||
</VacuumPump>
|
||||
<VacuumAct>
|
||||
<element>
|
||||
<ident>VacAct_01</ident>
|
||||
<alias>Attuatore vuoto 1</alias>
|
||||
<fonte>Random</fonte>
|
||||
<dataRefList>
|
||||
<dataRef>
|
||||
<Key>Count</Key>
|
||||
<Value>0#15</Value>
|
||||
</dataRef>
|
||||
</dataRefList>
|
||||
</element>
|
||||
<element>
|
||||
<ident>VacAct_02</ident>
|
||||
<alias>Attuatore vuoto 2</alias>
|
||||
<fonte>Random</fonte>
|
||||
<dataRefList>
|
||||
<dataRef>
|
||||
<Key>Count</Key>
|
||||
<Value>0#15</Value>
|
||||
</dataRef>
|
||||
</dataRefList>
|
||||
</element>
|
||||
</VacuumAct>
|
||||
<Lubro>
|
||||
<element>
|
||||
<ident>Lubro_01</ident>
|
||||
<alias>Lubrorefrigerante 1</alias>
|
||||
<fonte>Random</fonte>
|
||||
<dataRefList>
|
||||
<dataRef>
|
||||
<Key>Num</Key>
|
||||
<Value>0#15</Value>
|
||||
</dataRef>
|
||||
</dataRefList>
|
||||
</element>
|
||||
<element>
|
||||
<ident>Lubro_02</ident>
|
||||
<alias>Lubrorefrigerante 2</alias>
|
||||
<fonte>Random</fonte>
|
||||
<dataRefList>
|
||||
<dataRef>
|
||||
<Key>Num</Key>
|
||||
<Value>0#15</Value>
|
||||
</dataRef>
|
||||
</dataRefList>
|
||||
</element>
|
||||
</Lubro>
|
||||
<Cooler>
|
||||
<element>
|
||||
<ident>Cooler_01</ident>
|
||||
<alias>Cooler 1</alias>
|
||||
<fonte>Random</fonte>
|
||||
<dataRefList>
|
||||
<dataRef>
|
||||
<Key>Status</Key>
|
||||
<Value>0#3</Value>
|
||||
</dataRef>
|
||||
</dataRefList>
|
||||
</element>
|
||||
<element>
|
||||
<ident>Cooler_02</ident>
|
||||
<alias>Cooler 2</alias>
|
||||
<fonte>Random</fonte>
|
||||
<dataRefList>
|
||||
<dataRef>
|
||||
<Key>Status</Key>
|
||||
<Value>0#3</Value>
|
||||
</dataRef>
|
||||
</dataRefList>
|
||||
</element>
|
||||
</Cooler>
|
||||
<Press>
|
||||
<element>
|
||||
<ident>Press_01</ident>
|
||||
<alias>Pressostato 1</alias>
|
||||
<fonte>Random</fonte>
|
||||
<dataRefList>
|
||||
<dataRef>
|
||||
<Key>Value</Key>
|
||||
<Value>0#7</Value>
|
||||
</dataRef>
|
||||
</dataRefList>
|
||||
</element>
|
||||
<element>
|
||||
<ident>Press_02</ident>
|
||||
<alias>Pressostato 2</alias>
|
||||
<fonte>Random</fonte>
|
||||
<dataRefList>
|
||||
<dataRef>
|
||||
<Key>Value</Key>
|
||||
<Value>0#7</Value>
|
||||
</dataRef>
|
||||
</dataRefList>
|
||||
</element>
|
||||
</Press>
|
||||
<Temp>
|
||||
<element>
|
||||
<ident>Temp_01</ident>
|
||||
<alias>Sonda Temperatura 1</alias>
|
||||
<fonte>Random</fonte>
|
||||
<dataRefList>
|
||||
<dataRef>
|
||||
<Key>Value</Key>
|
||||
<Value>0#7</Value>
|
||||
</dataRef>
|
||||
</dataRefList>
|
||||
</element>
|
||||
<element>
|
||||
<ident>Temp_02</ident>
|
||||
<alias>Sonda Temperatura 2</alias>
|
||||
<fonte>Random</fonte>
|
||||
<dataRefList>
|
||||
<dataRef>
|
||||
<Key>Value</Key>
|
||||
<Value>0#7</Value>
|
||||
</dataRef>
|
||||
</dataRefList>
|
||||
</element>
|
||||
</Temp>
|
||||
<Path>
|
||||
<element>
|
||||
<ident>Path_01</ident>
|
||||
<alias>Path num 1</alias>
|
||||
<fonte>Random</fonte>
|
||||
<dataRefList>
|
||||
<dataRef>
|
||||
<Key>FeedRate</Key>
|
||||
<Value>0#15</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>FeedOverr</Key>
|
||||
<Value>16#31</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>SpeedOverr</Key>
|
||||
<Value>32#47</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>PosActX</Key>
|
||||
<Value>48#63</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>PosActY</Key>
|
||||
<Value>64#79</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>PosActZ</Key>
|
||||
<Value>80#95</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>PosActI</Key>
|
||||
<Value>96#111</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>PosActJ</Key>
|
||||
<Value>112#127</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>PosActK</Key>
|
||||
<Value>128#143</Value>
|
||||
</dataRef>
|
||||
</dataRefList>
|
||||
</element>
|
||||
</Path>
|
||||
<UnOp>
|
||||
<element>
|
||||
<ident>UnOp_01</ident>
|
||||
<alias>Unita Op num 1</alias>
|
||||
<fonte>Random</fonte>
|
||||
<dataRefList>
|
||||
<dataRef>
|
||||
<Key>ToolId</Key>
|
||||
<Value>0#7</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>NumCU</Key>
|
||||
<Value>8#15</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>Status</Key>
|
||||
<Value>16#23</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>VitaRes</Key>
|
||||
<Value>24#31</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>Speed</Key>
|
||||
<Value>32#39</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>Load</Key>
|
||||
<Value>40#47</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>AccTime</Key>
|
||||
<Value>48#55</Value>
|
||||
</dataRef>
|
||||
</dataRefList>
|
||||
</element>
|
||||
</UnOp>
|
||||
<Axis>
|
||||
<element>
|
||||
<ident>Axis_01</ident>
|
||||
<alias>Asse num 1</alias>
|
||||
<fonte>Random</fonte>
|
||||
<dataRefList>
|
||||
<dataRef>
|
||||
<Key>MainProc</Key>
|
||||
<Value>0#7</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>IsMast</Key>
|
||||
<Value>8#15</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>MastId</Key>
|
||||
<Value>16#23</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>Type</Key>
|
||||
<Value>24#31</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>Dir</Key>
|
||||
<Value>32#39</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>Load</Key>
|
||||
<Value>40#47</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>PosAct</Key>
|
||||
<Value>48#55</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>PosTgt</Key>
|
||||
<Value>56#63</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>FeedAct</Key>
|
||||
<Value>64#71</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>FeedOver</Key>
|
||||
<Value>72#79</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>AccelAct</Key>
|
||||
<Value>80#87</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>AccTime</Key>
|
||||
<Value>88#95</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>Battery</Key>
|
||||
<Value>96#103</Value>
|
||||
</dataRef>
|
||||
</dataRefList>
|
||||
</element>
|
||||
<element>
|
||||
<ident>Axis_02</ident>
|
||||
<alias>Asse num 2</alias>
|
||||
<fonte>Random</fonte>
|
||||
<dataRefList>
|
||||
<dataRef>
|
||||
<Key>MainProc</Key>
|
||||
<Value>0#7</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>IsMast</Key>
|
||||
<Value>8#15</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>MastId</Key>
|
||||
<Value>16#23</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>Type</Key>
|
||||
<Value>24#31</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>Dir</Key>
|
||||
<Value>32#39</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>Load</Key>
|
||||
<Value>40#47</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>PosAct</Key>
|
||||
<Value>48#55</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>PosTgt</Key>
|
||||
<Value>56#63</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>FeedAct</Key>
|
||||
<Value>64#71</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>FeedOver</Key>
|
||||
<Value>72#79</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>AccelAct</Key>
|
||||
<Value>80#87</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>AccTime</Key>
|
||||
<Value>88#95</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>Battery</Key>
|
||||
<Value>96#103</Value>
|
||||
</dataRef>
|
||||
</dataRefList>
|
||||
</element>
|
||||
<element>
|
||||
<ident>Axis_03</ident>
|
||||
<alias>Asse num 3</alias>
|
||||
<fonte>Random</fonte>
|
||||
<dataRefList>
|
||||
<dataRef>
|
||||
<Key>MainProc</Key>
|
||||
<Value>0#7</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>IsMast</Key>
|
||||
<Value>8#15</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>MastId</Key>
|
||||
<Value>16#23</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>Type</Key>
|
||||
<Value>24#31</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>Dir</Key>
|
||||
<Value>32#39</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>Load</Key>
|
||||
<Value>40#47</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>PosAct</Key>
|
||||
<Value>48#55</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>PosTgt</Key>
|
||||
<Value>56#63</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>FeedAct</Key>
|
||||
<Value>64#71</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>FeedOver</Key>
|
||||
<Value>72#79</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>AccelAct</Key>
|
||||
<Value>80#87</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>AccTime</Key>
|
||||
<Value>88#95</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>Battery</Key>
|
||||
<Value>96#103</Value>
|
||||
</dataRef>
|
||||
</dataRefList>
|
||||
</element>
|
||||
<element>
|
||||
<ident>Axis_04</ident>
|
||||
<alias>Asse num 4</alias>
|
||||
<fonte>Random</fonte>
|
||||
<dataRefList>
|
||||
<dataRef>
|
||||
<Key>MainProc</Key>
|
||||
<Value>0#7</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>IsMast</Key>
|
||||
<Value>8#15</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>MastId</Key>
|
||||
<Value>16#23</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>Type</Key>
|
||||
<Value>24#31</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>Dir</Key>
|
||||
<Value>32#39</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>Load</Key>
|
||||
<Value>40#47</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>PosAct</Key>
|
||||
<Value>48#55</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>PosTgt</Key>
|
||||
<Value>56#63</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>FeedAct</Key>
|
||||
<Value>64#71</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>FeedOver</Key>
|
||||
<Value>72#79</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>AccelAct</Key>
|
||||
<Value>80#87</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>AccTime</Key>
|
||||
<Value>88#95</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>Battery</Key>
|
||||
<Value>96#103</Value>
|
||||
</dataRef>
|
||||
</dataRefList>
|
||||
</element>
|
||||
<element>
|
||||
<ident>Axis_05</ident>
|
||||
<alias>Asse num 5</alias>
|
||||
<fonte>Random</fonte>
|
||||
<dataRefList>
|
||||
<dataRef>
|
||||
<Key>MainProc</Key>
|
||||
<Value>0#7</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>IsMast</Key>
|
||||
<Value>8#15</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>MastId</Key>
|
||||
<Value>16#23</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>Type</Key>
|
||||
<Value>24#31</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>Dir</Key>
|
||||
<Value>32#39</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>Load</Key>
|
||||
<Value>40#47</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>PosAct</Key>
|
||||
<Value>48#55</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>PosTgt</Key>
|
||||
<Value>56#63</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>FeedAct</Key>
|
||||
<Value>64#71</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>FeedOver</Key>
|
||||
<Value>72#79</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>AccelAct</Key>
|
||||
<Value>80#87</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>AccTime</Key>
|
||||
<Value>88#95</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>Battery</Key>
|
||||
<Value>96#103</Value>
|
||||
</dataRef>
|
||||
</dataRefList>
|
||||
</element>
|
||||
<element>
|
||||
<ident>Axis_06</ident>
|
||||
<alias>Asse num 6</alias>
|
||||
<fonte>Random</fonte>
|
||||
<dataRefList>
|
||||
<dataRef>
|
||||
<Key>MainProc</Key>
|
||||
<Value>0#7</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>IsMast</Key>
|
||||
<Value>8#15</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>MastId</Key>
|
||||
<Value>16#23</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>Type</Key>
|
||||
<Value>24#31</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>Dir</Key>
|
||||
<Value>32#39</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>Load</Key>
|
||||
<Value>40#47</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>PosAct</Key>
|
||||
<Value>48#55</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>PosTgt</Key>
|
||||
<Value>56#63</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>FeedAct</Key>
|
||||
<Value>64#71</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>FeedOver</Key>
|
||||
<Value>72#79</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>AccelAct</Key>
|
||||
<Value>80#87</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>AccTime</Key>
|
||||
<Value>88#95</Value>
|
||||
</dataRef>
|
||||
<dataRef>
|
||||
<Key>Battery</Key>
|
||||
<Value>96#103</Value>
|
||||
</dataRef>
|
||||
</dataRefList>
|
||||
</element>
|
||||
</Axis>
|
||||
</AdapterConf>
|
||||
@@ -346,22 +346,8 @@ namespace MTC_Sim
|
||||
/// <summary>
|
||||
/// Asse singolo, 1..n
|
||||
/// </summary>
|
||||
public class Axis
|
||||
public class Axis : element
|
||||
{
|
||||
/// <summary>
|
||||
/// Id univoco
|
||||
/// </summary>
|
||||
protected string idx;
|
||||
/// <summary>
|
||||
/// Descrizione/Alias
|
||||
/// </summary>
|
||||
protected string descr;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ID
|
||||
/// </summary>
|
||||
public Event mAxId;
|
||||
/// <summary>
|
||||
/// Descrizione / Alias
|
||||
/// </summary>
|
||||
@@ -424,29 +410,32 @@ namespace MTC_Sim
|
||||
/// <summary>
|
||||
/// Classe Asse con relativo ID UNIVOCO ed alias
|
||||
/// </summary>
|
||||
/// <param name="ident">Identificativo misura, codice sarà Ax_{0} dove {0}= ident</param>
|
||||
/// <param name="alias">Alias misura, salvato in event Ax_{0}_alias dove {0}=ident</param>
|
||||
public Axis(string ident, string alias)
|
||||
/// <param name="Idx">Identificativo univoco</param>
|
||||
/// <param name="Alias">Alias/descrizione</param>
|
||||
/// <param name="FonteD">Tipo fonte dati</param>
|
||||
/// <param name="DataRefList">Parametri x recupero dati in forma dictionary</param>
|
||||
public Axis(string Idx, string Alias, fonteDati FonteD, List<DataRefItem<string, string>> DataRefList)
|
||||
{
|
||||
idx = ident;
|
||||
descr = alias;
|
||||
ident = Idx;
|
||||
alias = Alias;
|
||||
fonte = FonteD;
|
||||
dataRefList = DataRefList;
|
||||
|
||||
// inizializzo vari eventi, sample, condizioni
|
||||
mAxId = new Event(string.Format("Ax_{0}_ID", idx));
|
||||
mAxAlias = new Event(string.Format("Ax_{0}_Alias", idx));
|
||||
mAxMainProc = new Event(string.Format("Ax_{0}_MainProc", idx));
|
||||
mAxIsMaster = new Event(string.Format("Ax_{0}_IsMast", idx));
|
||||
mAxMastId = new Event(string.Format("Ax_{0}_MastId", idx));
|
||||
mAxType = new Event(string.Format("Ax_{0}_Type", idx));
|
||||
mAxDir = new Sample(string.Format("Ax_{0}_Dir", idx));
|
||||
mAxLoad = new Sample(string.Format("Ax_{0}_Load", idx));
|
||||
mAxPosAct = new Sample(string.Format("Ax_{0}_PosAct", idx));
|
||||
mAxPosTgt = new Sample(string.Format("Ax_{0}_PosTgt", idx));
|
||||
mAxFeedAct = new Sample(string.Format("Ax_{0}_FeedAct", idx));
|
||||
mAxFeedOver = new Sample(string.Format("Ax_{0}_FeedOver", idx));
|
||||
mAxAccelAct = new Sample(string.Format("Ax_{0}_AccelAct", idx));
|
||||
mAxAccTime = new Sample(string.Format("Ax_{0}_AccTime", idx));
|
||||
mAxBattery = new Sample(string.Format("Ax_{0}_Battery", idx));
|
||||
mAxAlias = new Event(string.Format("{0}_Alias", Idx));
|
||||
mAxMainProc = new Event(string.Format("{0}_MainProc", Idx));
|
||||
mAxIsMaster = new Event(string.Format("{0}_IsMast", Idx));
|
||||
mAxMastId = new Event(string.Format("{0}_MastId", Idx));
|
||||
mAxType = new Event(string.Format("{0}_Type", Idx));
|
||||
mAxDir = new Sample(string.Format("{0}_Dir", Idx));
|
||||
mAxLoad = new Sample(string.Format("{0}_Load", Idx));
|
||||
mAxPosAct = new Sample(string.Format("{0}_PosAct", Idx));
|
||||
mAxPosTgt = new Sample(string.Format("{0}_PosTgt", Idx));
|
||||
mAxFeedAct = new Sample(string.Format("{0}_FeedAct", Idx));
|
||||
mAxFeedOver = new Sample(string.Format("{0}_FeedOver", Idx));
|
||||
mAxAccelAct = new Sample(string.Format("{0}_AccelAct", Idx));
|
||||
mAxAccTime = new Sample(string.Format("{0}_AccTime", Idx));
|
||||
mAxBattery = new Sample(string.Format("{0}_Battery", Idx));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Generated
+23
@@ -52,6 +52,8 @@
|
||||
this.nPath = new System.Windows.Forms.TextBox();
|
||||
this.label11 = new System.Windows.Forms.Label();
|
||||
this.nUnOp = new System.Windows.Forms.TextBox();
|
||||
this.label12 = new System.Windows.Forms.Label();
|
||||
this.nAssi = new System.Windows.Forms.TextBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// txtAdapter
|
||||
@@ -266,11 +268,30 @@
|
||||
this.nUnOp.TabIndex = 22;
|
||||
this.nUnOp.Text = "1";
|
||||
//
|
||||
// label12
|
||||
//
|
||||
this.label12.AutoSize = true;
|
||||
this.label12.Location = new System.Drawing.Point(25, 91);
|
||||
this.label12.Name = "label12";
|
||||
this.label12.Size = new System.Drawing.Size(39, 13);
|
||||
this.label12.TabIndex = 25;
|
||||
this.label12.Text = "n° Assi";
|
||||
//
|
||||
// nAssi
|
||||
//
|
||||
this.nAssi.Location = new System.Drawing.Point(91, 88);
|
||||
this.nAssi.Name = "nAssi";
|
||||
this.nAssi.Size = new System.Drawing.Size(33, 20);
|
||||
this.nAssi.TabIndex = 24;
|
||||
this.nAssi.Text = "1";
|
||||
//
|
||||
// SetupAdapter
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(692, 517);
|
||||
this.Controls.Add(this.label12);
|
||||
this.Controls.Add(this.nAssi);
|
||||
this.Controls.Add(this.label11);
|
||||
this.Controls.Add(this.nUnOp);
|
||||
this.Controls.Add(this.label10);
|
||||
@@ -328,5 +349,7 @@
|
||||
private System.Windows.Forms.TextBox nPath;
|
||||
private System.Windows.Forms.Label label11;
|
||||
private System.Windows.Forms.TextBox nUnOp;
|
||||
private System.Windows.Forms.Label label12;
|
||||
private System.Windows.Forms.TextBox nAssi;
|
||||
}
|
||||
}
|
||||
@@ -139,6 +139,20 @@ namespace MTC_Sim
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
int numAxis
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
try
|
||||
{
|
||||
answ = Convert.ToInt32(nAssi.Text);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
private void btnCreateFile_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -315,6 +329,35 @@ namespace MTC_Sim
|
||||
c.UnOp = UnOp;
|
||||
}
|
||||
|
||||
// UNITA OPERATRICI
|
||||
if (numAxis > 0)
|
||||
{
|
||||
// creo elementi richiesti
|
||||
element[] Axis = new element[numAxis];
|
||||
// inizializzo list x parametri
|
||||
listaDR = new List<DataRefItem<string, string>>();
|
||||
listaDR.Add(new DataRefItem<string, string>("MainProc", "0#7"));
|
||||
listaDR.Add(new DataRefItem<string, string>("IsMast", "8#15"));
|
||||
listaDR.Add(new DataRefItem<string, string>("MastId", "16#23"));
|
||||
listaDR.Add(new DataRefItem<string, string>("Type", "24#31"));
|
||||
listaDR.Add(new DataRefItem<string, string>("Dir", "32#39"));
|
||||
listaDR.Add(new DataRefItem<string, string>("Load", "40#47"));
|
||||
listaDR.Add(new DataRefItem<string, string>("PosAct", "48#55"));
|
||||
listaDR.Add(new DataRefItem<string, string>("PosTgt", "56#63"));
|
||||
listaDR.Add(new DataRefItem<string, string>("FeedAct", "64#71"));
|
||||
listaDR.Add(new DataRefItem<string, string>("FeedOver", "72#79"));
|
||||
listaDR.Add(new DataRefItem<string, string>("AccelAct", "80#87"));
|
||||
listaDR.Add(new DataRefItem<string, string>("AccTime", "88#95"));
|
||||
listaDR.Add(new DataRefItem<string, string>("Battery", "96#103"));
|
||||
// ciclo x istanziare!
|
||||
for (int i = 0; i < numAxis; i++)
|
||||
{
|
||||
Axis[i] = new element(string.Format("Axis_{0:00}", i + 1), string.Format("Asse num {0}", i + 1), fonteDati.Random, listaDR);
|
||||
}
|
||||
// salvo oggetto
|
||||
c.Axis = Axis;
|
||||
}
|
||||
|
||||
// Serializzo oggetto conf su file
|
||||
AdapterConf.Serialize(filePath, c);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user