Service Robotics Research Center
at Ulm University of Applied Sciences

User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
how-tos:documentation-datasheet:start [2019/12/10 09:35]
Alex Lotz
how-tos:documentation-datasheet:start [2019/12/12 17:43]
Dennis Stampfer
Line 14: Line 14:
-===== Using the Component ​Documentation ​Model =====+===== Documenting ​the Component Model =====
-In order to use the ComponentDocumentation feature in the SmartMDSD Toolchain, ​please manually create a new model file with the extension **.componentDocumentation** within ​the subfolder **model** of your component project. You can do this as follows:+Since SmartMDSD Toolchain ​version 3.12, the overall documentation is split into two main parts, one is the explicit digital datasheet ​model for non-technical properties (see the next section below) and the other is the implicit annotation ​of technical models (as described next).
-{{ :how-tos:documentation-datasheet:​newfilefordocu.png?500|}}+For technical ​documentation, you don't have to create any new models, but rather directly document your model elements as part of the technical model itself. In order to better distinguish the documentation from the actial model elements and for a most intuitive experience, we have adopted the notion of **doxygen-like code comments** in our textual modelsSo in order to document any model element, just add **a comment above a specific element**. Here we distinguish between two types of comments. One is the multiline comment that looks like this:
-  ​Select the **model** folder of your component project in the **Model Explorer** view +{{ :how-tos:documentation-datasheet:componentdocumentationdemo.png |}}
-  - Use the Eclipse menu**File** ​-> **New** -> **File** +
-  - Provide the model file name, e.g.**SmartCdlServer.componentDocumentation** (use your component name, but keep the file extension)+
-Your menu wizard should look as shown in the screenshot ​on the right.+At the top in the screenshot ​you can see the textual representation of the component model and as an example, the ouput port named JoystickServiceOut has a green comment above it. Please note the **two asterisks** after the slash **%%/​**%%**. A comment with two asterisks at the beginning is interpreted as an intentional documentation element, while a regular comment with only one asterisk after the slash %%/*%% is interpreted as a regular comment that is entirely ignored by the model interpreter. Regular comments can be used for example to temporarily comment out parts of the model or write any other comments that are not related to the model or documentation. Please also notice, each model element can have zero or exactly one documentation element that must be placed above the element to document, but an arbitrary number of regular comments that can be placed anywhere in the model. Moreover, you can use simple [[https://​​html/​html_formatting.asp|HTML text formatting tags]] which are interpreted at multiple places for formating the documentation comments. Please further notice that the optional astersisks (at the left side of the comment) are later parsed away for the actual documentation,​ so you don't have to care about them too much, they mostly serve a cosmetic purpose and are unrelated to the actual documentation.
-Now you can provide ​the content ​of the ComponentDocumentation ​model as shown in the screenshot ​belowAs soon as you save the ComponentDocumentation model, it will generate ​the file that uses the markdown ​syntax ​which can be interpreted by e.g. the github repository where this component might be hostedFor the SmartCdlServer example ​the output can be viewed here:+Next, at the center of the above screenshot, ​you can see the graphical diagram ​of the example component ​model with the selected output port JoystickServiceOut,​ whose properties are further ​shown at the botton of the screenshot ​within the **Properties** tabThere you can see the same documentation comment and you can even directly modify its contents directly from the Properties tabPlease be aware that you still have to use the doxygen-like ​syntax ​with the %%/**%% tag as explained for the textual part aboveRegardless of from which model editor (graphical or textual) you create ​the documentation elements, ​the respective other representation will be automatically synchronized as soon as you save the model.
-https://​​Servicerobotics-Ulm/​ComponentRepository/​tree/​master/​SmartCdlServer+The doxygen-like documentation capability is not limited to the component model, but is a recurring functionality in many other models as well. For instance, the component parameters can be documented in the same way as shown in the next screenshot:
-{{ :​how-tos:​documentation-datasheet:​smartcdlserverdocuscreenshot.png |}}+{{ :​how-tos:​documentation-datasheet:​cdlparametersdocumentation.png |}}
 +Here you can see the parameters of the CDL component (as an example) that are documented individually using the same comment-like syntax. As can bee seen not every element strictly has to be documented (although we highly recommend to do so), and you don't have to use multiple lines for documentation,​ single line comments are fine as well.
-Please note that **the ComponentDocumentation DSL is considered depricated** and its features are currently being migrated to the Digital Datasheet Model (see next section). 
 +===== Adding further Non-technical Meta-Data Elements to the Component Model =====
 +Since SmartMDSD Toolchain version 3.12, the **ComponentDatasheet** has been refined such that it solely focusses on the non-technical,​ yet structured documentation and annotation for meta-data elements such as e.g. the used license, the manufacturer and other non-technical attributes (descriptive information,​ also semantic information). Please notice, that the **ComponentDatasheet** model now replaces the old Component Documentation model, which is even deactivated since the SmartMDSD Toolchain version 3.12.
-===== Using the Digital Data Sheet Model =====+You can easily create a new **ComponentDatasheet** model as follows (see also the following screenshot):​
-Since SmartMDSD Toolchain version 3.7, new more powerful modeling feature provides a richer documentation capability for the following ​project ​types+  * Select ​project in the SmartMDSD Project Explorer window at the left side of the Eclipse window 
 +  * Right click on the project ​and click at the context menu**New** => **SmartMDSD Model...**
-  * for **DomainModels** projects**DomainModelsDatasheet** (file extension **.domainModelsDatasheet**) +{{ :how-tos:​documentation-datasheet:newsmartmdsdmodelwizard.png |}}
-  * for **Component** projects**ComponentDatasheet** (file extension **.componentDatasheet**)+
-These DSLs are by themselves kept slim as they focus on describing non-technical metadata of the respective ​project ​and at the same time collect technical documentation directly from the respective technical modelsAs an example we will provide technical documentation for the **CommJoystick** communication object (see the following screenshot).+A new popup window will appear where you will see the selected ​project. ​Please press the **Next** button so you should ​see this window:
-{{ :​how-tos:​documentation-datasheet:​commjoystickdocu.png |}}+{{ :​how-tos:​documentation-datasheet:​newcomponentdsmodelwizard.png |}}
-As shown in the screenshot above, you can document your model elements using a Javadoc-like syntax. Please note, that these comments are not only local comments, instead they are later collected from the respective Datasheed model to generate different Datasheet representations such as e.g. the RDF/TTL for importing in semantic triple-stores (as shown below). 
-{{ :how-tos:​documentation-datasheet:​newdomainmodelsds.png?​500|}}+Here you should activate the checkbox for the **ComponentDatasheet** model type and press the **Finish** button to create the model in your project. If you now check the model folder of your project at the right side in the SmartMDSD Project Explorer, you should now see a new model with the file extension **.componentDatasheet**:
-You can now create a new DomainModels Datasheet as follows:+{{ :how-tos:​documentation-datasheet:​generatecomponentdocumentation.png |}}
-  - Select ​the **model** folder of your current project ​in the **Model Explorer** view +Also, the component datasheet ​model will automatically open in the textual model editor as shown at the center of the above screenshot. Here you can add an arbitrary number of further custom ​**DatasheetPropert** elements. Each **DatasheetProperty** requires a **name** and a **value**. In additiona **semanticID** and a **shortDescription** can be addedThe **value** can be any string that makes sense in the context of the respective propertyThe **semanticID** is used to optionally reference an external specification of the property which can be e.g. an externally defined ontology, or any other taxonomy.
-  - Use the Eclipse menu: **File** -> **New** -> **File** +
-  - Provide the model file namee.g.: **CommBasicObjects.domainModelsDatasheet** (use your project name, but keep the file extension)+
-Your menu wizzard should look as shown in the screenshot ​on the right.+When you have provided all the required properties, you can now trigger the code generation (as shown in the above screenshot). Therefore, **select ​the project within the SmartMDSD Project Explorer** for which you want to trigger the code generator, and then use the Eclipse menu **SmartMDSD** => **Run Code-Generation**. This will generate two main outputs as described below
-You can now provide the non-technical information such as e.g. the used License in this model file. As soon as you save the model, it will collect all the technical information from related models and non-technical information and generate the supported Datasheet types. At the moment we already support the RDF/TTL syntax for importing in semantic triple-stores. An example is shown in the screenshot below. Please note, that the previously defined comments from the **CommJoystick** are also reflected in the generated Datasheet syntax.+{{ :how-tos:​documentation-datasheet:​componentdocumentationreadme.png |}}
-{{ :how-tos:documentation-datasheet:​commbasicobjectsds.png |}}+The code generation for the **ComponentDatasheet** model will generate two files, one is the **** file that will collect all the technical ​documentation ​comments from all related technical models, as well as the non-technical properties from the datasheet ​model itself. You can vew the contents of the Readme by double clicking at it. Please don't modify the generated file manually as all the manual changes will be whiped out the next time the code generation is triggered again. Instead you should provide the respective documentation directly within the models as described in the preceeding sections above and trigger the code generation again to update the Readme file. As a nice side effect, the file uses a markdown syntax that is compatible with the [[​features/​mastering-markdown/​|Github markdown syntax]], so that the readmes are nocely renderred when uploading the projects to Github.
-The documentation ​of the Component ​model works analogously to the DomainModels,​ with the only difference of the Datasheet file extension which is **.componentDatasheet**.+The second output ​of the **ComponentDatasheet** ​model is the **.ttl** file located in the new **datasheet-gen** subfolder. This file uses the RDF/TTL syntax for importing in semantic triple-stores. We might add further output formats in the future releases of the SmartMDSD Toolchain.
-Please ​notethat the Datasheet feature will someday entirely replace ​the former "​ComponentDocumentation"​ DSL (see above section).+Please ​notice, the documentation outputs are only generated if the respective project has a valid **ComponentDatasheet** model which acts as root model for code generation. This means that while you can (and shouldprovide technical documentation within technical models as described above, their output in the different datasheet formats will first take effect when you create a datasheet model. After that, you can modify any of the models as needed and the datasheet outputs will collect all the updates of all the models and re-combine them in the collective outputs.
 +The documentation of the **DomainModel** and **System** projects works analogously to the here presented **Component** documentation,​ with the only difference of the Datasheet file extensions which are analogously **.domainModelsDatasheet** and **.systemDatasheet**.
 +===== Free Form Documentation =====
 +To describe and document the algorithm that you implemented in a component, component behavior, or anything that is not covered by the above means for documentation,​ proceed as follows:
 +  * Create a folder "​documentation"​ in your project root
 +  * Place at least a in that folder and put your documentation in markdown into that file
 +  * Feel free to add any figures and further .md files to the documentation/​ folder. Make sure to link to them via
 ===== Acknowledgements ===== ===== Acknowledgements =====
how-tos/documentation-datasheet/start.txt · Last modified: 2019/12/12 17:43 by Dennis Stampfer