Commit 4c11a38f authored by Romain Courteaud's avatar Romain Courteaud

erp5_officejs_drone_simulator: jslint

parent 81707283
(function (window, RSVP, rJS, domsugar, document, Blob) {
/*jslint indent: 2, maxlen: 100*/
/*global window, rJS, domsugar, document, Blob*/
(function (window, rJS, domsugar, document, Blob) {
"use strict";
//Default values
......@@ -143,7 +145,7 @@
})
.declareMethod('render', function render() {
var gadget = this, query;
var gadget = this;//, query;
return gadget.getDeclaredGadget('form_view')
.push(function (form_gadget) {
return form_gadget.render({
......@@ -328,7 +330,7 @@
[["my_simulation_speed"], ["my_simulation_time"],
["my_drone_speed"], ["my_drone_acceleration"],
["my_number_of_drones"], ["my_map_height"], ["my_start_AMSL"]]
],[
], [
"right",
[["my_minimum_latitud"], ["my_maximum_latitud"],
["my_minimum_longitud"], ["my_maximum_longitud"],
......@@ -361,10 +363,13 @@
return simulator.render();
})
.push(function () {
for (var i = 0; i < options.number_of_drones; i += 1) {
DRONE_LIST[i] = {"id": i, "type": "DroneAaileFixeAPI", "script_content": options.script};
var i,
game_parameters_json;
for (i = 0; i < options.number_of_drones; i += 1) {
DRONE_LIST[i] = {"id": i, "type": "DroneAaileFixeAPI",
"script_content": options.script};
}
var game_parameters_json = {
game_parameters_json = {
"drone": {
"maxAcceleration": parseFloat(options.drone_acceleration),
"maxSpeed": parseFloat(options.drone_speed)
......@@ -399,15 +404,21 @@
});
})
.push(function (result_list) {
for (var i = 0; i < result_list.length; i += 1) {
var log_content = result_list[i].join('\n').replaceAll(",", ";"),
blob = new Blob([log_content], {type: 'text/plain'}),
var i,
log_content,
blob,
a,
log,
div;
for (i = 0; i < result_list.length; i += 1) {
log_content = result_list[i].join('\n').replaceAll(",", ";");
blob = new Blob([log_content], {type: 'text/plain'});
a = domsugar('a', {
text: 'Download Simulation LOG ' + i,
download: 'simulation_log.txt',
href: window.URL.createObjectURL(blob)
}),
log = domsugar('textarea', { value: log_content }),
});
log = domsugar('textarea', { value: log_content });
div = domsugar('div', [a]);
a.dataset.downloadurl = ['text/plain', a.download,
a.href].join(':');
......@@ -417,4 +428,4 @@
});
});
}(window, RSVP, rJS, domsugar, document, Blob));
\ No newline at end of file
}(window, rJS, domsugar, document, Blob));
\ No newline at end of file
......@@ -244,7 +244,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1004.26821.17898.13209</string> </value>
<value> <string>1004.32372.28972.29115</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -262,7 +262,7 @@
</tuple>
<state>
<tuple>
<float>1668799702.5</float>
<float>1669130240.05</float>
<string>UTC</string>
</tuple>
</state>
......
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