Commit d93a96a4 authored by Léo-Paul Géneau's avatar Léo-Paul Géneau 👾

software/js-drone: update subscriber description

parent 53b89db1
...@@ -22,11 +22,11 @@ md5sum = e0ea95530bf84edfc37eea994cc9ee86 ...@@ -22,11 +22,11 @@ md5sum = e0ea95530bf84edfc37eea994cc9ee86
[instance-default] [instance-default]
filename = instance-default.cfg.jinja2 filename = instance-default.cfg.jinja2
md5sum = 5c8ebd1f9ca3024d083b0652868e2f71 md5sum = 069f8947c55420ec013497d9eba56252
[instance-peer] [instance-peer]
filename = instance-peer.cfg.jinja2.in filename = instance-peer.cfg.jinja2.in
md5sum = d12fbb134c587173ddff46ff1bc6ffe7 md5sum = 328ba59583e7b47ab9e1a184ac8a201f
[main] [main]
_update_hash_filename_ = drone-scripts/main.js.jinja2 _update_hash_filename_ = drone-scripts/main.js.jinja2
...@@ -42,4 +42,4 @@ md5sum = a88028c1248d2b6a91b7d3cb03047196 ...@@ -42,4 +42,4 @@ md5sum = a88028c1248d2b6a91b7d3cb03047196
[worker] [worker]
_update_hash_filename_ = drone-scripts/worker.js.jinja2 _update_hash_filename_ = drone-scripts/worker.js.jinja2
md5sum = 06a322cc711830262fbbfdc1bfe7947a md5sum = a12788ec0d9972fc30c19c1f6db12da3
...@@ -206,11 +206,11 @@ import { evalScript, fdopen, loadFile, open } from "std"; ...@@ -206,11 +206,11 @@ import { evalScript, fdopen, loadFile, open } from "std";
switch (type) { switch (type) {
case "initPubsub": case "initPubsub":
initPubsub(configuration.numberOfDrone, configuration.numberOfSubscriber); initPubsub(configuration.numberOfDrones, configuration.numberOfSubscribers);
for (peer_id = 0; peer_id < configuration.numberOfDrone + configuration.numberOfSubscriber; peer_id++) { for (peer_id = 0; peer_id < configuration.numberOfDrones + configuration.numberOfSubscribers; peer_id++) {
peer_dict[peer_id] = new Drone(peer_id); peer_dict[peer_id] = new Drone(peer_id);
peer_dict[peer_id].init(peer_id); peer_dict[peer_id].init(peer_id);
if (peer_id < configuration.numberOfDrone) { if (peer_id < configuration.numberOfDrones) {
drone_dict[peer_id] = peer_dict[peer_id]; drone_dict[peer_id] = peer_dict[peer_id];
} }
} }
......
...@@ -17,8 +17,8 @@ return = instance-path ...@@ -17,8 +17,8 @@ return = instance-path
sla-computer_guid = {{ guid }} sla-computer_guid = {{ guid }}
config-autopilotIp = {{ parameter_dict['autopilotIp'] }} config-autopilotIp = {{ parameter_dict['autopilotIp'] }}
config-autopilotPort = {{ dumps(parameter_dict['autopilotPort']) }} config-autopilotPort = {{ dumps(parameter_dict['autopilotPort']) }}
config-numberOfDrone = {{ dumps(len(parameter_dict['droneGuidList'])) }} config-numberOfDrones = {{ dumps(len(parameter_dict['droneGuidList'])) }}
config-numberOfSubscriber = {{ dumps(len(parameter_dict['subscriberGuidList'])) }} config-numberOfSubscribers = {{ dumps(len(parameter_dict['subscriberGuidList'])) }}
config-id = {{ dumps(id) }} config-id = {{ dumps(id) }}
config-isASimulation = {{ dumps(parameter_dict['isASimulation']) }} config-isASimulation = {{ dumps(parameter_dict['isASimulation']) }}
{% if id < len(parameter_dict['droneGuidList']) -%} {% if id < len(parameter_dict['droneGuidList']) -%}
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
}, },
"subscriberGuidList": { "subscriberGuidList": {
"title": "List of subscribers computer ID", "title": "List of subscribers computer ID",
"description": "List of computer ID of swarms subscribers", "description": "List of computer ID of swarms subscribers (entities able to listen/send OPC-UA messages from/to the swarm)",
"type": "array", "type": "array",
"default": [] "default": []
}, },
......
...@@ -14,14 +14,14 @@ ...@@ -14,14 +14,14 @@
"description": "Port on which autopilot service is running.", "description": "Port on which autopilot service is running.",
"type": "integer" "type": "integer"
}, },
"numberOfDrone": { "numberOfDrones": {
"title": "Number of drone", "title": "Number of drones",
"description": "Number of drone in the swarm", "description": "Number of drones in the swarm",
"type": "integer" "type": "integer"
}, },
"numberOfSubscriber": { "numberOfSubscribers": {
"title": "Number of subscriber", "title": "Number of subscribers",
"description": "Number of subscriber of the swarm", "description": "Number of subscribers of the swarm (entities able to listen/send OPC-UA messages from/to the swarm)",
"type": "integer" "type": "integer"
}, },
"id": { "id": {
......
...@@ -67,7 +67,7 @@ recipe = slapos.recipe.template:jinja2 ...@@ -67,7 +67,7 @@ recipe = slapos.recipe.template:jinja2
template = ${index-html:target} template = ${index-html:target}
rendered = $${directory:public}/index.html rendered = $${directory:public}/index.html
context = context =
raw nb_drones {{ parameter_dict['numberOfDrone'] }} raw nb_drones {{ parameter_dict['numberOfDrones'] }}
[httpd-port] [httpd-port]
recipe = slapos.cookbook:free_port recipe = slapos.cookbook:free_port
......
...@@ -251,8 +251,8 @@ class SubscriberTestCase(SlapOSInstanceTestCase): ...@@ -251,8 +251,8 @@ class SubscriberTestCase(SlapOSInstanceTestCase):
{ {
'autopilotIp': '192.168.27.1', 'autopilotIp': '192.168.27.1',
'autopilotPort': 7909, 'autopilotPort': 7909,
'numberOfDrone': 1, 'numberOfDrones': 1,
'numberOfSubscriber': 1, 'numberOfSubscribers': 1,
'id': 1, 'id': 1,
'isASimulation': False, 'isASimulation': False,
'isADrone': False, 'isADrone': False,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment