Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Jung2011-04-04 16:43:14 -0400
committerThomas Schuetz2011-04-04 16:43:14 -0400
commit6c9498396351f08fda26479dba36f732ff57a294 (patch)
tree62fb4bad2e5eb2ad7ea51878f1d2fc96d4961647 /plugins
parent9c99893df7e0526ad637d3281c68340c72b144cc (diff)
downloadorg.eclipse.etrice-6c9498396351f08fda26479dba36f732ff57a294.tar.gz
org.eclipse.etrice-6c9498396351f08fda26479dba36f732ff57a294.tar.xz
org.eclipse.etrice-6c9498396351f08fda26479dba36f732ff57a294.zip
applied patch for system port: https://bugs.eclipse.org/bugs/show_bug.cgi?id=339803
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/templates/ActorClass.xpt12
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/templates/ProtocolClass.xpt4
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/templates/SubSystemClass.xpt18
3 files changed, 24 insertions, 10 deletions
diff --git a/plugins/org.eclipse.etrice.generator.java/src/templates/ActorClass.xpt b/plugins/org.eclipse.etrice.generator.java/src/templates/ActorClass.xpt
index 6a54aa737..2fa608343 100644
--- a/plugins/org.eclipse.etrice.generator.java/src/templates/ActorClass.xpt
+++ b/plugins/org.eclipse.etrice.generator.java/src/templates/ActorClass.xpt
@@ -62,11 +62,11 @@ public «IF ac.abstract»abstract «ENDIF»class «ac.name» extends «IF ac.base!=null
«ENDFOREACH»
//--------------------- interface item IDs
- «FOREACH ac.getEndPorts() AS ep»protected static final int IFITEM_«ep.name» = «xpac.getInterfaceItemLocalId(ep)»;
+ «FOREACH ac.getEndPorts() AS ep»protected static final int IFITEM_«ep.name» = «xpac.getInterfaceItemLocalId(ep)+1»;
«ENDFOREACH»
- «FOREACH ac.strSAPs AS sap»protected static final int IFITEM_«sap.name» = «xpac.getInterfaceItemLocalId(sap)»;
+ «FOREACH ac.strSAPs AS sap»protected static final int IFITEM_«sap.name» = «xpac.getInterfaceItemLocalId(sap)+1»;
«ENDFOREACH»
- «FOREACH ac.serviceImplementations AS svc»protected static final int IFITEM_«svc.spp.name» = «xpac.getInterfaceItemLocalId(svc.spp)»;
+ «FOREACH ac.serviceImplementations AS svc»protected static final int IFITEM_«svc.spp.name» = «xpac.getInterfaceItemLocalId(svc.spp)+1»;
«ENDFOREACH»
«EXPAND ProcedureHelpers::Attributes FOR ac.attributes»
@@ -74,11 +74,11 @@ public «IF ac.abstract»abstract «ENDIF»class «ac.name» extends «IF ac.base!=null
«EXPAND ProcedureHelpers::Operations FOR ac.operations»
//--------------------- construction
- public «ac.name»(IRTObject parent, String name, Address ownAddr, Address[][] port_addr, Address[][] peer_addr){
+ public «ac.name»(IRTObject parent, String name, Address[][] port_addr, Address[][] peer_addr){
«IF ac.base==null»
- super(parent, name, ownAddr);
+ super(parent, name, port_addr[0][0], peer_addr[0][0]);
«ELSE»
- super(parent, name, ownAddr, port_addr, peer_addr);
+ super(parent, name, port_addr, peer_addr);
«ENDIF»
setClassName("«ac.name»");
diff --git a/plugins/org.eclipse.etrice.generator.java/src/templates/ProtocolClass.xpt b/plugins/org.eclipse.etrice.generator.java/src/templates/ProtocolClass.xpt
index 6bda5a934..3e186f8a9 100644
--- a/plugins/org.eclipse.etrice.generator.java/src/templates/ProtocolClass.xpt
+++ b/plugins/org.eclipse.etrice.generator.java/src/templates/ProtocolClass.xpt
@@ -153,6 +153,10 @@ static public class «name»Repl {
return replication;
}
+ public int getIndexOf(InterfaceItemBase ifitem){
+ return ifitem.getIdx();
+ }
+
public «name» get(int i) {
return ports.get(i);
}
diff --git a/plugins/org.eclipse.etrice.generator.java/src/templates/SubSystemClass.xpt b/plugins/org.eclipse.etrice.generator.java/src/templates/SubSystemClass.xpt
index cb7833fce..5cd65d517 100644
--- a/plugins/org.eclipse.etrice.generator.java/src/templates/SubSystemClass.xpt
+++ b/plugins/org.eclipse.etrice.generator.java/src/templates/SubSystemClass.xpt
@@ -74,23 +74,33 @@ public class «comp.name» extends SubSystemClassBase {
// instantiate all actor instances
instances = new ActorClassBase[«comp.allContainedInstances.size»];
- «FOREACH comp.allContainedInstances AS ai»instances[«comp.allContainedInstances.indexOf(ai)»] = new «ai.actorClass.name»(
+ «FOREACH comp.allContainedInstances AS ai ITERATOR k»instances[«comp.allContainedInstances.indexOf(ai)»] = new «ai.actorClass.name»(
«IF SubSystemInstance.isInstance(ai.eContainer)»this«ELSE»instances[«comp.allContainedInstances.indexOf(ai.eContainer)»]«ENDIF»,
"«ai.name»",
- addr«ai.path.getPathName()»,
// own interface item addresses
- new Address[][] {«FOREACH ai.orderedIfItemInstances AS pi SEPARATOR ","»{«IF ServiceImplInstance.isInstance(pi) || pi.peers.size>1»«FOREACH pi.peers AS peer ITERATOR i SEPARATOR ","»addr_item_«pi.path.getPathName()»_«i.counter0»«ENDFOREACH»
+ new Address[][] {{addr_item_«ai.path.getPathName()»},«FOREACH ai.orderedIfItemInstances AS pi SEPARATOR ","»{«IF ServiceImplInstance.isInstance(pi) || pi.peers.size>1»«FOREACH pi.peers AS peer ITERATOR i SEPARATOR ","»addr_item_«pi.path.getPathName()»_«i.counter0»«ENDFOREACH»
«ELSE»addr_item_«pi.path.getPathName()»
«ENDIF»}
«ENDFOREACH»},
// peer interface item addresses
- new Address[][] {«FOREACH ai.orderedIfItemInstances AS pi SEPARATOR ","»{«IF !ServiceImplInstance.isInstance(pi) && pi.peers.isEmpty»null«ELSE»«FOREACH pi.peers AS pp SEPARATOR ","»«IF ServiceImplInstance.isInstance(pp) || pp.peers.size>1»addr_item_«pp.path.getPathName()»_«pp.peers.indexOf(pi)»
+ new Address[][] {{addr_item_SystemPort_«k.counter0»},«FOREACH ai.orderedIfItemInstances AS pi SEPARATOR ","»{«IF !ServiceImplInstance.isInstance(pi) && pi.peers.isEmpty»null«ELSE»«FOREACH pi.peers AS pp SEPARATOR ","»«IF ServiceImplInstance.isInstance(pp) || pp.peers.size>1»addr_item_«pp.path.getPathName()»_«pp.peers.indexOf(pi)»
«ELSE»addr_item_«pp.path.getPathName()»
«ENDIF»
«ENDFOREACH»«ENDIF»}
«ENDFOREACH»}
);
«ENDFOREACH»
+
+ // create the subsystem system port
+ RTSystemPort = new RTSystemServicesProtocolConjPortRepl(this, "RTSystemPort",
+ 0, //local ID
+ new Address[]{ // own addresses
+ «FOREACH comp.allContainedInstances AS ai ITERATOR i SEPARATOR ","»addr_item_SystemPort_«i.counter0»
+ «ENDFOREACH»},
+ new Address[]{ // peer addresses
+ «FOREACH comp.allContainedInstances AS ai SEPARATOR ","»addr_item_«ai.path.getPathName()»
+ «ENDFOREACH»});
+
}
};
«ENDFILE»

Back to the top