Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Papyrus/customizations/manufacturing/aas/jdt"

(JDT Integration)
(Editing operations code)
Line 16: Line 16:
 
[[File:AAS48.png|900px]]
 
[[File:AAS48.png|900px]]
  
To be able to see the synchronisation between the JDT editor and the AAS Model content, make sure that the AAS model editor and the java file JDT editor are opened side by side as shown in the figure below.  
+
The user can edit there the method implementation and save the Java file. (see Figure below).
  
It is possible to move the java file editor tab and place it side by side with the AAS Model editor in the editors zone.
+
[[File:AAS70_01.png|900px]]
  
[[File:AAS48_01.png|900px]]
+
This will trigger the CanvAAS JDT synchronization to include this new implementation in the model (see Figure below).
 +
 
 +
[[File:AAS70_02.png|900px]]
 +
 
 +
Each time the user regenerate the code from its AAS, this implementation will be automatically generated. At the other hand, the user can modify the implementation of the operation in the model, and again thanks to the JDT synchronization functionality, this will trigger the change of the method implementation in the generated java file.
 +
 
 +
It is worth to note that the synchronization functionality only concerns the method implementation update:  the user is not allowed to modify the method signature since this can cause compilation errors in the whole Java project generated by BaSyx.
 +
 
 +
For connected submodelElements (Property, SEC and File) the user can get the value of those dynamic properties from the server. Thus, a “get” Operation is generated for each dynamic connected submodelElement. The synchronization functionality is also available for “get” Operations generated from the connected submodelElements. Thus, the user can edit in the generated java file the implementation of a generated “get” Operation and its implementation will be synchronized in the Canvaas model.
 +
 
 +
[[File:AAS70_03.png|900px]]

Revision as of 11:25, 6 December 2022

JDT Integration

In order to edit the behavior of the submodel operations in CanvAAS, we have developed an integration functionality between CanvAAS modeling editors and the Eclipse Java development tools (JDT) . This integration is closely linked to the code generation and synchronization task. In fact, after defining a submodel operation, the user is able to specify the implementation of the operation in Java code. However, it is more intuitive for the user to edit the implementation of the operation in a JDT Editor and not directly in the model. Thus, the user can benefits from the completion and the automatic compilation of the java code provided by the JDT Editor.

In order to keep both possibilities of defining an implementation of a submodel operation (1) Directly in a Java Editor and (2) in the AAS model itself, AAS Designer offers the JDT synchronization functionality that consist in synchronizing this implementation in both direction from the model to the java code and from the java code to the model.

Editing operations code

After generating Basyx code from an AAS using the menu:

AAS -> Generate Basyx code, you can edit the JAVA code of submodel operations using the Eclipse JDT editor.

This java code, if edited, will update the AAS model content (operation's name and parameters) and will be stored inside the model.

To launch the JDT editor, right click on the operation in the model Explorer and click on Designer -> launch JDT editor:

AAS48.png

The user can edit there the method implementation and save the Java file. (see Figure below).

AAS70 01.png

This will trigger the CanvAAS JDT synchronization to include this new implementation in the model (see Figure below).

AAS70 02.png

Each time the user regenerate the code from its AAS, this implementation will be automatically generated. At the other hand, the user can modify the implementation of the operation in the model, and again thanks to the JDT synchronization functionality, this will trigger the change of the method implementation in the generated java file.

It is worth to note that the synchronization functionality only concerns the method implementation update: the user is not allowed to modify the method signature since this can cause compilation errors in the whole Java project generated by BaSyx.

For connected submodelElements (Property, SEC and File) the user can get the value of those dynamic properties from the server. Thus, a “get” Operation is generated for each dynamic connected submodelElement. The synchronization functionality is also available for “get” Operations generated from the connected submodelElements. Thus, the user can edit in the generated java file the implementation of a generated “get” Operation and its implementation will be synchronized in the Canvaas model.

900px

Back to the top