Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Łukasz Nowak
slapos
Commits
d94ee240
Commit
d94ee240
authored
Oct 24, 2023
by
Léo-Paul Géneau
👾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software/js-drone: add timestamps to the gui
Indicate the time of the last received message in format hh:mm:ss .
parent
d93a96a4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
2 deletions
+12
-2
software/js-drone/README.md
software/js-drone/README.md
+1
-0
software/js-drone/buildout.hash.cfg
software/js-drone/buildout.hash.cfg
+2
-2
software/js-drone/web-gui/index.html.jinja2
software/js-drone/web-gui/index.html.jinja2
+6
-0
software/js-drone/web-gui/script.js.jinja2
software/js-drone/web-gui/script.js.jinja2
+3
-0
No files found.
software/js-drone/README.md
View file @
d94ee240
...
@@ -47,6 +47,7 @@ For each drone is displayed:
...
@@ -47,6 +47,7 @@ For each drone is displayed:
*
the yaw angle in degrees
*
the yaw angle in degrees
*
the speed (ground speed for multicopters, airspeed for fixed wings) in meters per second
*
the speed (ground speed for multicopters, airspeed for fixed wings) in meters per second
*
the climb rate in meters per second
*
the climb rate in meters per second
*
the timestamp of the position in format hh:mm:ss
### Buttons
### Buttons
...
...
software/js-drone/buildout.hash.cfg
View file @
d94ee240
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
# not need these here).
# not need these here).
[index-html]
[index-html]
_update_hash_filename_ = web-gui/index.html.jinja2
_update_hash_filename_ = web-gui/index.html.jinja2
md5sum =
94479f7e7299650fc41878fab06e6555
md5sum =
8c18ed73d4b8212106f226d95c0ae3f3
[instance-profile]
[instance-profile]
filename = instance.cfg.in
filename = instance.cfg.in
...
@@ -38,7 +38,7 @@ md5sum = 1555496ad591a31a845f33488d5c335d
...
@@ -38,7 +38,7 @@ md5sum = 1555496ad591a31a845f33488d5c335d
[script-js]
[script-js]
_update_hash_filename_ = web-gui/script.js.jinja2
_update_hash_filename_ = web-gui/script.js.jinja2
md5sum =
a88028c1248d2b6a91b7d3cb0304719
6
md5sum =
dfa140d70d8a9cadc6cee865be4e8c2
6
[worker]
[worker]
_update_hash_filename_ = drone-scripts/worker.js.jinja2
_update_hash_filename_ = drone-scripts/worker.js.jinja2
...
...
software/js-drone/web-gui/index.html.jinja2
View file @
d94ee240
...
@@ -124,6 +124,12 @@
...
@@ -124,6 +124,12 @@
<td
id=
"climb_rate_{{ i }}"
></td>
<td
id=
"climb_rate_{{ i }}"
></td>
{% endfor %}
{% endfor %}
</tr>
</tr>
<tr>
<th>
Timestamp (hh:mm:ss)
</th>
{% for i in range(int(nb_drones)) -%}
<td
id=
"timestamp_{{ i }}"
></td>
{% endfor %}
</tr>
</table>
</table>
</div>
</div>
...
...
software/js-drone/web-gui/script.js.jinja2
View file @
d94ee240
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
QUIT_BTN_ID = "quit-btn",
QUIT_BTN_ID = "quit-btn",
RED_BTN_CLASS_NAME = "red-button",
RED_BTN_CLASS_NAME = "red-button",
SWITCH_BTN_ID = "switch-btn",
SWITCH_BTN_ID = "switch-btn",
TIMESTAMP_BASE_ID = "timestamp_",
WEB_SOCKET_STATUS_OUTPUT_ID = "web-socket-status",
WEB_SOCKET_STATUS_OUTPUT_ID = "web-socket-status",
YAW_BASE_ID = "yaw_",
YAW_BASE_ID = "yaw_",
socket;
socket;
...
@@ -62,6 +63,7 @@
...
@@ -62,6 +63,7 @@
socket.onmessage = function (event) {
socket.onmessage = function (event) {
var color_array,
var color_array,
date,
flight_state_cell,
flight_state_cell,
i,
i,
message = JSON.parse(event.data),
message = JSON.parse(event.data),
...
@@ -78,6 +80,7 @@
...
@@ -78,6 +80,7 @@
document.getElementById(YAW_BASE_ID + id).innerHTML = drone["yaw"];
document.getElementById(YAW_BASE_ID + id).innerHTML = drone["yaw"];
document.getElementById(SPEED_BASE_ID + id).innerHTML = drone["speed"];
document.getElementById(SPEED_BASE_ID + id).innerHTML = drone["speed"];
document.getElementById(CLIMB_RATE_BASE_ID + id).innerHTML = drone["climbRate"];
document.getElementById(CLIMB_RATE_BASE_ID + id).innerHTML = drone["climbRate"];
document.getElementById(TIMESTAMP_BASE_ID + id).innerHTML = new Date(drone["timestamp"]).toLocaleTimeString('fr-FR');
});
});
} else if (message.hasOwnProperty("state") && message.hasOwnProperty("id")) {
} else if (message.hasOwnProperty("state") && message.hasOwnProperty("id")) {
flight_state_cell = document.getElementById(FLIGHT_STATUS_BASE_ID + message['id']);
flight_state_cell = document.getElementById(FLIGHT_STATUS_BASE_ID + message['id']);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment