PENDING
Whatever the chosen graphical UML editor, you have to model your RTSJ application respecting some design rules in order that the UML data are correctly interpreted by the code generator. Besides, this allows you to be understood by all the users of this tool.
The services to expose have to be defined in UML Interfaces.
According to the nature of the UML Interface, these services will be modeled as UML Operation or UML Reception:
When you create a UML Reception, you have to set the signal property with a previously created UML Signal which contains potential UML Property parameters.
You can define a component definition creating a UML Class with a UML Port inside at least.
Then, on each of its input ports, you have to set the type property with the UML Interface which provides the services to expose through this port.
In the context of your applicative system to design, you are going to instantiate your components from the definitions and to choose to make them communicate from some way.
Your system has to be represented by a UML Class stereotyped <<Root>>.
The instantiation of a component is modeled, in this UML Class, by a UML Property which references the component definition with the type property.
To make communicate two components through an output and input port, you have to:
You have to set several properties for your UML Property:
For example, if you want to model a "buffer" UML Property, in a UML Class, as an array of byte with a max size equals to Constants.TELECOMMAND_MAX_LENGTH, you have to:
|
|
|
So, this code will be generated:
private byte[] buffer = new byte[Constants.TELECOMMAND_MAX_LENGTH];
For a unary cardinality, you can set the default property with the Java code to initialize this attribute (without ";" at the end).
For example, if you want to model a "station" UML Property, in a UML Class, you have to:
|
|
|
So, this code will be generated:
public Station station = new Station();
For a multiple cardinality, the default property has to be used to define the size of the array (like the primitive types). In this case, the aggregation property has to be set as "Composite".
For example, if you want to model a "stations" UML Property, in a UML Class, as an array of Station with a max size equals to Constants.MISSION_HDSTATIONLIST_LENGTH, you have to:
|
|
|
So, this code will be generated:
@part
public Station[] stations = new Station[Constants.MISSION_HDSTATIONLIST_LENGTH];
{
for (int i = 0; i < stations.length; i++) {
stations[i] = new Station();
}
}
A UML State Machine can be created on any UML Class.
PENDING
To apply an Ethernet configuration on your UML model for the code generation, you have to create an ETH model:
File > New > Other... > Example EMF Model Creation Wizards > Eth Model
|
|
|
Then, you have to load the resource related to the UML model you want to configure, from this ETH model:
Right click on the background of the ETH model editor > Load Resource...
Then, select the UML Connectors you want to apply an Ethernet configuration:
|
|
|
Note: The label of the displayed
UML Connectors could be improved. The component instance name should be displayed instead of the component definition one.
Then, create an Ethernet container to address your component instances concerned by this kind of communication:
Then, define the related components to locate under this Ethernet container and specify the IP Address and port number:
|
|
|
Only the components concerned by an Ethernet connector will be proposed on the left side of this wizard.
2 steps are required to launch a code generation:
Right click on the UML model you want to take as input of the generation > Properties > Uml2AutojavaComponent section.
This configuration will be stored on the current workspace. So, it will be saved for next generations.
Right click on the UML model you want to take as input of the generation. Then, you have the choice between 3 options: 1. Generate Autojava Components (only communication) : It generates only the code related to the communication between the component instances. 2. Generate Autojava Components (only components) : It generates only the code related to the components themselves. 3. Generate Autojava Components (All) : It generates the 2 parts.
PENDING
PENDING
PENDING
PENDING
PENDING
PENDING
PENDING
PENDING
PENDING
PENDING
PENDING
PENDING
PENDING
PENDING
PENDING