From 65f678532baa2ec92d2a283cc9d71beda7e9d518 Mon Sep 17 00:00:00 2001 From: Juergen Haug Date: Tue, 8 Sep 2015 13:27:01 +0200 Subject: [core] added data logging trigger + gnuplot generator Change-Id: I9694d9da168e947ce6f9e1aa8489c731e8ef1bbb --- .../model/Features/DataLoggingExample.room | 166 +++++++++ .../model/Features/gen_features.launch | 1 + .../gen_TrafficLight_step1.launch | 1 + .../gen_TrafficLight_step2.launch | 1 + .../gen_TrafficLight_step3.launch | 1 + .../gen_TrafficLight_step4.launch | 1 + .../generate_Template.launch | 1 + .../model/HelloWorld/generate_HelloWorldC.launch | 1 + .../model/PingPong/generate_PingPongC.launch | 1 + .../HelloWorld/generate_HelloWorldJava.launch | 1 + .../model/PingPong/generate_PingPongJava.launch | 1 + .../org.eclipse.etrice.feature/build_local.xml | 4 + features/org.eclipse.etrice.feature/feature.xml | 7 + .../templates/readme.txt | 2 +- .../templates/templates.xml | 18 +- .../META-INF/MANIFEST.MF | 3 +- .../src/org/eclipse/etrice/generator/c/Main.java | 7 + .../eclipse/etrice/generator/c/gen/NodeGen.xtend | 6 +- .../etrice/generator/c/gen/NodeRunnerGen.xtend | 3 +- .../etrice/generator/c/gen/ActorClassGen.java | 8 +- .../eclipse/etrice/generator/c/gen/NodeGen.java | 88 +++-- .../etrice/generator/c/gen/NodeRunnerGen.java | 17 +- .../etrice/generator/c/gen/ProtocolClassGen.java | 28 +- .../etrice/generator/c/gen/StateMachineGen.java | 8 +- .../etrice/generator/cpp/gen/ActorClassGen.xtend | 3 +- .../.classpath | 8 + .../.gitignore | 2 + .../org.eclipse.etrice.generator.gnuplot/.project | 34 ++ .../.settings/org.eclipse.core.resources.prefs | 2 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../META-INF/MANIFEST.MF | 22 ++ .../build.properties | 5 + .../generator/gnuplot/GnuplotScriptGenerator.xtend | 170 +++++++++ .../generator/gnuplot/GnuplotScriptGenerator.java | 407 +++++++++++++++++++++ .../etrice/generator/java/gen/ActorClassGen.java | 12 +- .../eclipse/etrice/generator/java/gen/NodeGen.java | 24 +- .../java/gen/OptionalActorInterfaceGen.java | 8 +- .../generator/java/gen/ProtocolClassGen.java | 20 +- .../etrice/generator/java/gen/StateMachineGen.java | 16 +- .../launch/java/JavaGeneratorConfigTab.java | 2 + .../generator/launch/GeneratorConfigTab.java | 17 +- .../GeneratorLaunchConfigurationDelegate.java | 7 +- .../generator/ui/wizard/ProjectFileFragments.xtend | 1 + .../ui/wizard/deprecated/MappingCreationPage.java | 8 +- .../ui/wizard/deprecated/MappingWizard.java | 12 - .../ui/wizard/deprecated/SelectRoomPage.java | 1 + .../generator/ui/wizard/ProjectFileFragments.java | 2 + .../etrice/generator/base/AbstractGenerator.java | 12 +- .../generator/base/GlobalGeneratorSettings.java | 95 ----- .../generator/base/GlobalGeneratorSettings.xtend | 39 ++ .../generator/base/GlobalGeneratorSettings.java | 116 ++++++ .../build.properties | 3 +- .../build.properties | 3 +- .../build.properties | 3 +- .../contents/org.eclipse.etrice.examples.c.zip | Bin 101844 -> 103380 bytes .../contents/org.eclipse.etrice.modellib.c.zip | Bin 229804 -> 213488 bytes .../contents/org.eclipse.etrice.runtime.c.zip | Bin 176855 -> 176855 bytes .../contents/org.eclipse.etrice.template.c.zip | Bin 10594 -> 10601 bytes .../contents/org.eclipse.etrice.tutorials.c.zip | Bin 19383 -> 19405 bytes .../contents/org.eclipse.etrice.tutorials.java.zip | Bin 29280 -> 17855 bytes .../model/Annotations.room | 19 + .../buildTools/Makefile | 19 - .../buildTools/Makefile.mk | 33 +- .../java/modelbase/RTSystemServicesProtocol.java | 7 - .../build.properties | 3 +- 65 files changed, 1248 insertions(+), 269 deletions(-) create mode 100644 examples/org.eclipse.etrice.examples.c/model/Features/DataLoggingExample.room create mode 100644 plugins/org.eclipse.etrice.generator.gnuplot/.classpath create mode 100644 plugins/org.eclipse.etrice.generator.gnuplot/.gitignore create mode 100644 plugins/org.eclipse.etrice.generator.gnuplot/.project create mode 100644 plugins/org.eclipse.etrice.generator.gnuplot/.settings/org.eclipse.core.resources.prefs create mode 100644 plugins/org.eclipse.etrice.generator.gnuplot/.settings/org.eclipse.jdt.core.prefs create mode 100644 plugins/org.eclipse.etrice.generator.gnuplot/META-INF/MANIFEST.MF create mode 100644 plugins/org.eclipse.etrice.generator.gnuplot/build.properties create mode 100644 plugins/org.eclipse.etrice.generator.gnuplot/src/org/eclipse/etrice/generator/gnuplot/GnuplotScriptGenerator.xtend create mode 100644 plugins/org.eclipse.etrice.generator.gnuplot/xtend-gen/org/eclipse/etrice/generator/gnuplot/GnuplotScriptGenerator.java delete mode 100644 plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/GlobalGeneratorSettings.java create mode 100644 plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/GlobalGeneratorSettings.xtend create mode 100644 plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/base/GlobalGeneratorSettings.java diff --git a/examples/org.eclipse.etrice.examples.c/model/Features/DataLoggingExample.room b/examples/org.eclipse.etrice.examples.c/model/Features/DataLoggingExample.room new file mode 100644 index 000000000..759f0f96c --- /dev/null +++ b/examples/org.eclipse.etrice.examples.c/model/Features/DataLoggingExample.room @@ -0,0 +1,166 @@ +/* + * Example of DataLogging Feature in conjunction with the Gnuplot Generator + * + * Prerequisite: gnuplot resides in PATH of environment (http://www.gnuplot.info/) + * Set physical thread interval = 20ms + */ +RoomModel DataLoggingExample { + + import room.basic.types.* from "../../../org.eclipse.etrice.modellib.c/model/Types.room" + import room.basic.service.timing.* from "../../../org.eclipse.etrice.modellib.c/model/TimingService.room" + import room.basic.annotations.* from "../../../org.eclipse.etrice.modellib.c/model/Annotations.room" + import room.basic.etunit.* from "../../../org.eclipse.etrice.modellib.c/model/Tests.room" + + LogicalSystem LogSys { + SubSystemRef subSystemRef : SubSysClass + } + + SubSystemClass SubSysClass { + @DataLogging(pathlist="/LogSys/subSystemRef/rootActor/serverInst/output,/LogSys/subSystemRef/rootActor/clientInst/output") + @Gnuplot(format="pngcairo", outputfile="main.data.png", width=1800, height=600, fontsize=10) + @GnuplotGraph( + paths="/LogSys/subSystemRef/rootActor/serverInst/output", + xtics=100, mxtics=4, ymin=-1.2, ymax=1.2 + ) + @GnuplotGraph( + paths="/LogSys/subSystemRef/rootActor/clientInst/output", + xtics=100, mxtics=4, ymin=0, ymax=7 + ) + + ActorRef rootActor: LoggerExampleTop + ActorRef timerService: ATimingService + LayerConnection ref rootActor satisfied_by timerService.timer + + LogicalThread defaultThread + } + + ActorClass LoggerExampleTop { + Structure { + ActorRef serverInst: Server + ActorRef clientInst: Client + SAP timer: PTimer + Binding clientInst.input and serverInst.output + Binding clientInst.output and serverInst.input + } + Behavior { + StateMachine { + Transition init: initial -> Running { + action { + "timer.startTimer(10*1000);" + } + } + Transition tr0: Running -> Done { + triggers { + + } + } + State Running + State Done { + entry { + "etSema_wakeup(etRuntime_getTerminateSemaphore());" + } + } + } + } + } + + datadriven ActorClass Server { + Interface { + Port input: SingleValueProtocol + conjugated Port output: SingleValueProtocol + } + Structure { + usercode3 { + "#include \"math.h\"" + "#include \"osal/etSema.h\"" + "#include \"runtime/etRuntime.h\"" + } + external Port output + external Port input + } + Behavior { + StateMachine { + Transition init: initial -> Working + State Working { + do { + "float32 i = input.data;" + "output.data(sinf(i));" + } + } + } + } + } + + datadriven ActorClass Client { + Interface { + Port input: SingleValueProtocol + conjugated Port output: SingleValueProtocol + } + Structure { + usercode3 { + "#include \"math.h\"" + } + external Port output + external Port input + Attribute workingData: float32 + Attribute maximum: float32 + Attribute cycles: int8 + Attribute maxCycles: int8 + Attribute scale: float32 + } + Behavior { + Operation incAndWrap(value:float32, inc:float32, max:float32) : float32 + { + "float32 result = value + inc;" + "if(result > max) result -= max;" + "return result;" + } + StateMachine { + Transition init: initial -> Up { + action { + "cycles = 0;" + "maxCycles = 16;" + "maximum = 2*M_PI;" + "workingData = 0.0F;" + "output.data(0.0F);" + } + } + Transition tr0: Up -> Down { + guard { + "input.data < 0" + } + } + Transition tr1: Down -> Up { + guard { + "input.data >= 0" + } + } + State Up { + entry { + "cycles++;" + "printf(\"cycles: %d \\n\", cycles);" + "//if(cycles >= maxCycles) etSema_wakeup(etRuntime_getTerminateSemaphore());" + } + + do { + "workingData = incAndWrap(workingData, 0.1, maximum);" + "output.data(workingData);" + } + } + State Down { + do { + "workingData = incAndWrap(workingData, 0.3, maximum);" + "output.data(workingData);" + } + } + } + } + } + + datadriven ProtocolClass SingleValueProtocol { + incoming { + Message data(value : float32) + } + } + +} \ No newline at end of file diff --git a/examples/org.eclipse.etrice.examples.c/model/Features/gen_features.launch b/examples/org.eclipse.etrice.examples.c/model/Features/gen_features.launch index 199d4872c..36c8f4bd0 100644 --- a/examples/org.eclipse.etrice.examples.c/model/Features/gen_features.launch +++ b/examples/org.eclipse.etrice.examples.c/model/Features/gen_features.launch @@ -1,6 +1,7 @@ + diff --git a/examples/org.eclipse.etrice.examples.c/model/TrafficLight_step1/gen_TrafficLight_step1.launch b/examples/org.eclipse.etrice.examples.c/model/TrafficLight_step1/gen_TrafficLight_step1.launch index 097e779bb..1b2ca1c71 100644 --- a/examples/org.eclipse.etrice.examples.c/model/TrafficLight_step1/gen_TrafficLight_step1.launch +++ b/examples/org.eclipse.etrice.examples.c/model/TrafficLight_step1/gen_TrafficLight_step1.launch @@ -1,6 +1,7 @@ + diff --git a/examples/org.eclipse.etrice.examples.c/model/TrafficLight_step2/gen_TrafficLight_step2.launch b/examples/org.eclipse.etrice.examples.c/model/TrafficLight_step2/gen_TrafficLight_step2.launch index 4106769c8..05c407b63 100644 --- a/examples/org.eclipse.etrice.examples.c/model/TrafficLight_step2/gen_TrafficLight_step2.launch +++ b/examples/org.eclipse.etrice.examples.c/model/TrafficLight_step2/gen_TrafficLight_step2.launch @@ -1,6 +1,7 @@ + diff --git a/examples/org.eclipse.etrice.examples.c/model/TrafficLight_step3/gen_TrafficLight_step3.launch b/examples/org.eclipse.etrice.examples.c/model/TrafficLight_step3/gen_TrafficLight_step3.launch index 6d30799d7..5d124d6d9 100644 --- a/examples/org.eclipse.etrice.examples.c/model/TrafficLight_step3/gen_TrafficLight_step3.launch +++ b/examples/org.eclipse.etrice.examples.c/model/TrafficLight_step3/gen_TrafficLight_step3.launch @@ -1,6 +1,7 @@ + diff --git a/examples/org.eclipse.etrice.examples.c/model/TrafficLight_step4/gen_TrafficLight_step4.launch b/examples/org.eclipse.etrice.examples.c/model/TrafficLight_step4/gen_TrafficLight_step4.launch index 8c28f4c3c..bee104e09 100644 --- a/examples/org.eclipse.etrice.examples.c/model/TrafficLight_step4/gen_TrafficLight_step4.launch +++ b/examples/org.eclipse.etrice.examples.c/model/TrafficLight_step4/gen_TrafficLight_step4.launch @@ -1,6 +1,7 @@ + diff --git a/examples/org.eclipse.etrice.template.c/generate_Template.launch b/examples/org.eclipse.etrice.template.c/generate_Template.launch index 035c12d35..8530db744 100644 --- a/examples/org.eclipse.etrice.template.c/generate_Template.launch +++ b/examples/org.eclipse.etrice.template.c/generate_Template.launch @@ -6,6 +6,7 @@ + diff --git a/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/generate_HelloWorldC.launch b/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/generate_HelloWorldC.launch index 05c644107..ebdecdb97 100644 --- a/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/generate_HelloWorldC.launch +++ b/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/generate_HelloWorldC.launch @@ -6,6 +6,7 @@ + diff --git a/examples/org.eclipse.etrice.tutorials.c/model/PingPong/generate_PingPongC.launch b/examples/org.eclipse.etrice.tutorials.c/model/PingPong/generate_PingPongC.launch index b8d30b234..0a1337a4a 100644 --- a/examples/org.eclipse.etrice.tutorials.c/model/PingPong/generate_PingPongC.launch +++ b/examples/org.eclipse.etrice.tutorials.c/model/PingPong/generate_PingPongC.launch @@ -6,6 +6,7 @@ + diff --git a/examples/org.eclipse.etrice.tutorials.java/model/HelloWorld/generate_HelloWorldJava.launch b/examples/org.eclipse.etrice.tutorials.java/model/HelloWorld/generate_HelloWorldJava.launch index 95b3a71cc..eaffe38f3 100644 --- a/examples/org.eclipse.etrice.tutorials.java/model/HelloWorld/generate_HelloWorldJava.launch +++ b/examples/org.eclipse.etrice.tutorials.java/model/HelloWorld/generate_HelloWorldJava.launch @@ -7,6 +7,7 @@ + diff --git a/examples/org.eclipse.etrice.tutorials.java/model/PingPong/generate_PingPongJava.launch b/examples/org.eclipse.etrice.tutorials.java/model/PingPong/generate_PingPongJava.launch index 4e962c525..64f3ae681 100644 --- a/examples/org.eclipse.etrice.tutorials.java/model/PingPong/generate_PingPongJava.launch +++ b/examples/org.eclipse.etrice.tutorials.java/model/PingPong/generate_PingPongJava.launch @@ -6,6 +6,7 @@ + diff --git a/features/org.eclipse.etrice.feature/build_local.xml b/features/org.eclipse.etrice.feature/build_local.xml index 4b319925a..6d1758762 100644 --- a/features/org.eclipse.etrice.feature/build_local.xml +++ b/features/org.eclipse.etrice.feature/build_local.xml @@ -1,4 +1,8 @@ + diff --git a/features/org.eclipse.etrice.feature/feature.xml b/features/org.eclipse.etrice.feature/feature.xml index a14c7f177..2d0e579fd 100644 --- a/features/org.eclipse.etrice.feature/feature.xml +++ b/features/org.eclipse.etrice.feature/feature.xml @@ -410,4 +410,11 @@ http://www.eclipse.org/legal/epl-v10.html version="0.0.0" unpack="false"/> + + diff --git a/plugins/org.eclipse.etrice.core.room.ui/templates/readme.txt b/plugins/org.eclipse.etrice.core.room.ui/templates/readme.txt index c2aadb5b2..32395d9ba 100644 --- a/plugins/org.eclipse.etrice.core.room.ui/templates/readme.txt +++ b/plugins/org.eclipse.etrice.core.room.ui/templates/readme.txt @@ -1,4 +1,4 @@ -http://www.eclipse.org/Xtext/documentation/latest/xtext.html#templates +https://eclipse.org/Xtext/documentation/304_ide_concepts.html#templates However, these templates will not be visible by default. To fix it, you have to manually edit the xml-file and insert an ID attribute for each template element. diff --git a/plugins/org.eclipse.etrice.core.room.ui/templates/templates.xml b/plugins/org.eclipse.etrice.core.room.ui/templates/templates.xml index 5eb87cd88..7812a7309 100644 --- a/plugins/org.eclipse.etrice.core.room.ui/templates/templates.xml +++ b/plugins/org.eclipse.etrice.core.room.ui/templates/templates.xml @@ -73,7 +73,7 @@ ${cursor} } ${cursor} - } ${cursor} - ${cursor} id="primitiveType" name="PrimitiveType">PrimitiveType ${name} -> ${typeName} (${typeCastName}) default "${defaultValueLiteral}" ${cursor} - \ No newline at end of file + + + diff --git a/plugins/org.eclipse.etrice.generator.c/META-INF/MANIFEST.MF b/plugins/org.eclipse.etrice.generator.c/META-INF/MANIFEST.MF index a34f65ef0..d41a9785d 100644 --- a/plugins/org.eclipse.etrice.generator.c/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.etrice.generator.c/META-INF/MANIFEST.MF @@ -19,7 +19,8 @@ Require-Bundle: org.eclipse.etrice.core.room.ui;bundle-version="0.5.0", org.eclipse.ui.ide;bundle-version="3.7.0", org.eclipse.xtend.lib;bundle-version="2.6.0", org.eclipse.xtext.generator;bundle-version="2.6.0", - org.eclipse.xtext.util;bundle-version="2.6.0" + org.eclipse.xtext.util;bundle-version="2.6.0", + org.eclipse.etrice.generator.gnuplot Import-Package: org.apache.log4j Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Export-Package: org.eclipse.etrice.generator.c diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/Main.java b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/Main.java index adebaf834..1a023e51c 100644 --- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/Main.java +++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/Main.java @@ -86,6 +86,9 @@ public class Main extends AbstractGenerator { @Inject protected org.eclipse.etrice.generator.doc.gen.MainGen mainDocGenerator; + @Inject + protected org.eclipse.etrice.generator.gnuplot.GnuplotScriptGenerator gnuPlotGenerator; + @Inject private Validator validator; @@ -175,6 +178,10 @@ public class Main extends AbstractGenerator { mainDocGenerator.doGenerate(genModel.eResource()); } + if(getSettings().isGenerateDataInstrumentation()){ + gnuPlotGenerator.doGenerate(genModel); + } + if (diagnostician.isFailed()) { logger.logInfo("errors during code generation"); logger.logError("-- terminating", null); diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeGen.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeGen.xtend index cda386cd2..34c27b984 100644 --- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeGen.xtend +++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeGen.xtend @@ -139,7 +139,7 @@ class NodeGen { val ssc = ssi.subSystemClass val clsname = nr.name+"_"+ssi.name val threads = nr.type.threads.filter(t|usedThreads.contains(t)) - val logData = ssc.annotations.isAnnotationPresent("DataLogging") + val logData = Main::settings.generateDataInstrumentation && ssc.annotations.isAnnotationPresent("DataLogging") ''' /** * @author generated by eTrice @@ -651,8 +651,8 @@ class NodeGen { def private generateDispatcherFile(Root root, SubSystemInstance ssi, Collection usedThreads) { val nr = ETMapUtil::getNodeRef(ssi) - val loggedPorts = ssi.loggedPorts - val logData = ssi.subSystemClass.annotations.isAnnotationPresent("DataLogging") + val logData = Main::settings.generateDataInstrumentation && ssi.subSystemClass.annotations.isAnnotationPresent("DataLogging") + val loggedPorts = if(logData) ssi.loggedPorts else newArrayList ''' /** diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeRunnerGen.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeRunnerGen.xtend index 136f93166..53ac1a14e 100644 --- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeRunnerGen.xtend +++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeRunnerGen.xtend @@ -21,6 +21,7 @@ import org.eclipse.xtext.generator.JavaIoFileSystemAccess import org.eclipse.etrice.generator.generic.RoomExtensions import org.eclipse.etrice.core.etmap.util.ETMapUtil import org.eclipse.etrice.core.common.base.util.BaseHelpers +import org.eclipse.etrice.generator.c.Main @Singleton class NodeRunnerGen { @@ -48,7 +49,7 @@ class NodeRunnerGen { def generateSourceFile(Root root, SubSystemInstance ssi, boolean first) { val nr = ETMapUtil::getNodeRef(ssi) val clsname = nr.name+"_"+ssi.name - val logData = ssi.subSystemClass.annotations.isAnnotationPresent("DataLogging") + val logData = Main.getSettings.isGenerateDataInstrumentation && ssi.subSystemClass.annotations.isAnnotationPresent("DataLogging") ''' /** * @author generated by eTrice 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 8292eb5c8..8d9e857dc 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,8 +209,8 @@ public class ActorClassGen extends GenericActorClassGenerator { _or = true; } else { GlobalGeneratorSettings _settings = Main.getSettings(); - boolean _generateMSCInstrumentation = _settings.generateMSCInstrumentation(); - _or = _generateMSCInstrumentation; + boolean _isGenerateMSCInstrumentation = _settings.isGenerateMSCInstrumentation(); + _or = _isGenerateMSCInstrumentation; } final boolean hasConstData = _or; boolean _and_3 = false; @@ -319,8 +319,8 @@ public class ActorClassGen extends GenericActorClassGenerator { _builder.newLineIfNotEmpty(); { GlobalGeneratorSettings _settings_1 = Main.getSettings(); - boolean _generateMSCInstrumentation_1 = _settings_1.generateMSCInstrumentation(); - if (_generateMSCInstrumentation_1) { + boolean _isGenerateMSCInstrumentation_1 = _settings_1.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation_1) { _builder.append("\t"); _builder.append("const char* instName;"); _builder.newLine(); diff --git a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/NodeGen.java b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/NodeGen.java index 9d92297df..0ba79145c 100644 --- a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/NodeGen.java +++ b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/NodeGen.java @@ -279,8 +279,17 @@ public class NodeGen { } }; final Iterable threads = IterableExtensions.filter(_threads, _function); - EList _annotations = ssc.getAnnotations(); - final boolean logData = this._roomHelpers.isAnnotationPresent(_annotations, "DataLogging"); + boolean _and = false; + GlobalGeneratorSettings _settings = Main.getSettings(); + boolean _isGenerateDataInstrumentation = _settings.isGenerateDataInstrumentation(); + if (!_isGenerateDataInstrumentation) { + _and = false; + } else { + EList _annotations = ssc.getAnnotations(); + boolean _isAnnotationPresent = this._roomHelpers.isAnnotationPresent(_annotations, "DataLogging"); + _and = _isAnnotationPresent; + } + final boolean logData = _and; StringConcatenation _builder = new StringConcatenation(); _builder.append("/**"); _builder.newLine(); @@ -1225,8 +1234,8 @@ public class NodeGen { { boolean _and = false; GlobalGeneratorSettings _settings = Main.getSettings(); - boolean _generateMSCInstrumentation = _settings.generateMSCInstrumentation(); - boolean _not = (!_generateMSCInstrumentation); + boolean _isGenerateMSCInstrumentation = _settings.isGenerateMSCInstrumentation(); + boolean _not = (!_isGenerateMSCInstrumentation); if (!_not) { _and = false; } else { @@ -1397,15 +1406,15 @@ public class NodeGen { _or = true; } else { GlobalGeneratorSettings _settings = Main.getSettings(); - boolean _generateMSCInstrumentation = _settings.generateMSCInstrumentation(); - _or = _generateMSCInstrumentation; + boolean _isGenerateMSCInstrumentation = _settings.isGenerateMSCInstrumentation(); + _or = _isGenerateMSCInstrumentation; } final boolean haveConstData = _or; final IntelligentSeparator sep = new IntelligentSeparator(","); String _xifexpression_1 = null; GlobalGeneratorSettings _settings_1 = Main.getSettings(); - boolean _generateMSCInstrumentation_1 = _settings_1.generateMSCInstrumentation(); - if (_generateMSCInstrumentation_1) { + boolean _isGenerateMSCInstrumentation_1 = _settings_1.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation_1) { _xifexpression_1 = "/*const*/"; } else { _xifexpression_1 = "const"; @@ -1414,8 +1423,8 @@ public class NodeGen { StringConcatenation _builder = new StringConcatenation(); { GlobalGeneratorSettings _settings_2 = Main.getSettings(); - boolean _generateMSCInstrumentation_2 = _settings_2.generateMSCInstrumentation(); - if (_generateMSCInstrumentation_2) { + boolean _isGenerateMSCInstrumentation_2 = _settings_2.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation_2) { CharSequence _genPeerPortArrays = this.genPeerPortArrays(root, ai); _builder.append(_genPeerPortArrays, ""); _builder.newLineIfNotEmpty(); @@ -1472,8 +1481,8 @@ public class NodeGen { _builder.newLineIfNotEmpty(); { GlobalGeneratorSettings _settings_3 = Main.getSettings(); - boolean _generateMSCInstrumentation_3 = _settings_3.generateMSCInstrumentation(); - if (_generateMSCInstrumentation_3) { + boolean _isGenerateMSCInstrumentation_3 = _settings_3.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation_3) { _builder.append("\t"); _builder.append(sep, "\t"); _builder.append("\""); @@ -1791,8 +1800,8 @@ public class NodeGen { String myInst = ""; String peerInst = ""; GlobalGeneratorSettings _settings = Main.getSettings(); - boolean _generateMSCInstrumentation = _settings.generateMSCInstrumentation(); - if (_generateMSCInstrumentation) { + boolean _isGenerateMSCInstrumentation = _settings.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation) { EObject _eContainer_1 = pi.eContainer(); String _path = ((ActorInstance) _eContainer_1).getPath(); String _plus = ("\n#ifdef ET_ASYNC_MSC_LOGGER_ACTIVATE\n,\"" + _path); @@ -1870,8 +1879,8 @@ public class NodeGen { final Iterable boolMsgs = IterableExtensions.filter(messages, _function_2); boolean _and = false; GlobalGeneratorSettings _settings = Main.getSettings(); - boolean _generateMSCInstrumentation = _settings.generateMSCInstrumentation(); - if (!_generateMSCInstrumentation) { + boolean _isGenerateMSCInstrumentation = _settings.isGenerateMSCInstrumentation(); + if (!_isGenerateMSCInstrumentation) { _and = false; } else { boolean _and_1 = false; @@ -1997,8 +2006,8 @@ public class NodeGen { final Iterable boolMsgs = IterableExtensions.filter(sentMsgs, _function_2); boolean _and = false; GlobalGeneratorSettings _settings = Main.getSettings(); - boolean _generateMSCInstrumentation = _settings.generateMSCInstrumentation(); - if (!_generateMSCInstrumentation) { + boolean _isGenerateMSCInstrumentation = _settings.isGenerateMSCInstrumentation(); + if (!_isGenerateMSCInstrumentation) { _and = false; } else { boolean _and_1 = false; @@ -2062,8 +2071,8 @@ public class NodeGen { String result = ""; String _xifexpression = null; GlobalGeneratorSettings _settings = Main.getSettings(); - boolean _generateMSCInstrumentation = _settings.generateMSCInstrumentation(); - if (_generateMSCInstrumentation) { + boolean _isGenerateMSCInstrumentation = _settings.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation) { EObject _eContainer = pi.eContainer(); String _path = ((ActorInstance) _eContainer).getPath(); String _plus = ("\n#ifdef ET_ASYNC_MSC_LOGGER_ACTIVATE\n,\"" + _path); @@ -2095,8 +2104,8 @@ public class NodeGen { String iiiD = this.getInterfaceItemInstanceData(pi); String _xifexpression_2 = null; GlobalGeneratorSettings _settings_1 = Main.getSettings(); - boolean _generateMSCInstrumentation_1 = _settings_1.generateMSCInstrumentation(); - if (_generateMSCInstrumentation_1) { + boolean _isGenerateMSCInstrumentation_1 = _settings_1.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation_1) { EObject _eContainer_2 = p.eContainer(); String _path_1 = ((ActorInstance) _eContainer_2).getPath(); String _plus_1 = (",\"" + _path_1); @@ -2144,10 +2153,25 @@ public class NodeGen { CharSequence _xblockexpression = null; { final NodeRef nr = ETMapUtil.getNodeRef(ssi); - final ArrayList loggedPorts = this.loggedPorts(ssi); - SubSystemClass _subSystemClass = ssi.getSubSystemClass(); - EList _annotations = _subSystemClass.getAnnotations(); - final boolean logData = this._roomHelpers.isAnnotationPresent(_annotations, "DataLogging"); + boolean _and = false; + GlobalGeneratorSettings _settings = Main.getSettings(); + boolean _isGenerateDataInstrumentation = _settings.isGenerateDataInstrumentation(); + if (!_isGenerateDataInstrumentation) { + _and = false; + } else { + SubSystemClass _subSystemClass = ssi.getSubSystemClass(); + EList _annotations = _subSystemClass.getAnnotations(); + boolean _isAnnotationPresent = this._roomHelpers.isAnnotationPresent(_annotations, "DataLogging"); + _and = _isAnnotationPresent; + } + final boolean logData = _and; + ArrayList _xifexpression = null; + if (logData) { + _xifexpression = this.loggedPorts(ssi); + } else { + _xifexpression = CollectionLiterals.newArrayList(); + } + final ArrayList loggedPorts = _xifexpression; StringConcatenation _builder = new StringConcatenation(); _builder.append("/**"); _builder.newLine(); @@ -2542,9 +2566,9 @@ public class NodeGen { _builder.newLine(); } else { { - GlobalGeneratorSettings _settings = Main.getSettings(); - boolean _generateMSCInstrumentation = _settings.generateMSCInstrumentation(); - if (_generateMSCInstrumentation) { + GlobalGeneratorSettings _settings_1 = Main.getSettings(); + boolean _isGenerateMSCInstrumentation = _settings_1.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation) { _builder.append("\t\t"); _builder.append("\t"); _builder.append("ET_MSC_LOGGER_ASYNC_IN("); @@ -2725,9 +2749,9 @@ public class NodeGen { _builder.newLine(); } else { { - GlobalGeneratorSettings _settings_1 = Main.getSettings(); - boolean _generateMSCInstrumentation_1 = _settings_1.generateMSCInstrumentation(); - if (_generateMSCInstrumentation_1) { + GlobalGeneratorSettings _settings_2 = Main.getSettings(); + boolean _isGenerateMSCInstrumentation_1 = _settings_2.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation_1) { _builder.append("\t\t"); _builder.append("\t"); _builder.append("ET_MSC_LOGGER_ASYNC_IN("); diff --git a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/NodeRunnerGen.java b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/NodeRunnerGen.java index 6fdd95b78..47fd4d7be 100644 --- a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/NodeRunnerGen.java +++ b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/NodeRunnerGen.java @@ -25,6 +25,8 @@ import org.eclipse.etrice.core.genmodel.etricegen.Root; import org.eclipse.etrice.core.genmodel.etricegen.StructureInstance; import org.eclipse.etrice.core.genmodel.etricegen.SubSystemInstance; import org.eclipse.etrice.core.room.SubSystemClass; +import org.eclipse.etrice.generator.base.GlobalGeneratorSettings; +import org.eclipse.etrice.generator.c.Main; import org.eclipse.etrice.generator.c.gen.CExtensions; import org.eclipse.etrice.generator.generic.RoomExtensions; import org.eclipse.xtend2.lib.StringConcatenation; @@ -88,9 +90,18 @@ public class NodeRunnerGen { String _plus = (_name + "_"); String _name_1 = ssi.getName(); final String clsname = (_plus + _name_1); - SubSystemClass _subSystemClass = ssi.getSubSystemClass(); - EList _annotations = _subSystemClass.getAnnotations(); - final boolean logData = this._baseHelpers.isAnnotationPresent(_annotations, "DataLogging"); + boolean _and = false; + GlobalGeneratorSettings _settings = Main.getSettings(); + boolean _isGenerateDataInstrumentation = _settings.isGenerateDataInstrumentation(); + if (!_isGenerateDataInstrumentation) { + _and = false; + } else { + SubSystemClass _subSystemClass = ssi.getSubSystemClass(); + EList _annotations = _subSystemClass.getAnnotations(); + boolean _isAnnotationPresent = this._baseHelpers.isAnnotationPresent(_annotations, "DataLogging"); + _and = _isAnnotationPresent; + } + final boolean logData = _and; StringConcatenation _builder = new StringConcatenation(); _builder.append("/**"); _builder.newLine(); diff --git a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.java b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.java index a4179c5b2..b138e26bb 100644 --- a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.java +++ b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.java @@ -202,8 +202,8 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator { _builder.newLine(); { GlobalGeneratorSettings _settings = Main.getSettings(); - boolean _generateMSCInstrumentation = _settings.generateMSCInstrumentation(); - if (_generateMSCInstrumentation) { + boolean _isGenerateMSCInstrumentation = _settings.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation) { _builder.append("/*--------------------- debug helpers */"); _builder.newLine(); _builder.newLine(); @@ -440,8 +440,8 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator { _builder.newLine(); { GlobalGeneratorSettings _settings = Main.getSettings(); - boolean _generateMSCInstrumentation = _settings.generateMSCInstrumentation(); - if (_generateMSCInstrumentation) { + boolean _isGenerateMSCInstrumentation = _settings.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation) { _builder.append("/*--------------------- debug helpers */"); _builder.newLine(); CharSequence _generateDebugHelpersImplementation = this.generateDebugHelpersImplementation(root, pc); @@ -687,8 +687,8 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator { final Iterable boolMsgs = IterableExtensions.filter(sentMsgs, _function_2); boolean _and = false; GlobalGeneratorSettings _settings = Main.getSettings(); - boolean _generateMSCInstrumentation = _settings.generateMSCInstrumentation(); - if (!_generateMSCInstrumentation) { + boolean _isGenerateMSCInstrumentation = _settings.isGenerateMSCInstrumentation(); + if (!_isGenerateMSCInstrumentation) { _and = false; } else { boolean _and_1 = false; @@ -960,8 +960,8 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator { final Iterable boolMsgs = IterableExtensions.filter(messages, _function_2); boolean _and = false; GlobalGeneratorSettings _settings = Main.getSettings(); - boolean _generateMSCInstrumentation = _settings.generateMSCInstrumentation(); - if (!_generateMSCInstrumentation) { + boolean _isGenerateMSCInstrumentation = _settings.isGenerateMSCInstrumentation(); + if (!_isGenerateMSCInstrumentation) { _and = false; } else { boolean _and_1 = false; @@ -1313,8 +1313,8 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator { _builder.newLineIfNotEmpty(); { GlobalGeneratorSettings _settings = Main.getSettings(); - boolean _generateMSCInstrumentation = _settings.generateMSCInstrumentation(); - if (_generateMSCInstrumentation) { + boolean _isGenerateMSCInstrumentation = _settings.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation) { _builder.append("\t"); _builder.append("\t"); _builder.append("ET_MSC_LOGGER_ASYNC_OUT(self->myInstName, \""); @@ -1385,8 +1385,8 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator { _builder.newLineIfNotEmpty(); { GlobalGeneratorSettings _settings_1 = Main.getSettings(); - boolean _generateMSCInstrumentation_1 = _settings_1.generateMSCInstrumentation(); - if (_generateMSCInstrumentation_1) { + boolean _isGenerateMSCInstrumentation_1 = _settings_1.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation_1) { _builder.append("\t"); _builder.append("\t"); _builder.append("ET_MSC_LOGGER_ASYNC_OUT(((etReplPort*)self)->ports[i].port.myInstName, \""); @@ -1447,8 +1447,8 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator { _builder.newLineIfNotEmpty(); { GlobalGeneratorSettings _settings_2 = Main.getSettings(); - boolean _generateMSCInstrumentation_2 = _settings_2.generateMSCInstrumentation(); - if (_generateMSCInstrumentation_2) { + boolean _isGenerateMSCInstrumentation_2 = _settings_2.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation_2) { _builder.append("\t"); _builder.append("\t"); _builder.append("ET_MSC_LOGGER_ASYNC_OUT(((etReplPort*)self)->ports[idx__et].port.myInstName, \""); diff --git a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/StateMachineGen.java b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/StateMachineGen.java index b718ffd4e..bb1ee4fef 100644 --- a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/StateMachineGen.java +++ b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/StateMachineGen.java @@ -124,8 +124,8 @@ public class StateMachineGen extends GenericStateMachineGenerator { StringConcatenation _builder = new StringConcatenation(); { GlobalGeneratorSettings _settings = Main.getSettings(); - boolean _generateMSCInstrumentation = _settings.generateMSCInstrumentation(); - if (_generateMSCInstrumentation) { + boolean _isGenerateMSCInstrumentation = _settings.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation) { _builder.append("/* state names */"); _builder.newLine(); _builder.append("static char* stateStrings[] = {\"\",\"\","); @@ -164,8 +164,8 @@ public class StateMachineGen extends GenericStateMachineGenerator { _builder.newLine(); { GlobalGeneratorSettings _settings_1 = Main.getSettings(); - boolean _generateMSCInstrumentation_1 = _settings_1.generateMSCInstrumentation(); - if (_generateMSCInstrumentation_1) { + boolean _isGenerateMSCInstrumentation_1 = _settings_1.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation_1) { _builder.append("\t"); _builder.append("ET_MSC_LOGGER_CHANGE_STATE(self->constData->instName, stateStrings[new_state])"); _builder.newLine(); diff --git a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ActorClassGen.xtend b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ActorClassGen.xtend index 6927bb434..89823b7fe 100644 --- a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ActorClassGen.xtend +++ b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ActorClassGen.xtend @@ -16,11 +16,10 @@ import com.google.inject.Inject import com.google.inject.Singleton import java.util.ArrayList import org.eclipse.etrice.core.fsm.fSM.ComponentCommunicationType -import org.eclipse.etrice.core.genmodel.fsm.base.ILogger import org.eclipse.etrice.core.genmodel.etricegen.ExpandedActorClass import org.eclipse.etrice.core.genmodel.etricegen.Root +import org.eclipse.etrice.core.genmodel.fsm.base.ILogger import org.eclipse.etrice.core.room.ActorClass -import org.eclipse.etrice.generator.base.AbstractGenerator import org.eclipse.etrice.generator.cpp.Main import org.eclipse.etrice.generator.generic.GenericActorClassGenerator import org.eclipse.etrice.generator.generic.ProcedureHelpers diff --git a/plugins/org.eclipse.etrice.generator.gnuplot/.classpath b/plugins/org.eclipse.etrice.generator.gnuplot/.classpath new file mode 100644 index 000000000..5cef82c24 --- /dev/null +++ b/plugins/org.eclipse.etrice.generator.gnuplot/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/plugins/org.eclipse.etrice.generator.gnuplot/.gitignore b/plugins/org.eclipse.etrice.generator.gnuplot/.gitignore new file mode 100644 index 000000000..65847a73f --- /dev/null +++ b/plugins/org.eclipse.etrice.generator.gnuplot/.gitignore @@ -0,0 +1,2 @@ +bin +*._trace diff --git a/plugins/org.eclipse.etrice.generator.gnuplot/.project b/plugins/org.eclipse.etrice.generator.gnuplot/.project new file mode 100644 index 000000000..69d0f9b43 --- /dev/null +++ b/plugins/org.eclipse.etrice.generator.gnuplot/.project @@ -0,0 +1,34 @@ + + + org.eclipse.etrice.generator.gnuplot + + + + + + org.eclipse.xtext.ui.shared.xtextBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + org.eclipse.xtext.ui.shared.xtextNature + + diff --git a/plugins/org.eclipse.etrice.generator.gnuplot/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.etrice.generator.gnuplot/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..7a7ab3463 --- /dev/null +++ b/plugins/org.eclipse.etrice.generator.gnuplot/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding//src/org/eclipse/etrice/generator/gnuplot/GnuplotScriptGenerator.xtend=UTF-8 diff --git a/plugins/org.eclipse.etrice.generator.gnuplot/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.etrice.generator.gnuplot/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..c537b6306 --- /dev/null +++ b/plugins/org.eclipse.etrice.generator.gnuplot/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/plugins/org.eclipse.etrice.generator.gnuplot/META-INF/MANIFEST.MF b/plugins/org.eclipse.etrice.generator.gnuplot/META-INF/MANIFEST.MF new file mode 100644 index 000000000..c6b605017 --- /dev/null +++ b/plugins/org.eclipse.etrice.generator.gnuplot/META-INF/MANIFEST.MF @@ -0,0 +1,22 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Gnuplot generator +Bundle-SymbolicName: org.eclipse.etrice.generator.gnuplot +Bundle-Version: 1.0.0.qualifier +Export-Package: org.eclipse.etrice.generator.gnuplot +Require-Bundle: org.eclipse.xtext;bundle-version="2.6.0", + org.eclipse.xtend.lib;bundle-version="2.6.0", + org.eclipse.etrice.generator;bundle-version="0.5.0", + org.eclipse.etrice.generator.fsm;bundle-version="0.5.0", + org.eclipse.etrice.core.room;bundle-version="0.5.0", + org.eclipse.etrice.core.genmodel;bundle-version="0.5.0", + org.eclipse.etrice.core.etphys;bundle-version="0.5.0", + org.eclipse.etrice.generator.config;bundle-version="0.5.0", + org.eclipse.etrice.generator.java;bundle-version="0.5.0", + org.eclipse.etrice.core.config;bundle-version="0.5.0", + org.eclipse.etrice.core.etmap;bundle-version="0.5.0", + org.eclipse.core.runtime;bundle-version="3.10.0", + org.eclipse.etrice.generator.doc;bundle-version="0.5.0", + org.eclipse.etrice.abstractexec.behavior;bundle-version="0.5.0" +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Bundle-ActivationPolicy: lazy diff --git a/plugins/org.eclipse.etrice.generator.gnuplot/build.properties b/plugins/org.eclipse.etrice.generator.gnuplot/build.properties new file mode 100644 index 000000000..c3d5e96b2 --- /dev/null +++ b/plugins/org.eclipse.etrice.generator.gnuplot/build.properties @@ -0,0 +1,5 @@ +source.. = src/,\ + xtend-gen/ +bin.includes = META-INF/,\ + . + diff --git a/plugins/org.eclipse.etrice.generator.gnuplot/src/org/eclipse/etrice/generator/gnuplot/GnuplotScriptGenerator.xtend b/plugins/org.eclipse.etrice.generator.gnuplot/src/org/eclipse/etrice/generator/gnuplot/GnuplotScriptGenerator.xtend new file mode 100644 index 000000000..d6cfafe09 --- /dev/null +++ b/plugins/org.eclipse.etrice.generator.gnuplot/src/org/eclipse/etrice/generator/gnuplot/GnuplotScriptGenerator.xtend @@ -0,0 +1,170 @@ +/******************************************************************************* + * Copyright (c) 2011 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: + * Eyrak Pean (initial contribution) + * Juergen Haug + * + *******************************************************************************/ + +package org.eclipse.etrice.generator.gnuplot + +import com.google.inject.Inject +import org.eclipse.etrice.core.common.base.Annotation +import org.eclipse.etrice.core.common.base.IntLiteral +import org.eclipse.etrice.core.common.base.KeyValue +import org.eclipse.etrice.core.common.base.RealLiteral +import org.eclipse.etrice.core.common.base.StringLiteral +import org.eclipse.etrice.core.genmodel.etricegen.Root +import org.eclipse.etrice.core.genmodel.etricegen.SubSystemInstance +import org.eclipse.etrice.generator.fsm.base.IGeneratorFileIo +import org.eclipse.etrice.generator.generic.RoomExtensions + +class GnuplotScriptGenerator { + @Inject + IGeneratorFileIo fileIo + + @Inject + extension RoomExtensions roomExtensions + + def doGenerate(Root root) { + if (root.subSystemInstances.empty) + return; + + // TODO: warning more than one ssi + val ssi = root.subSystemInstances.head + val path = ssi.subSystemClass.getGenerationTargetPath + val infoPath = ssi.subSystemClass.generationInfoPath + try { + fileIo.generateFile("Generating gnuplot script for subsystem " + ssi.name, path, infoPath, + "/gnuplot/log_main.data.csv-Script.plt", ssi.generatePlotScript) + fileIo.generateFile("Generating gnuplot launch configuration", path, infoPath, + "/gnuplot/create_gnuplot.launch", gnuPlotLaunchFile) + } catch (Exception e) { + //e.printStackTrace + } + + } + + def protected gnuPlotLaunchFile() ''' + + + + + + + + + ''' + + def protected getAttribute(Annotation anno, String name) { + anno.attributes.findFirst[attr|attr.key == name] + } + + def protected asString(KeyValue kv) { + if (kv.value instanceof StringLiteral) + (kv.value as StringLiteral).value + else + null + } + + def protected asReal(KeyValue kv) { + if (kv.value instanceof RealLiteral) + (kv.value as RealLiteral).value + else if (kv.value instanceof IntLiteral) + (kv.value as IntLiteral).value as double + else + null + } + + def protected asInteger(KeyValue kv) { + if (kv.value instanceof IntLiteral) + (kv.value as IntLiteral).value + else + null + } + + def protected generatePlotScript(SubSystemInstance ssi) { + + // TODO: warn if more than one GnuPlot annotation + val plotAnnotation = ssi.subSystemClass.annotations.filter [ a | + a.type.name == "Gnuplot" + ].head + + val defaultFontsize = 10 + + // TODO: error checking + val format = plotAnnotation?.getAttribute("format")?.asString + val outputfile = plotAnnotation?.getAttribute("outputfile")?.asString + val width = plotAnnotation?.getAttribute("width")?.asInteger + val height = plotAnnotation?.getAttribute("height")?.asInteger + val fontsize = plotAnnotation?.getAttribute("fontsize")?.asInteger ?: defaultFontsize + + val graphAnnotations = ssi.subSystemClass.annotations.filter [ a | + a.type.name == "GnuplotGraph" + ].toList + + ''' + #!/gnuplot + + # Color Brewer set1 5-set + set linetype 1 lc rgb '#e41a1c' lw 1 + set linetype 2 lc rgb '#377eb8' lw 1 + set linetype 3 lc rgb '#4daf4a' lw 1 + set linetype 4 lc rgb '#984ea3' lw 1 + set linetype 5 lc rgb '#ff7f00' lw 1 + set linetype cycle 5 + + cd 'log' + set datafile separator comma + set terminal «format» size «width»,«height» font ",«fontsize»" background "white" + set output '«outputfile»' + set size 1,1 + set multiplot layout «graphAnnotations.size»,1 + set grid + show grid + set format y "% 5.3f" + «var i = 0» + «FOR a : graphAnnotations» + + «ssi.generateGraph(a, i++, graphAnnotations.size)» + «ENDFOR» + + unset multiplot + unset output + + ''' + } + + def protected generateGraph(SubSystemInstance ssi, Annotation graph, int index, int total) { + + // TODO: handle multiple paths in the same graph + val paths = graph.getAttribute("paths")?.asString + + // TODO: take interval from physical thread associated with actor instance instead of annotation attribute + val interval = graph.getAttribute("interval")?.asInteger ?: 20 + val xtics = graph.getAttribute("xtics")?.asReal ?: 100 + val mxtics = graph.getAttribute("mxtics")?.asInteger ?: 4 + val ymin = graph.getAttribute("ymin")?.asReal + val ymax = graph.getAttribute("ymax")?.asReal + + val vertOrigin = ((total - (index + 1)) as double) / total + val vertSize = 1.0F / total + + ''' + set yrange [«ymin ?: "*"» : «ymax ?: "*"»] + set xtics rotate «xtics» + set mxtics «mxtics» + set ylabel + set xlabel "time (ms)" + timeInMs(x) = «interval» * x + set origin 0,«vertOrigin» + set size 1,«vertSize» + plot 'main.data.csv' using (timeInMs(column(1))):(column("«paths»")) with lines + ''' + } +} diff --git a/plugins/org.eclipse.etrice.generator.gnuplot/xtend-gen/org/eclipse/etrice/generator/gnuplot/GnuplotScriptGenerator.java b/plugins/org.eclipse.etrice.generator.gnuplot/xtend-gen/org/eclipse/etrice/generator/gnuplot/GnuplotScriptGenerator.java new file mode 100644 index 000000000..c0e4cf035 --- /dev/null +++ b/plugins/org.eclipse.etrice.generator.gnuplot/xtend-gen/org/eclipse/etrice/generator/gnuplot/GnuplotScriptGenerator.java @@ -0,0 +1,407 @@ +/** + * Copyright (c) 2011 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: + * Eyrak Pean (initial contribution) + * Juergen Haug + */ +package org.eclipse.etrice.generator.gnuplot; + +import com.google.common.base.Objects; +import com.google.inject.Inject; +import java.util.List; +import org.eclipse.emf.common.util.EList; +import org.eclipse.etrice.core.common.base.Annotation; +import org.eclipse.etrice.core.common.base.AnnotationType; +import org.eclipse.etrice.core.common.base.IntLiteral; +import org.eclipse.etrice.core.common.base.KeyValue; +import org.eclipse.etrice.core.common.base.Literal; +import org.eclipse.etrice.core.common.base.RealLiteral; +import org.eclipse.etrice.core.common.base.StringLiteral; +import org.eclipse.etrice.core.genmodel.etricegen.Root; +import org.eclipse.etrice.core.genmodel.etricegen.SubSystemInstance; +import org.eclipse.etrice.core.room.SubSystemClass; +import org.eclipse.etrice.generator.fsm.base.IGeneratorFileIo; +import org.eclipse.etrice.generator.generic.RoomExtensions; +import org.eclipse.xtend2.lib.StringConcatenation; +import org.eclipse.xtext.xbase.lib.Exceptions; +import org.eclipse.xtext.xbase.lib.Extension; +import org.eclipse.xtext.xbase.lib.Functions.Function1; +import org.eclipse.xtext.xbase.lib.IterableExtensions; + +@SuppressWarnings("all") +public class GnuplotScriptGenerator { + @Inject + private IGeneratorFileIo fileIo; + + @Inject + @Extension + private RoomExtensions roomExtensions; + + public void doGenerate(final Root root) { + EList _subSystemInstances = root.getSubSystemInstances(); + boolean _isEmpty = _subSystemInstances.isEmpty(); + if (_isEmpty) { + return; + } + EList _subSystemInstances_1 = root.getSubSystemInstances(); + final SubSystemInstance ssi = IterableExtensions.head(_subSystemInstances_1); + SubSystemClass _subSystemClass = ssi.getSubSystemClass(); + final String path = this.roomExtensions.getGenerationTargetPath(_subSystemClass); + SubSystemClass _subSystemClass_1 = ssi.getSubSystemClass(); + final String infoPath = this.roomExtensions.getGenerationInfoPath(_subSystemClass_1); + try { + String _name = ssi.getName(); + String _plus = ("Generating gnuplot script for subsystem " + _name); + CharSequence _generatePlotScript = this.generatePlotScript(ssi); + this.fileIo.generateFile(_plus, path, infoPath, + "/gnuplot/log_main.data.csv-Script.plt", _generatePlotScript); + CharSequence _gnuPlotLaunchFile = this.gnuPlotLaunchFile(); + this.fileIo.generateFile("Generating gnuplot launch configuration", path, infoPath, + "/gnuplot/create_gnuplot.launch", _gnuPlotLaunchFile); + } catch (final Throwable _t) { + if (_t instanceof Exception) { + final Exception e = (Exception)_t; + } else { + throw Exceptions.sneakyThrow(_t); + } + } + } + + protected CharSequence gnuPlotLaunchFile() { + StringConcatenation _builder = new StringConcatenation(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.newLine(); + return _builder; + } + + protected KeyValue getAttribute(final Annotation anno, final String name) { + EList _attributes = anno.getAttributes(); + final Function1 _function = new Function1() { + public Boolean apply(final KeyValue attr) { + String _key = attr.getKey(); + return Boolean.valueOf(Objects.equal(_key, name)); + } + }; + return IterableExtensions.findFirst(_attributes, _function); + } + + protected String asString(final KeyValue kv) { + String _xifexpression = null; + Literal _value = kv.getValue(); + if ((_value instanceof StringLiteral)) { + Literal _value_1 = kv.getValue(); + _xifexpression = ((StringLiteral) _value_1).getValue(); + } else { + _xifexpression = null; + } + return _xifexpression; + } + + protected Double asReal(final KeyValue kv) { + Double _xifexpression = null; + Literal _value = kv.getValue(); + if ((_value instanceof RealLiteral)) { + Literal _value_1 = kv.getValue(); + _xifexpression = Double.valueOf(((RealLiteral) _value_1).getValue()); + } else { + Double _xifexpression_1 = null; + Literal _value_2 = kv.getValue(); + if ((_value_2 instanceof IntLiteral)) { + Literal _value_3 = kv.getValue(); + long _value_4 = ((IntLiteral) _value_3).getValue(); + _xifexpression_1 = Double.valueOf(((double) _value_4)); + } else { + _xifexpression_1 = null; + } + _xifexpression = _xifexpression_1; + } + return _xifexpression; + } + + protected Long asInteger(final KeyValue kv) { + Long _xifexpression = null; + Literal _value = kv.getValue(); + if ((_value instanceof IntLiteral)) { + Literal _value_1 = kv.getValue(); + _xifexpression = Long.valueOf(((IntLiteral) _value_1).getValue()); + } else { + _xifexpression = null; + } + return _xifexpression; + } + + protected CharSequence generatePlotScript(final SubSystemInstance ssi) { + CharSequence _xblockexpression = null; + { + SubSystemClass _subSystemClass = ssi.getSubSystemClass(); + EList _annotations = _subSystemClass.getAnnotations(); + final Function1 _function = new Function1() { + public Boolean apply(final Annotation a) { + AnnotationType _type = a.getType(); + String _name = _type.getName(); + return Boolean.valueOf(Objects.equal(_name, "Gnuplot")); + } + }; + Iterable _filter = IterableExtensions.filter(_annotations, _function); + final Annotation plotAnnotation = IterableExtensions.head(_filter); + final int defaultFontsize = 10; + KeyValue _attribute = null; + if (plotAnnotation!=null) { + _attribute=this.getAttribute(plotAnnotation, "format"); + } + String _asString = null; + if (_attribute!=null) { + _asString=this.asString(_attribute); + } + final String format = _asString; + KeyValue _attribute_1 = null; + if (plotAnnotation!=null) { + _attribute_1=this.getAttribute(plotAnnotation, "outputfile"); + } + String _asString_1 = null; + if (_attribute_1!=null) { + _asString_1=this.asString(_attribute_1); + } + final String outputfile = _asString_1; + KeyValue _attribute_2 = null; + if (plotAnnotation!=null) { + _attribute_2=this.getAttribute(plotAnnotation, "width"); + } + Long _asInteger = null; + if (_attribute_2!=null) { + _asInteger=this.asInteger(_attribute_2); + } + final Long width = _asInteger; + KeyValue _attribute_3 = null; + if (plotAnnotation!=null) { + _attribute_3=this.getAttribute(plotAnnotation, "height"); + } + Long _asInteger_1 = null; + if (_attribute_3!=null) { + _asInteger_1=this.asInteger(_attribute_3); + } + final Long height = _asInteger_1; + Number _elvis = null; + KeyValue _attribute_4 = null; + if (plotAnnotation!=null) { + _attribute_4=this.getAttribute(plotAnnotation, "fontsize"); + } + Long _asInteger_2 = null; + if (_attribute_4!=null) { + _asInteger_2=this.asInteger(_attribute_4); + } + if (_asInteger_2 != null) { + _elvis = _asInteger_2; + } else { + _elvis = Integer.valueOf(defaultFontsize); + } + final Number fontsize = ((Number)_elvis); + SubSystemClass _subSystemClass_1 = ssi.getSubSystemClass(); + EList _annotations_1 = _subSystemClass_1.getAnnotations(); + final Function1 _function_1 = new Function1() { + public Boolean apply(final Annotation a) { + AnnotationType _type = a.getType(); + String _name = _type.getName(); + return Boolean.valueOf(Objects.equal(_name, "GnuplotGraph")); + } + }; + Iterable _filter_1 = IterableExtensions.filter(_annotations_1, _function_1); + final List graphAnnotations = IterableExtensions.toList(_filter_1); + StringConcatenation _builder = new StringConcatenation(); + _builder.append("#!/gnuplot"); + _builder.newLine(); + _builder.newLine(); + _builder.append("# Color Brewer set1 5-set"); + _builder.newLine(); + _builder.append("set linetype 1 lc rgb \'#e41a1c\' lw 1"); + _builder.newLine(); + _builder.append("set linetype 2 lc rgb \'#377eb8\' lw 1"); + _builder.newLine(); + _builder.append("set linetype 3 lc rgb \'#4daf4a\' lw 1"); + _builder.newLine(); + _builder.append("set linetype 4 lc rgb \'#984ea3\' lw 1"); + _builder.newLine(); + _builder.append("set linetype 5 lc rgb \'#ff7f00\' lw 1"); + _builder.newLine(); + _builder.append("set linetype cycle 5"); + _builder.newLine(); + _builder.newLine(); + _builder.append("cd \'log\'"); + _builder.newLine(); + _builder.append("set datafile separator comma"); + _builder.newLine(); + _builder.append("set terminal "); + _builder.append(format, ""); + _builder.append(" size "); + _builder.append(width, ""); + _builder.append(","); + _builder.append(height, ""); + _builder.append(" font \","); + _builder.append(((Number)fontsize), ""); + _builder.append("\" background \"white\""); + _builder.newLineIfNotEmpty(); + _builder.append("set output \'"); + _builder.append(outputfile, ""); + _builder.append("\'"); + _builder.newLineIfNotEmpty(); + _builder.append("set size 1,1"); + _builder.newLine(); + _builder.append("set multiplot layout "); + int _size = graphAnnotations.size(); + _builder.append(_size, ""); + _builder.append(",1"); + _builder.newLineIfNotEmpty(); + _builder.append("set grid"); + _builder.newLine(); + _builder.append("show grid"); + _builder.newLine(); + _builder.append("set format y \"% 5.3f\""); + _builder.newLine(); + int i = 0; + _builder.newLineIfNotEmpty(); + { + for(final Annotation a : graphAnnotations) { + _builder.newLine(); + int _plusPlus = i++; + int _size_1 = graphAnnotations.size(); + CharSequence _generateGraph = this.generateGraph(ssi, a, _plusPlus, _size_1); + _builder.append(_generateGraph, ""); + _builder.newLineIfNotEmpty(); + } + } + _builder.newLine(); + _builder.append("unset multiplot"); + _builder.newLine(); + _builder.append("unset output"); + _builder.newLine(); + _builder.newLine(); + _xblockexpression = _builder; + } + return _xblockexpression; + } + + protected CharSequence generateGraph(final SubSystemInstance ssi, final Annotation graph, final int index, final int total) { + CharSequence _xblockexpression = null; + { + KeyValue _attribute = this.getAttribute(graph, "paths"); + String _asString = null; + if (_attribute!=null) { + _asString=this.asString(_attribute); + } + final String paths = _asString; + Number _elvis = null; + KeyValue _attribute_1 = this.getAttribute(graph, "interval"); + Long _asInteger = null; + if (_attribute_1!=null) { + _asInteger=this.asInteger(_attribute_1); + } + if (_asInteger != null) { + _elvis = _asInteger; + } else { + _elvis = Integer.valueOf(20); + } + final Number interval = ((Number)_elvis); + Number _elvis_1 = null; + KeyValue _attribute_2 = this.getAttribute(graph, "xtics"); + Double _asReal = null; + if (_attribute_2!=null) { + _asReal=this.asReal(_attribute_2); + } + if (_asReal != null) { + _elvis_1 = _asReal; + } else { + _elvis_1 = Integer.valueOf(100); + } + final Number xtics = ((Number)_elvis_1); + Number _elvis_2 = null; + KeyValue _attribute_3 = this.getAttribute(graph, "mxtics"); + Long _asInteger_1 = null; + if (_attribute_3!=null) { + _asInteger_1=this.asInteger(_attribute_3); + } + if (_asInteger_1 != null) { + _elvis_2 = _asInteger_1; + } else { + _elvis_2 = Integer.valueOf(4); + } + final Number mxtics = ((Number)_elvis_2); + KeyValue _attribute_4 = this.getAttribute(graph, "ymin"); + Double _asReal_1 = null; + if (_attribute_4!=null) { + _asReal_1=this.asReal(_attribute_4); + } + final Double ymin = _asReal_1; + KeyValue _attribute_5 = this.getAttribute(graph, "ymax"); + Double _asReal_2 = null; + if (_attribute_5!=null) { + _asReal_2=this.asReal(_attribute_5); + } + final Double ymax = _asReal_2; + final double vertOrigin = (((double) (total - (index + 1))) / total); + final float vertSize = (1.0F / total); + StringConcatenation _builder = new StringConcatenation(); + _builder.append("set yrange ["); + Object _elvis_3 = null; + if (ymin != null) { + _elvis_3 = ymin; + } else { + _elvis_3 = "*"; + } + _builder.append(((Object)_elvis_3), ""); + _builder.append(" : "); + Object _elvis_4 = null; + if (ymax != null) { + _elvis_4 = ymax; + } else { + _elvis_4 = "*"; + } + _builder.append(((Object)_elvis_4), ""); + _builder.append("]"); + _builder.newLineIfNotEmpty(); + _builder.append("set xtics rotate "); + _builder.append(((Number)xtics), ""); + _builder.newLineIfNotEmpty(); + _builder.append("set mxtics "); + _builder.append(((Number)mxtics), ""); + _builder.newLineIfNotEmpty(); + _builder.append("set ylabel"); + _builder.newLine(); + _builder.append("set xlabel \"time (ms)\""); + _builder.newLine(); + _builder.append("timeInMs(x) = "); + _builder.append(((Number)interval), ""); + _builder.append(" * x"); + _builder.newLineIfNotEmpty(); + _builder.append("set origin 0,"); + _builder.append(vertOrigin, ""); + _builder.newLineIfNotEmpty(); + _builder.append("set size 1,"); + _builder.append(vertSize, ""); + _builder.newLineIfNotEmpty(); + _builder.append("plot \'main.data.csv\' using (timeInMs(column(1))):(column(\""); + _builder.append(paths, ""); + _builder.append("\")) with lines"); + _builder.newLineIfNotEmpty(); + _xblockexpression = _builder; + } + return _xblockexpression; + } +} diff --git a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ActorClassGen.java b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ActorClassGen.java index 1a92addc9..4337138b5 100644 --- a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ActorClassGen.java +++ b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ActorClassGen.java @@ -656,8 +656,8 @@ public class ActorClassGen extends GenericActorClassGenerator { _builder.newLineIfNotEmpty(); { GlobalSettings _settings_4 = Main.getSettings(); - boolean _generateMSCInstrumentation = _settings_4.generateMSCInstrumentation(); - if (_generateMSCInstrumentation) { + boolean _isGenerateMSCInstrumentation = _settings_4.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation) { _builder.append("\t\t"); _builder.append("\t"); _builder.append("DebuggingService.getInstance().addMessageActorCreate(this, \""); @@ -686,8 +686,8 @@ public class ActorClassGen extends GenericActorClassGenerator { } else { { GlobalSettings _settings_5 = Main.getSettings(); - boolean _generateMSCInstrumentation_1 = _settings_5.generateMSCInstrumentation(); - if (_generateMSCInstrumentation_1) { + boolean _isGenerateMSCInstrumentation_1 = _settings_5.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation_1) { _builder.append("\t\t"); _builder.append("DebuggingService.getInstance().addMessageActorCreate(this, \""); String _name_26 = sub_2.getName(); @@ -930,8 +930,8 @@ public class ActorClassGen extends GenericActorClassGenerator { _builder.newLine(); { GlobalSettings _settings_6 = Main.getSettings(); - boolean _generateMSCInstrumentation_2 = _settings_6.generateMSCInstrumentation(); - if (_generateMSCInstrumentation_2) { + boolean _isGenerateMSCInstrumentation_2 = _settings_6.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation_2) { _builder.append("\t"); _builder.append("\t"); _builder.append("DebuggingService.getInstance().addMessageActorDestroy(this);"); 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 5947a9cda..b1c0871e0 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 @@ -229,8 +229,8 @@ public class NodeGen { _builder.newLine(); { GlobalSettings _settings = Main.getSettings(); - boolean _generateMSCInstrumentation = _settings.generateMSCInstrumentation(); - if (_generateMSCInstrumentation) { + boolean _isGenerateMSCInstrumentation = _settings.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation) { _builder.append("import org.eclipse.etrice.runtime.java.debugging.DebuggingService;"); _builder.newLine(); } @@ -453,8 +453,8 @@ public class NodeGen { _builder.newLineIfNotEmpty(); { GlobalSettings _settings_1 = Main.getSettings(); - boolean _generateMSCInstrumentation_1 = _settings_1.generateMSCInstrumentation(); - if (_generateMSCInstrumentation_1) { + boolean _isGenerateMSCInstrumentation_1 = _settings_1.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation_1) { _builder.append("\t\t"); _builder.append("\t"); _builder.append("DebuggingService.getInstance().addMessageActorCreate(this, \""); @@ -481,8 +481,8 @@ public class NodeGen { } else { { GlobalSettings _settings_2 = Main.getSettings(); - boolean _generateMSCInstrumentation_2 = _settings_2.generateMSCInstrumentation(); - if (_generateMSCInstrumentation_2) { + boolean _isGenerateMSCInstrumentation_2 = _settings_2.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation_2) { _builder.append("\t\t"); _builder.append("DebuggingService.getInstance().addMessageActorCreate(this, \""); String _name_8 = sub.getName(); @@ -660,8 +660,8 @@ public class NodeGen { _builder.newLine(); { GlobalSettings _settings_3 = Main.getSettings(); - boolean _generateMSCInstrumentation_3 = _settings_3.generateMSCInstrumentation(); - if (_generateMSCInstrumentation_3) { + boolean _isGenerateMSCInstrumentation_3 = _settings_3.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation_3) { _builder.append("\t\t"); _builder.append("DebuggingService.getInstance().addVisibleComment(\"begin sub system initialization\");"); _builder.newLine(); @@ -690,8 +690,8 @@ public class NodeGen { } { GlobalSettings _settings_4 = Main.getSettings(); - boolean _generateMSCInstrumentation_4 = _settings_4.generateMSCInstrumentation(); - if (_generateMSCInstrumentation_4) { + boolean _isGenerateMSCInstrumentation_4 = _settings_4.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation_4) { _builder.append("\t\t"); _builder.append("DebuggingService.getInstance().addVisibleComment(\"done sub system initialization\");"); _builder.newLine(); @@ -724,8 +724,8 @@ public class NodeGen { _builder.newLine(); { GlobalSettings _settings_5 = Main.getSettings(); - boolean _generateMSCInstrumentation_5 = _settings_5.generateMSCInstrumentation(); - if (_generateMSCInstrumentation_5) { + boolean _isGenerateMSCInstrumentation_5 = _settings_5.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation_5) { _builder.append("\t"); _builder.newLine(); _builder.append("\t"); diff --git a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/OptionalActorInterfaceGen.java b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/OptionalActorInterfaceGen.java index 59db7ab1e..6915c618b 100644 --- a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/OptionalActorInterfaceGen.java +++ b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/OptionalActorInterfaceGen.java @@ -93,8 +93,8 @@ public class OptionalActorInterfaceGen extends GenericActorClassGenerator { _builder.newLine(); { GlobalSettings _settings = Main.getSettings(); - boolean _generateMSCInstrumentation = _settings.generateMSCInstrumentation(); - if (_generateMSCInstrumentation) { + boolean _isGenerateMSCInstrumentation = _settings.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation) { _builder.append("import org.eclipse.etrice.runtime.java.debugging.DebuggingService;"); _builder.newLine(); } @@ -194,8 +194,8 @@ public class OptionalActorInterfaceGen extends GenericActorClassGenerator { _builder.newLine(); { GlobalSettings _settings_1 = Main.getSettings(); - boolean _generateMSCInstrumentation_1 = _settings_1.generateMSCInstrumentation(); - if (_generateMSCInstrumentation_1) { + boolean _isGenerateMSCInstrumentation_1 = _settings_1.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation_1) { _builder.append("\t"); _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 90f38fa4f..cf2893be6 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 @@ -153,8 +153,8 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator { _builder.newLine(); { GlobalSettings _settings = Main.getSettings(); - boolean _generateMSCInstrumentation = _settings.generateMSCInstrumentation(); - if (_generateMSCInstrumentation) { + boolean _isGenerateMSCInstrumentation = _settings.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation) { _builder.append("import org.eclipse.etrice.runtime.java.debugging.DebuggingService;"); _builder.newLine(); } @@ -319,8 +319,8 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator { } { GlobalSettings _settings = Main.getSettings(); - boolean _generateMSCInstrumentation = _settings.generateMSCInstrumentation(); - if (_generateMSCInstrumentation) { + boolean _isGenerateMSCInstrumentation = _settings.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation) { _builder.append("\t\t"); _builder.append("DebuggingService.getInstance().addPortInstance(this);"); _builder.newLine(); @@ -331,8 +331,8 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator { _builder.newLine(); { GlobalSettings _settings_1 = Main.getSettings(); - boolean _generateMSCInstrumentation_1 = _settings_1.generateMSCInstrumentation(); - if (_generateMSCInstrumentation_1) { + boolean _isGenerateMSCInstrumentation_1 = _settings_1.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation_1) { _builder.append("\t"); _builder.newLine(); _builder.append("\t"); @@ -372,8 +372,8 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator { _builder.newLine(); { GlobalSettings _settings_2 = Main.getSettings(); - boolean _generateMSCInstrumentation_2 = _settings_2.generateMSCInstrumentation(); - if (_generateMSCInstrumentation_2) { + boolean _isGenerateMSCInstrumentation_2 = _settings_2.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation_2) { _builder.append("\t\t\t"); _builder.append("DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);"); _builder.newLine(); @@ -743,8 +743,8 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator { } else { { GlobalSettings _settings = Main.getSettings(); - boolean _generateMSCInstrumentation = _settings.generateMSCInstrumentation(); - if (_generateMSCInstrumentation) { + boolean _isGenerateMSCInstrumentation = _settings.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation) { _builder.append("\t"); _builder.append("DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings["); _builder.append(dir, "\t"); 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 b0d8cfacc..28ca43689 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 @@ -45,13 +45,13 @@ public class StateMachineGen extends GenericStateMachineGenerator { { boolean _or = false; GlobalSettings _settings = Main.getSettings(); - boolean _generateMSCInstrumentation = _settings.generateMSCInstrumentation(); - if (_generateMSCInstrumentation) { + boolean _isGenerateMSCInstrumentation = _settings.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation) { _or = true; } else { GlobalSettings _settings_1 = Main.getSettings(); - boolean _generateWithVerboseOutput = _settings_1.generateWithVerboseOutput(); - _or = _generateWithVerboseOutput; + boolean _isGenerateWithVerboseOutput = _settings_1.isGenerateWithVerboseOutput(); + _or = _isGenerateWithVerboseOutput; } if (_or) { _builder.append("// state names"); @@ -101,8 +101,8 @@ public class StateMachineGen extends GenericStateMachineGenerator { _builder.newLine(); { GlobalSettings _settings_2 = Main.getSettings(); - boolean _generateMSCInstrumentation_1 = _settings_2.generateMSCInstrumentation(); - if (_generateMSCInstrumentation_1) { + boolean _isGenerateMSCInstrumentation_1 = _settings_2.isGenerateMSCInstrumentation(); + if (_isGenerateMSCInstrumentation_1) { _builder.append("\t"); _builder.append("DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);"); _builder.newLine(); @@ -110,8 +110,8 @@ public class StateMachineGen extends GenericStateMachineGenerator { } { GlobalSettings _settings_3 = Main.getSettings(); - boolean _generateWithVerboseOutput_1 = _settings_3.generateWithVerboseOutput(); - if (_generateWithVerboseOutput_1) { + boolean _isGenerateWithVerboseOutput_1 = _settings_3.isGenerateWithVerboseOutput(); + if (_isGenerateWithVerboseOutput_1) { _builder.append("\t"); _builder.append("if (stateStrings[new_state]!=\"Idle\") {"); _builder.newLine(); diff --git a/plugins/org.eclipse.etrice.generator.launch.java/src/org/eclipse/etrice/generator/launch/java/JavaGeneratorConfigTab.java b/plugins/org.eclipse.etrice.generator.launch.java/src/org/eclipse/etrice/generator/launch/java/JavaGeneratorConfigTab.java index 818fcb6e4..315211c0f 100644 --- a/plugins/org.eclipse.etrice.generator.launch.java/src/org/eclipse/etrice/generator/launch/java/JavaGeneratorConfigTab.java +++ b/plugins/org.eclipse.etrice.generator.launch.java/src/org/eclipse/etrice/generator/launch/java/JavaGeneratorConfigTab.java @@ -56,6 +56,8 @@ public class JavaGeneratorConfigTab extends GeneratorConfigTab { genDataObj = createCheckButton(mainComposite, "generate store to/from POJO data objects"); genDataObj.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false, 2, 1)); genDataObj.addSelectionListener(new UpdateConfig()); + + dataButton.setEnabled(false); } /* (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 b8336ff64..fe1d38b51 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 @@ -69,7 +69,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 MSC_INSTR = "MSC"; + public static final String DATA_INSTR = "DataLogging"; public static final String VERBOSE = "Verbose"; public static final String USE_TRAANSLATION = "UseTranslation"; public static final String OVERRIDE_DIRECTORIES = "OverrideDirectories"; @@ -90,6 +91,7 @@ public abstract class GeneratorConfigTab extends AbstractLaunchConfigurationTab private Text srcgenPath; private Text infoPath; private Text docPath; + protected Button dataButton; /* (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite) @@ -157,9 +159,13 @@ public abstract class GeneratorConfigTab extends AbstractLaunchConfigurationTab 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 = createCheckButton(mainComposite, "generate instrumentation for MSC logging"); mscButton.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false, 2, 1)); mscButton.addSelectionListener(new UpdateConfig()); + + dataButton = createCheckButton(mainComposite, "generate instrumentation for data logging"); + dataButton.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false, 2, 1)); + dataButton.addSelectionListener(new UpdateConfig()); verboseButton = createCheckButton(mainComposite, "generate instrumentation for verbose output"); verboseButton.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false, 2, 1)); @@ -302,6 +308,7 @@ public abstract class GeneratorConfigTab extends AbstractLaunchConfigurationTab @Override public void initializeFrom(ILaunchConfiguration configuration) { try { + // defaults: org.eclipse.etrice.generator.base.GlobalGeneratorSettings libButton.setSelection(configuration.getAttribute(LIB, false)); boolean save = configuration.getAttribute(SAVE_GEN_MODEL, false); saveGenModel.setSelection(save); @@ -313,7 +320,8 @@ public abstract class GeneratorConfigTab extends AbstractLaunchConfigurationTab genDocu = true; documentationButton.setSelection(genDocu); debugButton.setSelection(configuration.getAttribute(DEBUG, false)); - mscButton.setSelection(configuration.getAttribute(MSC, true)); + mscButton.setSelection(configuration.getAttribute(MSC_INSTR, false)); + dataButton.setSelection(configuration.getAttribute(DATA_INSTR, false)); verboseButton.setSelection(configuration.getAttribute(VERBOSE, false)); ScopedPreferenceStore prefStore = new ScopedPreferenceStore(InstanceScope.INSTANCE, "org.eclipse.etrice.generator.ui"); @@ -355,7 +363,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(MSC_INSTR, mscButton.getSelection()); + configuration.setAttribute(DATA_INSTR, dataButton.getSelection()); configuration.setAttribute(VERBOSE, verboseButton.getSelection()); configuration.setAttribute(USE_TRAANSLATION, useTranslationButton.getSelection()); diff --git a/plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/GeneratorLaunchConfigurationDelegate.java b/plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/GeneratorLaunchConfigurationDelegate.java index dadd64e09..5d8ccc209 100644 --- a/plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/GeneratorLaunchConfigurationDelegate.java +++ b/plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/GeneratorLaunchConfigurationDelegate.java @@ -190,8 +190,11 @@ public abstract class GeneratorLaunchConfigurationDelegate extends AbstractJavaL if (configuration.getAttribute(GeneratorConfigTab.DEBUG, false)) { argString.append(" "+AbstractGenerator.OPTION_DEBUG); } - if (configuration.getAttribute(GeneratorConfigTab.MSC, false)) { - argString.append(" "+AbstractGenerator.OPTION_MSC); + if (configuration.getAttribute(GeneratorConfigTab.MSC_INSTR, false)) { + argString.append(" "+AbstractGenerator.OPTION_MSC_INSTR); + } + if (configuration.getAttribute(GeneratorConfigTab.DATA_INSTR, false)) { + argString.append(" "+AbstractGenerator.OPTION_DATA_INSTR); } if (configuration.getAttribute(GeneratorConfigTab.VERBOSE, false)) { argString.append(" "+AbstractGenerator.OPTION_VERBOSE_RT); diff --git a/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/ProjectFileFragments.xtend b/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/ProjectFileFragments.xtend index 190d81207..ab25d6573 100644 --- a/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/ProjectFileFragments.xtend +++ b/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/ProjectFileFragments.xtend @@ -92,6 +92,7 @@ class ProjectFileFragments { + diff --git a/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/deprecated/MappingCreationPage.java b/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/deprecated/MappingCreationPage.java index 91b3a8b2f..a4d2d8fec 100644 --- a/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/deprecated/MappingCreationPage.java +++ b/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/deprecated/MappingCreationPage.java @@ -13,11 +13,6 @@ package org.eclipse.etrice.generator.ui.wizard.deprecated; import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.etrice.core.etmap.eTMap.Mapping; -import org.eclipse.etrice.core.etphys.eTPhys.NodeClass; -import org.eclipse.etrice.core.etphys.eTPhys.PhysicalSystem; -import org.eclipse.etrice.core.etphys.eTPhys.RuntimeClass; import org.eclipse.etrice.core.room.RoomModel; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.swt.SWT; @@ -26,9 +21,7 @@ import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.xtext.resource.IResourceFactory; -import org.eclipse.xtext.resource.SaveOptions; import org.eclipse.xtext.resource.XtextResource; -import org.eclipse.xtext.serializer.ISerializer; import org.eclipse.xtext.ui.editor.embedded.EmbeddedEditor; import org.eclipse.xtext.ui.editor.embedded.EmbeddedEditorFactory; import org.eclipse.xtext.ui.editor.embedded.IEditedResourceProvider; @@ -47,6 +40,7 @@ public class MappingCreationPage extends WizardPage { private Injector etPhysInjector; private EmbeddedEditor etPhysEditor; + @SuppressWarnings("unused") private MappingBuilder builder = null; public MappingCreationPage(Injector etMapInjector, Injector etPhysInjector) { diff --git a/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/deprecated/MappingWizard.java b/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/deprecated/MappingWizard.java index 2731a305c..4dbf81b84 100644 --- a/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/deprecated/MappingWizard.java +++ b/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/deprecated/MappingWizard.java @@ -12,11 +12,6 @@ package org.eclipse.etrice.generator.ui.wizard.deprecated; -import java.io.IOException; - -import org.eclipse.core.resources.IFile; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.etrice.core.etmap.ui.internal.ETMapActivator; import org.eclipse.etrice.core.etphys.ui.internal.ETPhysActivator; import org.eclipse.etrice.core.ui.internal.RoomActivator; @@ -25,13 +20,6 @@ import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.wizard.Wizard; import org.eclipse.ui.INewWizard; import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.ide.IDE; -import org.eclipse.xtext.resource.SaveOptions; -import org.eclipse.xtext.resource.XtextResource; import com.google.inject.Injector; diff --git a/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/deprecated/SelectRoomPage.java b/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/deprecated/SelectRoomPage.java index aa8d03940..24ee1cc98 100644 --- a/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/deprecated/SelectRoomPage.java +++ b/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/deprecated/SelectRoomPage.java @@ -202,6 +202,7 @@ public class SelectRoomPage extends WizardPage implements SelectionListener { setErrorMessage(null); } + @SuppressWarnings("deprecation") protected void setPageComplete() { setPageComplete(selectedRoomModel != null); diff --git a/plugins/org.eclipse.etrice.generator.ui/xtend-gen/org/eclipse/etrice/generator/ui/wizard/ProjectFileFragments.java b/plugins/org.eclipse.etrice.generator.ui/xtend-gen/org/eclipse/etrice/generator/ui/wizard/ProjectFileFragments.java index 7c21c3d63..5032e0ac6 100644 --- a/plugins/org.eclipse.etrice.generator.ui/xtend-gen/org/eclipse/etrice/generator/ui/wizard/ProjectFileFragments.java +++ b/plugins/org.eclipse.etrice.generator.ui/xtend-gen/org/eclipse/etrice/generator/ui/wizard/ProjectFileFragments.java @@ -194,6 +194,8 @@ public class ProjectFileFragments { _builder.newLineIfNotEmpty(); _builder.append(""); _builder.newLine(); + _builder.append(""); + _builder.newLine(); _builder.append(""); diff --git a/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/AbstractGenerator.java b/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/AbstractGenerator.java index 14c769e4b..58582a554 100644 --- a/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/AbstractGenerator.java +++ b/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/AbstractGenerator.java @@ -79,7 +79,8 @@ public abstract class AbstractGenerator implements IDetailCodeTranslator { public static final String OPTION_GEN_DIR = "-genDir"; public static final String OPTION_GEN_INFO_DIR = "-genInfoDir"; public static final String OPTION_GEN_DOC_DIR = "-genDocDir"; - public static final String OPTION_MSC = "-msc_instr"; + public static final String OPTION_MSC_INSTR = "-msc_instr"; + public static final String OPTION_DATA_INSTR = "-data_instr"; public static final String OPTION_VERBOSE_RT = "-gen_as_verbose"; public static final String OPTION_DEBUG = "-debug"; public static final String OPTION_NOTRANSLATE = "-notranslate"; @@ -217,7 +218,7 @@ public abstract class AbstractGenerator implements IDetailCodeTranslator { *
  • {@value #OPTION_GEN_INCREMENTAL}
  • *
  • {@value #OPTION_GEN_INFO_DIR}
  • *
  • {@value #OPTION_LIB}
  • - *
  • {@value #OPTION_MSC}
  • + *
  • {@value #OPTION_MSC_INSTR}
  • *
  • {@value #OPTION_NOEXIT}
  • *
  • {@value #OPTION_SAVE_GEN_MODEL}
  • *
  • {@value #OPTION_VERBOSE_RT}
  • @@ -274,9 +275,12 @@ public abstract class AbstractGenerator implements IDetailCodeTranslator { else if (arg.equals(OPTION_NOEXIT)) { setTerminateOnError(false); } - else if (arg.equals(OPTION_MSC)) { + else if (arg.equals(OPTION_MSC_INSTR)) { generatorSettings.setGenerateMSCInstrumentation(true); } + else if (arg.equals(OPTION_DATA_INSTR)) { + generatorSettings.setGenerateDataInstrumentation(true); + } else if (arg.equals(OPTION_NOTRANSLATE)) { generatorSettings.setNoTranslation(true); } @@ -330,7 +334,7 @@ public abstract class AbstractGenerator implements IDetailCodeTranslator { +" ["+OPTION_GEN_INFO_DIR+" ]" +" ["+OPTION_GEN_DOC_DIR+" ]" +" ["+OPTION_DEBUG+"]" - +" ["+OPTION_MSC+"]" + +" ["+OPTION_MSC_INSTR+"]" +" ["+OPTION_VERBOSE_RT+"]" +" ["+OPTION_HELP+"]" ; diff --git a/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/GlobalGeneratorSettings.java b/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/GlobalGeneratorSettings.java deleted file mode 100644 index 635fd5ca7..000000000 --- a/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/GlobalGeneratorSettings.java +++ /dev/null @@ -1,95 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 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.base; - -import java.util.ArrayList; -import java.util.List; - - -/** - * @author Henrik Rentz-Reichert - * - */ -public class GlobalGeneratorSettings { - - private List inputModelURIs = new ArrayList(); - private boolean generateMSCInstrumentation = false; - private boolean generateWithVerboseOutput = false; - private String generatorModelPath = null; - private boolean generateDocumentation = false; - private boolean generateAsLibrary = false; - private boolean debugMode = false; - private boolean noTranslation = false; - - public boolean generateMSCInstrumentation() { - return generateMSCInstrumentation; - } - - public void setGenerateMSCInstrumentation( - boolean generateMSCInstrumentation) { - this.generateMSCInstrumentation = generateMSCInstrumentation; - } - - public boolean generateWithVerboseOutput() { - return generateWithVerboseOutput; - } - - public void setGenerateWithVerboseOutput(boolean generateWithVerboseOutput) { - this.generateWithVerboseOutput = generateWithVerboseOutput; - } - - public List getInputModelURIs() { - return inputModelURIs; - } - - public String getGeneratorModelPath() { - return generatorModelPath; - } - - public void setGeneratorModelPath(String generatorModelPath) { - this.generatorModelPath = generatorModelPath; - } - - public boolean isGenerateDocumentation() { - return generateDocumentation; - } - - public void setGenerateDocumentation(boolean generateDocumentation) { - this.generateDocumentation = generateDocumentation; - } - - public boolean isGenerateAsLibrary() { - return generateAsLibrary; - } - - public void setGenerateAsLibrary(boolean generateAsLibrary) { - this.generateAsLibrary = generateAsLibrary; - } - - public boolean isDebugMode() { - return debugMode; - } - - public void setDebugMode(boolean debugMode) { - this.debugMode = debugMode; - } - - public void setNoTranslation(boolean b) { - this.noTranslation = b; - } - - public boolean isNoTranslation() { - return noTranslation; - } - -} diff --git a/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/GlobalGeneratorSettings.xtend b/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/GlobalGeneratorSettings.xtend new file mode 100644 index 000000000..c057da8ab --- /dev/null +++ b/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/GlobalGeneratorSettings.xtend @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2013 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) + * Juergen Haug + * + *******************************************************************************/ + +package org.eclipse.etrice.generator.base + +import java.util.List +import org.eclipse.xtend.lib.annotations.Accessors + +@Accessors +class GlobalGeneratorSettings { + + // all models from input + val List inputModelURIs = newArrayList + + // generation options + boolean generateAsLibrary = false + boolean generateMSCInstrumentation = false + boolean generateDataInstrumentation = false + boolean noTranslation = false + + // extra generators + String generatorModelPath = null + boolean generateDocumentation = false + + // generator logging + boolean generateWithVerboseOutput = false + boolean debugMode = false + +} \ No newline at end of file diff --git a/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/base/GlobalGeneratorSettings.java b/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/base/GlobalGeneratorSettings.java new file mode 100644 index 000000000..2ecf06a43 --- /dev/null +++ b/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/base/GlobalGeneratorSettings.java @@ -0,0 +1,116 @@ +/** + * Copyright (c) 2013 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) + * Juergen Haug + */ +package org.eclipse.etrice.generator.base; + +import java.util.List; +import org.eclipse.xtend.lib.annotations.Accessors; +import org.eclipse.xtext.xbase.lib.CollectionLiterals; +import org.eclipse.xtext.xbase.lib.Pure; + +@Accessors +@SuppressWarnings("all") +public class GlobalGeneratorSettings { + private final List inputModelURIs = CollectionLiterals.newArrayList(); + + private boolean generateAsLibrary = false; + + private boolean generateMSCInstrumentation = false; + + private boolean generateDataInstrumentation = false; + + private boolean noTranslation = false; + + private String generatorModelPath = null; + + private boolean generateDocumentation = false; + + private boolean generateWithVerboseOutput = false; + + private boolean debugMode = false; + + @Pure + public List getInputModelURIs() { + return this.inputModelURIs; + } + + @Pure + public boolean isGenerateAsLibrary() { + return this.generateAsLibrary; + } + + public void setGenerateAsLibrary(final boolean generateAsLibrary) { + this.generateAsLibrary = generateAsLibrary; + } + + @Pure + public boolean isGenerateMSCInstrumentation() { + return this.generateMSCInstrumentation; + } + + public void setGenerateMSCInstrumentation(final boolean generateMSCInstrumentation) { + this.generateMSCInstrumentation = generateMSCInstrumentation; + } + + @Pure + public boolean isGenerateDataInstrumentation() { + return this.generateDataInstrumentation; + } + + public void setGenerateDataInstrumentation(final boolean generateDataInstrumentation) { + this.generateDataInstrumentation = generateDataInstrumentation; + } + + @Pure + public boolean isNoTranslation() { + return this.noTranslation; + } + + public void setNoTranslation(final boolean noTranslation) { + this.noTranslation = noTranslation; + } + + @Pure + public String getGeneratorModelPath() { + return this.generatorModelPath; + } + + public void setGeneratorModelPath(final String generatorModelPath) { + this.generatorModelPath = generatorModelPath; + } + + @Pure + public boolean isGenerateDocumentation() { + return this.generateDocumentation; + } + + public void setGenerateDocumentation(final boolean generateDocumentation) { + this.generateDocumentation = generateDocumentation; + } + + @Pure + public boolean isGenerateWithVerboseOutput() { + return this.generateWithVerboseOutput; + } + + public void setGenerateWithVerboseOutput(final boolean generateWithVerboseOutput) { + this.generateWithVerboseOutput = generateWithVerboseOutput; + } + + @Pure + public boolean isDebugMode() { + return this.debugMode; + } + + public void setDebugMode(final boolean debugMode) { + this.debugMode = debugMode; + } +} diff --git a/plugins/org.eclipse.etrice.ui.behavior.actioneditor/build.properties b/plugins/org.eclipse.etrice.ui.behavior.actioneditor/build.properties index 6c480f39f..c59c976d4 100644 --- a/plugins/org.eclipse.etrice.ui.behavior.actioneditor/build.properties +++ b/plugins/org.eclipse.etrice.ui.behavior.actioneditor/build.properties @@ -1,4 +1,5 @@ -source.. = src/ +source.. = src/,\ + xtend-gen/ output.. = bin/ bin.includes = META-INF/,\ .,\ diff --git a/plugins/org.eclipse.etrice.ui.behavior.fsm/build.properties b/plugins/org.eclipse.etrice.ui.behavior.fsm/build.properties index 79785acae..cab10d177 100644 --- a/plugins/org.eclipse.etrice.ui.behavior.fsm/build.properties +++ b/plugins/org.eclipse.etrice.ui.behavior.fsm/build.properties @@ -1,4 +1,5 @@ -source.. = src/ +source.. = src/,\ + xtend-gen/ output.. = bin/ bin.includes = META-INF/,\ .,\ diff --git a/plugins/org.eclipse.etrice.ui.behavior/build.properties b/plugins/org.eclipse.etrice.ui.behavior/build.properties index 6c480f39f..c59c976d4 100644 --- a/plugins/org.eclipse.etrice.ui.behavior/build.properties +++ b/plugins/org.eclipse.etrice.ui.behavior/build.properties @@ -1,4 +1,5 @@ -source.. = src/ +source.. = src/,\ + xtend-gen/ output.. = bin/ bin.includes = META-INF/,\ .,\ diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.c.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.c.zip index 1e4c258a8..8cea2fd71 100644 Binary files a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.c.zip and b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.c.zip differ diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.c.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.c.zip index a94dfafbd..1647fe5cb 100644 Binary files a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.c.zip and b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.c.zip differ diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.c.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.c.zip index bd8c025aa..3667824f0 100644 Binary files a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.c.zip and b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.c.zip differ diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.template.c.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.template.c.zip index cf1cf3d6c..de5218df5 100644 Binary files a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.template.c.zip and b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.template.c.zip differ diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.c.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.c.zip index c9f1ca009..0586d60a9 100644 Binary files a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.c.zip and b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.c.zip differ diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.java.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.java.zip index c09e18d66..e1f044d4c 100644 Binary files a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.java.zip and b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.java.zip differ diff --git a/runtime/org.eclipse.etrice.modellib.c/model/Annotations.room b/runtime/org.eclipse.etrice.modellib.c/model/Annotations.room index 2856bce7a..ce4d61683 100644 --- a/runtime/org.eclipse.etrice.modellib.c/model/Annotations.room +++ b/runtime/org.eclipse.etrice.modellib.c/model/Annotations.room @@ -9,4 +9,23 @@ RoomModel room.basic.annotations { mandatory attribute pathlist: ptCharacter } + AnnotationType Gnuplot { + target = SubSystemClass + mandatory attribute format: ptCharacter + mandatory attribute outputfile: ptCharacter + mandatory attribute width: ptInteger + mandatory attribute height: ptInteger + optional attribute fontsize: ptInteger + } + + AnnotationType GnuplotGraph { + target = SubSystemClass + mandatory attribute paths: ptCharacter + optional attribute interval: ptInteger + optional attribute xtics: ptReal + optional attribute mxtics: ptInteger + optional attribute ymin: ptReal + optional attribute ymax: ptReal + } + } \ No newline at end of file diff --git a/runtime/org.eclipse.etrice.runtime.c/buildTools/Makefile b/runtime/org.eclipse.etrice.runtime.c/buildTools/Makefile index 2122ddab0..1c3586189 100644 --- a/runtime/org.eclipse.etrice.runtime.c/buildTools/Makefile +++ b/runtime/org.eclipse.etrice.runtime.c/buildTools/Makefile @@ -21,25 +21,6 @@ IN_INCDIRS += ./src-gen ./src IN_SRCDIRS_REC += ./src-gen ./src #--- -# Do NOT set IN_XX as make paramater or environment variable, -# instead make variables from outside explicit: -# IN_TARGET := ${APP_TARGET} -# IN_INCDIRS += ${APP_INCDIRS} -# IN_SRCDIRS_REC += ${APP_SRCDIRS_REC} - -# All options: -#IN_TARGET -#IN_TARGET_DIR -#IN_BUILD_DIR -#IN_TARGET_PLATFORM -#IN_INCDIRS -#IN_SRCDIRS_REC -#IN_SOURCES -#IN_CFLAGS -#IN_DEFS -#IN_LDFLAGS -#IN_LDLIBS -#IN_PREREQS # Create rules include ${RUNTIME_ROOTDIR}/buildTools/Makefile.mk \ No newline at end of file diff --git a/runtime/org.eclipse.etrice.runtime.c/buildTools/Makefile.mk b/runtime/org.eclipse.etrice.runtime.c/buildTools/Makefile.mk index b30d42731..1809ac49b 100644 --- a/runtime/org.eclipse.etrice.runtime.c/buildTools/Makefile.mk +++ b/runtime/org.eclipse.etrice.runtime.c/buildTools/Makefile.mk @@ -1,9 +1,29 @@ -# CANONICAL_PATH - Given one or more paths, converts the paths to the canonical -# form. The canonical form is the path, relative to the project's top-level -# directory (the directory from which "make" is run), and without -# any "./" or "../" sequences. For paths that are not located below the -# top-level directory, the canonical form is the absolute path (i.e. from -# the root of the filesystem) also without "./" or "../" sequences. +#----------------------------------------------------------------------------------------------- +# Generic makefile for executable/library + +# All options: +# IN_TARGET +# IN_TARGET_DIR +# IN_BUILD_DIR +# IN_TARGET_PLATFORM +# IN_INCDIRS +# IN_SRCDIRS_REC +# IN_SOURCES +# IN_CFLAGS +# IN_DEFS +# IN_LDFLAGS +# IN_LDLIBS +# IN_PREREQS + +# Do NOT set IN_XX as make paramater or environment variable, +# instead set variables from outside explicit: +# IN_TARGET := ${APP_TARGET} +# IN_INCDIRS += ${APP_INCDIRS} +# IN_SRCDIRS_REC += ${APP_SRCDIRS_REC} + +#----------------------------------------------------------------------------------------------- + +# relative to basedir or absolute if not possible define CANONICAL_PATH $(patsubst ${CURDIR}/%,%,$(abspath ${1})) endef @@ -23,6 +43,7 @@ define TARGET_RULE endif endef + ifeq ($(strip ${IN_BUILD_DIR}),) IN_BUILD_DIR := ${TARGET_BUILD_DIR} endif diff --git a/runtime/org.eclipse.etrice.runtime.java/src-gen/org/eclipse/etrice/runtime/java/modelbase/RTSystemServicesProtocol.java b/runtime/org.eclipse.etrice.runtime.java/src-gen/org/eclipse/etrice/runtime/java/modelbase/RTSystemServicesProtocol.java index 5ca5ab4fd..113008b8b 100644 --- a/runtime/org.eclipse.etrice.runtime.java/src-gen/org/eclipse/etrice/runtime/java/modelbase/RTSystemServicesProtocol.java +++ b/runtime/org.eclipse.etrice.runtime.java/src-gen/org/eclipse/etrice/runtime/java/modelbase/RTSystemServicesProtocol.java @@ -1,13 +1,6 @@ package org.eclipse.etrice.runtime.java.modelbase; import org.eclipse.etrice.runtime.java.messaging.Message; -import org.eclipse.etrice.runtime.java.modelbase.EventMessage; -import org.eclipse.etrice.runtime.java.modelbase.EventWithDataMessage; -import org.eclipse.etrice.runtime.java.modelbase.IInterfaceItemOwner; -import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase; -import org.eclipse.etrice.runtime.java.modelbase.PortBase; -import org.eclipse.etrice.runtime.java.modelbase.ReplicatedPortBase; -import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*; diff --git a/tests/org.eclipse.etrice.core.room.tests/build.properties b/tests/org.eclipse.etrice.core.room.tests/build.properties index 8a12e2f65..774ee5239 100644 --- a/tests/org.eclipse.etrice.core.room.tests/build.properties +++ b/tests/org.eclipse.etrice.core.room.tests/build.properties @@ -1,6 +1,7 @@ source.. = src/,\ - models/ + xtend-gen/ output.. = bin/ bin.includes = META-INF/,\ .,\ models/ +src.includes = models/ -- cgit v1.2.3