Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Schuetz2012-02-01 19:18:47 -0500
committerThomas Schuetz2012-02-01 19:18:47 -0500
commitcfe46b9799947e484ed42a2eefded0db55d43904 (patch)
treed9bc3a1da58f07a53405c35cc698716db4e8fcf2
parent68374559c8cf752b62ef9215dafda1c5f891b09e (diff)
downloadorg.eclipse.etrice-cfe46b9799947e484ed42a2eefded0db55d43904.tar.gz
org.eclipse.etrice-cfe46b9799947e484ed42a2eefded0db55d43904.tar.xz
org.eclipse.etrice-cfe46b9799947e484ed42a2eefded0db55d43904.zip
[generator.c] implementation of port to MessageService communication
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/model/cGenRef.room4
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/CommunicationProtocol.c30
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/CommunicationProtocol.h7
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/ReceiverManual.c12
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/ReceiverManual.h2
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SenderManual.c13
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SenderManual.h2
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys.c24
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys_Runner.c4
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/experiments/MSCLogTest.c4
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/tmp/msc.seq502
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ActorClassGen.xtend42
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.xtend46
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.xtend25
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/SubSystemRunnerGen.xtend4
-rw-r--r--plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ActorClassGen.java170
-rw-r--r--plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.java140
-rw-r--r--plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.java119
-rw-r--r--plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemRunnerGen.java9
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/.cproject2
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/Debug/liborg.eclipse.etrice.runtime.c.abin120968 -> 129190 bytes
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/etMSCLogger.h7
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/etMessage.c4
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/etMessageQueue.c20
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/etMessageService.c41
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/etMessageService.h3
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/etPort.c4
27 files changed, 1179 insertions, 61 deletions
diff --git a/examples/org.eclipse.etrice.generator.c.reference/model/cGenRef.room b/examples/org.eclipse.etrice.generator.c.reference/model/cGenRef.room
index 8054390a4..72395a840 100644
--- a/examples/org.eclipse.etrice.generator.c.reference/model/cGenRef.room
+++ b/examples/org.eclipse.etrice.generator.c.reference/model/cGenRef.room
@@ -132,7 +132,7 @@ RoomModel cGenRef {
Attribute attribute2: DataClass1
}
Behavior {
- @BehaviorManual
+ //@BehaviorManual
Operation operation1(argument1:int32, argument2: DataClass1 ref){""}
}
}
@@ -144,7 +144,7 @@ RoomModel cGenRef {
external Port dataIn
}
Behavior {
- @BehaviorManual
+ //@BehaviorManual
}
}
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/CommunicationProtocol.c b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/CommunicationProtocol.c
index 4ff412e02..40bc41261 100644
--- a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/CommunicationProtocol.c
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/CommunicationProtocol.c
@@ -7,8 +7,38 @@
#include "CommunicationProtocol.h"
+#include "etMSCLogger.h"
+
/*--------------------- port classes */
+void CommunicationProtocolPort_receivedData(const CommunicationProtocolPort* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("CommunicationProtocolPort", "receivedData")
+ etMessage* msg = etMessageService_getMessageBuffer(self->msgService, sizeof(etMessage));
+ msg->address = self->peerAddress;
+ msg->evtID = CommunicationProtocol_OUT_receivedData;
+ etMessageService_pushMessage(self->msgService, msg);
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+
+
+void CommunicationProtocolConjPort_sendData(const CommunicationProtocolConjPort* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("CommunicationProtocolConjPort", "sendData")
+ etMessage* msg = etMessageService_getMessageBuffer(self->msgService, sizeof(etMessage));
+ msg->address = self->peerAddress;
+ msg->evtID = CommunicationProtocol_IN_sendData;
+ etMessageService_pushMessage(self->msgService, msg);
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+void CommunicationProtocolConjPort_sendData2(const CommunicationProtocolConjPort* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("CommunicationProtocolConjPort", "sendData2")
+ etMessage* msg = etMessageService_getMessageBuffer(self->msgService, sizeof(etMessage));
+ msg->address = self->peerAddress;
+ msg->evtID = CommunicationProtocol_IN_sendData2;
+ etMessageService_pushMessage(self->msgService, msg);
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
/*--------------------- debug helpers */
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/CommunicationProtocol.h b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/CommunicationProtocol.h
index a600e07e8..788b62654 100644
--- a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/CommunicationProtocol.h
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/CommunicationProtocol.h
@@ -30,11 +30,18 @@ enum {
typedef etPort CommunicationProtocolPort;
+void CommunicationProtocolPort_receivedData(const CommunicationProtocolPort* self);
+
+
typedef etPort CommunicationProtocolConjPort;
+void CommunicationProtocolConjPort_sendData(const CommunicationProtocolConjPort* self);
+void CommunicationProtocolConjPort_sendData2(const CommunicationProtocolConjPort* self);
+
+
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/ReceiverManual.c b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/ReceiverManual.c
index 420d2ec62..20be31165 100644
--- a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/ReceiverManual.c
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/ReceiverManual.c
@@ -9,8 +9,18 @@
#include "etLogger.h"
+#include "etMSCLogger.h"
+
+
+void ReceiverManual_init(ReceiverManual* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("ReceiverManual", "init")
+ CommunicationProtocolPort_receivedData(&self->constData->dataIn);
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
void ReceiverManual_ReceiveMessage(void* self, etInt16 localId, const etMessage* msg){
- etLogger_logInfoF("ReceiverManual_ReceiveMessage");
+ ET_MSC_LOGGER_SYNC_ENTRY("ReceiverManual", "ReceiveMessage")
+ ET_MSC_LOGGER_SYNC_EXIT
}
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/ReceiverManual.h b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/ReceiverManual.h
index ac21f48db..aea6fc331 100644
--- a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/ReceiverManual.h
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/ReceiverManual.h
@@ -29,6 +29,8 @@ struct ReceiverManual {
const ReceiverManual_const* constData;
};
+void ReceiverManual_init(ReceiverManual* self);
+
void ReceiverManual_ReceiveMessage(void* self, etInt16 localId, const etMessage* msg);
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SenderManual.c b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SenderManual.c
index 6fd1af385..cb3e0512b 100644
--- a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SenderManual.c
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SenderManual.c
@@ -9,8 +9,19 @@
#include "etLogger.h"
+#include "etMSCLogger.h"
+
+
+void SenderManual_init(SenderManual* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("SenderManual", "init")
+ CommunicationProtocolConjPort_sendData(&self->constData->dataOut);
+ CommunicationProtocolConjPort_sendData2(&self->constData->dataOut);
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
void SenderManual_ReceiveMessage(void* self, etInt16 localId, const etMessage* msg){
- etLogger_logInfoF("SenderManual_ReceiveMessage");
+ ET_MSC_LOGGER_SYNC_ENTRY("SenderManual", "ReceiveMessage")
+ ET_MSC_LOGGER_SYNC_EXIT
}
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SenderManual.h b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SenderManual.h
index 87ee6e77a..b3980e4bb 100644
--- a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SenderManual.h
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SenderManual.h
@@ -30,6 +30,8 @@ struct SenderManual {
const SenderManual_const* constData;
};
+void SenderManual_init(SenderManual* self);
+
void SenderManual_ReceiveMessage(void* self, etInt16 localId, const etMessage* msg);
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys.c b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys.c
index eca7b5290..0d24a222c 100644
--- a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys.c
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys.c
@@ -11,6 +11,8 @@
#include "SubSys_Inst.h"
#include "etLogger.h"
+#include "etMSCLogger.h"
+
/* data for SubSysten SubSys */
typedef struct SubSys {
@@ -19,31 +21,53 @@ typedef struct SubSys {
static SubSys SubSysInst = {"SubSys"};
+void SubSys_initActorInstances(void);
+
void SubSys_init(void){
+ ET_MSC_LOGGER_SYNC_ENTRY("SubSys", "init")
etLogger_logInfoF("%s_init", SubSysInst.name);
/* initialization of all message services */
etMessageService_init(&msgService_Thread1, msgBuffer_Thread1, MESSAGE_POOL_MAX, MESSAGE_BLOCK_SIZE);
+ /* init all actors */
+ SubSys_initActorInstances();
+
+ ET_MSC_LOGGER_SYNC_EXIT
}
void SubSys_start(void){
+ ET_MSC_LOGGER_SYNC_ENTRY("SubSys", "start")
etLogger_logInfoF("%s_start", SubSysInst.name);
+ ET_MSC_LOGGER_SYNC_EXIT
}
void SubSys_run(void){
+ ET_MSC_LOGGER_SYNC_ENTRY("SubSys", "run")
int32 i;
for (i=0; i<100; i++){
etLogger_logInfoF("%s Scheduler tick %d", SubSysInst.name, i);
+ etMessageService_execute(&msgService_Thread1);
}
+ ET_MSC_LOGGER_SYNC_EXIT
}
void SubSys_stop(void){
+ ET_MSC_LOGGER_SYNC_ENTRY("SubSys", "stop")
etLogger_logInfoF("%s_stop", SubSysInst.name);
+ ET_MSC_LOGGER_SYNC_EXIT
}
void SubSys_destroy(void){
+ ET_MSC_LOGGER_SYNC_ENTRY("SubSys", "destroy")
etLogger_logInfoF("%s_destroy", SubSysInst.name);
+ ET_MSC_LOGGER_SYNC_EXIT
}
+void SubSys_initActorInstances(void){
+ ET_MSC_LOGGER_SYNC_ENTRY("SubSys", "initActorInstances")
+ ReceiverManual_init(&_SubSys_Receiver);
+ SenderManual_init(&_SubSys_Sender);
+ ET_MSC_LOGGER_SYNC_EXIT
+}
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys_Runner.c b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys_Runner.c
index 845779756..b0b586b8b 100644
--- a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys_Runner.c
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys_Runner.c
@@ -9,6 +9,8 @@
#include "SubSys.h"
#include "etLogger.h"
+#include "etMSCLogger.h"
+
/**
* main function
@@ -18,6 +20,7 @@
int main(void) {
etLogger_logInfo("*** T H E B E G I N ***");
+ ET_MSC_LOGGER_OPEN("main");
/* startup sequence of lifecycle */
SubSys_init(); /* lifecycle init */
@@ -30,6 +33,7 @@ int main(void) {
SubSys_stop(); /* lifecycle stop */
SubSys_destroy(); /* lifecycle destroy */
+ ET_MSC_LOGGER_CLOSE
etLogger_logInfo("*** T H E E N D ***");
return 0;
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src/test/experiments/MSCLogTest.c b/examples/org.eclipse.etrice.generator.c.reference/src/test/experiments/MSCLogTest.c
index a7bc55404..e1ec75344 100644
--- a/examples/org.eclipse.etrice.generator.c.reference/src/test/experiments/MSCLogTest.c
+++ b/examples/org.eclipse.etrice.generator.c.reference/src/test/experiments/MSCLogTest.c
@@ -5,13 +5,13 @@
void Class2_ff(void) {
ET_MSC_LOGGER_SYNC_ENTRY("Class2", "ff")
- ET_MSC_LOGGER_SYNC_EXIT()
+ ET_MSC_LOGGER_SYNC_EXIT
}
void CLass1_f(void) {
ET_MSC_LOGGER_SYNC_ENTRY("Class1", "f")
Class2_ff();
- ET_MSC_LOGGER_SYNC_EXIT()
+ ET_MSC_LOGGER_SYNC_EXIT
}
//int main(void) {
diff --git a/examples/org.eclipse.etrice.generator.c.reference/tmp/msc.seq b/examples/org.eclipse.etrice.generator.c.reference/tmp/msc.seq
index ca38d9f30..595503353 100644
--- a/examples/org.eclipse.etrice.generator.c.reference/tmp/msc.seq
+++ b/examples/org.eclipse.etrice.generator.c.reference/tmp/msc.seq
@@ -1,4 +1,498 @@
-main ==> Class1 f
-Class1 ==> Class2 ff
-Class1 <== Class2
-main <== Class1
+main ==> SubSys init
+SubSys ==> etMessageService init
+etMessageService ==> etMessageQueue init
+etMessageService <== etMessageQueue
+etMessageService ==> etMessageQueue init
+etMessageService <== etMessageQueue
+etMessageService ==> etMessageService initMessagePool
+etMessageService ==> etMessageQueue push
+etMessageService <== etMessageQueue
+etMessageService ==> etMessageQueue push
+etMessageService <== etMessageQueue
+etMessageService ==> etMessageQueue push
+etMessageService <== etMessageQueue
+etMessageService ==> etMessageQueue push
+etMessageService <== etMessageQueue
+etMessageService ==> etMessageQueue push
+etMessageService <== etMessageQueue
+etMessageService ==> etMessageQueue push
+etMessageService <== etMessageQueue
+etMessageService ==> etMessageQueue push
+etMessageService <== etMessageQueue
+etMessageService ==> etMessageQueue push
+etMessageService <== etMessageQueue
+etMessageService ==> etMessageQueue push
+etMessageService <== etMessageQueue
+etMessageService ==> etMessageQueue push
+etMessageService <== etMessageQueue
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> SubSys initActorInstances
+SubSys ==> ReceiverManual init
+ReceiverManual ==> CommunicationProtocolPort receivedData
+CommunicationProtocolPort ==> etMessageService getMessageBuffer
+etMessageService ==> etMessageQueue pop
+etMessageService <== etMessageQueue
+CommunicationProtocolPort <== etMessageService
+CommunicationProtocolPort ==> etMessageService pushMessage
+etMessageService ==> etMessageQueue push
+etMessageService <== etMessageQueue
+CommunicationProtocolPort <== etMessageService
+ReceiverManual <== CommunicationProtocolPort
+SubSys <== ReceiverManual
+SubSys ==> SenderManual init
+SenderManual ==> CommunicationProtocolConjPort sendData
+CommunicationProtocolConjPort ==> etMessageService getMessageBuffer
+etMessageService ==> etMessageQueue pop
+etMessageService <== etMessageQueue
+CommunicationProtocolConjPort <== etMessageService
+CommunicationProtocolConjPort ==> etMessageService pushMessage
+etMessageService ==> etMessageQueue push
+etMessageService <== etMessageQueue
+CommunicationProtocolConjPort <== etMessageService
+SenderManual <== CommunicationProtocolConjPort
+SenderManual ==> CommunicationProtocolConjPort sendData2
+CommunicationProtocolConjPort ==> etMessageService getMessageBuffer
+etMessageService ==> etMessageQueue pop
+etMessageService <== etMessageQueue
+CommunicationProtocolConjPort <== etMessageService
+CommunicationProtocolConjPort ==> etMessageService pushMessage
+etMessageService ==> etMessageQueue push
+etMessageService <== etMessageQueue
+CommunicationProtocolConjPort <== etMessageService
+SenderManual <== CommunicationProtocolConjPort
+SubSys <== SenderManual
+SubSys <== SubSys
+main <== SubSys
+main ==> SubSys start
+main <== SubSys
+main ==> SubSys run
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService ==> etMessageService popMessage
+etMessageService ==> etMessageQueue pop
+etMessageService <== etMessageQueue
+etMessageService <== etMessageService
+etMessageService ==> etMessageService returnMessageBuffer
+etMessageService ==> etMessageQueue push
+etMessageService <== etMessageQueue
+etMessageService <== etMessageService
+etMessageService ==> etMessageService popMessage
+etMessageService ==> etMessageQueue pop
+etMessageService <== etMessageQueue
+etMessageService <== etMessageService
+etMessageService ==> etMessageService returnMessageBuffer
+etMessageService ==> etMessageQueue push
+etMessageService <== etMessageQueue
+etMessageService <== etMessageService
+etMessageService ==> etMessageService popMessage
+etMessageService ==> etMessageQueue pop
+etMessageService <== etMessageQueue
+etMessageService <== etMessageService
+etMessageService ==> etMessageService returnMessageBuffer
+etMessageService ==> etMessageQueue push
+etMessageService <== etMessageQueue
+etMessageService <== etMessageService
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+SubSys ==> etMessageService execute
+etMessageService ==> etMessageService deliverAllMessages
+etMessageService <== etMessageService
+SubSys <== etMessageService
+main <== SubSys
+main ==> SubSys stop
+main <== SubSys
+main ==> SubSys destroy
+main <== SubSys
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ActorClassGen.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ActorClassGen.xtend
index 3a874e4fd..ab0300045 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ActorClassGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ActorClassGen.xtend
@@ -48,11 +48,22 @@ class ActorClassGen {
fileAccess.setOutputPath(path)
fileAccess.generateFile(xpac.actorClass.getCHeaderFileName, root.generateHeaderFile(xpac, xpac.actorClass))
- // header file
- logger.logInfo("generating ActorClass header '"+xpac.actorClass.getCSourceFileName +"' in '"+path+"'")
- fileAccess.setOutputPath(path)
- fileAccess.generateFile(xpac.actorClass.getCSourceFileName , root.generateSourceFile(xpac, xpac.actorClass))
+ // source file
+ if(hasBehaviorAnnotation(xpac, "BehaviorManual") == false){
+ logger.logInfo("generating ActorClass header '"+xpac.actorClass.getCSourceFileName +"' in '"+path+"'")
+ fileAccess.setOutputPath(path)
+ fileAccess.generateFile(xpac.actorClass.getCSourceFileName , root.generateSourceFile(xpac, xpac.actorClass))
+ }
+ }
+ }
+
+ def hasBehaviorAnnotation(ExpandedActorClass xpac, String annotation) {
+ if (xpac.actorClass.annotations != null){
+ if(xpac.actorClass.annotations.findFirst(e|e.name == annotation) != null){
+ return true;
+ }
}
+ return false;
}
def generateHeaderFile(Root root, ExpandedActorClass xpac, ActorClass ac) {'''
@@ -92,6 +103,8 @@ class ActorClassGen {
const «xpac.name»_const* constData;
};
+ void «xpac.name»_init(«xpac.name»* self);
+
void «xpac.name»_ReceiveMessage(void* self, etInt16 localId, const etMessage* msg);
@@ -205,11 +218,30 @@ class ActorClassGen {
#include "«xpac.getCHeaderFileName»"
#include "etLogger.h"
+
+ #include "etMSCLogger.h"
«helpers.UserCode(xpac.userCode3)»
+ void «xpac.name»_init(«xpac.name»* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("«xpac.name»", "init")
+ «FOR port : xpac.actorClass.endPorts.filter(e|e.conjugated)»
+ «FOR message : port.protocol.incomingMessages»
+ «port.getPortClassName()»_«message.name»(&self->constData->«port.name»);
+ «ENDFOR»
+ «ENDFOR»
+ «FOR port : xpac.actorClass.endPorts.filter(e| !e.conjugated)»
+ «FOR message : port.protocol.outgoingMessages»
+ «port.getPortClassName()»_«message.name»(&self->constData->«port.name»);
+ «ENDFOR»
+ «ENDFOR»
+ ET_MSC_LOGGER_SYNC_EXIT
+ }
+
+
void «xpac.name»_ReceiveMessage(void* self, etInt16 localId, const etMessage* msg){
- etLogger_logInfoF("«xpac.name»_ReceiveMessage");
+ ET_MSC_LOGGER_SYNC_ENTRY("«xpac.name»", "ReceiveMessage")
+ ET_MSC_LOGGER_SYNC_EXIT
}
'''
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.xtend
index 21165613e..acbba5822 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.xtend
@@ -112,6 +112,8 @@ class ProtocolClassGen {
#include "«pc.getCHeaderFileName»"
+ #include "etMSCLogger.h"
+
/*--------------------- port classes */
«portClassSource(pc, false)»
«portClassSource(pc, true)»
@@ -246,6 +248,19 @@ class ProtocolClassGen {
typedef etPort «portClassName»;
+ «IF !conj»
+««« send functions for outgoing messages
+ «FOR message : pc.getAllOutgoingMessages()»
+ void «portClassName»_«message.name»(const «portClassName»* self);
+ «ENDFOR»
+ «ELSE»
+««« send functions for incoming messages
+ «FOR message : pc.getAllIncomingMessages()»
+ void «portClassName»_«message.name»(const «portClassName»* self);
+ «ENDFOR»
+ «ENDIF»
+
+
««« «ClassOperationSignature(portClassName, "MyOperation1", "int a, int b", "void", true)»
««« «ClassOperationSignature(portClassName, "MyOperation2", "", "int", false)»
@@ -255,8 +270,35 @@ class ProtocolClassGen {
def portClassSource(ProtocolClass pc, Boolean conj){
'''
- «var name = pc.getPortClassName(conj)»
- «var pclass = pc.getPortClass(conj)»
+ «var portClassName = pc.getPortClassName(conj)»
+ «var pClass = pc.getPortClass(conj)»
+
+ «IF !conj»
+««« send functions for outgoing messages
+ «FOR message : pc.getAllOutgoingMessages()»
+ void «portClassName»_«message.name»(const «portClassName»* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("«portClassName»", "«message.name»")
+ etMessage* msg = etMessageService_getMessageBuffer(self->msgService, sizeof(etMessage));
+ msg->address = self->peerAddress;
+ msg->evtID = «outMessageId(pc.name, message.name)»;
+ etMessageService_pushMessage(self->msgService, msg);
+ ET_MSC_LOGGER_SYNC_EXIT
+ }
+ «ENDFOR»
+ «ELSE»
+««« send functions for incoming messages
+ «FOR message : pc.getAllIncomingMessages()»
+ void «portClassName»_«message.name»(const «portClassName»* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("«portClassName»", "«message.name»")
+ etMessage* msg = etMessageService_getMessageBuffer(self->msgService, sizeof(etMessage));
+ msg->address = self->peerAddress;
+ msg->evtID = «inMessageId(pc.name, message.name)»;
+ etMessageService_pushMessage(self->msgService, msg);
+ ET_MSC_LOGGER_SYNC_EXIT
+ }
+ «ENDFOR»
+ «ENDIF»
+
'''
}
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.xtend
index 96edd5de1..969211abc 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.xtend
@@ -100,6 +100,8 @@ class SubSystemClassGen {
#include "«ssc.getInstSourceFileName»"
#include "etLogger.h"
+ #include "etMSCLogger.h"
+
/* data for SubSysten «ssc.name» */
typedef struct «ssc.name» {
@@ -108,33 +110,56 @@ class SubSystemClassGen {
static «ssc.name» «ssc.name»Inst = {"«ssc.name»"};
+ void «ssc.name»_initActorInstances(void);
+
void «ssc.name»_init(void){
+ ET_MSC_LOGGER_SYNC_ENTRY("SubSys", "init")
etLogger_logInfoF("%s_init", «ssc.name»Inst.name);
/* initialization of all message services */
etMessageService_init(&msgService_Thread1, msgBuffer_Thread1, MESSAGE_POOL_MAX, MESSAGE_BLOCK_SIZE);
+ /* init all actors */
+ «ssc.name»_initActorInstances();
+
+ ET_MSC_LOGGER_SYNC_EXIT
}
void «ssc.name»_start(void){
+ ET_MSC_LOGGER_SYNC_ENTRY("SubSys", "start")
etLogger_logInfoF("%s_start", «ssc.name»Inst.name);
+ ET_MSC_LOGGER_SYNC_EXIT
}
void «ssc.name»_run(void){
+ ET_MSC_LOGGER_SYNC_ENTRY("SubSys", "run")
int32 i;
for (i=0; i<100; i++){
etLogger_logInfoF("%s Scheduler tick %d", «ssc.name»Inst.name, i);
+ etMessageService_execute(&msgService_Thread1);
}
+ ET_MSC_LOGGER_SYNC_EXIT
}
void «ssc.name»_stop(void){
+ ET_MSC_LOGGER_SYNC_ENTRY("SubSys", "stop")
etLogger_logInfoF("%s_stop", «ssc.name»Inst.name);
+ ET_MSC_LOGGER_SYNC_EXIT
}
void «ssc.name»_destroy(void){
+ ET_MSC_LOGGER_SYNC_ENTRY("SubSys", "destroy")
etLogger_logInfoF("%s_destroy", «ssc.name»Inst.name);
+ ET_MSC_LOGGER_SYNC_EXIT
}
+ void «ssc.name»_initActorInstances(void){
+ ET_MSC_LOGGER_SYNC_ENTRY("«ssc.name»", "initActorInstances")
+ «FOR ai : ssi.allContainedInstances»
+ «ai.actorClass.name»_init(&«ai.path.getPathName()»);
+ «ENDFOR»
+ ET_MSC_LOGGER_SYNC_EXIT
+ }
'''
}
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/SubSystemRunnerGen.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/SubSystemRunnerGen.xtend
index f6323b81d..347a45a62 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/SubSystemRunnerGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/SubSystemRunnerGen.xtend
@@ -46,6 +46,8 @@ class SubSystemRunnerGen {
#include "«ssi.name».h"
#include "etLogger.h"
+ #include "etMSCLogger.h"
+
/**
* main function
@@ -55,6 +57,7 @@ class SubSystemRunnerGen {
int main(void) {
etLogger_logInfo("*** T H E B E G I N ***");
+ ET_MSC_LOGGER_OPEN("main");
/* startup sequence of lifecycle */
«ssi.name»_init(); /* lifecycle init */
@@ -67,6 +70,7 @@ class SubSystemRunnerGen {
«ssi.name»_stop(); /* lifecycle stop */
«ssi.name»_destroy(); /* lifecycle destroy */
+ ET_MSC_LOGGER_CLOSE
etLogger_logInfo("*** T H E E N D ***");
return 0;
diff --git a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ActorClassGen.java b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ActorClassGen.java
index faadfb2e9..c9ddd6cea 100644
--- a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ActorClassGen.java
+++ b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ActorClassGen.java
@@ -6,8 +6,10 @@ import java.util.HashSet;
import java.util.List;
import org.eclipse.emf.common.util.EList;
import org.eclipse.etrice.core.room.ActorClass;
+import org.eclipse.etrice.core.room.Annotation;
import org.eclipse.etrice.core.room.DataClass;
import org.eclipse.etrice.core.room.DetailCode;
+import org.eclipse.etrice.core.room.Message;
import org.eclipse.etrice.core.room.Port;
import org.eclipse.etrice.core.room.ProtocolClass;
import org.eclipse.etrice.generator.base.ILogger;
@@ -19,6 +21,10 @@ import org.eclipse.etrice.generator.extensions.RoomExtensions;
import org.eclipse.etrice.generator.generic.ProcedureHelpers;
import org.eclipse.etrice.generator.generic.TypeHelpers;
import org.eclipse.xtext.generator.JavaIoFileSystemAccess;
+import org.eclipse.xtext.xbase.lib.BooleanExtensions;
+import org.eclipse.xtext.xbase.lib.Functions.Function1;
+import org.eclipse.xtext.xbase.lib.IterableExtensions;
+import org.eclipse.xtext.xbase.lib.ObjectExtensions;
import org.eclipse.xtext.xbase.lib.StringExtensions;
import org.eclipse.xtext.xtend2.lib.StringConcatenation;
@@ -69,23 +75,52 @@ public class ActorClassGen {
ActorClass _actorClass_4 = xpac.getActorClass();
StringConcatenation _generateHeaderFile = this.generateHeaderFile(root, xpac, _actorClass_4);
this.fileAccess.generateFile(_cHeaderFileName_1, _generateHeaderFile);
- ActorClass _actorClass_5 = xpac.getActorClass();
- String _cSourceFileName = this.stdExt.getCSourceFileName(_actorClass_5);
- String _operator_plus_5 = StringExtensions.operator_plus("generating ActorClass header \'", _cSourceFileName);
- String _operator_plus_6 = StringExtensions.operator_plus(_operator_plus_5, "\' in \'");
- String _operator_plus_7 = StringExtensions.operator_plus(_operator_plus_6, path);
- String _operator_plus_8 = StringExtensions.operator_plus(_operator_plus_7, "\'");
- this.logger.logInfo(_operator_plus_8);
- this.fileAccess.setOutputPath(path);
- ActorClass _actorClass_6 = xpac.getActorClass();
- String _cSourceFileName_1 = this.stdExt.getCSourceFileName(_actorClass_6);
- ActorClass _actorClass_7 = xpac.getActorClass();
- StringConcatenation _generateSourceFile = this.generateSourceFile(root, xpac, _actorClass_7);
- this.fileAccess.generateFile(_cSourceFileName_1, _generateSourceFile);
+ boolean _hasBehaviorAnnotation = this.hasBehaviorAnnotation(xpac, "BehaviorManual");
+ boolean _operator_equals = ObjectExtensions.operator_equals(((Boolean)_hasBehaviorAnnotation), ((Boolean)false));
+ if (_operator_equals) {
+ {
+ ActorClass _actorClass_5 = xpac.getActorClass();
+ String _cSourceFileName = this.stdExt.getCSourceFileName(_actorClass_5);
+ String _operator_plus_5 = StringExtensions.operator_plus("generating ActorClass header \'", _cSourceFileName);
+ String _operator_plus_6 = StringExtensions.operator_plus(_operator_plus_5, "\' in \'");
+ String _operator_plus_7 = StringExtensions.operator_plus(_operator_plus_6, path);
+ String _operator_plus_8 = StringExtensions.operator_plus(_operator_plus_7, "\'");
+ this.logger.logInfo(_operator_plus_8);
+ this.fileAccess.setOutputPath(path);
+ ActorClass _actorClass_6 = xpac.getActorClass();
+ String _cSourceFileName_1 = this.stdExt.getCSourceFileName(_actorClass_6);
+ ActorClass _actorClass_7 = xpac.getActorClass();
+ StringConcatenation _generateSourceFile = this.generateSourceFile(root, xpac, _actorClass_7);
+ this.fileAccess.generateFile(_cSourceFileName_1, _generateSourceFile);
+ }
+ }
}
}
}
+ public boolean hasBehaviorAnnotation(final ExpandedActorClass xpac, final String annotation) {
+ ActorClass _actorClass = xpac.getActorClass();
+ EList<Annotation> _annotations = _actorClass.getAnnotations();
+ boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_annotations, null);
+ if (_operator_notEquals) {
+ ActorClass _actorClass_1 = xpac.getActorClass();
+ EList<Annotation> _annotations_1 = _actorClass_1.getAnnotations();
+ final Function1<Annotation,Boolean> _function = new Function1<Annotation,Boolean>() {
+ public Boolean apply(final Annotation e) {
+ String _name = e.getName();
+ boolean _operator_equals = ObjectExtensions.operator_equals(_name, annotation);
+ return ((Boolean)_operator_equals);
+ }
+ };
+ Annotation _findFirst = IterableExtensions.<Annotation>findFirst(_annotations_1, _function);
+ boolean _operator_notEquals_1 = ObjectExtensions.operator_notEquals(_findFirst, null);
+ if (_operator_notEquals_1) {
+ return true;
+ }
+ }
+ return false;
+ }
+
public StringConcatenation generateHeaderFile(final Root root, final ExpandedActorClass xpac, final ActorClass ac) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("/**");
@@ -209,6 +244,15 @@ public class ActorClassGen {
_builder.append("void ");
String _name_12 = xpac.getName();
_builder.append(_name_12, "");
+ _builder.append("_init(");
+ String _name_13 = xpac.getName();
+ _builder.append(_name_13, "");
+ _builder.append("* self);");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("void ");
+ String _name_14 = xpac.getName();
+ _builder.append(_name_14, "");
_builder.append("_ReceiveMessage(void* self, etInt16 localId, const etMessage* msg);");
_builder.newLineIfNotEmpty();
_builder.newLine();
@@ -219,8 +263,8 @@ public class ActorClassGen {
_builder.append(_UserCode_1, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
- String _name_13 = xpac.getName();
- StringConcatenation _generateIncludeGuardEnd = this.stdExt.generateIncludeGuardEnd(_name_13);
+ String _name_15 = xpac.getName();
+ StringConcatenation _generateIncludeGuardEnd = this.stdExt.generateIncludeGuardEnd(_name_15);
_builder.append(_generateIncludeGuardEnd, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
@@ -258,6 +302,9 @@ public class ActorClassGen {
_builder.append("#include \"etLogger.h\"");
_builder.newLine();
_builder.newLine();
+ _builder.append("#include \"etMSCLogger.h\"");
+ _builder.newLine();
+ _builder.newLine();
DetailCode _userCode3 = xpac.getUserCode3();
StringConcatenation _UserCode = this.helpers.UserCode(_userCode3);
_builder.append(_UserCode, "");
@@ -266,14 +313,99 @@ public class ActorClassGen {
_builder.append("void ");
String _name_1 = xpac.getName();
_builder.append(_name_1, "");
+ _builder.append("_init(");
+ String _name_2 = xpac.getName();
+ _builder.append(_name_2, "");
+ _builder.append("* self){");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("ET_MSC_LOGGER_SYNC_ENTRY(\"");
+ String _name_3 = xpac.getName();
+ _builder.append(_name_3, " ");
+ _builder.append("\", \"init\")");
+ _builder.newLineIfNotEmpty();
+ {
+ ActorClass _actorClass = xpac.getActorClass();
+ List<Port> _endPorts = this.roomExt.getEndPorts(_actorClass);
+ final Function1<Port,Boolean> _function = new Function1<Port,Boolean>() {
+ public Boolean apply(final Port e) {
+ boolean _isConjugated = e.isConjugated();
+ return ((Boolean)_isConjugated);
+ }
+ };
+ Iterable<Port> _filter = IterableExtensions.<Port>filter(_endPorts, _function);
+ for(final Port port : _filter) {
+ {
+ ProtocolClass _protocol = port.getProtocol();
+ EList<Message> _incomingMessages = _protocol.getIncomingMessages();
+ for(final Message message : _incomingMessages) {
+ _builder.append("\t");
+ String _portClassName = this.roomExt.getPortClassName(port);
+ _builder.append(_portClassName, " ");
+ _builder.append("_");
+ String _name_4 = message.getName();
+ _builder.append(_name_4, " ");
+ _builder.append("(&self->constData->");
+ String _name_5 = port.getName();
+ _builder.append(_name_5, " ");
+ _builder.append(");");
+ _builder.newLineIfNotEmpty();
+ }
+ }
+ }
+ }
+ {
+ ActorClass _actorClass_1 = xpac.getActorClass();
+ List<Port> _endPorts_1 = this.roomExt.getEndPorts(_actorClass_1);
+ final Function1<Port,Boolean> _function_1 = new Function1<Port,Boolean>() {
+ public Boolean apply(final Port e) {
+ boolean _isConjugated = e.isConjugated();
+ boolean _operator_not = BooleanExtensions.operator_not(_isConjugated);
+ return ((Boolean)_operator_not);
+ }
+ };
+ Iterable<Port> _filter_1 = IterableExtensions.<Port>filter(_endPorts_1, _function_1);
+ for(final Port port_1 : _filter_1) {
+ {
+ ProtocolClass _protocol_1 = port_1.getProtocol();
+ EList<Message> _outgoingMessages = _protocol_1.getOutgoingMessages();
+ for(final Message message_1 : _outgoingMessages) {
+ _builder.append("\t");
+ String _portClassName_1 = this.roomExt.getPortClassName(port_1);
+ _builder.append(_portClassName_1, " ");
+ _builder.append("_");
+ String _name_6 = message_1.getName();
+ _builder.append(_name_6, " ");
+ _builder.append("(&self->constData->");
+ String _name_7 = port_1.getName();
+ _builder.append(_name_7, " ");
+ _builder.append(");");
+ _builder.newLineIfNotEmpty();
+ }
+ }
+ }
+ }
+ _builder.append("\t");
+ _builder.append("ET_MSC_LOGGER_SYNC_EXIT");
+ _builder.newLine();
+ _builder.append("}");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("void ");
+ String _name_8 = xpac.getName();
+ _builder.append(_name_8, "");
_builder.append("_ReceiveMessage(void* self, etInt16 localId, const etMessage* msg){");
_builder.newLineIfNotEmpty();
_builder.append("\t");
- _builder.append("etLogger_logInfoF(\"");
- String _name_2 = xpac.getName();
- _builder.append(_name_2, " ");
- _builder.append("_ReceiveMessage\");");
+ _builder.append("ET_MSC_LOGGER_SYNC_ENTRY(\"");
+ String _name_9 = xpac.getName();
+ _builder.append(_name_9, " ");
+ _builder.append("\", \"ReceiveMessage\")");
_builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("ET_MSC_LOGGER_SYNC_EXIT");
+ _builder.newLine();
_builder.append("}");
_builder.newLine();
_builder.newLine();
diff --git a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.java b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.java
index 2a08b5c46..c317c877c 100644
--- a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.java
+++ b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.java
@@ -19,6 +19,7 @@ import org.eclipse.etrice.generator.etricegen.Root;
import org.eclipse.etrice.generator.extensions.RoomExtensions;
import org.eclipse.etrice.generator.generic.ProcedureHelpers;
import org.eclipse.xtext.generator.JavaIoFileSystemAccess;
+import org.eclipse.xtext.xbase.lib.BooleanExtensions;
import org.eclipse.xtext.xbase.lib.IntegerExtensions;
import org.eclipse.xtext.xbase.lib.ObjectExtensions;
import org.eclipse.xtext.xbase.lib.StringExtensions;
@@ -254,6 +255,9 @@ public class ProtocolClassGen {
_builder.append("\"");
_builder.newLineIfNotEmpty();
_builder.newLine();
+ _builder.append("#include \"etMSCLogger.h\"");
+ _builder.newLine();
+ _builder.newLine();
_builder.append("/*--------------------- port classes */");
_builder.newLine();
StringConcatenation _portClassSource = this.portClassSource(pc, ((Boolean)false));
@@ -296,6 +300,42 @@ public class ProtocolClassGen {
_builder.append(";");
_builder.newLineIfNotEmpty();
_builder.newLine();
+ {
+ boolean _operator_not = BooleanExtensions.operator_not(conj);
+ if (_operator_not) {
+ {
+ List<Message> _allOutgoingMessages = this.roomExt.getAllOutgoingMessages(pc);
+ for(final Message message : _allOutgoingMessages) {
+ _builder.append("void ");
+ _builder.append(portClassName, "");
+ _builder.append("_");
+ String _name = message.getName();
+ _builder.append(_name, "");
+ _builder.append("(const ");
+ _builder.append(portClassName, "");
+ _builder.append("* self);");
+ _builder.newLineIfNotEmpty();
+ }
+ }
+ } else {
+ {
+ List<Message> _allIncomingMessages = this.roomExt.getAllIncomingMessages(pc);
+ for(final Message message_1 : _allIncomingMessages) {
+ _builder.append("void ");
+ _builder.append(portClassName, "");
+ _builder.append("_");
+ String _name_1 = message_1.getName();
+ _builder.append(_name_1, "");
+ _builder.append("(const ");
+ _builder.append(portClassName, "");
+ _builder.append("* self);");
+ _builder.newLineIfNotEmpty();
+ }
+ }
+ }
+ }
+ _builder.newLine();
+ _builder.newLine();
_builder.newLine();
_builder.newLine();
return _builder;
@@ -304,12 +344,108 @@ public class ProtocolClassGen {
public StringConcatenation portClassSource(final ProtocolClass pc, final Boolean conj) {
StringConcatenation _builder = new StringConcatenation();
String _portClassName = this.roomExt.getPortClassName(pc, conj);
- String name = _portClassName;
+ String portClassName = _portClassName;
_builder.newLineIfNotEmpty();
PortClass _portClass = this.roomExt.getPortClass(pc, conj);
- PortClass pclass = _portClass;
+ PortClass pClass = _portClass;
_builder.newLineIfNotEmpty();
_builder.newLine();
+ {
+ boolean _operator_not = BooleanExtensions.operator_not(conj);
+ if (_operator_not) {
+ {
+ List<Message> _allOutgoingMessages = this.roomExt.getAllOutgoingMessages(pc);
+ for(final Message message : _allOutgoingMessages) {
+ _builder.append("void ");
+ _builder.append(portClassName, "");
+ _builder.append("_");
+ String _name = message.getName();
+ _builder.append(_name, "");
+ _builder.append("(const ");
+ _builder.append(portClassName, "");
+ _builder.append("* self){");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("ET_MSC_LOGGER_SYNC_ENTRY(\"");
+ _builder.append(portClassName, " ");
+ _builder.append("\", \"");
+ String _name_1 = message.getName();
+ _builder.append(_name_1, " ");
+ _builder.append("\")");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("etMessage* msg = etMessageService_getMessageBuffer(self->msgService, sizeof(etMessage));");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("msg->address = self->peerAddress;");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("msg->evtID = ");
+ String _name_2 = pc.getName();
+ String _name_3 = message.getName();
+ String _outMessageId = this.stdExt.outMessageId(_name_2, _name_3);
+ _builder.append(_outMessageId, " ");
+ _builder.append(";");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("etMessageService_pushMessage(self->msgService, msg);");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("ET_MSC_LOGGER_SYNC_EXIT");
+ _builder.newLine();
+ _builder.append("}");
+ _builder.newLine();
+ }
+ }
+ } else {
+ {
+ List<Message> _allIncomingMessages = this.roomExt.getAllIncomingMessages(pc);
+ for(final Message message_1 : _allIncomingMessages) {
+ _builder.append("void ");
+ _builder.append(portClassName, "");
+ _builder.append("_");
+ String _name_4 = message_1.getName();
+ _builder.append(_name_4, "");
+ _builder.append("(const ");
+ _builder.append(portClassName, "");
+ _builder.append("* self){");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("ET_MSC_LOGGER_SYNC_ENTRY(\"");
+ _builder.append(portClassName, " ");
+ _builder.append("\", \"");
+ String _name_5 = message_1.getName();
+ _builder.append(_name_5, " ");
+ _builder.append("\")");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("etMessage* msg = etMessageService_getMessageBuffer(self->msgService, sizeof(etMessage));");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("msg->address = self->peerAddress;");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("msg->evtID = ");
+ String _name_6 = pc.getName();
+ String _name_7 = message_1.getName();
+ String _inMessageId = this.stdExt.inMessageId(_name_6, _name_7);
+ _builder.append(_inMessageId, " ");
+ _builder.append(";");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("etMessageService_pushMessage(self->msgService, msg);");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("ET_MSC_LOGGER_SYNC_EXIT");
+ _builder.newLine();
+ _builder.append("}");
+ _builder.newLine();
+ }
+ }
+ }
+ }
+ _builder.newLine();
+ _builder.newLine();
return _builder;
}
diff --git a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.java b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.java
index 68a75c326..5338f91ea 100644
--- a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.java
+++ b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.java
@@ -200,6 +200,9 @@ public class SubSystemClassGen {
_builder.newLine();
_builder.append("#include \"etLogger.h\"");
_builder.newLine();
+ _builder.append("#include \"etMSCLogger.h\"");
+ _builder.newLine();
+ _builder.newLine();
_builder.newLine();
_builder.append("/* data for SubSysten ");
String _name_1 = ssc.getName();
@@ -235,12 +238,21 @@ public class SubSystemClassGen {
_builder.append("void ");
String _name_7 = ssc.getName();
_builder.append(_name_7, "");
+ _builder.append("_initActorInstances(void);");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("void ");
+ String _name_8 = ssc.getName();
+ _builder.append(_name_8, "");
_builder.append("_init(void){");
_builder.newLineIfNotEmpty();
_builder.append("\t");
+ _builder.append("ET_MSC_LOGGER_SYNC_ENTRY(\"SubSys\", \"init\")");
+ _builder.newLine();
+ _builder.append("\t");
_builder.append("etLogger_logInfoF(\"%s_init\", ");
- String _name_8 = ssc.getName();
- _builder.append(_name_8, " ");
+ String _name_9 = ssc.getName();
+ _builder.append(_name_9, " ");
_builder.append("Inst.name);");
_builder.newLineIfNotEmpty();
_builder.append("\t");
@@ -253,29 +265,51 @@ public class SubSystemClassGen {
_builder.newLine();
_builder.append("\t");
_builder.newLine();
+ _builder.append("\t");
+ _builder.append("/* init all actors */");
+ _builder.newLine();
+ _builder.append("\t");
+ String _name_10 = ssc.getName();
+ _builder.append(_name_10, " ");
+ _builder.append("_initActorInstances();");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("ET_MSC_LOGGER_SYNC_EXIT");
+ _builder.newLine();
_builder.append("}");
_builder.newLine();
_builder.newLine();
_builder.append("void ");
- String _name_9 = ssc.getName();
- _builder.append(_name_9, "");
+ String _name_11 = ssc.getName();
+ _builder.append(_name_11, "");
_builder.append("_start(void){");
_builder.newLineIfNotEmpty();
_builder.append("\t");
+ _builder.append("ET_MSC_LOGGER_SYNC_ENTRY(\"SubSys\", \"start\")");
+ _builder.newLine();
+ _builder.append("\t");
_builder.append("etLogger_logInfoF(\"%s_start\", ");
- String _name_10 = ssc.getName();
- _builder.append(_name_10, " ");
+ String _name_12 = ssc.getName();
+ _builder.append(_name_12, " ");
_builder.append("Inst.name);");
_builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("ET_MSC_LOGGER_SYNC_EXIT");
+ _builder.newLine();
_builder.append("}");
_builder.newLine();
_builder.newLine();
_builder.append("void ");
- String _name_11 = ssc.getName();
- _builder.append(_name_11, "");
+ String _name_13 = ssc.getName();
+ _builder.append(_name_13, "");
_builder.append("_run(void){");
_builder.newLineIfNotEmpty();
_builder.append("\t");
+ _builder.append("ET_MSC_LOGGER_SYNC_ENTRY(\"SubSys\", \"run\")");
+ _builder.newLine();
+ _builder.append("\t");
_builder.append("int32 i;");
_builder.newLine();
_builder.append("\t");
@@ -283,44 +317,93 @@ public class SubSystemClassGen {
_builder.newLine();
_builder.append("\t\t");
_builder.append("etLogger_logInfoF(\"%s Scheduler tick %d\", ");
- String _name_12 = ssc.getName();
- _builder.append(_name_12, " ");
+ String _name_14 = ssc.getName();
+ _builder.append(_name_14, " ");
_builder.append("Inst.name, i);");
_builder.newLineIfNotEmpty();
+ _builder.append("\t\t");
+ _builder.append("etMessageService_execute(&msgService_Thread1);");
+ _builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
+ _builder.append("\t");
+ _builder.append("ET_MSC_LOGGER_SYNC_EXIT");
+ _builder.newLine();
_builder.append("}");
_builder.newLine();
_builder.newLine();
_builder.append("void ");
- String _name_13 = ssc.getName();
- _builder.append(_name_13, "");
+ String _name_15 = ssc.getName();
+ _builder.append(_name_15, "");
_builder.append("_stop(void){");
_builder.newLineIfNotEmpty();
_builder.append("\t");
+ _builder.append("ET_MSC_LOGGER_SYNC_ENTRY(\"SubSys\", \"stop\")");
+ _builder.newLine();
+ _builder.append("\t");
_builder.append("etLogger_logInfoF(\"%s_stop\", ");
- String _name_14 = ssc.getName();
- _builder.append(_name_14, " ");
+ String _name_16 = ssc.getName();
+ _builder.append(_name_16, " ");
_builder.append("Inst.name);");
_builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("ET_MSC_LOGGER_SYNC_EXIT");
+ _builder.newLine();
_builder.append("}");
_builder.newLine();
_builder.newLine();
_builder.append("void ");
- String _name_15 = ssc.getName();
- _builder.append(_name_15, "");
+ String _name_17 = ssc.getName();
+ _builder.append(_name_17, "");
_builder.append("_destroy(void){");
_builder.newLineIfNotEmpty();
_builder.append("\t");
+ _builder.append("ET_MSC_LOGGER_SYNC_ENTRY(\"SubSys\", \"destroy\")");
+ _builder.newLine();
+ _builder.append("\t");
_builder.append("etLogger_logInfoF(\"%s_destroy\", ");
- String _name_16 = ssc.getName();
- _builder.append(_name_16, " ");
+ String _name_18 = ssc.getName();
+ _builder.append(_name_18, " ");
_builder.append("Inst.name);");
_builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("ET_MSC_LOGGER_SYNC_EXIT");
+ _builder.newLine();
_builder.append("}");
_builder.newLine();
_builder.newLine();
+ _builder.append("void ");
+ String _name_19 = ssc.getName();
+ _builder.append(_name_19, "");
+ _builder.append("_initActorInstances(void){");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("ET_MSC_LOGGER_SYNC_ENTRY(\"");
+ String _name_20 = ssc.getName();
+ _builder.append(_name_20, " ");
+ _builder.append("\", \"initActorInstances\")");
+ _builder.newLineIfNotEmpty();
+ {
+ EList<ActorInstance> _allContainedInstances = ssi.getAllContainedInstances();
+ for(final ActorInstance ai : _allContainedInstances) {
+ _builder.append("\t");
+ ActorClass _actorClass = ai.getActorClass();
+ String _name_21 = _actorClass.getName();
+ _builder.append(_name_21, " ");
+ _builder.append("_init(&");
+ String _path = ai.getPath();
+ String _pathName = this.roomExt.getPathName(_path);
+ _builder.append(_pathName, " ");
+ _builder.append(");");
+ _builder.newLineIfNotEmpty();
+ }
+ }
+ _builder.append("\t");
+ _builder.append("ET_MSC_LOGGER_SYNC_EXIT");
+ _builder.newLine();
+ _builder.append("}");
+ _builder.newLine();
_builder.newLine();
return _builder;
}
diff --git a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemRunnerGen.java b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemRunnerGen.java
index fc08d3bd3..fb976ba44 100644
--- a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemRunnerGen.java
+++ b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemRunnerGen.java
@@ -73,6 +73,9 @@ public class SubSystemRunnerGen {
_builder.newLine();
_builder.append("#include \"etLogger.h\"");
_builder.newLine();
+ _builder.append("#include \"etMSCLogger.h\"");
+ _builder.newLine();
+ _builder.newLine();
_builder.newLine();
_builder.append("/**");
_builder.newLine();
@@ -92,6 +95,9 @@ public class SubSystemRunnerGen {
_builder.append("\t");
_builder.append("etLogger_logInfo(\"*** T H E B E G I N ***\");");
_builder.newLine();
+ _builder.append("\t");
+ _builder.append("ET_MSC_LOGGER_OPEN(\"main\");");
+ _builder.newLine();
_builder.newLine();
_builder.append("\t");
_builder.append("/* startup sequence of lifecycle */");
@@ -131,6 +137,9 @@ public class SubSystemRunnerGen {
_builder.newLineIfNotEmpty();
_builder.newLine();
_builder.append("\t");
+ _builder.append("ET_MSC_LOGGER_CLOSE");
+ _builder.newLine();
+ _builder.append("\t");
_builder.append("etLogger_logInfo(\"*** T H E E N D ***\");");
_builder.newLine();
_builder.newLine();
diff --git a/runtime/org.eclipse.etrice.runtime.c/.cproject b/runtime/org.eclipse.etrice.runtime.c/.cproject
index 76fd63aca..7912bcab3 100644
--- a/runtime/org.eclipse.etrice.runtime.c/.cproject
+++ b/runtime/org.eclipse.etrice.runtime.c/.cproject
@@ -34,7 +34,7 @@
<tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.lib.debug.1185604346" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.lib.debug">
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.mingw.lib.debug.option.optimization.level.157947957" name="Optimization Level" superClass="gnu.c.compiler.mingw.lib.debug.option.optimization.level" valueType="enumerated"/>
<option id="gnu.c.compiler.mingw.lib.debug.option.debugging.level.1083191317" name="Debug Level" superClass="gnu.c.compiler.mingw.lib.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
- <option id="gnu.c.compiler.option.include.paths.790097072" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath"/>
+ <option id="gnu.c.compiler.option.include.paths.790097072" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.361048721" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.base.597146923" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.base"/>
diff --git a/runtime/org.eclipse.etrice.runtime.c/Debug/liborg.eclipse.etrice.runtime.c.a b/runtime/org.eclipse.etrice.runtime.c/Debug/liborg.eclipse.etrice.runtime.c.a
index 81c945ba4..529620e5e 100644
--- a/runtime/org.eclipse.etrice.runtime.c/Debug/liborg.eclipse.etrice.runtime.c.a
+++ b/runtime/org.eclipse.etrice.runtime.c/Debug/liborg.eclipse.etrice.runtime.c.a
Binary files differ
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/etMSCLogger.h b/runtime/org.eclipse.etrice.runtime.c/src/etMSCLogger.h
index 71e2dfe74..8fc3847fd 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/etMSCLogger.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/etMSCLogger.h
@@ -40,11 +40,16 @@ void etMSCLogger_asyncIn(char* sourceName, char* messageName, char* targetName);
etMSCLogger_syncCall(sourceName, message, targetName); \
etMSCLogger_setObjectName(targetName);
- #define ET_MSC_LOGGER_SYNC_EXIT() \
+ #define ET_MSC_LOGGER_SYNC_EXIT \
etMSCLogger_syncReturn(sourceName, targetName); \
etMSCLogger_setObjectName(sourceName);
#else
+ #define ET_MSC_LOGGER_OPEN
+ #define ET_MSC_LOGGER_CLOSE
+
+ #define ET_MSC_LOGGER_SYNC_ENTRY(object, message)
+ #define ET_MSC_LOGGER_SYNC_EXIT
#endif
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/etMessage.c b/runtime/org.eclipse.etrice.runtime.c/src/etMessage.c
index 940dc61c2..f2db6e2e3 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/etMessage.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/etMessage.c
@@ -12,10 +12,14 @@
#include "etMessage.h"
+#include "etMSCLogger.h"
+
#include <stddef.h>
void etMessage_init(etMessage* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessage", "init")
self->next = NULL;
self->address = 0;
self->evtID = 0;
+ ET_MSC_LOGGER_SYNC_EXIT
}
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/etMessageQueue.c b/runtime/org.eclipse.etrice.runtime.c/src/etMessageQueue.c
index 2575d1a1d..3f00515a5 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/etMessageQueue.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/etMessageQueue.c
@@ -12,16 +12,21 @@
#include "etMessageQueue.h"
+#include "etMSCLogger.h"
+
void etMessageQueue_init(etMessageQueue* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageQueue", "init")
self->first = NULL;
self->last = NULL;
self->highWaterMark = 0;
self->size = 0;
+ ET_MSC_LOGGER_SYNC_EXIT
}
void etMessageQueue_push(etMessageQueue* self, etMessage* msg){
// TODO: optimize queue for concurrent push / pop
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageQueue", "push")
if (self->first == NULL) {
/*no message in queue*/
self->first = self->last = msg;
@@ -35,12 +40,16 @@ void etMessageQueue_push(etMessageQueue* self, etMessage* msg){
if (++self->size > self->highWaterMark)
self->highWaterMark++;
+
+ ET_MSC_LOGGER_SYNC_EXIT
}
etMessage* etMessageQueue_pop(etMessageQueue* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageQueue", "pop")
etMessage* pop_msg = self->first;
if(self->first == NULL){
/*no message in queue*/
+ ET_MSC_LOGGER_SYNC_EXIT
return NULL;
}
if (self->first->next==NULL){
@@ -55,25 +64,36 @@ etMessage* etMessageQueue_pop(etMessageQueue* self){
pop_msg->next=NULL;
self->size--;
+ ET_MSC_LOGGER_SYNC_EXIT
return pop_msg;
}
etInt16 etMessageQueue_getSize(etMessageQueue* self) {
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageQueue", "init")
+ ET_MSC_LOGGER_SYNC_EXIT
return self->size;
}
etMessage* etMessageQueue_getFirst(etMessageQueue* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageQueue", "init")
+ ET_MSC_LOGGER_SYNC_EXIT
return self->first;
}
etMessage* etMessageQueue_getLast(etMessageQueue* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageQueue", "init")
+ ET_MSC_LOGGER_SYNC_EXIT
return self->last;
}
etBool etMessageQueue_isNotEmpty(etMessageQueue* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageQueue", "init")
+ ET_MSC_LOGGER_SYNC_EXIT
return self->last != NULL;
}
etInt16 etMessageQueue_getHightWaterMark(etMessageQueue* self) {
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageQueue", "init")
+ ET_MSC_LOGGER_SYNC_EXIT
return self->highWaterMark;
}
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/etMessageService.c b/runtime/org.eclipse.etrice.runtime.c/src/etMessageService.c
index dcf04e0ba..dc40642a7 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/etMessageService.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/etMessageService.c
@@ -13,7 +13,12 @@
#include "etMessageService.h"
+
+#include "etLogger.h"
+#include "etMSCLogger.h"
+
void etMessageService_init(etMessageService* self, etUInt8* buffer, etUInt16 maxBlocks, etUInt16 blockSize){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageService", "init")
self->messageBuffer.buffer = buffer;
self->messageBuffer.maxBlocks = maxBlocks;
self->messageBuffer.blockSize = blockSize;
@@ -21,6 +26,7 @@ void etMessageService_init(etMessageService* self, etUInt8* buffer, etUInt16 max
etMessageQueue_init(&self->messageQueue);
etMessageService_initMessagePool(self);
+ ET_MSC_LOGGER_SYNC_EXIT
}
/*
@@ -28,33 +34,62 @@ void etMessageService_init(etMessageService* self, etUInt8* buffer, etUInt16 max
* all blocks are added to pool
*/
void etMessageService_initMessagePool(etMessageService* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageService", "initMessagePool")
etInt16 i;
for (i=0; i<self->messageBuffer.maxBlocks; i++){
etMessage* block = (etMessage*) &self->messageBuffer.buffer[i*self->messageBuffer.blockSize];
etMessageQueue_push(&self->messagePool, block);
}
+ ET_MSC_LOGGER_SYNC_EXIT
}
void etMessageService_pushMessage(etMessageService* self, etMessage* msg){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageService", "pushMessage")
etMessageQueue_push(&self->messageQueue, msg);
-
+ ET_MSC_LOGGER_SYNC_EXIT
}
etMessage* etMessageService_popMessage(etMessageService* self){
- return etMessageQueue_pop(&self->messageQueue);
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageService", "popMessage")
+ etMessage* msg = etMessageQueue_pop(&self->messageQueue);
+ ET_MSC_LOGGER_SYNC_EXIT
+ return msg;
}
etMessage* etMessageService_getMessageBuffer(etMessageService* self, etUInt16 size){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageService", "getMessageBuffer")
if (size<=self->messageBuffer.blockSize){
if (self->messagePool.size>0){
- return etMessageQueue_pop(&self->messagePool);
+ etMessage* msg = etMessageQueue_pop(&self->messagePool);
+ ET_MSC_LOGGER_SYNC_EXIT
+ return msg;
}
}
+ ET_MSC_LOGGER_SYNC_EXIT
return NULL;
}
void etMessageService_returnMessageBuffer(etMessageService* self, etMessage* buffer){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageService", "returnMessageBuffer")
etMessageQueue_push(&self->messagePool, buffer);
+ ET_MSC_LOGGER_SYNC_EXIT
}
+
+void etMessageService_deliverAllMessages(etMessageService* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageService", "deliverAllMessages")
+ while (self->messageQueue.size > 0){
+ etMessage* msg = etMessageService_popMessage(self);
+ etLogger_logInfoF("Message ID=%d, Address=%d", msg->evtID, msg->address);
+ etMessageService_returnMessageBuffer(self, msg);
+ }
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+void etMessageService_execute(etMessageService* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageService", "execute")
+ etMessageService_deliverAllMessages(self);
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/etMessageService.h b/runtime/org.eclipse.etrice.runtime.c/src/etMessageService.h
index 12f02885b..a5b0f0285 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/etMessageService.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/etMessageService.h
@@ -41,4 +41,7 @@ etMessage* etMessageService_popMessage(etMessageService* self);
etMessage* etMessageService_getMessageBuffer(etMessageService* self, etUInt16 size);
void etMessageService_returnMessageBuffer(etMessageService* self, etMessage* buffer);
+void etMessageService_execute(etMessageService* self);
+
+
#endif /* RMESSAGESERVICE_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/etPort.c b/runtime/org.eclipse.etrice.runtime.c/src/etPort.c
index 6f122c15b..d5df6acfb 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/etPort.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/etPort.c
@@ -12,7 +12,11 @@
#include "etPort.h"
+#include "etMSCLogger.h"
+
void etPort_receive(etPort* self, etMessage* msg) {
+ ET_MSC_LOGGER_SYNC_ENTRY("etPort", "receive")
(self->receiveMessageFunc)(self->myActor, self->localId, msg);
+ ET_MSC_LOGGER_SYNC_EXIT
}

Back to the top