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
[instance-default]
filename = instance-default.cfg.jinja2
md5sum = 5c8ebd1f9ca3024d083b0652868e2f71
md5sum = 069f8947c55420ec013497d9eba56252
[instance-peer]
filename = instance-peer.cfg.jinja2.in
md5sum = d12fbb134c587173ddff46ff1bc6ffe7
md5sum = 328ba59583e7b47ab9e1a184ac8a201f
[main]
_update_hash_filename_ = drone-scripts/main.js.jinja2
......@@ -42,4 +42,4 @@ md5sum = a88028c1248d2b6a91b7d3cb03047196
[worker]
_update_hash_filename_ = drone-scripts/worker.js.jinja2
md5sum = 06a322cc711830262fbbfdc1bfe7947a
md5sum = a12788ec0d9972fc30c19c1f6db12da3
......@@ -206,11 +206,11 @@ import { evalScript, fdopen, loadFile, open } from "std";
switch (type) {
case "initPubsub":
initPubsub(configuration.numberOfDrone, configuration.numberOfSubscriber);
for (peer_id = 0; peer_id < configuration.numberOfDrone + configuration.numberOfSubscriber; peer_id++) {
initPubsub(configuration.numberOfDrones, configuration.numberOfSubscribers);
for (peer_id = 0; peer_id < configuration.numberOfDrones + configuration.numberOfSubscribers; peer_id++) {
peer_dict[peer_id] = new Drone(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];
}
}
......
......@@ -17,8 +17,8 @@ return = instance-path
sla-computer_guid = {{ guid }}
config-autopilotIp = {{ parameter_dict['autopilotIp'] }}
config-autopilotPort = {{ dumps(parameter_dict['autopilotPort']) }}
config-numberOfDrone = {{ dumps(len(parameter_dict['droneGuidList'])) }}
config-numberOfSubscriber = {{ dumps(len(parameter_dict['subscriberGuidList'])) }}
config-numberOfDrones = {{ dumps(len(parameter_dict['droneGuidList'])) }}
config-numberOfSubscribers = {{ dumps(len(parameter_dict['subscriberGuidList'])) }}
config-id = {{ dumps(id) }}
config-isASimulation = {{ dumps(parameter_dict['isASimulation']) }}
{% if id < len(parameter_dict['droneGuidList']) -%}
......
......@@ -48,7 +48,7 @@
},
"subscriberGuidList": {
"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",
"default": []
},
......
......@@ -14,14 +14,14 @@
"description": "Port on which autopilot service is running.",
"type": "integer"
},
"numberOfDrone": {
"title": "Number of drone",
"description": "Number of drone in the swarm",
"numberOfDrones": {
"title": "Number of drones",
"description": "Number of drones in the swarm",
"type": "integer"
},
"numberOfSubscriber": {
"title": "Number of subscriber",
"description": "Number of subscriber of the swarm",
"numberOfSubscribers": {
"title": "Number of subscribers",
"description": "Number of subscribers of the swarm (entities able to listen/send OPC-UA messages from/to the swarm)",
"type": "integer"
},
"id": {
......
......@@ -67,7 +67,7 @@ recipe = slapos.recipe.template:jinja2
template = ${index-html:target}
rendered = $${directory:public}/index.html
context =
raw nb_drones {{ parameter_dict['numberOfDrone'] }}
raw nb_drones {{ parameter_dict['numberOfDrones'] }}
[httpd-port]
recipe = slapos.cookbook:free_port
......
......@@ -251,8 +251,8 @@ class SubscriberTestCase(SlapOSInstanceTestCase):
{
'autopilotIp': '192.168.27.1',
'autopilotPort': 7909,
'numberOfDrone': 1,
'numberOfSubscriber': 1,
'numberOfDrones': 1,
'numberOfSubscribers': 1,
'id': 1,
'isASimulation': 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