Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2012-01-12 15:06:59 +0000
committerHenrik Rentz-Reichert2012-01-12 15:06:59 +0000
commit9b85a9a9621f6fd1b2fb38c36f657b5174c853e9 (patch)
tree15cd6dc3d3e4c81e5894282cac7b7dca9db05463 /runtime
parentcaa7cd1c95a48b30b65f6b3fa6486b498dac56a3 (diff)
downloadorg.eclipse.etrice-9b85a9a9621f6fd1b2fb38c36f657b5174c853e9.tar.gz
org.eclipse.etrice-9b85a9a9621f6fd1b2fb38c36f657b5174c853e9.tar.xz
org.eclipse.etrice-9b85a9a9621f6fd1b2fb38c36f657b5174c853e9.zip
[core.room and affected] added possibility of private Messages and of PortClass Operations sending Messages
- grammar changes - formatting - outline - new icons - incoming/outgoing optional but validation checks >0 messages - behavior message selection adds PortClass operations - generator makes send message methods private - made use of this in ALogService.room
Diffstat (limited to 'runtime')
-rw-r--r--runtime/org.eclipse.etrice.modellib/models/ALogService.room11
-rw-r--r--runtime/org.eclipse.etrice.modellib/src-gen/room/basic/service/logging/Log.java41
2 files changed, 21 insertions, 31 deletions
diff --git a/runtime/org.eclipse.etrice.modellib/models/ALogService.room b/runtime/org.eclipse.etrice.modellib/models/ALogService.room
index 3b1d70dbd..1fe1f2dec 100644
--- a/runtime/org.eclipse.etrice.modellib/models/ALogService.room
+++ b/runtime/org.eclipse.etrice.modellib/models/ALogService.room
@@ -77,10 +77,9 @@ RoomModel room.basic.service.logging {
Message open(fileName: string)
Message setLogLevel(l: int32)
Message close()
- Message log(data: LogData)
- Message internalLog(data: InternalLogData)
+ private Message internalLog(data: InternalLogData)
}
- outgoing { }
+
conjugate PortClass {
usercode {
"public static final int LOG_LEVEL_LOW = 1;"
@@ -93,10 +92,10 @@ RoomModel room.basic.service.logging {
"logLevel=l;"
"if (logLevel > LOG_LEVEL_HIGH) logLevel=LOG_LEVEL_HIGH;"
}
- handle log {
+ Operation log(logLevel: int32, userString: string) sends internalLog {
"long s;"
- "if (data.logLevel>this.logLevel){"
- "d.userString=data.userString;"
+ "if (logLevel>this.logLevel){"
+ "d.userString=userString;"
"s=System.currentTimeMillis();"
"d.timeStamp=Long.toString(s);"
"d.sender=getInstancePath();"
diff --git a/runtime/org.eclipse.etrice.modellib/src-gen/room/basic/service/logging/Log.java b/runtime/org.eclipse.etrice.modellib/src-gen/room/basic/service/logging/Log.java
index cea42b67b..cca681ec0 100644
--- a/runtime/org.eclipse.etrice.modellib/src-gen/room/basic/service/logging/Log.java
+++ b/runtime/org.eclipse.etrice.modellib/src-gen/room/basic/service/logging/Log.java
@@ -19,13 +19,12 @@ public class Log {
public static final int IN_open = 1;
public static final int IN_setLogLevel = 2;
public static final int IN_close = 3;
- public static final int IN_log = 4;
- public static final int IN_internalLog = 5;
+ public static final int IN_internalLog = 4;
//error if msgID >= MSG_MAX
- public static final int MSG_MAX = 6;
+ public static final int MSG_MAX = 5;
- private static String messageStrings[] = {"MIN", "open","setLogLevel","close","log","internalLog","MAX"};
+ private static String messageStrings[] = {"MIN", "open","setLogLevel","close","internalLog","MAX"};
public String getMessageString(int msg_id) {
if (msg_id<MSG_MIN || msg_id>MSG_MAX+1){
@@ -144,6 +143,17 @@ public class Log {
//--------------------- attributes
//--------------------- operations
+ public void log(int logLevel, String userString) {
+ long s;
+ if (logLevel>this.logLevel){
+ d.userString=userString;
+ s=System.currentTimeMillis();
+ d.timeStamp=Long.toString(s);
+ d.sender=getInstancePath();
+ if (getPeerAddress()!=null)
+ getPeerMsgReceiver().receive(new EventWithDataMessage(getPeerAddress(), IN_internalLog, d));
+ }
+ }
// sent messages
public void open(String fileName) {
@@ -166,21 +176,7 @@ public class Log {
if (getPeerAddress()!=null)
getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), IN_close));
}
- public void log(LogData data) {
- long s;
- if (data.logLevel>this.logLevel){
- d.userString=data.userString;
- s=System.currentTimeMillis();
- d.timeStamp=Long.toString(s);
- d.sender=getInstancePath();
- if (getPeerAddress()!=null)
- getPeerMsgReceiver().receive(new EventWithDataMessage(getPeerAddress(), IN_internalLog, d));
- }
- }
- public void log(int logLevel, String userString) {
- log(new LogData(logLevel, userString));
- }
- public void internalLog(InternalLogData data) {
+ private void internalLog(InternalLogData data) {
if (messageStrings[ IN_internalLog] != "timerTick"){
// TODOTS: model switch for activation
DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_internalLog]);
@@ -236,12 +232,7 @@ public class Log {
ports.get(i).close();
}
}
- public void log(LogData data){
- for (int i=0; i<replication; ++i) {
- ports.get(i).log( data);
- }
- }
- public void internalLog(InternalLogData data){
+ private void internalLog(InternalLogData data){
for (int i=0; i<replication; ++i) {
ports.get(i).internalLog( data);
}

Back to the top