|
Re: External Interface [message #990183 is a reply to message #990115] |
Tue, 11 December 2012 10:18 |
Thomas Jung Messages: 12 Registered: February 2011 |
Junior Member |
|
|
Hi Tim,
yes, you will find the registration method within the manual code of the tutorial "PedestrianLight":
/org.eclipse.etrice.tutorials.java/src/org/eclipse/etrice/tutorials/PedLightGUI/PedestrianLightWndNoTcp.java
at line 131:
// This is used for PedLightController tutorial and must be disabled for Blinky
public void setPort(PedControlProtocolConjPort p){
port=p;
}
In the tutorial model, this method will be called on the initial transition of the "GuiAdapter" actor. You can see, that the manual code must know the generated protocol class at this point. Other than in OT you can define your own protocoll class, with as many messages as you want. You must not relay on a predefined protocol class (External) as in OT.
The actor "GuiAdapter" from the tutorial, is able to receive messages from the model and may call methods from the manual code. In the other direction, the manual code is able to send messages via rgistered ports (e.g. if the "request" button is pressed, same file line 119):
if (s.equals("REQUEST")) {
System.out.println("Taste gedrückt");
// This is used for PedLightController tutorial and must be disabled for Blinky
if (port != null) port.start();
}
}
The "GuiAdapter" actor provides full protection, because sending messages (even from the manual code) takes place via the protected queue.
Could i answere your question?
Best Regards
Thomas
|
|
|
|
Powered by
FUDForum. Page generated in 0.02415 seconds