Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
flight-scripts
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
1
Merge Requests
1
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
nexedi
flight-scripts
Commits
c55e7090
Commit
c55e7090
authored
May 24, 2023
by
Léo-Paul Géneau
👾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stop running script interactively
The script is now run as a SlapOS service and not manually.
parent
50afd61b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
11 deletions
+6
-11
subscribe.js
subscribe.js
+6
-11
No files found.
subscribe.js
View file @
c55e7090
...
...
@@ -4,16 +4,11 @@
*/
/*jslint nomen: true, indent: 2, maxerr: 3, maxlen: 80 */
/*global
console,
me*/
/*global me*/
(
function
(
console
,
me
)
{
(
function
(
me
)
{
"
use strict
"
;
me
.
onStart
=
function
()
{
me
.
f
=
me
.
fdopen
(
me
.
in
,
"
r
"
);
console
.
log
(
"
Use q to quit
"
);
};
me
.
onUpdate
=
function
(
timestamp
)
{
var
drone_dict
=
{};
Object
.
entries
(
me
.
getDroneDict
()).
forEach
(
function
([
id
,
drone
])
{
...
...
@@ -24,7 +19,8 @@
yaw
:
drone
.
yaw
.
toFixed
(
2
),
speed
:
drone
.
speed
.
toFixed
(
2
),
climbRate
:
drone
.
climbRate
.
toFixed
(
2
),
timestamp
:
drone
.
timestamp
timestamp
:
drone
.
timestamp
,
log
:
drone
.
log
};
});
me
.
writeWebsocketMessage
(
JSON
.
stringify
({
drone_dict
:
drone_dict
}));
...
...
@@ -42,8 +38,7 @@
me
.
sendMsg
(
JSON
.
stringify
({
status
:
"
stopped
"
}));
break
;
case
"
switch
"
:
leader_id
=
leader_id
==
0
?
1
:
0
;
me
.
sendMsg
(
JSON
.
stringify
({
leader_id
:
leader_id
,
status
:
"
switch
"
}));
me
.
sendMsg
(
JSON
.
stringify
({
status
:
"
switch
"
}));
break
;
default
:
me
.
writeWebsocketMessage
(
"
Unknown instruction
"
+
msg
);
...
...
@@ -53,4 +48,4 @@
me
.
onGetMsg
=
function
(
msg
)
{
me
.
writeWebsocketMessage
(
msg
);
};
}(
console
,
me
));
}(
me
));
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