Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/Main.java23
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/GlobalSettings.java41
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.xtend36
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/StateMachineGen.xtend10
-rw-r--r--plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.java108
-rw-r--r--plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/StateMachineGen.java27
-rw-r--r--plugins/org.eclipse.etrice.generator.launch.java/src/org/eclipse/etrice/generator/launch/java/JavaGeneratorLaunchConfigurationDelegate.java6
-rw-r--r--plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/GeneratorConfigTab.java16
-rw-r--r--runtime/org.eclipse.etrice.modellib.java/models/TimingService.room5
-rw-r--r--runtime/org.eclipse.etrice.modellib.java/src-gen/org/eclipse/etrice/modellib/Socket/DSocketConfiguration.java3
-rw-r--r--runtime/org.eclipse.etrice.modellib.java/src-gen/org/eclipse/etrice/modellib/Socket/DSocketData.java3
-rw-r--r--runtime/org.eclipse.etrice.modellib.java/src-gen/org/eclipse/etrice/modellib/Socket/PSocket.java35
-rw-r--r--runtime/org.eclipse.etrice.modellib.java/src-gen/org/eclipse/etrice/modellib/Socket/SocketClient.java1
-rw-r--r--runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/logging/ALogService.java7
-rw-r--r--runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/logging/InternalLogData.java4
-rw-r--r--runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/logging/Log.java21
-rw-r--r--runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/tcp/ATcpClient.java9
-rw-r--r--runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/tcp/ATcpServer.java11
-rw-r--r--runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/tcp/DTcpControl.java3
-rw-r--r--runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/tcp/DTcpPayload.java10
-rw-r--r--runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/tcp/PTcpControl.java23
-rw-r--r--runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/tcp/PTcpPayload.java17
-rw-r--r--runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/timing/ATimingService.java7
-rw-r--r--runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/timing/PTimer.java30
-rw-r--r--runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/timing/TimerData.java2
25 files changed, 234 insertions, 224 deletions
diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/Main.java b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/Main.java
index 1dfdec064..009f35065 100644
--- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/Main.java
+++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/Main.java
@@ -23,6 +23,7 @@ import org.eclipse.etrice.core.genmodel.etricegen.Root;
import org.eclipse.etrice.generator.base.AbstractGenerator;
import org.eclipse.etrice.generator.base.IDataConfiguration;
import org.eclipse.etrice.generator.base.IResourceURIAcceptor;
+import org.eclipse.etrice.generator.java.gen.GlobalSettings;
import org.eclipse.etrice.generator.java.gen.Validator;
import org.eclipse.etrice.generator.java.setup.GeneratorModule;
import org.eclipse.xtext.generator.IGenerator;
@@ -37,19 +38,31 @@ public class Main extends AbstractGenerator {
public static final String OPTION_DOCUMENTATION = "-genDocu";
public static final String OPTION_SAVE_GEN_MODEL = "-saveGenModel";
public static final String OPTION_DEBUG = "-debug";
+ public static final String OPTION_MSC = "-msc_instr";
+ public static final String OPTION_VERBOSE_RT = "-gen_as_verbose";
/**
* print usage message to stderr
*/
private static void printUsage() {
- output.println(Main.class.getName()+" [-saveGenModel <genmodel path>] [-genInstDiag] [-lib] <list of model file paths>");
+ output.println(Main.class.getName()+" [-saveGenModel <genmodel path>]"
+ +" ["+OPTION_DOCUMENTATION+"]"
+ +" ["+OPTION_LIB+"]"
+ +" ["+OPTION_NOEXIT+"]"
+ +" ["+OPTION_SAVE_GEN_MODEL+" <genmodel path>]"
+ +" ["+OPTION_DEBUG+"]"
+ +" ["+OPTION_MSC+"]"
+ +" ["+OPTION_VERBOSE_RT+"]"
+ +" <list of model file paths>");
output.println(" <list of model file paths> # model file paths may be specified as");
output.println(" # e.g. C:\\path\\to\\model\\mymodel.room");
- output.println(" -saveGenModel <genmodel path> # if specified the generator model will be saved to this location");
output.println(" -genDocu # if specified documentation is created");
output.println(" -lib # if specified all classes are generated and no instances");
output.println(" -noexit # if specified the JVM is not exited");
+ output.println(" -saveGenModel <genmodel path> # if specified the generator model will be saved to this location");
output.println(" -debug # if specified create debug output");
+ output.println(" -msc_instr # generate instrumentation for MSC generation");
+ output.println(" -gen_as_verbose # generate instrumentation for verbose console output");
}
public static void main(String[] args) {
@@ -101,6 +114,12 @@ public class Main extends AbstractGenerator {
else if (args[i].equals(OPTION_NOEXIT)) {
setTerminateOnError(false);
}
+ else if (args[i].equals(OPTION_MSC)) {
+ GlobalSettings.setGenerateMSCInstrumentation(true);
+ }
+ else if (args[i].equals(OPTION_VERBOSE_RT)) {
+ GlobalSettings.setGenerateWithVerboseOutput(true);
+ }
else if (args[i].equals(OPTION_DEBUG)) {
debug = true;
}
diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/GlobalSettings.java b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/GlobalSettings.java
new file mode 100644
index 000000000..3cdefe7dc
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/GlobalSettings.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * 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:
+ * Henrik Rentz-Reichert (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.generator.java.gen;
+
+/**
+ * @author Henrik Rentz-Reichert
+ *
+ */
+public class GlobalSettings {
+
+ private static boolean generateMSCInstrumentation = false;
+ private static boolean generateWithVerboseOutput = false;
+
+ public static boolean generateMSCInstrumentation() {
+ return generateMSCInstrumentation;
+ }
+
+ public static void setGenerateMSCInstrumentation(
+ boolean generateMSCInstrumentation) {
+ GlobalSettings.generateMSCInstrumentation = generateMSCInstrumentation;
+ }
+
+ public static boolean generateWithVerboseOutput() {
+ return generateWithVerboseOutput;
+ }
+
+ public static void setGenerateWithVerboseOutput(boolean generateWithVerboseOutput) {
+ GlobalSettings.generateWithVerboseOutput = generateWithVerboseOutput;
+ }
+
+}
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 492a8cc73..64e6a247f 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
@@ -60,7 +60,9 @@ class ProtocolClassGen extends GenericProtocolClassGenerator {
import org.eclipse.etrice.runtime.java.messaging.Address;
import org.eclipse.etrice.runtime.java.messaging.Message;
import org.eclipse.etrice.runtime.java.modelbase.*;
- import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
+ «IF GlobalSettings::generateMSCInstrumentation»
+ import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
+ «ENDIF»
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
«pc.userCode(1)»
@@ -107,14 +109,18 @@ class ProtocolClassGen extends GenericProtocolClassGenerator {
// constructors
public «portClassName»(IEventReceiver actor, String name, int localId, Address addr, Address peerAddress) {
this(actor, name, localId, 0, addr, peerAddress);
- DebuggingService.getInstance().addPortInstance(this);
+ «IF GlobalSettings::generateMSCInstrumentation»
+ DebuggingService.getInstance().addPortInstance(this);
+ «ENDIF»
}
public «portClassName»(IEventReceiver actor, String name, int localId, int idx, Address addr, Address peerAddress) {
super(actor, name, localId, idx, addr, peerAddress);
«IF pclass!=null»
«pclass.attributes.attributeInitialization(pclass, true)»
«ENDIF»
- DebuggingService.getInstance().addPortInstance(this);
+ «IF GlobalSettings::generateMSCInstrumentation»
+ DebuggingService.getInstance().addPortInstance(this);
+ «ENDIF»
}
@Override
@@ -122,13 +128,13 @@ class ProtocolClassGen extends GenericProtocolClassGenerator {
if (!(m instanceof EventMessage))
return;
EventMessage msg = (EventMessage) m;
- if (msg.getEvtId() <= 0 || msg.getEvtId() >= MSG_MAX)
- System.out.println("unknown");
- else {
- if (messageStrings[msg.getEvtId()] != "timerTick"){
-««« TODOTS: model switch for activation
- DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
- }
+ if (0 < msg.getEvtId() && msg.getEvtId() < MSG_MAX) {
+ «IF GlobalSettings::generateMSCInstrumentation»
+ if (messageStrings[msg.getEvtId()] != "timerTick"){
+««« TODOTS: model switch for activation
+ DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
+ }
+ «ENDIF»
«IF pc.handlesReceive(conj)»
switch (msg.getEvtId()) {
«FOR hdlr : pc.getReceiveHandlers(conj)»
@@ -250,10 +256,12 @@ class ProtocolClassGen extends GenericProtocolClassGenerator {
«FOR command : hdlr.detailCode.commands» «command»
«ENDFOR»
«ELSE»
- if (messageStrings[ «dir»_«m.name»] != "timerTick"){
-««« TODOTS: model switch for activation
- DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[«dir»_«m.name»]);
- }
+ «IF GlobalSettings::generateMSCInstrumentation»
+ if (messageStrings[ «dir»_«m.name»] != "timerTick") {
+««« TODOTS: model switch for activation
+ DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[«dir»_«m.name»]);
+ }
+ «ENDIF»
if (getPeerAddress()!=null)
«IF m.data==null»getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), «dir»_«m.name»));
«ELSE»getPeerMsgReceiver().receive(new EventWithDataMessage(getPeerAddress(), «dir»_«m.name», «m.data.name»«IF (!m.data.refType.ref && !(m.data.refType.type instanceof PrimitiveType))».deepCopy()«ENDIF»));
diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/StateMachineGen.xtend b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/StateMachineGen.xtend
index 585927587..a6baa5e1a 100644
--- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/StateMachineGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/StateMachineGen.xtend
@@ -39,10 +39,14 @@ class StateMachineGen extends GenericStateMachineGenerator {
protected int history[] = {NO_STATE,NO_STATE«FOR state : ac.getAllBaseStates()»,NO_STATE«ENDFOR»};
private void setState(int new_state) {
- DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
+ «IF GlobalSettings::generateMSCInstrumentation»
+ DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
+ «ENDIF»
if (stateStrings[new_state]!="Idle") {
-««« TODOTS: model switch for activation
- System.out.println(getInstancePath() + " -> " + stateStrings[new_state]);
+ «IF GlobalSettings::generateWithVerboseOutput»
+ System.out.println("state switch of "+getInstancePath() + ": "
+ + stateStrings[this.state] + " -> " + stateStrings[new_state]);
+ «ENDIF»
}
this.state = new_state;
}
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 9f2355e7a..c0bfc0e1c 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
@@ -25,6 +25,7 @@ import org.eclipse.etrice.generator.generic.ProcedureHelpers;
import org.eclipse.etrice.generator.generic.RoomExtensions;
import org.eclipse.etrice.generator.generic.TypeHelpers;
import org.eclipse.etrice.generator.java.gen.DataClassGen;
+import org.eclipse.etrice.generator.java.gen.GlobalSettings;
import org.eclipse.etrice.generator.java.gen.Initialization;
import org.eclipse.etrice.generator.java.gen.JavaExtensions;
import org.eclipse.xtend2.lib.StringConcatenation;
@@ -94,8 +95,13 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.newLine();
_builder.append("import org.eclipse.etrice.runtime.java.modelbase.*;");
_builder.newLine();
- _builder.append("import org.eclipse.etrice.runtime.java.debugging.DebuggingService;");
- _builder.newLine();
+ {
+ boolean _generateMSCInstrumentation = GlobalSettings.generateMSCInstrumentation();
+ if (_generateMSCInstrumentation) {
+ _builder.append("import org.eclipse.etrice.runtime.java.debugging.DebuggingService;");
+ _builder.newLine();
+ }
+ }
_builder.append("import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;");
_builder.newLine();
_builder.newLine();
@@ -233,9 +239,14 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.append("\t\t");
_builder.append("this(actor, name, localId, 0, addr, peerAddress);");
_builder.newLine();
- _builder.append("\t\t");
- _builder.append("DebuggingService.getInstance().addPortInstance(this);");
- _builder.newLine();
+ {
+ boolean _generateMSCInstrumentation = GlobalSettings.generateMSCInstrumentation();
+ if (_generateMSCInstrumentation) {
+ _builder.append("\t\t");
+ _builder.append("DebuggingService.getInstance().addPortInstance(this);");
+ _builder.newLine();
+ }
+ }
_builder.append("\t");
_builder.append("}");
_builder.newLine();
@@ -257,9 +268,14 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.newLineIfNotEmpty();
}
}
- _builder.append("\t\t");
- _builder.append("DebuggingService.getInstance().addPortInstance(this);");
- _builder.newLine();
+ {
+ boolean _generateMSCInstrumentation_1 = GlobalSettings.generateMSCInstrumentation();
+ if (_generateMSCInstrumentation_1) {
+ _builder.append("\t\t");
+ _builder.append("DebuggingService.getInstance().addPortInstance(this);");
+ _builder.newLine();
+ }
+ }
_builder.append("\t");
_builder.append("}");
_builder.newLine();
@@ -280,24 +296,24 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.append("EventMessage msg = (EventMessage) m;");
_builder.newLine();
_builder.append("\t\t\t");
- _builder.append("if (msg.getEvtId() <= 0 || msg.getEvtId() >= MSG_MAX)");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("System.out.println(\"unknown\");");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("else {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("if (messageStrings[msg.getEvtId()] != \"timerTick\"){");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("}");
+ _builder.append("if (0 < msg.getEvtId() && msg.getEvtId() < MSG_MAX) {");
_builder.newLine();
{
+ boolean _generateMSCInstrumentation_2 = GlobalSettings.generateMSCInstrumentation();
+ if (_generateMSCInstrumentation_2) {
+ _builder.append("\t\t\t\t");
+ _builder.append("if (messageStrings[msg.getEvtId()] != \"timerTick\"){");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("\t");
+ _builder.append("DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ }
+ }
+ {
boolean _handlesReceive = this._roomExtensions.handlesReceive(pc, (conj).booleanValue());
if (_handlesReceive) {
_builder.append("\t\t\t\t");
@@ -674,25 +690,31 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
}
}
} else {
- _builder.append("\t");
- _builder.append("if (messageStrings[ ");
- _builder.append(dir, " ");
- _builder.append("_");
- String _name = m.getName();
- _builder.append(_name, " ");
- _builder.append("] != \"timerTick\"){");
- _builder.newLineIfNotEmpty();
- _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();
+ {
+ boolean _generateMSCInstrumentation = GlobalSettings.generateMSCInstrumentation();
+ if (_generateMSCInstrumentation) {
+ _builder.append("\t");
+ _builder.append("if (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");
_builder.append("if (getPeerAddress()!=null)");
_builder.newLine();
diff --git a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/StateMachineGen.java b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/StateMachineGen.java
index bb397d606..e6ac84165 100644
--- a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/StateMachineGen.java
+++ b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/StateMachineGen.java
@@ -8,6 +8,7 @@ import org.eclipse.etrice.core.room.ActorClass;
import org.eclipse.etrice.core.room.State;
import org.eclipse.etrice.generator.generic.GenericStateMachineGenerator;
import org.eclipse.etrice.generator.generic.RoomExtensions;
+import org.eclipse.etrice.generator.java.gen.GlobalSettings;
import org.eclipse.xtend2.lib.StringConcatenation;
@Singleton
@@ -57,15 +58,29 @@ public class StateMachineGen extends GenericStateMachineGenerator {
_builder.newLine();
_builder.append("private void setState(int new_state) {");
_builder.newLine();
- _builder.append("\t");
- _builder.append("DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);");
- _builder.newLine();
+ {
+ boolean _generateMSCInstrumentation = GlobalSettings.generateMSCInstrumentation();
+ if (_generateMSCInstrumentation) {
+ _builder.append("\t");
+ _builder.append("DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);");
+ _builder.newLine();
+ }
+ }
_builder.append("\t");
_builder.append("if (stateStrings[new_state]!=\"Idle\") {");
_builder.newLine();
- _builder.append("\t\t");
- _builder.append("System.out.println(getInstancePath() + \" -> \" + stateStrings[new_state]);");
- _builder.newLine();
+ {
+ boolean _generateWithVerboseOutput = GlobalSettings.generateWithVerboseOutput();
+ if (_generateWithVerboseOutput) {
+ _builder.append("\t\t");
+ _builder.append("System.out.println(\"state switch of \"+getInstancePath() + \": \"");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("\t\t");
+ _builder.append("+ stateStrings[this.state] + \" -> \" + stateStrings[new_state]);");
+ _builder.newLine();
+ }
+ }
_builder.append("\t");
_builder.append("}\t");
_builder.newLine();
diff --git a/plugins/org.eclipse.etrice.generator.launch.java/src/org/eclipse/etrice/generator/launch/java/JavaGeneratorLaunchConfigurationDelegate.java b/plugins/org.eclipse.etrice.generator.launch.java/src/org/eclipse/etrice/generator/launch/java/JavaGeneratorLaunchConfigurationDelegate.java
index 9e856ad54..13c957bbf 100644
--- a/plugins/org.eclipse.etrice.generator.launch.java/src/org/eclipse/etrice/generator/launch/java/JavaGeneratorLaunchConfigurationDelegate.java
+++ b/plugins/org.eclipse.etrice.generator.launch.java/src/org/eclipse/etrice/generator/launch/java/JavaGeneratorLaunchConfigurationDelegate.java
@@ -43,6 +43,12 @@ public class JavaGeneratorLaunchConfigurationDelegate extends GeneratorLaunchCon
if (configuration.getAttribute(JavaGeneratorConfigTab.DEBUG, false)) {
argString.append(" "+Main.OPTION_DEBUG);
}
+ if (configuration.getAttribute(JavaGeneratorConfigTab.MSC, false)) {
+ argString.append(" "+Main.OPTION_MSC);
+ }
+ if (configuration.getAttribute(JavaGeneratorConfigTab.VERBOSE, false)) {
+ argString.append(" "+Main.OPTION_VERBOSE_RT);
+ }
}
/* (non-Javadoc)
diff --git a/plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/GeneratorConfigTab.java b/plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/GeneratorConfigTab.java
index a77348eec..98ba03cf1 100644
--- a/plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/GeneratorConfigTab.java
+++ b/plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/GeneratorConfigTab.java
@@ -65,6 +65,8 @@ public abstract class GeneratorConfigTab extends AbstractLaunchConfigurationTab
public static final String SAVE_GEN_MODEL = "SaveGenModel";
public static final String LIB = "Lib";
public static final String DEBUG = "Debug";
+ public static final String MSC = "MSC";
+ public static final String VERBOSE = "Verbose";
private Button libButton;
private Button documentationButton;
@@ -72,6 +74,8 @@ public abstract class GeneratorConfigTab extends AbstractLaunchConfigurationTab
private Text genModelPath;
private Button browsePath;
private Button debugButton;
+ private Button mscButton;
+ private Button verboseButton;
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
@@ -134,6 +138,14 @@ public abstract class GeneratorConfigTab extends AbstractLaunchConfigurationTab
debugButton = createCheckButton(mainComposite, "debug output");
debugButton.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false, 2, 1));
debugButton.addSelectionListener(new UpdateConfig());
+
+ mscButton = createCheckButton(mainComposite, "generate instrumentation for MSC generation");
+ mscButton.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false, 2, 1));
+ mscButton.addSelectionListener(new UpdateConfig());
+
+ verboseButton = createCheckButton(mainComposite, "generate instrumentation for verbose output");
+ verboseButton.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false, 2, 1));
+ verboseButton.addSelectionListener(new UpdateConfig());
addFurtherControls(mainComposite);
}
@@ -215,6 +227,8 @@ public abstract class GeneratorConfigTab extends AbstractLaunchConfigurationTab
genDocu = true;
documentationButton.setSelection(genDocu);
debugButton.setSelection(configuration.getAttribute(DEBUG, false));
+ mscButton.setSelection(configuration.getAttribute(MSC, false));
+ verboseButton.setSelection(configuration.getAttribute(VERBOSE, false));
}
catch (CoreException e) {
e.printStackTrace();
@@ -232,6 +246,8 @@ public abstract class GeneratorConfigTab extends AbstractLaunchConfigurationTab
configuration.setAttribute(GEN_INSTANCE_DIAGRAM, documentationButton.getSelection());
configuration.setAttribute(GEN_DOCUMENTATION, documentationButton.getSelection());
configuration.setAttribute(DEBUG, debugButton.getSelection());
+ configuration.setAttribute(MSC, mscButton.getSelection());
+ configuration.setAttribute(VERBOSE, verboseButton.getSelection());
}
/* (non-Javadoc)
diff --git a/runtime/org.eclipse.etrice.modellib.java/models/TimingService.room b/runtime/org.eclipse.etrice.modellib.java/models/TimingService.room
index ed91fadca..c175854d1 100644
--- a/runtime/org.eclipse.etrice.modellib.java/models/TimingService.room
+++ b/runtime/org.eclipse.etrice.modellib.java/models/TimingService.room
@@ -163,9 +163,6 @@ RoomModel room.basic.service.timing {
handle
incoming kill {
"//conjugate PortClass kill
- DebuggingService.getInstance().addMessageAsyncOut(getAddress(),
- getPeerAddress(), messageStrings[IN_kill]);
-
if (active) {
active = false;
TimerData td = new TimerData();
@@ -179,7 +176,6 @@ RoomModel room.basic.service.timing {
if (active) return;
active = true;
- DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_internalStartTimer]);
getPeerMsgReceiver().receive(new EventWithDataMessage(getPeerAddress(), IN_internalStartTimer, new TimerData(time_ms,++currentId)));
"
}
@@ -188,7 +184,6 @@ RoomModel room.basic.service.timing {
if (active) return;
active = true;
- 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.modellib.java/src-gen/org/eclipse/etrice/modellib/Socket/DSocketConfiguration.java b/runtime/org.eclipse.etrice.modellib.java/src-gen/org/eclipse/etrice/modellib/Socket/DSocketConfiguration.java
index cf5a0c40c..7c17ea7fc 100644
--- a/runtime/org.eclipse.etrice.modellib.java/src-gen/org/eclipse/etrice/modellib/Socket/DSocketConfiguration.java
+++ b/runtime/org.eclipse.etrice.modellib.java/src-gen/org/eclipse/etrice/modellib/Socket/DSocketConfiguration.java
@@ -1,5 +1,7 @@
package org.eclipse.etrice.modellib.Socket;
+import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
+
@@ -52,6 +54,7 @@ public class DSocketConfiguration {
super();
// initialize attributes
+ this.setServerName("");
}
// constructor using fields
diff --git a/runtime/org.eclipse.etrice.modellib.java/src-gen/org/eclipse/etrice/modellib/Socket/DSocketData.java b/runtime/org.eclipse.etrice.modellib.java/src-gen/org/eclipse/etrice/modellib/Socket/DSocketData.java
index 02aef15f0..78aee43c4 100644
--- a/runtime/org.eclipse.etrice.modellib.java/src-gen/org/eclipse/etrice/modellib/Socket/DSocketData.java
+++ b/runtime/org.eclipse.etrice.modellib.java/src-gen/org/eclipse/etrice/modellib/Socket/DSocketData.java
@@ -1,5 +1,7 @@
package org.eclipse.etrice.modellib.Socket;
+import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
+
@@ -31,6 +33,7 @@ public class DSocketData {
super();
// initialize attributes
+ this.setData("");
}
// constructor using fields
diff --git a/runtime/org.eclipse.etrice.modellib.java/src-gen/org/eclipse/etrice/modellib/Socket/PSocket.java b/runtime/org.eclipse.etrice.modellib.java/src-gen/org/eclipse/etrice/modellib/Socket/PSocket.java
index 407236440..65da2bd4f 100644
--- a/runtime/org.eclipse.etrice.modellib.java/src-gen/org/eclipse/etrice/modellib/Socket/PSocket.java
+++ b/runtime/org.eclipse.etrice.modellib.java/src-gen/org/eclipse/etrice/modellib/Socket/PSocket.java
@@ -5,7 +5,6 @@ import java.util.ArrayList;
import org.eclipse.etrice.runtime.java.messaging.Address;
import org.eclipse.etrice.runtime.java.messaging.Message;
import org.eclipse.etrice.runtime.java.modelbase.*;
-import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -42,11 +41,9 @@ public class PSocket {
// constructors
public PSocketPort(IEventReceiver actor, String name, int localId, Address addr, Address peerAddress) {
this(actor, name, localId, 0, addr, peerAddress);
- DebuggingService.getInstance().addPortInstance(this);
}
public PSocketPort(IEventReceiver actor, String name, int localId, int idx, Address addr, Address peerAddress) {
super(actor, name, localId, idx, addr, peerAddress);
- DebuggingService.getInstance().addPortInstance(this);
}
@Override
@@ -57,9 +54,6 @@ public class PSocket {
if (msg.getEvtId() <= 0 || msg.getEvtId() >= MSG_MAX)
System.out.println("unknown");
else {
- if (messageStrings[msg.getEvtId()] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
- }
if (msg instanceof EventWithDataMessage)
getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
else
@@ -70,37 +64,22 @@ public class PSocket {
// sent messages
public void connected() {
- if (messageStrings[ OUT_connected] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[OUT_connected]);
- }
if (getPeerAddress()!=null)
getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), OUT_connected));
}
public void disconnected() {
- if (messageStrings[ OUT_disconnected] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[OUT_disconnected]);
- }
if (getPeerAddress()!=null)
getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), OUT_disconnected));
}
public void receivedData() {
- if (messageStrings[ OUT_receivedData] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[OUT_receivedData]);
- }
if (getPeerAddress()!=null)
getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), OUT_receivedData));
}
public void sentData() {
- if (messageStrings[ OUT_sentData] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[OUT_sentData]);
- }
if (getPeerAddress()!=null)
getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), OUT_sentData));
}
public void error() {
- if (messageStrings[ OUT_error] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[OUT_error]);
- }
if (getPeerAddress()!=null)
getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), OUT_error));
}
@@ -167,11 +146,9 @@ public class PSocket {
// constructors
public PSocketConjPort(IEventReceiver actor, String name, int localId, Address addr, Address peerAddress) {
this(actor, name, localId, 0, addr, peerAddress);
- DebuggingService.getInstance().addPortInstance(this);
}
public PSocketConjPort(IEventReceiver actor, String name, int localId, int idx, Address addr, Address peerAddress) {
super(actor, name, localId, idx, addr, peerAddress);
- DebuggingService.getInstance().addPortInstance(this);
}
@Override
@@ -182,9 +159,6 @@ public class PSocket {
if (msg.getEvtId() <= 0 || msg.getEvtId() >= MSG_MAX)
System.out.println("unknown");
else {
- if (messageStrings[msg.getEvtId()] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
- }
if (msg instanceof EventWithDataMessage)
getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
else
@@ -195,9 +169,6 @@ public class PSocket {
// sent messages
public void connect(DSocketConfiguration config) {
- if (messageStrings[ IN_connect] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_connect]);
- }
if (getPeerAddress()!=null)
getPeerMsgReceiver().receive(new EventWithDataMessage(getPeerAddress(), IN_connect, config.deepCopy()));
}
@@ -205,16 +176,10 @@ public class PSocket {
connect(new DSocketConfiguration(serverName, portNumber, protocol, checkCookie, mode));
}
public void disconnect() {
- if (messageStrings[ IN_disconnect] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_disconnect]);
- }
if (getPeerAddress()!=null)
getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), IN_disconnect));
}
public void sendData(DSocketData data) {
- if (messageStrings[ IN_sendData] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_sendData]);
- }
if (getPeerAddress()!=null)
getPeerMsgReceiver().receive(new EventWithDataMessage(getPeerAddress(), IN_sendData, data.deepCopy()));
}
diff --git a/runtime/org.eclipse.etrice.modellib.java/src-gen/org/eclipse/etrice/modellib/Socket/SocketClient.java b/runtime/org.eclipse.etrice.modellib.java/src-gen/org/eclipse/etrice/modellib/Socket/SocketClient.java
index 582f3a4bd..60872b94f 100644
--- a/runtime/org.eclipse.etrice.modellib.java/src-gen/org/eclipse/etrice/modellib/Socket/SocketClient.java
+++ b/runtime/org.eclipse.etrice.modellib.java/src-gen/org/eclipse/etrice/modellib/Socket/SocketClient.java
@@ -28,7 +28,6 @@ public class SocketClient extends ActorClassBase {
//--------------------- interface item IDs
public static final int IFITEM_fct = 1;
-
/*--------------------- attributes ---------------------*/
/*--------------------- operations ---------------------*/
diff --git a/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/logging/ALogService.java b/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/logging/ALogService.java
index 1b8cd7168..aec840f60 100644
--- a/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/logging/ALogService.java
+++ b/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/logging/ALogService.java
@@ -37,7 +37,6 @@ public class ALogService extends ActorClassBase {
//--------------------- interface item IDs
public static final int IFITEM_log = 1;
-
/*--------------------- attributes ---------------------*/
/*--------------------- operations ---------------------*/
public void destroyUser() {
@@ -88,7 +87,6 @@ public class ALogService extends ActorClassBase {
public void destroy(){
}
-
/* state IDs */
public static final int STATE_closed = 2;
public static final int STATE_opened = 3;
@@ -114,7 +112,6 @@ public class ALogService extends ActorClassBase {
protected int history[] = {NO_STATE,NO_STATE,NO_STATE,NO_STATE};
private void setState(int new_state) {
- DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
if (stateStrings[new_state]!="Idle") {
System.out.println(getInstancePath() + " -> " + stateStrings[new_state]);
}
@@ -244,7 +241,7 @@ public class ALogService extends ActorClassBase {
boolean skip_entry = false;
if (!handleSystemEvent(ifitem, evt, generic_data)) {
- switch (this.state) {
+ switch (getState()) {
case STATE_closed:
switch(trigger) {
case TRIG_log__open:
@@ -274,7 +271,7 @@ public class ALogService extends ActorClassBase {
}
}
if (chain != NOT_CAUGHT) {
- exitTo(this.state, catching_state, is_handler);
+ exitTo(getState(), catching_state, is_handler);
int next = executeTransitionChain(chain, ifitem, generic_data);
next = enterHistory(next, is_handler, skip_entry);
setState(next);
diff --git a/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/logging/InternalLogData.java b/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/logging/InternalLogData.java
index 67f715a96..94b8418c6 100644
--- a/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/logging/InternalLogData.java
+++ b/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/logging/InternalLogData.java
@@ -1,5 +1,7 @@
package room.basic.service.logging;
+import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
+
@@ -38,6 +40,8 @@ public class InternalLogData {
super();
// initialize attributes
+ this.setUserString("");
+ this.setSender("");
}
// constructor using fields
diff --git a/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/logging/Log.java b/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/logging/Log.java
index 7762c6bb9..0125a4258 100644
--- a/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/logging/Log.java
+++ b/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/logging/Log.java
@@ -5,7 +5,6 @@ import java.util.ArrayList;
import org.eclipse.etrice.runtime.java.messaging.Address;
import org.eclipse.etrice.runtime.java.messaging.Message;
import org.eclipse.etrice.runtime.java.modelbase.*;
-import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -42,11 +41,9 @@ public class Log {
// constructors
public LogPort(IEventReceiver actor, String name, int localId, Address addr, Address peerAddress) {
this(actor, name, localId, 0, addr, peerAddress);
- DebuggingService.getInstance().addPortInstance(this);
}
public LogPort(IEventReceiver actor, String name, int localId, int idx, Address addr, Address peerAddress) {
super(actor, name, localId, idx, addr, peerAddress);
- DebuggingService.getInstance().addPortInstance(this);
}
@Override
@@ -57,9 +54,6 @@ public class Log {
if (msg.getEvtId() <= 0 || msg.getEvtId() >= MSG_MAX)
System.out.println("unknown");
else {
- if (messageStrings[msg.getEvtId()] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
- }
if (msg instanceof EventWithDataMessage)
getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
else
@@ -111,12 +105,10 @@ public class Log {
// constructors
public LogConjPort(IEventReceiver actor, String name, int localId, Address addr, Address peerAddress) {
this(actor, name, localId, 0, addr, peerAddress);
- DebuggingService.getInstance().addPortInstance(this);
}
public LogConjPort(IEventReceiver actor, String name, int localId, int idx, Address addr, Address peerAddress) {
super(actor, name, localId, idx, addr, peerAddress);
// initialize attributes
- DebuggingService.getInstance().addPortInstance(this);
}
@Override
@@ -127,9 +119,6 @@ public class Log {
if (msg.getEvtId() <= 0 || msg.getEvtId() >= MSG_MAX)
System.out.println("unknown");
else {
- if (messageStrings[msg.getEvtId()] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
- }
if (msg instanceof EventWithDataMessage)
getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
else
@@ -138,7 +127,6 @@ public class Log {
}
/*--------------------- attributes ---------------------*/
- // TODO JH: Avoid collision attr getters/setter <-> user operations
//--------------------- attribute setters and getters
/*--------------------- operations ---------------------*/
public void setLogLevel(int l) {
@@ -158,23 +146,14 @@ public class Log {
// sent messages
public void open(String fileName) {
- if (messageStrings[ IN_open] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_open]);
- }
if (getPeerAddress()!=null)
getPeerMsgReceiver().receive(new EventWithDataMessage(getPeerAddress(), IN_open, fileName));
}
public void close() {
- if (messageStrings[ IN_close] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_close]);
- }
if (getPeerAddress()!=null)
getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), IN_close));
}
private void internalLog(InternalLogData data) {
- if (messageStrings[ IN_internalLog] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_internalLog]);
- }
if (getPeerAddress()!=null)
getPeerMsgReceiver().receive(new EventWithDataMessage(getPeerAddress(), IN_internalLog, data.deepCopy()));
}
diff --git a/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/tcp/ATcpClient.java b/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/tcp/ATcpClient.java
index 6c1e24d6c..cc03562f0 100644
--- a/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/tcp/ATcpClient.java
+++ b/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/tcp/ATcpClient.java
@@ -64,7 +64,6 @@ public class ATcpClient extends ActorClassBase {
public static final int IFITEM_ControlPort = 1;
public static final int IFITEM_PayloadPort = 2;
-
/*--------------------- attributes ---------------------*/
int lastError;
/*--------------------- operations ---------------------*/
@@ -83,7 +82,7 @@ public class ATcpClient extends ActorClassBase {
setClassName("ATcpClient");
// initialize attributes
- lastError = 0;
+ this.setLastError(0);
// own ports
ControlPort = new PTcpControlPort(this, "ControlPort", IFITEM_ControlPort, 0, port_addr[IFITEM_ControlPort][0], peer_addr[IFITEM_ControlPort][0]);
@@ -128,7 +127,6 @@ public class ATcpClient extends ActorClassBase {
public void destroy(){
}
-
/* state IDs */
public static final int STATE_closed = 2;
public static final int STATE_opened = 3;
@@ -156,7 +154,6 @@ public class ATcpClient extends ActorClassBase {
protected int history[] = {NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE};
private void setState(int new_state) {
- DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
if (stateStrings[new_state]!="Idle") {
System.out.println(getInstancePath() + " -> " + stateStrings[new_state]);
}
@@ -317,7 +314,7 @@ public class ATcpClient extends ActorClassBase {
boolean skip_entry = false;
if (!handleSystemEvent(ifitem, evt, generic_data)) {
- switch (this.state) {
+ switch (getState()) {
case STATE_closed:
switch(trigger) {
case TRIG_ControlPort__open:
@@ -349,7 +346,7 @@ public class ATcpClient extends ActorClassBase {
}
}
if (chain != NOT_CAUGHT) {
- exitTo(this.state, catching_state, is_handler);
+ exitTo(getState(), catching_state, is_handler);
int next = executeTransitionChain(chain, ifitem, generic_data);
next = enterHistory(next, is_handler, skip_entry);
setState(next);
diff --git a/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/tcp/ATcpServer.java b/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/tcp/ATcpServer.java
index 48408e69a..574bcfa89 100644
--- a/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/tcp/ATcpServer.java
+++ b/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/tcp/ATcpServer.java
@@ -100,7 +100,6 @@ public class ATcpServer extends ActorClassBase {
public static final int IFITEM_ControlPort = 1;
public static final int IFITEM_PayloadPort = 2;
-
/*--------------------- attributes ---------------------*/
int lastError;
int payloadPortReplocation;
@@ -120,8 +119,8 @@ public class ATcpServer extends ActorClassBase {
setClassName("ATcpServer");
// initialize attributes
- lastError = 0;
- payloadPortReplocation = 0;
+ this.setLastError(0);
+ this.setPayloadPortReplocation(0);
// own ports
ControlPort = new PTcpControlPort(this, "ControlPort", IFITEM_ControlPort, 0, port_addr[IFITEM_ControlPort][0], peer_addr[IFITEM_ControlPort][0]);
@@ -172,7 +171,6 @@ public class ATcpServer extends ActorClassBase {
public void destroy(){
}
-
/* state IDs */
public static final int STATE_closed = 2;
public static final int STATE_opened = 3;
@@ -200,7 +198,6 @@ public class ATcpServer extends ActorClassBase {
protected int history[] = {NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE};
private void setState(int new_state) {
- DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
if (stateStrings[new_state]!="Idle") {
System.out.println(getInstancePath() + " -> " + stateStrings[new_state]);
}
@@ -356,7 +353,7 @@ public class ATcpServer extends ActorClassBase {
boolean skip_entry = false;
if (!handleSystemEvent(ifitem, evt, generic_data)) {
- switch (this.state) {
+ switch (getState()) {
case STATE_closed:
switch(trigger) {
case TRIG_ControlPort__open:
@@ -388,7 +385,7 @@ public class ATcpServer extends ActorClassBase {
}
}
if (chain != NOT_CAUGHT) {
- exitTo(this.state, catching_state, is_handler);
+ exitTo(getState(), catching_state, is_handler);
int next = executeTransitionChain(chain, ifitem, generic_data);
next = enterHistory(next, is_handler, skip_entry);
setState(next);
diff --git a/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/tcp/DTcpControl.java b/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/tcp/DTcpControl.java
index 5316b3057..3848b7a3b 100644
--- a/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/tcp/DTcpControl.java
+++ b/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/tcp/DTcpControl.java
@@ -1,5 +1,7 @@
package room.basic.service.tcp;
+import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
+
@@ -31,6 +33,7 @@ public class DTcpControl {
super();
// initialize attributes
+ this.setIPAddr("");
}
// constructor using fields
diff --git a/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/tcp/DTcpPayload.java b/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/tcp/DTcpPayload.java
index 0bd40e08e..4e75a1ed8 100644
--- a/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/tcp/DTcpPayload.java
+++ b/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/tcp/DTcpPayload.java
@@ -1,5 +1,7 @@
package room.basic.service.tcp;
+import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
+
@@ -38,7 +40,13 @@ public class DTcpPayload {
super();
// initialize attributes
- data = new byte[1000];
+ {
+ byte[] array = new byte[1000];
+ for (int i=0;i<1000;i++){
+ array[i] = (byte)0;
+ }
+ this.setData(array);
+ }
}
// constructor using fields
diff --git a/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/tcp/PTcpControl.java b/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/tcp/PTcpControl.java
index 602282b7e..ee7fee66a 100644
--- a/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/tcp/PTcpControl.java
+++ b/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/tcp/PTcpControl.java
@@ -5,7 +5,6 @@ import java.util.ArrayList;
import org.eclipse.etrice.runtime.java.messaging.Address;
import org.eclipse.etrice.runtime.java.messaging.Message;
import org.eclipse.etrice.runtime.java.modelbase.*;
-import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -38,11 +37,9 @@ public class PTcpControl {
// constructors
public PTcpControlPort(IEventReceiver actor, String name, int localId, Address addr, Address peerAddress) {
this(actor, name, localId, 0, addr, peerAddress);
- DebuggingService.getInstance().addPortInstance(this);
}
public PTcpControlPort(IEventReceiver actor, String name, int localId, int idx, Address addr, Address peerAddress) {
super(actor, name, localId, idx, addr, peerAddress);
- DebuggingService.getInstance().addPortInstance(this);
}
@Override
@@ -53,9 +50,6 @@ public class PTcpControl {
if (msg.getEvtId() <= 0 || msg.getEvtId() >= MSG_MAX)
System.out.println("unknown");
else {
- if (messageStrings[msg.getEvtId()] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
- }
if (msg instanceof EventWithDataMessage)
getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
else
@@ -66,16 +60,10 @@ public class PTcpControl {
// sent messages
public void established() {
- if (messageStrings[ OUT_established] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[OUT_established]);
- }
if (getPeerAddress()!=null)
getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), OUT_established));
}
public void error() {
- if (messageStrings[ OUT_error] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[OUT_error]);
- }
if (getPeerAddress()!=null)
getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), OUT_error));
}
@@ -127,11 +115,9 @@ public class PTcpControl {
// constructors
public PTcpControlConjPort(IEventReceiver actor, String name, int localId, Address addr, Address peerAddress) {
this(actor, name, localId, 0, addr, peerAddress);
- DebuggingService.getInstance().addPortInstance(this);
}
public PTcpControlConjPort(IEventReceiver actor, String name, int localId, int idx, Address addr, Address peerAddress) {
super(actor, name, localId, idx, addr, peerAddress);
- DebuggingService.getInstance().addPortInstance(this);
}
@Override
@@ -142,9 +128,6 @@ public class PTcpControl {
if (msg.getEvtId() <= 0 || msg.getEvtId() >= MSG_MAX)
System.out.println("unknown");
else {
- if (messageStrings[msg.getEvtId()] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
- }
if (msg instanceof EventWithDataMessage)
getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
else
@@ -155,9 +138,6 @@ public class PTcpControl {
// sent messages
public void open(DTcpControl data) {
- if (messageStrings[ IN_open] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_open]);
- }
if (getPeerAddress()!=null)
getPeerMsgReceiver().receive(new EventWithDataMessage(getPeerAddress(), IN_open, data.deepCopy()));
}
@@ -165,9 +145,6 @@ public class PTcpControl {
open(new DTcpControl(IPAddr, TcpPort));
}
public void close() {
- if (messageStrings[ IN_close] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_close]);
- }
if (getPeerAddress()!=null)
getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), IN_close));
}
diff --git a/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/tcp/PTcpPayload.java b/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/tcp/PTcpPayload.java
index 5bf3b83fe..dfec96edc 100644
--- a/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/tcp/PTcpPayload.java
+++ b/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/tcp/PTcpPayload.java
@@ -5,7 +5,6 @@ import java.util.ArrayList;
import org.eclipse.etrice.runtime.java.messaging.Address;
import org.eclipse.etrice.runtime.java.messaging.Message;
import org.eclipse.etrice.runtime.java.modelbase.*;
-import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -36,11 +35,9 @@ public class PTcpPayload {
// constructors
public PTcpPayloadPort(IEventReceiver actor, String name, int localId, Address addr, Address peerAddress) {
this(actor, name, localId, 0, addr, peerAddress);
- DebuggingService.getInstance().addPortInstance(this);
}
public PTcpPayloadPort(IEventReceiver actor, String name, int localId, int idx, Address addr, Address peerAddress) {
super(actor, name, localId, idx, addr, peerAddress);
- DebuggingService.getInstance().addPortInstance(this);
}
@Override
@@ -51,9 +48,6 @@ public class PTcpPayload {
if (msg.getEvtId() <= 0 || msg.getEvtId() >= MSG_MAX)
System.out.println("unknown");
else {
- if (messageStrings[msg.getEvtId()] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
- }
if (msg instanceof EventWithDataMessage)
getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
else
@@ -64,9 +58,6 @@ public class PTcpPayload {
// sent messages
public void receive(DTcpPayload data) {
- if (messageStrings[ OUT_receive] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[OUT_receive]);
- }
if (getPeerAddress()!=null)
getPeerMsgReceiver().receive(new EventWithDataMessage(getPeerAddress(), OUT_receive, data.deepCopy()));
}
@@ -116,11 +107,9 @@ public class PTcpPayload {
// constructors
public PTcpPayloadConjPort(IEventReceiver actor, String name, int localId, Address addr, Address peerAddress) {
this(actor, name, localId, 0, addr, peerAddress);
- DebuggingService.getInstance().addPortInstance(this);
}
public PTcpPayloadConjPort(IEventReceiver actor, String name, int localId, int idx, Address addr, Address peerAddress) {
super(actor, name, localId, idx, addr, peerAddress);
- DebuggingService.getInstance().addPortInstance(this);
}
@Override
@@ -131,9 +120,6 @@ public class PTcpPayload {
if (msg.getEvtId() <= 0 || msg.getEvtId() >= MSG_MAX)
System.out.println("unknown");
else {
- if (messageStrings[msg.getEvtId()] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
- }
if (msg instanceof EventWithDataMessage)
getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
else
@@ -144,9 +130,6 @@ public class PTcpPayload {
// sent messages
public void send(DTcpPayload data) {
- if (messageStrings[ IN_send] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_send]);
- }
if (getPeerAddress()!=null)
getPeerMsgReceiver().receive(new EventWithDataMessage(getPeerAddress(), IN_send, data.deepCopy()));
}
diff --git a/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/timing/ATimingService.java b/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/timing/ATimingService.java
index 3865c2440..429ae918c 100644
--- a/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/timing/ATimingService.java
+++ b/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/timing/ATimingService.java
@@ -36,7 +36,6 @@ public class ATimingService extends ActorClassBase {
//--------------------- interface item IDs
public static final int IFITEM_timer = 1;
-
/*--------------------- attributes ---------------------*/
/*--------------------- operations ---------------------*/
public void stop() {
@@ -82,7 +81,6 @@ public class ATimingService extends ActorClassBase {
public void destroy(){
}
-
/* state IDs */
public static final int STATE_Operational = 2;
@@ -106,7 +104,6 @@ public class ATimingService extends ActorClassBase {
protected int history[] = {NO_STATE,NO_STATE,NO_STATE};
private void setState(int new_state) {
- DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);
if (stateStrings[new_state]!="Idle") {
System.out.println(getInstancePath() + " -> " + stateStrings[new_state]);
}
@@ -230,7 +227,7 @@ public class ATimingService extends ActorClassBase {
boolean skip_entry = false;
if (!handleSystemEvent(ifitem, evt, generic_data)) {
- switch (this.state) {
+ switch (getState()) {
case STATE_Operational:
switch(trigger) {
case TRIG_timer__internalStartTimer:
@@ -256,7 +253,7 @@ public class ATimingService extends ActorClassBase {
}
}
if (chain != NOT_CAUGHT) {
- exitTo(this.state, catching_state, is_handler);
+ exitTo(getState(), catching_state, is_handler);
int next = executeTransitionChain(chain, ifitem, generic_data);
next = enterHistory(next, is_handler, skip_entry);
setState(next);
diff --git a/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/timing/PTimer.java b/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/timing/PTimer.java
index 033c18ca6..b71d00fce 100644
--- a/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/timing/PTimer.java
+++ b/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/timing/PTimer.java
@@ -5,7 +5,6 @@ import java.util.ArrayList;
import org.eclipse.etrice.runtime.java.messaging.Address;
import org.eclipse.etrice.runtime.java.messaging.Message;
import org.eclipse.etrice.runtime.java.modelbase.*;
-import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
/*--------------------- begin user code ---------------------*/
@@ -76,12 +75,10 @@ public class PTimer {
// constructors
public PTimerPort(IEventReceiver actor, String name, int localId, Address addr, Address peerAddress) {
this(actor, name, localId, 0, addr, peerAddress);
- DebuggingService.getInstance().addPortInstance(this);
}
public PTimerPort(IEventReceiver actor, String name, int localId, int idx, Address addr, Address peerAddress) {
super(actor, name, localId, idx, addr, peerAddress);
// initialize attributes
- DebuggingService.getInstance().addPortInstance(this);
}
@Override
@@ -92,9 +89,6 @@ public class PTimer {
if (msg.getEvtId() <= 0 || msg.getEvtId() >= MSG_MAX)
System.out.println("unknown");
else {
- if (messageStrings[msg.getEvtId()] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
- }
switch (msg.getEvtId()) {
case IN_internalStartTimer:
{
@@ -134,22 +128,15 @@ public class PTimer {
}
/*--------------------- attributes ---------------------*/
- // TODO JH: Avoid collision attr getters/setter <-> user operations
//--------------------- attribute setters and getters
/*--------------------- operations ---------------------*/
// sent messages
public void timeout() {
- if (messageStrings[ OUT_timeout] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[OUT_timeout]);
- }
if (getPeerAddress()!=null)
getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), OUT_timeout));
}
private void internalTimeout(TimerData td) {
- if (messageStrings[ OUT_internalTimeout] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[OUT_internalTimeout]);
- }
if (getPeerAddress()!=null)
getPeerMsgReceiver().receive(new EventWithDataMessage(getPeerAddress(), OUT_internalTimeout, td.deepCopy()));
}
@@ -208,12 +195,10 @@ public class PTimer {
// constructors
public PTimerConjPort(IEventReceiver actor, String name, int localId, Address addr, Address peerAddress) {
this(actor, name, localId, 0, addr, peerAddress);
- DebuggingService.getInstance().addPortInstance(this);
}
public PTimerConjPort(IEventReceiver actor, String name, int localId, int idx, Address addr, Address peerAddress) {
super(actor, name, localId, idx, addr, peerAddress);
// initialize attributes
- DebuggingService.getInstance().addPortInstance(this);
}
@Override
@@ -224,9 +209,6 @@ public class PTimer {
if (msg.getEvtId() <= 0 || msg.getEvtId() >= MSG_MAX)
System.out.println("unknown");
else {
- if (messageStrings[msg.getEvtId()] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
- }
switch (msg.getEvtId()) {
case OUT_internalTimeout:
{
@@ -249,7 +231,6 @@ public class PTimer {
}
/*--------------------- attributes ---------------------*/
- // TODO JH: Avoid collision attr getters/setter <-> user operations
//--------------------- attribute setters and getters
/*--------------------- operations ---------------------*/
public void startTimer(int time_ms) {
@@ -257,7 +238,6 @@ public class PTimer {
if (active) return;
active = true;
- DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_internalStartTimer]);
getPeerMsgReceiver().receive(new EventWithDataMessage(getPeerAddress(), IN_internalStartTimer, new TimerData(time_ms,++currentId)));
}
public void startTimeout(int time_ms) {
@@ -265,16 +245,12 @@ public class PTimer {
if (active) return;
active = true;
- DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_internalStartTimeout]);
getPeerMsgReceiver().receive(new EventWithDataMessage(getPeerAddress(), IN_internalStartTimeout, new TimerData(time_ms,++currentId)));
}
// sent messages
public void kill() {
//conjugate PortClass kill
- DebuggingService.getInstance().addMessageAsyncOut(getAddress(),
- getPeerAddress(), messageStrings[IN_kill]);
-
if (active) {
active = false;
TimerData td = new TimerData();
@@ -284,9 +260,6 @@ public class PTimer {
}
}
private void internalStartTimer(TimerData td) {
- if (messageStrings[ IN_internalStartTimer] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_internalStartTimer]);
- }
if (getPeerAddress()!=null)
getPeerMsgReceiver().receive(new EventWithDataMessage(getPeerAddress(), IN_internalStartTimer, td.deepCopy()));
}
@@ -294,9 +267,6 @@ public class PTimer {
internalStartTimer(new TimerData(time, id));
}
private void internalStartTimeout(TimerData td) {
- if (messageStrings[ IN_internalStartTimeout] != "timerTick"){
- DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_internalStartTimeout]);
- }
if (getPeerAddress()!=null)
getPeerMsgReceiver().receive(new EventWithDataMessage(getPeerAddress(), IN_internalStartTimeout, td.deepCopy()));
}
diff --git a/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/timing/TimerData.java b/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/timing/TimerData.java
index a4c143a39..eea006dc7 100644
--- a/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/timing/TimerData.java
+++ b/runtime/org.eclipse.etrice.modellib.java/src-gen/room/basic/service/timing/TimerData.java
@@ -1,5 +1,7 @@
package room.basic.service.timing;
+import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
+

Back to the top