Skip to content

Commit 2b95182

Browse files
Doc updates for 2.0.1
1 parent 894644a commit 2b95182

7 files changed

Lines changed: 15 additions & 160 deletions

File tree

art-samples/TrafficLightWeb/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
This sample implements a traffic light system consisting of two lights (one for traffic and one for pedestrians) and a push button (for pedestrians to push when they want to safely cross the street). The realtime application uses the [TCPServer library](../TcpServer/README.md) in order to communicate with a Node.js web application. Information about current states of the lights are updated on the web page in real time, and pushing the button on the web page will inject the request from the pedestrian to cross the street.
55

6-
To be able to intercept the outgoing messages about light changes, the Node.js application embeds a simple TCP server. Hence, this sample implements bi-directional communication using two separate TCP servers (one in the Node.js application and one in the realtime C++ application).
6+
To be able to intercept the outgoing messages about light changes, the Node.js application embeds a simple TCP server (using the library [rt-tcp-utils](https://www.npmjs.com/package/rt-tcp-utils)). Hence, this sample implements bi-directional communication using two separate TCP servers (one in the Node.js application and one in the realtime C++ application).
77

88
## Starting the web server
99
`cd webapp`

art-samples/TrafficLightWeb/webapp/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function msgReceived(msg) {
7171
}
7272
}
7373

74-
const tcpServer = require('./tcp-server')('localhost', 9911); // Send TCP requests to RT app on port 9911
74+
const tcpServer = require('rt-tcp-utils')('localhost', 9911); // Send TCP requests to RT app on port 9911
7575

7676
tcpServer.setEventReceivedCallback(msgReceived);
7777
tcpServer.startListenForEvents(2234) // Receive TCP requests from RT app on port 2234

art-samples/TrafficLightWeb/webapp/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
"name": "trafficlight-webapp",
33
"version": "0.0.1",
44
"private": true,
5-
"description": "TrafficLight web app that uses rt-test-probe for communicating with the realtime app and websocket for communicating with the web page",
5+
"description": "TrafficLight web app that uses rt-tcp-utils for communicating with the realtime app and websocket for communicating with the web page",
66
"keywords": [],
77
"author": "Mattias Mohlin",
88
"license": "MIT",
99
"main": "app.js",
1010
"dependencies": {
11-
"express": "^4.12.3",
12-
"socket.io": "^2.1.1"
11+
"express": "^4.21.1",
12+
"socket.io": "^4.8.0",
13+
"rt-tcp-utils": "^0.0.1"
1314
},
1415
"scripts": {
1516
"start": "node app.js"

art-samples/TrafficLightWeb/webapp/tcp-server.js

Lines changed: 0 additions & 153 deletions
This file was deleted.

docs-sources/running-and-debugging/debugging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ You can send an event by clicking the **Send Event** arrow that appears when you
117117

118118
![](images/send_event.png)
119119

120-
A popup appears where you can select the event you want to send on that port. All ports defined in the protocol that types the port are shown, and if an event has a data parameter, the type of that parameter is also shown.
120+
A popup appears where you can select the event you want to send on that port. All events defined in the protocol that types the port are shown, and if an event has a data parameter, the type of that parameter is also shown. You can send events both in to the port, and out from the port. If the selected port is not conjugated the in-events of the port's protocol will be sent in to the port, and the out-events will be sent out from the port. If the port is conjugated it becomes the other way around. The popup that lists the events shows icons that tell if the event will be sent in to the port (→◼) or out from the port (◼→).
121121

122122
![](images/select_event.png)
123123

3.34 KB
Loading

docs-sources/samples.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,19 @@ This sample shows how to use [dependency injection](https://en.wikipedia.org/wik
5454
**TargetRTS:** [RTInjector](targetrts-api/class_r_t_injector.html), [RTActorFactoryInterface](targetrts-api/class_r_t_actor_factory_interface.html)
5555

5656
## [QtTrafficLight](https://github.com/secure-dev-ops/code-realtime/tree/main/art-samples/QtTrafficLight)
57-
This application has a user interface developed with [Qt](https://www.qt.io/) which controls a realtime application that implements the logic of a traffic light that works together with a pedestrian light.
57+
This application has a user interface developed with [Qt](https://www.qt.io/) which controls a realtime application that implements the logic of a traffic light that works together with a pedestrian light. Note that you need to have [Qt](https://www.qt.io/) installed to build and run this sample.
5858

5959
**Art:** [composite state with entry- and exitpoint](art-lang/index.md#hierarchical-state-machine), [external port](target-rts/integrate-with-external-code.md#external-port), [notification port](art-lang/index.md#notification-port), [internal transition](art-lang/index.md#internal-transition)
6060

6161
**TargetRTS:** [RTTiming](targetrts-api/class_timing_1_1_base.html)::cancelTimer()
6262

63+
## [TrafficLightWeb](https://github.com/secure-dev-ops/code-realtime/tree/main/art-samples/TrafficLightWeb)
64+
This sample is similar to [QtTrafficLight](#qttrafficlight) but the user interface is instead implemented as a Node.js web application. The application uses the [TCPServer library](https://github.com/secure-dev-ops/code-realtime/tree/main/art-samples/TcpServer) and the Node.js application therefore can use the [rt-tcp-utils](https://www.npmjs.com/package/rt-tcp-utils) library for communicating with it. Communication between the Node.js application and the web page uses [socket.io](https://socket.io/).
65+
66+
**Art:** [junction point](art-lang/index.md#choice-and-junction)
67+
68+
**TargetRTS:** Extracting command-line arguments by means of [RTMain](targetrts-api/class_r_t_main.html)::argCount() and [RTMain](targetrts-api/class_r_t_main.html)::argStrings()
69+
6370
## [TcpRangeCounter](https://github.com/secure-dev-ops/code-realtime/tree/main/art-samples/TcpRangeCounter)
6471
This sample uses the [TCPServer library](https://github.com/secure-dev-ops/code-realtime/tree/main/art-samples/TcpServer) which makes it possible to communicate with the application from the "outside" by means of making TCP requests. Two sample client applications for making such requests are included:
6572

0 commit comments

Comments
 (0)