Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/ReceiverManual.c4
-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.c4
-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_Inst.h4
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/experiments/MSCLogTest.c28
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/experiments/MSCLogger.seq15
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/experiments/Runner.c25
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/tmp/msc.seq4
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ActorClassGen.xtend6
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.xtend2
-rw-r--r--plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ActorClassGen.java7
-rw-r--r--plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.java14
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/Debug/liborg.eclipse.etrice.runtime.c.abin104764 -> 120968 bytes
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/etMSCLogger.c57
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/etMSCLogger.h51
16 files changed, 184 insertions, 41 deletions
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 aa5113e40..420d2ec62 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
@@ -7,8 +7,10 @@
#include "ReceiverManual.h"
+#include "etLogger.h"
-void ReceiverManual_ReceiveMessage(void* self, etInt16 localId, const etMessage*){
+
+void ReceiverManual_ReceiveMessage(void* self, etInt16 localId, const etMessage* msg){
etLogger_logInfoF("ReceiverManual_ReceiveMessage");
}
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 a1d21b256..ac21f48db 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,7 +29,7 @@ struct ReceiverManual {
const ReceiverManual_const* constData;
};
-void ReceiverManual_ReceiveMessage(void* self, etInt16 localId, const etMessage*);
+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 0ba6959ee..6fd1af385 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
@@ -7,8 +7,10 @@
#include "SenderManual.h"
+#include "etLogger.h"
-void SenderManual_ReceiveMessage(void* self, etInt16 localId, const etMessage*){
+
+void SenderManual_ReceiveMessage(void* self, etInt16 localId, const etMessage* msg){
etLogger_logInfoF("SenderManual_ReceiveMessage");
}
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 b131993a7..87ee6e77a 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,7 +30,7 @@ struct SenderManual {
const SenderManual_const* constData;
};
-void SenderManual_ReceiveMessage(void* self, etInt16 localId, const etMessage*);
+void SenderManual_ReceiveMessage(void* self, etInt16 localId, const etMessage* msg);
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys_Inst.h b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys_Inst.h
index 2feae0971..e9a22e4da 100644
--- a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys_Inst.h
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys_Inst.h
@@ -36,7 +36,7 @@ static SenderManual _SubSys_Sender;
static const ReceiverManual_const _SubSys_Receiver_const = {
&_SubSys_Receiver,
/* Ports: {myActor, etReceiveMessage, msgService, peerAddress, localId} */
- {&_SubSys_Receiver, NULL, &msgService_Thread1, 1, 123} /* Port dataIn */
+ {&_SubSys_Receiver, ReceiverManual_ReceiveMessage, &msgService_Thread1, 1, 123} /* Port dataIn */
};
static ReceiverManual _SubSys_Receiver = {&_SubSys_Receiver_const};
@@ -45,7 +45,7 @@ static ReceiverManual _SubSys_Receiver = {&_SubSys_Receiver_const};
static const SenderManual_const _SubSys_Sender_const = {
&_SubSys_Sender,
/* Ports: {myActor, etReceiveMessage, msgService, peerAddress, localId} */
- {&_SubSys_Sender, NULL, &msgService_Thread1, 1, 123} /* Port dataOut */
+ {&_SubSys_Sender, SenderManual_ReceiveMessage, &msgService_Thread1, 1, 123} /* Port dataOut */
};
static SenderManual _SubSys_Sender = {&_SubSys_Sender_const};
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
new file mode 100644
index 000000000..a7bc55404
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src/test/experiments/MSCLogTest.c
@@ -0,0 +1,28 @@
+
+#include "etLogger.h"
+#include "etMSCLogger.h"
+
+void Class2_ff(void) {
+ ET_MSC_LOGGER_SYNC_ENTRY("Class2", "ff")
+
+ ET_MSC_LOGGER_SYNC_EXIT()
+}
+
+void CLass1_f(void) {
+ ET_MSC_LOGGER_SYNC_ENTRY("Class1", "f")
+ Class2_ff();
+ ET_MSC_LOGGER_SYNC_EXIT()
+}
+
+//int main(void) {
+//
+// etLogger_logInfo("*** T H E B E G I N ***");
+//
+// ET_MSC_LOGGER_OPEN("main");
+// CLass1_f();
+// 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/MSCLogger.seq b/examples/org.eclipse.etrice.generator.c.reference/src/test/experiments/MSCLogger.seq
new file mode 100644
index 000000000..a40c67677
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src/test/experiments/MSCLogger.seq
@@ -0,0 +1,15 @@
+! a
+! b
+0004 a ==> b
+! d
+0006 d ==> b
+0007 b >>> State1
+! c
+0009 b ==> c
+0010 b <== c
+0011 a <== b
+! /MainComponent
+! /MainComponent/services
+...
+0015 [Data=1111] /MainComponent >-- /MainComponent/services executeInitialTransition
+0016 [Data=1234] /MainComponent --> /MainComponent/services executeInitialTransition
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src/test/experiments/Runner.c b/examples/org.eclipse.etrice.generator.c.reference/src/test/experiments/Runner.c
deleted file mode 100644
index c082e6398..000000000
--- a/examples/org.eclipse.etrice.generator.c.reference/src/test/experiments/Runner.c
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-#include "etLogger.h"
-
-#include "SubSystem.h"
-
-//int main(void) {
-//
-//
-// etLogger_logInfo("*** T H E B E G I N ***");
-//
-// SubSystem_init(); // lifecycle init
-// SubSystem_start(); // lifecycle start
-//
-// // run Scheduler
-// SubSystem_Scheduler();
-//
-// // end the lifecycle
-// SubSystem_stop(); // lifecycle stop
-// SubSystem_destroy(); // lifecycle destroy
-//
-// etLogger_logInfo("*** T H E E N D ***");
-//
-// return 0;
-//}
diff --git a/examples/org.eclipse.etrice.generator.c.reference/tmp/msc.seq b/examples/org.eclipse.etrice.generator.c.reference/tmp/msc.seq
new file mode 100644
index 000000000..ca38d9f30
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/tmp/msc.seq
@@ -0,0 +1,4 @@
+main ==> Class1 f
+Class1 ==> Class2 ff
+Class1 <== Class2
+main <== Class1
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 f9583c2fa..3a874e4fd 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
@@ -92,7 +92,7 @@ class ActorClassGen {
const «xpac.name»_const* constData;
};
- void «xpac.name»_ReceiveMessage(void* self, etInt16 localId, const etMessage*);
+ void «xpac.name»_ReceiveMessage(void* self, etInt16 localId, const etMessage* msg);
««« public «IF ac.abstract»abstract «ENDIF»class «ac.name» extends «IF ac.base!=null»«ac.base.name»«ELSE»ActorClassBase«ENDIF» {
@@ -204,9 +204,11 @@ class ActorClassGen {
#include "«xpac.getCHeaderFileName»"
+ #include "etLogger.h"
+
«helpers.UserCode(xpac.userCode3)»
- void «xpac.name»_ReceiveMessage(void* self, etInt16 localId, const etMessage*){
+ void «xpac.name»_ReceiveMessage(void* self, etInt16 localId, const etMessage* msg){
etLogger_logInfoF("«xpac.name»_ReceiveMessage");
}
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 e3e89029e..96edd5de1 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
@@ -182,7 +182,7 @@ class SubSystemClassGen {
&«ai.path.getPathName()»,
/* Ports: {myActor, etReceiveMessage, msgService, peerAddress, localId} */
«FOR port : ai.actorClass.endPorts»
- {&«ai.path.getPathName()», NULL, &msgService_Thread1, 1, 123} /* Port «port.name» */
+ {&«ai.path.getPathName()», «ai.actorClass.name»_ReceiveMessage, &msgService_Thread1, 1, 123} /* Port «port.name» */
«ENDFOR»
};
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 b668d859c..faadfb2e9 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
@@ -209,7 +209,7 @@ public class ActorClassGen {
_builder.append("void ");
String _name_12 = xpac.getName();
_builder.append(_name_12, "");
- _builder.append("_ReceiveMessage(void* self, etInt16 localId, const etMessage*);");
+ _builder.append("_ReceiveMessage(void* self, etInt16 localId, const etMessage* msg);");
_builder.newLineIfNotEmpty();
_builder.newLine();
_builder.newLine();
@@ -255,6 +255,9 @@ public class ActorClassGen {
_builder.append("\"");
_builder.newLineIfNotEmpty();
_builder.newLine();
+ _builder.append("#include \"etLogger.h\"");
+ _builder.newLine();
+ _builder.newLine();
DetailCode _userCode3 = xpac.getUserCode3();
StringConcatenation _UserCode = this.helpers.UserCode(_userCode3);
_builder.append(_UserCode, "");
@@ -263,7 +266,7 @@ public class ActorClassGen {
_builder.append("void ");
String _name_1 = xpac.getName();
_builder.append(_name_1, "");
- _builder.append("_ReceiveMessage(void* self, etInt16 localId, const etMessage*){");
+ _builder.append("_ReceiveMessage(void* self, etInt16 localId, const etMessage* msg){");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("etLogger_logInfoF(\"");
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 01d667957..68a75c326 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
@@ -456,9 +456,13 @@ public class SubSystemClassGen {
String _path_4 = ai_1.getPath();
String _pathName_4 = this.roomExt.getPathName(_path_4);
_builder.append(_pathName_4, " ");
- _builder.append(", NULL, &msgService_Thread1, 1, 123} /* Port ");
- String _name_5 = port.getName();
+ _builder.append(", ");
+ ActorClass _actorClass_3 = ai_1.getActorClass();
+ String _name_5 = _actorClass_3.getName();
_builder.append(_name_5, " ");
+ _builder.append("_ReceiveMessage, &msgService_Thread1, 1, 123} /* Port ");
+ String _name_6 = port.getName();
+ _builder.append(_name_6, " ");
_builder.append(" */");
_builder.newLineIfNotEmpty();
}
@@ -468,9 +472,9 @@ public class SubSystemClassGen {
_builder.append("};");
_builder.newLine();
_builder.append("static ");
- ActorClass _actorClass_3 = ai_1.getActorClass();
- String _name_6 = _actorClass_3.getName();
- _builder.append(_name_6, "");
+ ActorClass _actorClass_4 = ai_1.getActorClass();
+ String _name_7 = _actorClass_4.getName();
+ _builder.append(_name_7, "");
_builder.append(" ");
String _path_5 = ai_1.getPath();
String _pathName_5 = this.roomExt.getPathName(_path_5);
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 6e41f9bd0..81c945ba4 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.c b/runtime/org.eclipse.etrice.runtime.c/src/etMSCLogger.c
new file mode 100644
index 000000000..3d641aac0
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.c/src/etMSCLogger.c
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2012 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Thomas Schuetz (initial contribution)
+ *
+ *******************************************************************************/
+
+#include "etMSCLogger.h"
+
+#include "etLogger.h"
+
+static etFileHandle etMSCLogger_fileHandle = NULL;
+static char* etMSCLogger_objectName = "";
+
+#define ET_MAX_FILENAME_LEN 256
+
+void etMSCLogger_open(char* logPath, char* mscName){
+ char path[ET_MAX_FILENAME_LEN];
+ sprintf(path, "%s/%s.seq", logPath, mscName);
+ etMSCLogger_fileHandle = etLogger_fopen(path, "w+");
+}
+
+void etMSCLogger_close(void){
+ if (etMSCLogger_fileHandle != NULL){
+ etLogger_fclose(etMSCLogger_fileHandle);
+ }
+
+}
+
+void etMSCLogger_setObjectName(char* objectName){
+ etMSCLogger_objectName = objectName;
+}
+
+char* etMSCLogger_getObjectName(void){
+ return etMSCLogger_objectName;
+}
+
+void etMSCLogger_syncCall(char* sourceName, char* messageName, char* targetName){
+ etLogger_fprintf(etMSCLogger_fileHandle, "%s ==> %s %s\n", sourceName, targetName, messageName);
+}
+
+void etMSCLogger_syncReturn(char* sourceName, char* targetName){
+ etLogger_fprintf(etMSCLogger_fileHandle, "%s <== %s\n", sourceName, targetName);
+}
+
+void etMSCLogger_asyncOut(char* sourceName, char* messageName, char* targetName){
+ etLogger_fprintf(etMSCLogger_fileHandle, "%s >-- %s %s\n", sourceName, targetName, messageName);
+}
+
+void etMSCLogger_asyncIn(char* sourceName, char* messageName, char* targetName){
+ etLogger_fprintf(etMSCLogger_fileHandle, "%s --> %s %s\n", sourceName, targetName, messageName);
+}
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/etMSCLogger.h b/runtime/org.eclipse.etrice.runtime.c/src/etMSCLogger.h
new file mode 100644
index 000000000..71e2dfe74
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.c/src/etMSCLogger.h
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2012 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Thomas Schuetz (initial contribution)
+ *
+ *******************************************************************************/
+
+#ifndef _ETMSCLOGGER_H_
+#define _ETMSCLOGGER_H_
+
+#define ET_MSC_LOGGER_ACTIVATE
+
+void etMSCLogger_open(char* logPath, char* mscName);
+void etMSCLogger_close(void);
+
+void etMSCLogger_setObjectName(char* objectName);
+char* etMSCLogger_getObjectName(void);
+
+void etMSCLogger_syncCall(char* sourceName, char* messageName, char* targetName);
+void etMSCLogger_syncReturn(char* sourceName, char* targetName);
+
+void etMSCLogger_asyncOut(char* sourceName, char* messageName, char* targetName);
+void etMSCLogger_asyncIn(char* sourceName, char* messageName, char* targetName);
+
+#ifdef ET_MSC_LOGGER_ACTIVATE
+ #define ET_MSC_LOGGER_OPEN(object) \
+ etMSCLogger_open("tmp", "msc"); \
+ etMSCLogger_setObjectName(object);
+
+ #define ET_MSC_LOGGER_CLOSE etMSCLogger_close();
+
+ #define ET_MSC_LOGGER_SYNC_ENTRY(object, message) \
+ char* sourceName = etMSCLogger_getObjectName(); \
+ char* targetName = object; \
+ etMSCLogger_syncCall(sourceName, message, targetName); \
+ etMSCLogger_setObjectName(targetName);
+
+ #define ET_MSC_LOGGER_SYNC_EXIT() \
+ etMSCLogger_syncReturn(sourceName, targetName); \
+ etMSCLogger_setObjectName(sourceName);
+
+#else
+#endif
+
+
+#endif /* _ETMSCLOGGER_H_ */

Back to the top