Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2011-05-30 10:02:25 +0000
committerHenrik Rentz-Reichert2011-05-30 10:02:25 +0000
commit8cfefa4371776c67afc87c8589c3309a38895cca (patch)
treeeca964d196ef954923b6ce0ad3c7437132237a4d /examples/org.eclipse.etrice.tutorials
parent8ad30223a35df80e4368d325995dc1bb148ddcc3 (diff)
downloadorg.eclipse.etrice-8cfefa4371776c67afc87c8589c3309a38895cca.tar.gz
org.eclipse.etrice-8cfefa4371776c67afc87c8589c3309a38895cca.tar.xz
org.eclipse.etrice-8cfefa4371776c67afc87c8589c3309a38895cca.zip
[doc/examples] moved tutorials to examples and removed old examples project
Diffstat (limited to 'examples/org.eclipse.etrice.tutorials')
-rw-r--r--examples/org.eclipse.etrice.tutorials/.classpath10
-rw-r--r--examples/org.eclipse.etrice.tutorials/.gitignore2
-rw-r--r--examples/org.eclipse.etrice.tutorials/.project40
-rw-r--r--examples/org.eclipse.etrice.tutorials/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--examples/org.eclipse.etrice.tutorials/META-INF/MANIFEST.MF19
-rw-r--r--examples/org.eclipse.etrice.tutorials/build.properties4
-rw-r--r--examples/org.eclipse.etrice.tutorials/genAllTutorials.mwe2.launch19
-rw-r--r--examples/org.eclipse.etrice.tutorials/model/fast/PingPongFast.room84
-rw-r--r--examples/org.eclipse.etrice.tutorials/model/scratch/PingPong.room121
-rw-r--r--examples/org.eclipse.etrice.tutorials/src/workflow/genAllModels.mwe231
-rw-r--r--examples/org.eclipse.etrice.tutorials/tmp/log/.gitignore2
11 files changed, 340 insertions, 0 deletions
diff --git a/examples/org.eclipse.etrice.tutorials/.classpath b/examples/org.eclipse.etrice.tutorials/.classpath
new file mode 100644
index 000000000..18304f00e
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials/.classpath
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="src-gen"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.etrice.modellib"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.etrice.runtime.java"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/examples/org.eclipse.etrice.tutorials/.gitignore b/examples/org.eclipse.etrice.tutorials/.gitignore
new file mode 100644
index 000000000..4bd2f9ef0
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials/.gitignore
@@ -0,0 +1,2 @@
+bin
+src-gen/*
diff --git a/examples/org.eclipse.etrice.tutorials/.project b/examples/org.eclipse.etrice.tutorials/.project
new file mode 100644
index 000000000..2bd66d08d
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials/.project
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.etrice.doc.tutorials</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.xtend.shared.ui.xtendBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+ <nature>org.eclipse.xtend.shared.ui.xtendXPandNature</nature>
+ </natures>
+</projectDescription>
diff --git a/examples/org.eclipse.etrice.tutorials/.settings/org.eclipse.jdt.core.prefs b/examples/org.eclipse.etrice.tutorials/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..4b0664ccc
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Tue Apr 05 15:46:50 CEST 2011
+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/examples/org.eclipse.etrice.tutorials/META-INF/MANIFEST.MF b/examples/org.eclipse.etrice.tutorials/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..7ce23a51a
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials/META-INF/MANIFEST.MF
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Tutorials
+Bundle-SymbolicName: org.eclipse.etrice.doc.tutorials
+Bundle-Version: 1.0.0
+Export-Package: workflow
+Require-Bundle: org.eclipse.etrice.generator.java;bundle-version="0.1.0",
+ org.eclipse.etrice.generator;bundle-version="0.1.0",
+ org.eclipse.etrice.modellib;bundle-version="0.1.0",
+ org.eclipse.emf.mwe2.launch;bundle-version="1.0.1";resolution:=optional,
+ org.eclipse.emf.mwe.utils;bundle-version="1.0.0";visibility:=reexport,
+ org.apache.log4j;bundle-version="1.2.15",
+ org.apache.commons.logging;bundle-version="1.0.4",
+ org.eclipse.jface.text;bundle-version="3.6.0",
+ org.eclipse.jdt.core;bundle-version="3.6.0",
+ org.eclipse.xtend.util.stdlib;bundle-version="1.0.0",
+ org.eclipse.core.runtime;bundle-version="3.6.0",
+ org.eclipse.xtext.generator;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/examples/org.eclipse.etrice.tutorials/build.properties b/examples/org.eclipse.etrice.tutorials/build.properties
new file mode 100644
index 000000000..41eb6ade2
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/examples/org.eclipse.etrice.tutorials/genAllTutorials.mwe2.launch b/examples/org.eclipse.etrice.tutorials/genAllTutorials.mwe2.launch
new file mode 100644
index 000000000..fbc9cc0f3
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials/genAllTutorials.mwe2.launch
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.emf.mwe2.launch.Mwe2LaunchConfigurationType">
+<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${workspace}"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.etrice.doc.tutorials"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="4"/>
+</listAttribute>
+<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6&quot; javaProject=&quot;org.eclipse.etrice.doc.tutorials&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#13;&#10;"/>
+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#13;&#10;&lt;memento exportedEntriesOnly=&quot;false&quot; project=&quot;org.eclipse.etrice.doc.tutorials&quot;/&gt;&#13;&#10;&lt;/runtimeClasspathEntry&gt;&#13;&#10;"/>
+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/org.eclipse.etrice.modellib&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
+</listAttribute>
+<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="src/workflow/genAllModels.mwe2"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.etrice.doc.tutorials"/>
+</launchConfiguration>
diff --git a/examples/org.eclipse.etrice.tutorials/model/fast/PingPongFast.room b/examples/org.eclipse.etrice.tutorials/model/fast/PingPongFast.room
new file mode 100644
index 000000000..e40e3ffbc
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials/model/fast/PingPongFast.room
@@ -0,0 +1,84 @@
+RoomModel PingPongFast {
+
+
+ LogicalSystem System_PingPong {
+ SubSystemRef subsystem : SubSystem_PingPong
+ }
+
+ SubSystemClass SubSystem_PingPong {
+ ActorRef application : PingPongTop
+ //LogicalThread mrPingThread prio=5{application.MrPing}
+ //LogicalThread mrPongThread prio=5 {application.MrPong}
+ }
+
+ ActorClass PingPongTop {
+ Structure {
+ ActorRef MrPing : MrPingActor
+ ActorRef MrPong : MrPongActor
+ Binding MrPing.PingPongPort and MrPong.PingPongPort
+ }
+ }
+
+ ActorClass MrPingActor {
+ Interface {
+ conjugated Port PingPongPort : PingPongProtocol
+ }
+ Structure {
+ usercode2 {
+ "private int msgCounter = 0;"
+ }
+ external Port PingPongPort
+ }
+
+ Behavior {
+ StateMachine {
+ Transition tr0: initial -> waitForPong {
+ action{
+ "PingPongPort.ping();"
+ }
+ }
+ Transition tr2: waitForPong -> waitForPong {
+ triggers {
+ <pong:PingPongPort>
+ }
+ action {
+ "if (msgCounter++ < 1000){PingPongPort.ping();}"
+ }
+ }
+ State waitForPong {}
+ }
+ }
+ }
+
+ ActorClass MrPongActor {
+ Interface {
+ Port PingPongPort : PingPongProtocol
+ }
+ Structure {
+ external Port PingPongPort
+ }
+ Behavior {
+ StateMachine {
+ Transition tr0: initial -> waitForPing {}
+ Transition myTrigger: waitForPing -> waitForPing {
+ triggers {
+ <ping:PingPongPort>
+ }
+ action {
+ "PingPongPort.pong();"
+ }
+ }
+ State waitForPing {}
+ }
+ }
+ }
+
+ ProtocolClass PingPongProtocol {
+ incoming {
+ Message ping ()
+ }
+ outgoing {
+ Message pong ()
+ }
+ }
+} \ No newline at end of file
diff --git a/examples/org.eclipse.etrice.tutorials/model/scratch/PingPong.room b/examples/org.eclipse.etrice.tutorials/model/scratch/PingPong.room
new file mode 100644
index 000000000..bdd82520e
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials/model/scratch/PingPong.room
@@ -0,0 +1,121 @@
+RoomModel PingPong {
+
+ import room.basic.service.timing.*
+
+ LogicalSystem System_PingPong {
+ SubSystemRef subsystem: SubSystem_PingPong
+ }
+
+ SubSystemClass SubSystem_PingPong {
+ ActorRef application: PingPongTop
+ ActorRef services: ATimingService
+ LayerConnection ref application satisfied_by services.timer
+ LayerConnection ref application satisfied_by services.timeout
+ LogicalThread mrPingThread prio=5 {application.MrPing}
+ LogicalThread mrPong1Thread prio=5 {application.MrPong1}
+// LogicalThread mrPong2Thread prio=5 {application.MrPong2}
+ }
+
+ // automatically inserted App_SubSystem_PedLightController
+ ActorClass PingPongTop {
+ Structure {
+ ActorRef MrPing: MrPingActor
+ ActorRef MrPong1: MrPongActor1
+ // ActorRef MrPong2: MrPongActor2
+ Binding MrPing.PingPongPort and MrPong1.PingPongPort
+ }
+ }
+
+ ActorClass MrPingActor {
+ Interface {
+ conjugated Port PingPongPort [2]: PingPongProtocol
+ }
+ Structure {
+ external Port PingPongPort
+ SAP timer: PTimeout
+ }
+ Behavior {
+ StateMachine {
+ Transition tr0: initial -> waitForTimer {
+ action {
+ "timer.Start(1000);"
+ }
+ }
+ Transition tr1: waitForTimer -> waitForPong {
+ triggers {
+ <timeoutTick: timer>
+ }
+ action {
+ "PingPongPort.ping();"
+ }
+ }
+ Transition tr2: waitForPong -> waitForTimer {
+ triggers {
+ <pong: PingPongPort>
+ }
+ action {
+ "timer.Start(1000);"
+ }
+ }
+ State waitForTimer { }
+ State waitForPong { }
+ }
+ }
+ }
+
+ ActorClass MrPongActor1 {
+ Interface {
+ Port PingPongPort: PingPongProtocol
+ }
+ Structure {
+ external Port PingPongPort
+ }
+ Behavior {
+ StateMachine {
+ Transition tr0: initial -> waitForPing { }
+ Transition myTrigger: waitForPing -> waitForPing {
+ triggers {
+ <ping: PingPongPort>
+ }
+ action {
+ "PingPongPort.pong();"
+ }
+ }
+ State waitForPing { }
+ }
+ }
+ }
+
+/* ActorClass MrPongActor2 {
+ Interface {
+ Port PingPongPort: PingPongProtocol
+ }
+ Structure {
+ external Port PingPongPort
+ }
+ Behavior {
+ StateMachine {
+ Transition tr0: initial -> waitForPing { }
+ Transition myTrigger: waitForPing -> waitForPing {
+ triggers {
+ <ping: PingPongPort>
+ }
+ action {
+ "PingPongPort.pong();"
+ }
+ }
+ State waitForPing { }
+ }
+ }
+ }*/
+
+ ProtocolClass PingPongProtocol {
+ incoming {
+ Message ping()
+ }
+ outgoing {
+ Message pong()
+ }
+ }
+
+} \ No newline at end of file
diff --git a/examples/org.eclipse.etrice.tutorials/src/workflow/genAllModels.mwe2 b/examples/org.eclipse.etrice.tutorials/src/workflow/genAllModels.mwe2
new file mode 100644
index 000000000..1b93034a5
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials/src/workflow/genAllModels.mwe2
@@ -0,0 +1,31 @@
+module workflow.tutorials
+
+import org.eclipse.emf.mwe.utils.*
+import workflow.ExecuteCommand.*
+
+var destDir = "src-gen"
+
+Workflow {
+
+ component = DirectoryCleaner {
+ directory = destDir
+ }
+
+ component = @workflow.RoomGenerator {
+ sourceDir = "model/scratch"
+ targetDir = destDir
+ }
+
+ component = @workflow.RoomGenerator {
+ sourceDir = "model/fast"
+ targetDir = destDir
+ }
+
+ component = org.eclipse.etrice.generator.workflow.ExecuteCommand {
+ commandString = "dot -osrc-gen/PingPong/SubSystem_PingPong.jpg -Tjpg src-gen/PingPong/SubSystem_PingPong.dot"
+ }
+
+ component = org.eclipse.etrice.generator.workflow.ExecuteCommand {
+ commandString = "dot -osrc-gen/PingPongFast/SubSystem_PingPong.jpg -Tjpg src-gen/PingPongFast/SubSystem_PingPong.dot"
+ }
+} \ No newline at end of file
diff --git a/examples/org.eclipse.etrice.tutorials/tmp/log/.gitignore b/examples/org.eclipse.etrice.tutorials/tmp/log/.gitignore
new file mode 100644
index 000000000..005717ead
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials/tmp/log/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore

Back to the top