Changes for page SCCharts Development
Last modified by Richard Kreissig on 2023/09/14 10:04
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Objects (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,12 +1,5 @@ 1 -{{layout}} 2 -{{layout-section ac:type="single"}} 3 -{{layout-cell}} 4 -This is a light-weight tutorial for developing additions for SCCharts in KIELER. It will use Eclipse, EMF, and Xtend and therefore, finishing the corresponding tutorials could prove useful. However, they are not a strict requirement for this tutorial. 1 +This is a light-weight tutorial for developing additions for SCCharts. It will use Eclipse, EMF, and Xtend and therefore, finishing the corresponding tutorials could prove useful. However, they are no strict requirement for this one. 5 5 6 - 7 - 8 -{{toc/}} 9 - 10 10 = Preliminaries = 11 11 12 12 There's a few things to do before we dive into the tutorial itself. For example, to do Eclipse programming, you will have to get your hands on an Eclipse installation first. Read through the following sections to get ready for the tutorial tasks. ... ... @@ -14,40 +14,9 @@ 14 14 == Required Software == 15 15 16 16 As you're going to develop for KIELER SCCharts we recommend to use the semantic Oomph setup as described in [[doc:KIELER.Getting Eclipse]] (Oomph Setup). However, you could also install all componentes by yourself. Please consult the other tutorials if you want to do that. You would need to install the Modeling Tools and the Xtext SDK. 17 -{{/layout-cell}} 18 -{{/layout-section}} 19 19 20 -{{layout-section ac:type="three_equal"}} 21 -{{layout-cell}} 22 - 11 +Additionally, install the** EcoreViz** from the **Ecore Model Visualization** category from the **OpenKieler** update site: [[http:~~/~~/rtsys.informatik.uni-kiel.de/~~~~kieler/updatesite/nightly-openkieler/>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/updatesite/nightly-openkieler/||rel="nofollow" shape="rect"]] 23 23 24 -Additionally, install the** EcoreViz** from the **Ecore Model Visualization** category from the **OpenKieler** update site: [[http:~~/~~/rtsys.informatik.uni-kiel.de/~~~~kieler/updatesite/nightly-openkieler/>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/updatesite/nightly-openkieler/||rel="nofollow" shape="rect"]]. For this, choose //Install New Software...// in the //Help// tab. 25 - 26 -Due to the ongoing migration you have to install a workaround for EcoreViz to function. You have to install the KLighD diagram view directly from [[http:~~/~~/rtsys.informatik.uni-kiel.de/~~~~kieler/updatesite/release_pragmatics_2016-02/>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/updatesite/release_pragmatics_2016-02/||shape="rect"]]. Select the features 27 - 28 -* KIELER Lightweight Diagrams - Developer Resources and 29 -* KIELER Lightweight Diagrams Generic Diagram View. 30 - 31 -(This step should be obsolete in the near future.) 32 -{{/layout-cell}} 33 - 34 -{{layout-cell}} 35 - 36 - 37 -[[image:attach:InstallEcoreViz.png]] 38 - 39 - 40 -{{/layout-cell}} 41 - 42 -{{layout-cell}} 43 - 44 - 45 -[[image:attach:InstallKLighDFeatures.png]] 46 -{{/layout-cell}} 47 -{{/layout-section}} 48 - 49 -{{layout-section ac:type="single"}} 50 -{{layout-cell}} 51 51 == Recommended Tutorials == 52 52 53 53 We recommend that you have completed the following tutorials before diving into this one (or at least sweep over them). However, this is not a strict requirement. ... ... @@ -69,7 +69,7 @@ 69 69 70 70 == Finding Documentation == 71 71 72 -You can find additional documentation to the aforementioned topics in the corresponding tutorials. If you get stuck with a particular topic, please consult that tutorial. For SCCharts, you should read the SCCharts confluence page in our wiki: [[doc:KIELER.SCCharts]] 34 +You can find links additional documentation to the aforementioned topics in the corresponding tutorials. If you get stuck with a particular topic, please consult that tutorial. For SCCharts, you should read the SCCharts confluence page in our wiki: [[doc:KIELER.SCCharts]] 73 73 74 74 As usual, documentation often gets obsolete or wrong if not maintained regularly, so please, if you find missing, misleading, or outdated information, please let us know. 75 75 ... ... @@ -84,57 +84,23 @@ 84 84 * **Overview and High-Level Transformations in Detail:** 85 85 (% style="color: rgb(0,0,0);" %)Reinhard von Hanxleden and Björn Duderstadt and Christian Motika and Steven Smyth and Michael Mendler and Joaquín Aguado and Stephen Mercer and Owen O’Brien. SCCharts: Sequentially Constructive Statecharts for Safety-Critical Applications. Technical Report 1311, Christian-Albrechts-Universität zu Kiel, Department of Computer Science, December 2013. ISSN 2192-6247. (%%)[[pdf>>url:http://rtsys.informatik.uni-kiel.de/~~biblio/downloads/papers/report-1311.pdf||shape="rect"]](% style="color: rgb(0,0,0);" %), (%%)[[bib>>url:http://rtsys.informatik.uni-kiel.de/~~biblio/cgi-bin/bibcgi.cgi?key=vonHanxledenDM+13b||shape="rect"]] 86 86 87 - 88 -{{/layout-cell}} 89 -{{/layout-section}} 90 - 91 -{{layout-section ac:type="two_right_sidebar"}} 92 -{{layout-cell}} 93 93 = The SCCharts Metamodel = 94 94 95 -Navigate to the {{codelanguage="none"}}models{{/code}}folder of the plugin51 +Navigate to the models folder of the plugin {{code language="none"}}de.cau.cs.kieler.sccharts{{/code}}. Here, open the {{code language="none"}}sccharts.ecore{{/code}} and right-click on the {{code language="none"}}sccharts.ecore{{/code}} file and select //Visualize Ecore Model//. Since you also installed **EcoreViz** from the OpenKieler Suite, you should now see a graphical representation of the SCCharts metamodel. Every SCChart will be a model of this metamodel. 96 96 97 - To see all class information check //Attributes/Literals// in the Diagram Options on the right.53 +IMAGE 98 98 99 -EcoreViz gives you an overview over the selected Ecore diagram. However, Ecore model definitions may depend on other Ecore definitions that are not displayed in the diagram. You can open new diagrams for these Ecore files as described before or use the Ecore tree editor to inspect all classes. 100 - 101 101 Try to understand most parts of the metamodel. You don't have to understand every detail but you should get the idea. 102 102 103 103 ==== Model Task ==== 104 104 105 -1. Answer the following questions 106 -11. How do you describe a superstate in the model? 107 -11. Outline the relationship between states, regions, transitions, and valued objects.\\ 108 -11. Name the class of the root element of an SCChart. 109 -11. What is a valued object? 110 -11. How do you get the type of an interface variable? 111 -11. What other metamodels are needed for the SCCharts metamodel and write down which one is needed for what? 112 -1. Write down (on paper, text editor, etc) how the following SCChart models look like 113 -11. Open the wiki page that explains the [[doc:KIELER.Textual SCCharts Language SCT]]. 114 -11. Search the //SCChart, Initial State, State, Transition and Immediate Transition //example and ... 115 -111. write down (on paper or text editor, etc) how the model of that SCChart looks like. 116 -111. The user now marks C as final. What has to be changed in the model? What semantic problem do you see? 117 -11. Now, navigate to the //Super State: Strong Abort Transition //example. Write down (on paper) how the model of that SCCharts looks like. 118 -11. And finally a more sophisticated model: Write down the model of ABO (from [[doc:KIELER.Examples]]). 59 +1. (% style="line-height: 1.42857;" %)Open the wiki page that explains the [[doc:KIELER.Textual SCCharts Language SCT]]. 60 +1. (% style="line-height: 1.4286; line-height: 1.4286" %)Search the (%%)//SCChart, Initial State, State, Transition and Immediate Transition //example and ... 61 +11. write down (on paper etc) what the model of that SCChart looks like. 62 +11. The user now marks C as final. What has to be changed in the model? What semantic problem do you see? 63 +1. (% style="line-height: 1.42857;" %)Now, navigate to the //Super State: Strong Abort Transition //example. Write down (on paper) what the model of that SCCharts looks like. 64 +1. And finally a more sophisticated model: Write down the model of ABO (from [[doc:KIELER.Examples]]). 119 119 120 - 121 - 122 -{{info title="KLighD Screenshots"}} 123 -By the way: You can //right-click// on the Diagram View surface and select //Save as image...// to create a screenshot! 124 -{{/info}} 125 -{{/layout-cell}} 126 - 127 -{{layout-cell}} 128 -[[image:attach:sccharts_metamodel.png]] 129 - 130 -[[image:attach:sccharts_metamodel_treeEditor.png]] 131 - 132 -[[image:attach:KLighDSaveAsImage.png]] 133 -{{/layout-cell}} 134 -{{/layout-section}} 135 - 136 -{{layout-section ac:type="single"}} 137 -{{layout-cell}} 138 138 = Creating SCCharts Models Programmatically = 139 139 140 140 == Creating a Test Project == ... ... @@ -141,7 +141,6 @@ 141 141 142 142 We need a project for testing. Do the following: 143 143 144 -1. If you used the standard KIELER Oomph installation setup, create a new Working Set named Tutorial in the Package Explorer. Then... 145 145 1. Create a new empty //Plug-In Project//. 146 146 1. Add the project that contains the sccharts metamodel as a dependency of your new project through the //Plugin Manifest Editor//. 147 147 1. Create a simple Java class that implements a main method. Hint: In a new Java class, simply type main and hit Ctrl+Space. Eclipse content assist will create the method for you. ... ... @@ -148,7 +148,7 @@ 148 148 149 149 == Creating a Model == 150 150 151 -To create a model 78 +To create a model programmatically you cannot directly use the Java classes generated for the model. Instead, the main package contains interfaces for all of your model object classes. The {{code language="none"}}impl{{/code}} package contains the actual implementation and the {{code language="none"}}util{{/code}} package contains some helper classes. Do not instantiate objects directly by manually calling {{code language="none"}}new{{/code}}. EMF generates a Factory to create new objects. The factory itself uses the singleton pattern to get access to it: 152 152 153 153 {{code language="java"}} 154 154 SCChartsFactory sccFactory = SCChartsFactory.eINSTANCE; ... ... @@ -160,7 +160,7 @@ 160 160 161 161 {{code language="java"}} 162 162 KExpressionsFactory kFactory = KExpressionsFactory.eINSTANCE; 163 -BoolValue boolValue = kFactory.createBoolValue(); 90 +BooleanValue boolValue = kFactory.createBooleanValue(); 164 164 {{/code}} 165 165 166 166 For all simple attributes, there are getter and setter methods: ... ... @@ -179,13 +179,9 @@ 179 179 List references (multiplicity of > 1) have only a list getter, which is used to manipulate the list: 180 180 181 181 {{code language="java"}} 182 -state. getOutgoingTransitions().add(transition);109 +state.outgoingTransitions.add(transition); 183 183 {{/code}} 184 184 185 -{{info title="Plugin Dependencies"}} 186 -You may have noticed that is was not necessary to add a dependency for the kexpressions classes. The SCCharts plugin reexports the dependencies of the other EMF metamodels. Look at the plugin.xml in the SCCharts plugin in the dependency tab for more information. 187 -{{/info}} 188 - 189 189 == Saving a Model == 190 190 191 191 EMF uses the [[Eclipse Resource concept>>url:http://help.eclipse.org/juno/topic/org.eclipse.platform.doc.isv/guide/resInt.htm?cp=2_0_10||rel="nofollow" shape="rect" class="external-link"]] to save models to files and load models from files. It can use different //Resource Factories// that determine how exactly models are serialized. We will use the [[XMIResourceFactoryImpl>>url:http://download.eclipse.org/modeling/emf/emf/javadoc/2.8.0/org/eclipse/emf/ecore/xmi/impl/XMIResourceFactoryImpl.html||rel="nofollow" shape="rect" class="external-link"]] to save our models to XML files: ... ... @@ -230,17 +230,7 @@ 230 230 1. Execute the main method. 231 231 1. Inspect your SCT file. 232 232 1. Start your SCChart Editor Eclipse instance and load your SCT file. KLighD should now be able to visualize your ABO correctly. 233 -{{/layout-cell}} 234 -{{/layout-section}} 235 235 236 -{{layout-section ac:type="single"}} 237 -{{layout-cell}} 238 - 239 -{{/layout-cell}} 240 -{{/layout-section}} 241 - 242 -{{layout-section ac:type="single"}} 243 -{{layout-cell}} 244 244 = Transforming SCCharts = 245 245 246 246 Transformations from one model to another may be performed within the same metamodel or from metamodel to a different metamodel. Both methods are used in KIELER and in principle they do not really differ in implementation. Nevertheless, if working within the same metamodel you should keep in mind that you're potentially changing the actual model instead of changing another instance (after copying). Both is possible. Just make sure that you know what you're doing. ... ... @@ -483,6 +483,3 @@ 483 483 Congratulations! You finished the SCCharts Development Tutorial. Ask your supervisor for further instructions! 484 484 485 485 486 -{{/layout-cell}} 487 -{{/layout-section}} 488 -{{/layout}}
- Confluence.Code.ConfluencePageClass[0]
-
- Id
-
... ... @@ -1,1 +1,1 @@ 1 -16810 3181 +16810255 - URL
-
... ... @@ -1,1 +1,1 @@ 1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/TUT/pages/16810 318/SCCharts Development1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/TUT/pages/16810255/SCCharts Development