Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.etrice.generator.java/src/templates/SubSystemClass.xpt')
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/templates/SubSystemClass.xpt25
1 files changed, 18 insertions, 7 deletions
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 5cd65d517..0655850df 100644
--- a/plugins/org.eclipse.etrice.generator.java/src/templates/SubSystemClass.xpt
+++ b/plugins/org.eclipse.etrice.generator.java/src/templates/SubSystemClass.xpt
@@ -31,8 +31,10 @@ import org.eclipse.etrice.runtime.java.messaging.MessageService;
import org.eclipse.etrice.runtime.java.messaging.RTServices;
import org.eclipse.etrice.runtime.java.messaging.Address;
import org.eclipse.etrice.runtime.java.messaging.IRTObject;
+import org.eclipse.etrice.runtime.java.messaging.RTSystemServicesProtocol.*;
import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
«LET this.getReferencedModels(cc) AS models»
«FOREACH models AS model»import «model.name».*;«ENDFOREACH»
@@ -41,31 +43,40 @@ import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
«EXPAND ProcedureHelpers::UserCode FOR cc.userCode1»
-public class «comp.name» extends SubSystemClassBase {
+public class «comp.name» extends SubSystemClassBase{
«EXPAND ProcedureHelpers::UserCode FOR cc.userCode2»
public «comp.name»(IRTObject parent, String name) {
super(parent, name);
}
-
+
+ @Override
+ public void receiveEvent(InterfaceItemBase ifitem, int evt, Object... data){
+ }
+
@Override
public void instantiateMessageServices(){
RTServices.getInstance().getMsgSvcCtrl().addMsgSvc(new MessageService(this, new Address(0, 0, 0),"MessageService_Main"));
«FOREACH comp.subSystemClass.threads AS thread ITERATOR tid»
- RTServices.getInstance().getMsgSvcCtrl().addMsgSvc(new MessageService(this, new Address(0, «tid.counter0»+1, 0),"MessageService_«thread.name»"));
+ RTServices.getInstance().getMsgSvcCtrl().addMsgSvc(new MessageService(this, new Address(0, «tid.counter1», 0),"MessageService_«thread.name»"));
«ENDFOREACH»
}
@Override
public void instantiateActors(){
// all addresses
+ // Addresses for the Subsystem Systemport
+ «FOREACH comp.allContainedInstances AS ai ITERATOR i»Address addr_item_SystemPort_«i.counter0»=new Address(0,0,«comp.objCounter.getAndIncrementCount()»);
+ «ENDFOREACH»
+
«FOREACH comp.allContainedInstances AS ai»
- // actor instance «ai.path» itself
- Address addr«ai.path.getPathName()»= new Address(0,«ai.threadId»,«ai.objId»);
- // interface items of «ai.path»«FOREACH ai.orderedIfItemInstances AS pi»
- «IF ServiceImplInstance.isInstance(pi) || pi.peers.size>1»«FOREACH pi.peers AS peer ITERATOR i»Address addr_item_«pi.path.getPathName()»_«i.counter0» = new Address(0,«pi.threadId»,«pi.objId»+«i.counter0»);
+ // actor instance «ai.path» itself => Systemport Address
+ // TODOTJ: For each Actor, multiple addresses should be generated (actor?, systemport, debugport)
+ Address addr_item_«ai.path.getPathName()»= new Address(0,«ai.threadId»,«ai.objId»);
+ // interface items of «ai.path»«FOREACH ai.orderedIfItemInstances AS pi»
+ «IF ServiceImplInstance.isInstance(pi) || pi.peers.size>1»«FOREACH pi.peers AS peer ITERATOR i»Address addr_item_«pi.path.getPathName()»_«i.counter0» = new Address(0,«pi.threadId»,«pi.objId+i.counter0»);
«ENDFOREACH»
«ELSE»Address addr_item_«pi.path.getPathName()» = new Address(0,«ai.threadId»,«pi.objId»);
«ENDIF»

Back to the top