Use the New Model Wizzard to create a new eTrice project and name it PedLightsController.
Copy the package org.eclipse.etrice.tutorials.PedLightGUI to your src directory (see blinky tutorial).
In PedestrianLightWndNoTcp.jav uncomment line 15 (import), 36, 122 (usage) and 132-134 (registration). The error markers will disappear after the code is generated from the model.
Copy the model from /org.eclipse.etrice.tutorials/model/PedLightsController to your model file, or run the model directly in the tutorial directory.
Adapt the import statement to your path.
import room.basic.service.timing.* from "../../org.eclipse.etrice.modellib/models/TimingService.room"
Generate the code from the model.
Add the org.eclipse.etrice.modellib to the Java Class Path of your project.
All error markers should be disappeared and the model should be operable.
Arrange the Structure and the Statemachines to understand the model
The GuiAdapter represents the interface to the external code. It registers its ControlPort by the external code.
Visit the initial transition to understand the registration. The actor handles the incoming messages as usual and controls the traffic lights as known from blinky.
The Controller receives the start message and controls the timing of the lights. Note that the start message will be sent from the external code whenever the REQUEST button is pressed.
Visit the model and take a closer look to the following elements:
PedControlProtocol => notice that the start message is defined as usual
Initial transition of the GuiAdapter => see the registration
The Controller => notice that the Controller receives the external message (not the GuiAdapter). The GuiAdapter just provides its port and handles the incoming messages.
Visit the hand written code => see the import statement of the protocol class and the usage of the port.
Generate and test the model
Take a look at the generated MSC => notice that the start message will shown as if the GuiAdapter had sent it.