Description
To show the possibilities of the tool AutoFocus an online
simulation was created. Out of a designed model of a traffic light, java code was
generated.
Due to a client-server architecture the generated code can be connected to a
server that makes the visual presentation of the model possible.
The Server
The server provides an interface for direct interaction. A socket can be opened for communication. Due to this interface a visualisation of the model is realized. The in and output ports are mapped to certain commands that are sent respectively received from the client.
The Client
In the HTML-page a java-applet is loaded that opens a connection to the server. Commands from the server are sent via the applet to the JavaScript-engine of the browser. This way objects inside the HTML-page can be manipulated.
The Model
The model is a simple traffic light system that provides the possibility to request green light for pedestrians. You can download the AutoFocus qml- file here for further examination. Out of this model java source code is generated. See part of it or download complete.
Usage
Supported Browsers :
Due to incomplete implementation of the JavaScript engine of several
browsers only these ones are supported:
IE5.X
NS4.7
NS6 is definitely not supported.
If the page does not load correctly, please do not press the "reload
button". Go back to this page and start the visualisation again with
the link below.
Actions :
To connect to the server first of all press the "open Socket"
button in the applet. In the memo field you can watch the communication and
other status messages. For requesting green traffic light, press the button
in the middle of the forehold traffic light. Watch the lights change. As
there is only one java-service running on the machine another person may
have clicked the button, so do not be surprised if traffic lights change
without your interaction.
After 20min of idle time you are automatically disconnected from the server.
You will receive exception messages from the applet. To restart the
simulation again, just reload this page and follow the link below.