Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2013-10-14 05:25:37 -0400
committerHenrik Rentz-Reichert2013-10-14 05:25:37 -0400
commit6dbcf39f60725a181f22e582c262aeca62bc2ec3 (patch)
tree7de6d2dc8c2ec9224ee076c59d34fcde8df89665
parent1ee7427321ab62e0ce78c60a3577f34448f1c9cd (diff)
downloadorg.eclipse.etrice-6dbcf39f60725a181f22e582c262aeca62bc2ec3.tar.gz
org.eclipse.etrice-6dbcf39f60725a181f22e582c262aeca62bc2ec3.tar.xz
org.eclipse.etrice-6dbcf39f60725a181f22e582c262aeca62bc2ec3.zip
[generator.java][modellib.java][runtime.java] Bug 419343: improve logging of timer messages
https://bugs.eclipse.org/419343
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/NodeGen.xtend5
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.xtend10
-rw-r--r--plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/NodeGen.java15
-rw-r--r--plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.java41
-rw-r--r--runtime/org.eclipse.etrice.modellib.java/model/TimingService.room5
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/SubSystemClassBase.java4
6 files changed, 42 insertions, 38 deletions
diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/NodeGen.xtend b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/NodeGen.xtend
index 46ec3f9ab..ee28fedc3 100644
--- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/NodeGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/NodeGen.xtend
@@ -245,6 +245,11 @@ class NodeGen {
«IF Main::settings.generateMSCInstrumentation»
@Override
+ public boolean hasGeneratedMSCInstrumentation() {
+ return true;
+ }
+
+ @Override
public void destroy() {
DebuggingService.getInstance().addVisibleComment("begin sub system destruction");
super.destroy();
diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.xtend b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.xtend
index 93476d570..fde3e5a42 100644
--- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.xtend
@@ -147,10 +147,7 @@ class ProtocolClassGen extends GenericProtocolClassGenerator {
EventMessage msg = (EventMessage) m;
if (0 < msg.getEvtId() && msg.getEvtId() < MSG_MAX) {
«IF Main::settings.generateMSCInstrumentation»
- if (messageStrings[msg.getEvtId()] != "timerTick"){
-««« TODOTS: model switch for activation
- DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
- }
+ DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
«ENDIF»
«IF pc.handlesReceive(conj)»
switch (msg.getEvtId()) {
@@ -270,10 +267,7 @@ class ProtocolClassGen extends GenericProtocolClassGenerator {
«ENDFOR»
«ELSE»
«IF Main::settings.generateMSCInstrumentation»
- if (messageStrings[ «dir»_«m.name»] != "timerTick") {
-««« TODOTS: model switch for activation
- DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[«dir»_«m.name»]);
- }
+ DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[«dir»_«m.name»]);
«ENDIF»
if (getPeerAddress()!=null)
«IF m.data==null»
diff --git a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/NodeGen.java b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/NodeGen.java
index 42a66723e..cd82793f5 100644
--- a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/NodeGen.java
+++ b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/NodeGen.java
@@ -741,6 +741,21 @@ public class NodeGen {
_builder.append("@Override");
_builder.newLine();
_builder.append("\t");
+ _builder.append("public boolean hasGeneratedMSCInstrumentation() {");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("\t");
+ _builder.append("return true;");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("@Override");
+ _builder.newLine();
+ _builder.append("\t");
_builder.append("public void destroy() {");
_builder.newLine();
_builder.append("\t");
diff --git a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.java b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.java
index 33f40aa68..3ccec30ae 100644
--- a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.java
+++ b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.java
@@ -373,15 +373,8 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
boolean _generateMSCInstrumentation_2 = _settings_2.generateMSCInstrumentation();
if (_generateMSCInstrumentation_2) {
_builder.append("\t\t\t");
- _builder.append("if (messageStrings[msg.getEvtId()] != \"timerTick\"){");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("\t");
_builder.append("DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);");
_builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("}");
- _builder.newLine();
}
}
{
@@ -751,25 +744,13 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
boolean _generateMSCInstrumentation = _settings.generateMSCInstrumentation();
if (_generateMSCInstrumentation) {
_builder.append("\t");
- _builder.append("if (messageStrings[ ");
+ _builder.append("DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[");
_builder.append(dir, " ");
_builder.append("_");
String _name = m.getName();
_builder.append(_name, " ");
- _builder.append("] != \"timerTick\") {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[");
- _builder.append(dir, " ");
- _builder.append("_");
- String _name_1 = m.getName();
- _builder.append(_name_1, " ");
_builder.append("]);");
_builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
}
}
_builder.append("\t");
@@ -784,8 +765,8 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.append("getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), ");
_builder.append(dir, " ");
_builder.append("_");
- String _name_2 = m.getName();
- _builder.append(_name_2, " ");
+ String _name_1 = m.getName();
+ _builder.append(_name_1, " ");
_builder.append("));");
_builder.newLineIfNotEmpty();
} else {
@@ -794,12 +775,12 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.append("getPeerMsgReceiver().receive(new EventWithDataMessage(getPeerAddress(), ");
_builder.append(dir, " ");
_builder.append("_");
- String _name_3 = m.getName();
- _builder.append(_name_3, " ");
+ String _name_2 = m.getName();
+ _builder.append(_name_2, " ");
_builder.append(", ");
VarDecl _data_1 = m.getData();
- String _name_4 = _data_1.getName();
- _builder.append(_name_4, " ");
+ String _name_3 = _data_1.getName();
+ _builder.append(_name_3, " ");
{
boolean _and = false;
VarDecl _data_2 = m.getData();
@@ -845,14 +826,14 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.append(" {");
_builder.newLineIfNotEmpty();
_builder.append("\t");
- String _name_5 = m.getName();
- _builder.append(_name_5, " ");
+ String _name_4 = m.getName();
+ _builder.append(_name_4, " ");
_builder.append("(new ");
VarDecl _data_6 = m.getData();
RefableType _refType_3 = _data_6.getRefType();
DataType _type_2 = _refType_3.getType();
- String _name_6 = _type_2.getName();
- _builder.append(_name_6, " ");
+ String _name_5 = _type_2.getName();
+ _builder.append(_name_5, " ");
_builder.append("(");
VarDecl _data_7 = m.getData();
RefableType _refType_4 = _data_7.getRefType();
diff --git a/runtime/org.eclipse.etrice.modellib.java/model/TimingService.room b/runtime/org.eclipse.etrice.modellib.java/model/TimingService.room
index 0260bdf93..ded502814 100644
--- a/runtime/org.eclipse.etrice.modellib.java/model/TimingService.room
+++ b/runtime/org.eclipse.etrice.modellib.java/model/TimingService.room
@@ -72,6 +72,7 @@ RoomModel room.basic.service.timing {
ProtocolClass PTimer {
usercode1 {
"import java.util.TimerTask;"
+ "import org.eclipse.etrice.runtime.java.messaging.RTServices;"
}
usercode2 {
"static protected class FireTimeoutTask extends TimerTask {
@@ -191,6 +192,8 @@ RoomModel room.basic.service.timing {
if (active) return;
active = true;
+ if (RTServices.getInstance().getSubSystem().hasGeneratedMSCInstrumentation())
+ DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_internalStartTimer]);
getPeerMsgReceiver().receive(new EventWithDataMessage(getPeerAddress(), IN_internalStartTimer, new TimerData(time_ms,++currentId)));
"
}
@@ -199,6 +202,8 @@ RoomModel room.basic.service.timing {
if (active) return;
active = true;
+ if (RTServices.getInstance().getSubSystem().hasGeneratedMSCInstrumentation())
+ DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_internalStartTimeout]);
getPeerMsgReceiver().receive(new EventWithDataMessage(getPeerAddress(), IN_internalStartTimeout, new TimerData(time_ms,++currentId)));
"
}
diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/SubSystemClassBase.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/SubSystemClassBase.java
index 66806a22f..f890161b4 100644
--- a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/SubSystemClassBase.java
+++ b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/SubSystemClassBase.java
@@ -216,4 +216,8 @@ public abstract class SubSystemClassBase extends RTObject implements IEventRecei
public IReplicatedInterfaceItem getSystemPort() {
return RTSystemPort;
}
+
+ public boolean hasGeneratedMSCInstrumentation() {
+ return false;
+ }
}

Back to the top