Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.etrice.doc/help/CreatetheHelloWorldmodel.html')
-rw-r--r--plugins/org.eclipse.etrice.doc/help/CreatetheHelloWorldmodel.html63
1 files changed, 63 insertions, 0 deletions
diff --git a/plugins/org.eclipse.etrice.doc/help/CreatetheHelloWorldmodel.html b/plugins/org.eclipse.etrice.doc/help/CreatetheHelloWorldmodel.html
new file mode 100644
index 000000000..7abbdb618
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/help/CreatetheHelloWorldmodel.html
@@ -0,0 +1,63 @@
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Create the HelloWorld model</title>
+<link href="book.css" rel="stylesheet" type="text/css">
+<meta content="DocBook XSL Stylesheets V1.75.1" name="generator">
+<link rel="home" href="index.html" title="eTrice User Guide">
+<link rel="up" href="TutorialHelloWorldC.html" title="Tutorial HelloWorld ( C )">
+<link rel="prev" href="Createanewmodelfromscratch4.html" title="Create a new model from scratch">
+<link rel="next" href="CreatealaunchconfigurationtostarttheCcodegenerator.html" title="Create a launch configuration to start the C codegenerator">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">Create the HelloWorld model</h1>
+<div class="section" title="Create the HelloWorld model">
+<div class="titlepage">
+<div>
+<div>
+<h2 class="title" style="clear: both">
+<a name="CreatetheHelloWorldmodel"></a>Create the HelloWorld model</h2>
+</div>
+</div>
+</div>
+<p>Once the model file is created and the Xtext nature is added, you can create the model as you did it for Java.
+ Creating the model is not the focus of this tutorial. Therefore copy and paste the following code into your model file. Optionally you can open and layout the diagrams.
+ Recognize the C specific parts:
+ - Import CTypes instead of JavaTypes
+ - The action code contains C instead of Java. Later versions will contain a common action language, but for the moment the action language is target specific.</p>
+<p>ToDo: shutdown must be not depend on the subsystem.</p>
+<div class="literallayout">
+<p>
+<code class="code">RoomModel&nbsp;HelloWorldCModel&nbsp;{<br>
+ import&nbsp;room.basic.types.c.*&nbsp;from&nbsp;"../../org.eclipse.etrice.modellib.c/model/CTypes.room"<br>
+ SubSystemClass&nbsp;HelloWorldCSubSysClass&nbsp;{<br>
+ ActorRef&nbsp;HelloETriceTopRef:AHelloWorldCTop&nbsp;<br>
+ }<br>
+ ActorClass&nbsp;AHelloWorldCTop&nbsp;{<br>
+ Structure&nbsp;{&nbsp;}<br>
+ Behavior&nbsp;{<br>
+ StateMachine&nbsp;{<br>
+ Transition&nbsp;init:&nbsp;initial&nbsp;-&gt;&nbsp;state0&nbsp;{&nbsp;}<br>
+ State&nbsp;state0&nbsp;{<br>
+ entry&nbsp;{<br>
+ "printf(\"HelloETrice&nbsp;!\\n\");"<br>
+ "HelloETriceSubSysClass_shutdown();//exit(0);"<br>
+ "\t\t\t\t\t\t"<br>
+ }<br>
+ }<br>
+ }<br>
+ }<br>
+ } <br>
+}<br>
+
+</code>
+</p>
+</div>
+<div class="blockquote">
+<blockquote class="blockquote">
+<p></p>
+</blockquote>
+</div>
+</div>
+</body>
+</html>

Back to the top