Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
f159d4f2
Commit
f159d4f2
authored
Mar 15, 2024
by
Léo-Paul Géneau
👾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs_drone_simulator: fix timeout
Timeout feature was broken by
2f7689d1
. Add timeout check in tests.
parent
a12d43f0
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
90 additions
and
83 deletions
+90
-83
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/drone_capture_flag_logic_js.js
...mplateItem/web_page_module/drone_capture_flag_logic_js.js
+2
-3
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/drone_capture_flag_logic_js.xml
...plateItem/web_page_module/drone_capture_flag_logic_js.xml
+2
-2
bt5/erp5_officejs_drone_capture_flag_test/PathTemplateItem/web_page_module/test_capture_drone_flight_js.js
...plateItem/web_page_module/test_capture_drone_flight_js.js
+35
-30
bt5/erp5_officejs_drone_capture_flag_test/PathTemplateItem/web_page_module/test_capture_drone_flight_js.xml
...lateItem/web_page_module/test_capture_drone_flight_js.xml
+2
-2
bt5/erp5_officejs_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_logic_js.js
...hTemplateItem/web_page_module/drone_simulator_logic_js.js
+2
-3
bt5/erp5_officejs_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_logic_js.xml
...TemplateItem/web_page_module/drone_simulator_logic_js.xml
+2
-2
bt5/erp5_officejs_drone_simulator_test/PathTemplateItem/web_page_module/test_drone_simulator_flight_js.js
...ateItem/web_page_module/test_drone_simulator_flight_js.js
+43
-39
bt5/erp5_officejs_drone_simulator_test/PathTemplateItem/web_page_module/test_drone_simulator_flight_js.xml
...teItem/web_page_module/test_drone_simulator_flight_js.xml
+2
-2
No files found.
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/drone_capture_flag_logic_js.js
View file @
f159d4f2
...
@@ -1043,8 +1043,7 @@ var GameManager = /** @class */ (function () {
...
@@ -1043,8 +1043,7 @@ var GameManager = /** @class */ (function () {
};
};
GameManager
.
prototype
.
_timeOut
=
function
()
{
GameManager
.
prototype
.
_timeOut
=
function
()
{
var
seconds
=
Math
.
floor
(
this
.
_game_duration
/
1000
);
return
this
.
_totalTime
-
this
.
_game_duration
<=
0
;
return
this
.
_totalTime
-
seconds
<=
0
;
};
};
GameManager
.
prototype
.
_allDronesFinished
=
function
()
{
GameManager
.
prototype
.
_allDronesFinished
=
function
()
{
...
@@ -1227,7 +1226,7 @@ var GameManager = /** @class */ (function () {
...
@@ -1227,7 +1226,7 @@ var GameManager = /** @class */ (function () {
_this
.
finish_deferred
=
RSVP
.
defer
();
_this
.
finish_deferred
=
RSVP
.
defer
();
console
.
log
(
"
Simulation started.
"
);
console
.
log
(
"
Simulation started.
"
);
this
.
_game_duration
=
Date
.
now
();
this
.
_game_duration
=
Date
.
now
();
this
.
_totalTime
=
GAMEPARAMETERS
.
gameTime
+
this
.
_game_duration
;
this
.
_totalTime
=
GAMEPARAMETERS
.
gameTime
*
1000
+
this
.
_game_duration
;
return
new
RSVP
.
Queue
()
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
.
push
(
function
()
{
...
...
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/drone_capture_flag_logic_js.xml
View file @
f159d4f2
...
@@ -246,7 +246,7 @@
...
@@ -246,7 +246,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
101
4.65026.25145.27272
</string>
</value>
<value>
<string>
101
5.15557.49327.13158
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -266,7 +266,7 @@
...
@@ -266,7 +266,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
17
09560433.33
</float>
<float>
17
10511088.86
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_officejs_drone_capture_flag_test/PathTemplateItem/web_page_module/test_capture_drone_flight_js.js
View file @
f159d4f2
...
@@ -3,8 +3,9 @@
...
@@ -3,8 +3,9 @@
(
function
(
window
,
rJS
,
domsugar
,
document
)
{
(
function
(
window
,
rJS
,
domsugar
,
document
)
{
"
use strict
"
;
"
use strict
"
;
var
SIMULATION_SPEED
=
10
,
var
SIMULATION_SPEED
=
1
,
SIMULATION_TIME
=
270
,
LOOP_INTERVAL
=
1000
/
60
,
SIMULATION_TIME
=
LOOP_INTERVAL
/
1000
,
MIN_LAT
=
45.6364
,
MIN_LAT
=
45.6364
,
MAX_LAT
=
45.65
,
MAX_LAT
=
45.65
,
MIN_LON
=
14.2521
,
MIN_LON
=
14.2521
,
...
@@ -74,7 +75,7 @@
...
@@ -74,7 +75,7 @@
'
me.getCurrentPosition().longitude
\n
'
+
'
me.getCurrentPosition().longitude
\n
'
+
'
).toFixed(8),
\n
'
+
'
).toFixed(8),
\n
'
+
'
time_interval = timestamp - me.start_time,
\n
'
+
'
time_interval = timestamp - me.start_time,
\n
'
+
'
expected_interval =
1000 / 60
,
\n
'
+
'
expected_interval =
'
+
LOOP_INTERVAL
+
'
,
\n
'
+
'
expectedDistance = (me.getSpeed() * expected_interval / 1000).toFixed(8);
\n
'
+
'
expectedDistance = (me.getSpeed() * expected_interval / 1000).toFixed(8);
\n
'
+
'
assert(time_interval, Math.floor(expected_interval), "Timestamp");
\n
'
+
'
assert(time_interval, Math.floor(expected_interval), "Timestamp");
\n
'
+
'
assert(realDistance, expectedDistance, "Distance");
\n
'
+
'
assert(realDistance, expectedDistance, "Distance");
\n
'
+
...
@@ -84,7 +85,6 @@
...
@@ -84,7 +85,6 @@
'
longitude: me.initialPosition.longitude,
\n
'
+
'
longitude: me.initialPosition.longitude,
\n
'
+
'
altitude: me.initialPosition.altitude
\n
'
+
'
altitude: me.initialPosition.altitude
\n
'
+
'
});
\n
'
+
'
});
\n
'
+
'
me.exit(me.land());
\n
'
+
'
};
'
,
'
};
'
,
DRAW
=
true
,
DRAW
=
true
,
LOG
=
true
,
LOG
=
true
,
...
@@ -120,19 +120,19 @@
...
@@ -120,19 +120,19 @@
"
script_content
"
:
DEFAULT_SCRIPT_CONTENT
};
"
script_content
"
:
DEFAULT_SCRIPT_CONTENT
};
}
}
map_json
=
{
map_json
=
{
"
height
"
:
parseInt
(
map_height
,
10
)
,
"
height
"
:
map_height
,
"
start_AMSL
"
:
parseFloat
(
start_AMSL
)
,
"
start_AMSL
"
:
start_AMSL
,
"
min_lat
"
:
parseFloat
(
MIN_LAT
)
,
"
min_lat
"
:
MIN_LAT
,
"
max_lat
"
:
parseFloat
(
MAX_LAT
)
,
"
max_lat
"
:
MAX_LAT
,
"
min_lon
"
:
parseFloat
(
MIN_LON
)
,
"
min_lon
"
:
MIN_LON
,
"
max_lon
"
:
parseFloat
(
MAX_LON
)
,
"
max_lon
"
:
MAX_LON
,
"
flag_list
"
:
[],
"
flag_list
"
:
[],
"
obstacle_list
"
:
[],
"
obstacle_list
"
:
[],
"
enemy_list
"
:
[],
"
enemy_list
"
:
[],
"
initial_position
"
:
{
"
initial_position
"
:
{
"
longitude
"
:
parseFloat
(
INIT_LON
)
,
"
longitude
"
:
INIT_LON
,
"
latitude
"
:
parseFloat
(
INIT_LAT
)
,
"
latitude
"
:
INIT_LAT
,
"
altitude
"
:
parseFloat
(
INIT_ALT
)
"
altitude
"
:
INIT_ALT
}
}
};
};
operator_init_msg
=
{
operator_init_msg
=
{
...
@@ -142,20 +142,20 @@
...
@@ -142,20 +142,20 @@
game_parameters_json
=
{
game_parameters_json
=
{
"
debug_test_mode
"
:
true
,
"
debug_test_mode
"
:
true
,
"
drone
"
:
{
"
drone
"
:
{
"
maxAcceleration
"
:
parseInt
(
MAX_ACCELERATION
,
10
)
,
"
maxAcceleration
"
:
MAX_ACCELERATION
,
"
maxDeceleration
"
:
parseInt
(
MAX_DECELERATION
,
10
)
,
"
maxDeceleration
"
:
MAX_DECELERATION
,
"
minSpeed
"
:
parseInt
(
MIN_SPEED
,
10
)
,
"
minSpeed
"
:
MIN_SPEED
,
"
speed
"
:
parseFloat
(
DEFAULT_SPEED
)
,
"
speed
"
:
DEFAULT_SPEED
,
"
maxSpeed
"
:
parseInt
(
MAX_SPEED
,
10
)
,
"
maxSpeed
"
:
MAX_SPEED
,
"
maxRoll
"
:
parseFloat
(
MAX_ROLL
)
,
"
maxRoll
"
:
MAX_ROLL
,
"
minPitchAngle
"
:
parseFloat
(
MIN_PITCH
)
,
"
minPitchAngle
"
:
MIN_PITCH
,
"
maxPitchAngle
"
:
parseFloat
(
MAX_PITCH
)
,
"
maxPitchAngle
"
:
MAX_PITCH
,
"
maxSinkRate
"
:
parseFloat
(
MAX_SINK_RATE
)
,
"
maxSinkRate
"
:
MAX_SINK_RATE
,
"
maxClimbRate
"
:
parseFloat
(
MAX_CLIMB_RATE
)
,
"
maxClimbRate
"
:
MAX_CLIMB_RATE
,
"
list
"
:
DRONE_LIST
"
list
"
:
DRONE_LIST
},
},
"
gameTime
"
:
parseInt
(
SIMULATION_TIME
,
10
)
,
"
gameTime
"
:
SIMULATION_TIME
,
"
simulation_speed
"
:
parseInt
(
SIMULATION_SPEED
,
10
)
,
"
simulation_speed
"
:
SIMULATION_SPEED
,
"
latency
"
:
{
"
latency
"
:
{
"
information
"
:
0
,
"
information
"
:
0
,
"
communication
"
:
0
"
communication
"
:
0
...
@@ -214,19 +214,24 @@
...
@@ -214,19 +214,24 @@
})
})
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
var
div
=
domsugar
(
'
div
'
,
{
text
:
"
CONSOLE LOG ENTRIES:
"
}),
lines
,
var
div
=
domsugar
(
'
div
'
,
{
text
:
"
CONSOLE LOG ENTRIES:
"
}),
lines
,
l
,
node
;
l
,
test_log_node
=
document
.
querySelector
(
'
.test_log
'
)
;
document
.
querySelector
(
'
.container
'
).
parentNode
.
appendChild
(
div
);
document
.
querySelector
(
'
.container
'
).
parentNode
.
appendChild
(
div
);
function
createLogNode
(
message
)
{
function
appendToTestLog
(
test_log_node
,
message
)
{
var
log_node
=
document
.
createElement
(
"
div
"
),
var
log_node
=
document
.
createElement
(
"
div
"
),
textNode
=
document
.
createTextNode
(
message
);
textNode
=
document
.
createTextNode
(
message
);
log_node
.
appendChild
(
textNode
);
log_node
.
appendChild
(
textNode
);
return
log_node
;
test_log_node
.
appendChild
(
log_node
)
;
}
}
lines
=
result
.
console_log
.
split
(
'
\n
'
);
lines
=
result
.
console_log
.
split
(
'
\n
'
);
for
(
l
=
0
;
l
<
lines
.
length
;
l
+=
1
)
{
for
(
l
=
0
;
l
<
lines
.
length
;
l
+=
1
)
{
node
=
createLogNode
(
lines
[
l
]);
if
(
lines
[
l
]
!==
'
TIMEOUT!
'
)
{
document
.
querySelector
(
'
.test_log
'
).
appendChild
(
node
);
appendToTestLog
(
test_log_node
,
lines
[
l
]);
}
else
{
appendToTestLog
(
test_log_node
,
'
Timeout: OK
'
);
return
;
}
}
}
appendToTestLog
(
test_log_node
,
'
Timeout: FAILED
'
);
},
function
(
error
)
{
},
function
(
error
)
{
return
gadget
.
notifySubmitted
({
message
:
"
Error:
"
+
error
.
message
,
return
gadget
.
notifySubmitted
({
message
:
"
Error:
"
+
error
.
message
,
status
:
'
error
'
});
status
:
'
error
'
});
...
...
bt5/erp5_officejs_drone_capture_flag_test/PathTemplateItem/web_page_module/test_capture_drone_flight_js.xml
View file @
f159d4f2
...
@@ -246,7 +246,7 @@
...
@@ -246,7 +246,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
101
4.60680.20078.34286
</string>
</value>
<value>
<string>
101
5.15807.32412.36915
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -266,7 +266,7 @@
...
@@ -266,7 +266,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
17
09286290.59
</float>
<float>
17
10526066.91
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_officejs_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_logic_js.js
View file @
f159d4f2
...
@@ -763,8 +763,7 @@ var GameManager = /** @class */ (function () {
...
@@ -763,8 +763,7 @@ var GameManager = /** @class */ (function () {
};
};
GameManager
.
prototype
.
_timeOut
=
function
()
{
GameManager
.
prototype
.
_timeOut
=
function
()
{
var
seconds
=
Math
.
floor
(
this
.
_game_duration
/
1000
);
return
this
.
_totalTime
-
this
.
_game_duration
<=
0
;
return
this
.
_totalTime
-
seconds
<=
0
;
};
};
GameManager
.
prototype
.
_allDronesFinished
=
function
()
{
GameManager
.
prototype
.
_allDronesFinished
=
function
()
{
...
@@ -904,7 +903,7 @@ var GameManager = /** @class */ (function () {
...
@@ -904,7 +903,7 @@ var GameManager = /** @class */ (function () {
_this
.
finish_deferred
=
RSVP
.
defer
();
_this
.
finish_deferred
=
RSVP
.
defer
();
console
.
log
(
"
Simulation started.
"
);
console
.
log
(
"
Simulation started.
"
);
this
.
_game_duration
=
Date
.
now
();
this
.
_game_duration
=
Date
.
now
();
this
.
_totalTime
=
GAMEPARAMETERS
.
gameTime
+
this
.
_game_duration
;
this
.
_totalTime
=
GAMEPARAMETERS
.
gameTime
*
1000
+
this
.
_game_duration
;
return
new
RSVP
.
Queue
()
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
.
push
(
function
()
{
...
...
bt5/erp5_officejs_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_logic_js.xml
View file @
f159d4f2
...
@@ -240,7 +240,7 @@
...
@@ -240,7 +240,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
101
4.65027.38618.31573
</string>
</value>
<value>
<string>
101
5.15533.18317.53657
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -260,7 +260,7 @@
...
@@ -260,7 +260,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
17
09560536.57
</float>
<float>
17
10509638.96
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_officejs_drone_simulator_test/PathTemplateItem/web_page_module/test_drone_simulator_flight_js.js
View file @
f159d4f2
...
@@ -3,11 +3,9 @@
...
@@ -3,11 +3,9 @@
(
function
(
window
,
rJS
,
domsugar
,
document
,
URLSearchParams
,
Blob
)
{
(
function
(
window
,
rJS
,
domsugar
,
document
,
URLSearchParams
,
Blob
)
{
"
use strict
"
;
"
use strict
"
;
var
SIMULATION_SPEED
=
10
,
var
SIMULATION_SPEED
=
1
,
SIMULATION_TIME
=
270
,
LOOP_INTERVAL
=
1000
/
60
,
MAP_SIZE
=
600
,
SIMULATION_TIME
=
LOOP_INTERVAL
/
1000
,
map_height
=
700
,
start_AMSL
=
595
,
DEFAULT_SPEED
=
16
,
DEFAULT_SPEED
=
16
,
MAX_ACCELERATION
=
6
,
MAX_ACCELERATION
=
6
,
MAX_DECELERATION
=
1
,
MAX_DECELERATION
=
1
,
...
@@ -19,7 +17,6 @@
...
@@ -19,7 +17,6 @@
MAX_CLIMB_RATE
=
8
,
MAX_CLIMB_RATE
=
8
,
MAX_SINK_RATE
=
3
,
MAX_SINK_RATE
=
3
,
NUMBER_OF_DRONES
=
1
,
NUMBER_OF_DRONES
=
1
,
FLAG_WEIGHT
=
5
,
MIN_LAT
=
45.6364
,
MIN_LAT
=
45.6364
,
MAX_LAT
=
45.65
,
MAX_LAT
=
45.65
,
MIN_LON
=
14.2521
,
MIN_LON
=
14.2521
,
...
@@ -78,7 +75,7 @@
...
@@ -78,7 +75,7 @@
'
me.getCurrentPosition().longitude
\n
'
+
'
me.getCurrentPosition().longitude
\n
'
+
'
).toFixed(8),
\n
'
+
'
).toFixed(8),
\n
'
+
'
time_interval = timestamp - me.start_time,
\n
'
+
'
time_interval = timestamp - me.start_time,
\n
'
+
'
expected_interval =
1000 / 60
,
\n
'
+
'
expected_interval =
'
+
LOOP_INTERVAL
+
'
,
\n
'
+
'
expectedDistance = (me.getSpeed() * expected_interval / 1000).toFixed(8);
\n
'
+
'
expectedDistance = (me.getSpeed() * expected_interval / 1000).toFixed(8);
\n
'
+
'
assert(time_interval.toFixed(4), expected_interval.toFixed(4), "Timestamp");
\n
'
+
'
assert(time_interval.toFixed(4), expected_interval.toFixed(4), "Timestamp");
\n
'
+
'
assert(realDistance, expectedDistance, "Distance");
\n
'
+
'
assert(realDistance, expectedDistance, "Distance");
\n
'
+
...
@@ -88,7 +85,6 @@
...
@@ -88,7 +85,6 @@
'
longitude: me.initialPosition.longitude,
\n
'
+
'
longitude: me.initialPosition.longitude,
\n
'
+
'
altitude: me.initialPosition.altitude
\n
'
+
'
altitude: me.initialPosition.altitude
\n
'
+
'
});
\n
'
+
'
});
\n
'
+
'
me.exit(me.land());
\n
'
+
'
};
'
,
'
};
'
,
DRAW
=
true
,
DRAW
=
true
,
LOG
=
true
,
LOG
=
true
,
...
@@ -175,35 +171,35 @@
...
@@ -175,35 +171,35 @@
game_parameters_json
=
{
game_parameters_json
=
{
"
debug_test_mode
"
:
true
,
"
debug_test_mode
"
:
true
,
"
drone
"
:
{
"
drone
"
:
{
"
maxAcceleration
"
:
parseInt
(
MAX_ACCELERATION
,
10
)
,
"
maxAcceleration
"
:
MAX_ACCELERATION
,
"
maxDeceleration
"
:
parseInt
(
MAX_DECELERATION
,
10
)
,
"
maxDeceleration
"
:
MAX_DECELERATION
,
"
minSpeed
"
:
parseInt
(
MIN_SPEED
,
10
)
,
"
minSpeed
"
:
MIN_SPEED
,
"
speed
"
:
parseFloat
(
DEFAULT_SPEED
)
,
"
speed
"
:
DEFAULT_SPEED
,
"
maxSpeed
"
:
parseInt
(
MAX_SPEED
,
10
)
,
"
maxSpeed
"
:
MAX_SPEED
,
"
maxRoll
"
:
parseFloat
(
MAX_ROLL
)
,
"
maxRoll
"
:
MAX_ROLL
,
"
minPitchAngle
"
:
parseFloat
(
MIN_PITCH
)
,
"
minPitchAngle
"
:
MIN_PITCH
,
"
maxPitchAngle
"
:
parseFloat
(
MAX_PITCH
)
,
"
maxPitchAngle
"
:
MAX_PITCH
,
"
maxSinkRate
"
:
parseFloat
(
MAX_SINK_RATE
)
,
"
maxSinkRate
"
:
MAX_SINK_RATE
,
"
maxClimbRate
"
:
parseFloat
(
MAX_CLIMB_RATE
)
"
maxClimbRate
"
:
MAX_CLIMB_RATE
},
},
"
gameTime
"
:
parseInt
(
SIMULATION_TIME
,
10
)
,
"
gameTime
"
:
SIMULATION_TIME
,
"
simulation_speed
"
:
parseInt
(
SIMULATION_SPEED
,
10
)
,
"
simulation_speed
"
:
SIMULATION_SPEED
,
"
latency
"
:
{
"
latency
"
:
{
"
information
"
:
0
,
"
information
"
:
0
,
"
communication
"
:
0
"
communication
"
:
0
},
},
"
map
"
:
{
"
map
"
:
{
"
min_lat
"
:
parseFloat
(
MIN_LAT
)
,
"
min_lat
"
:
MIN_LAT
,
"
max_lat
"
:
parseFloat
(
MAX_LAT
)
,
"
max_lat
"
:
MAX_LAT
,
"
min_lon
"
:
parseFloat
(
MIN_LON
)
,
"
min_lon
"
:
MIN_LON
,
"
max_lon
"
:
parseFloat
(
MAX_LON
)
,
"
max_lon
"
:
MAX_LON
,
"
height
"
:
parseInt
(
HEIGHT
)
,
"
height
"
:
HEIGHT
,
"
start_AMSL
"
:
parseFloat
(
start_AMSL
)
"
start_AMSL
"
:
start_AMSL
},
},
"
initialPosition
"
:
{
"
initialPosition
"
:
{
"
longitude
"
:
parseFloat
(
INIT_LON
)
,
"
longitude
"
:
INIT_LON
,
"
latitude
"
:
parseFloat
(
INIT_LAT
)
,
"
latitude
"
:
INIT_LAT
,
"
altitude
"
:
parseFloat
(
INIT_ALT
)
"
altitude
"
:
INIT_ALT
},
},
"
draw_flight_path
"
:
DRAW
,
"
draw_flight_path
"
:
DRAW
,
"
temp_flight_path
"
:
true
,
"
temp_flight_path
"
:
true
,
...
@@ -257,19 +253,27 @@
...
@@ -257,19 +253,27 @@
return
form_gadget
.
getContent
();
return
form_gadget
.
getContent
();
})
})
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
var
div
=
domsugar
(
'
div
'
,
{
text
:
"
CONSOLE LOG ENTRIES:
"
});
var
div
=
domsugar
(
'
div
'
,
{
text
:
"
CONSOLE LOG ENTRIES:
"
}),
lines
=
result
.
console_log
.
split
(
'
\n
'
),
line_nb
,
node
,
test_log_node
=
document
.
querySelector
(
'
.test_log
'
);;
document
.
querySelector
(
'
.container
'
).
parentNode
.
appendChild
(
div
);
document
.
querySelector
(
'
.container
'
).
parentNode
.
appendChild
(
div
);
function
createLogNode
(
message
)
{
function
appendToTestLog
(
test_log_node
,
message
)
{
var
node
=
document
.
createElement
(
"
div
"
);
var
log_node
=
document
.
createElement
(
"
div
"
),
var
textNode
=
document
.
createTextNode
(
message
);
textNode
=
document
.
createTextNode
(
message
);
node
.
appendChild
(
textNode
);
log_node
.
appendChild
(
textNode
);
return
node
;
test_log_node
.
appendChild
(
log_node
);
}
for
(
line_nb
=
0
;
line_nb
<
lines
.
length
;
line_nb
+=
1
)
{
if
(
lines
[
line_nb
]
!==
'
TIMEOUT!
'
)
{
appendToTestLog
(
test_log_node
,
lines
[
line_nb
]);
}
else
{
appendToTestLog
(
test_log_node
,
'
Timeout: OK
'
);
return
;
}
}
var
lines
=
result
.
console_log
.
split
(
'
\n
'
);
for
(
var
i
=
0
;
i
<
lines
.
length
;
i
++
)
{
var
node
=
createLogNode
(
lines
[
i
]);
document
.
querySelector
(
'
.test_log
'
).
appendChild
(
node
);
}
}
appendToTestLog
(
test_log_node
,
'
Timeout: FAILED
'
);
},
function
(
error
)
{
},
function
(
error
)
{
return
gadget
.
notifySubmitted
({
message
:
"
Error:
"
+
error
.
message
,
return
gadget
.
notifySubmitted
({
message
:
"
Error:
"
+
error
.
message
,
status
:
'
error
'
});
status
:
'
error
'
});
...
...
bt5/erp5_officejs_drone_simulator_test/PathTemplateItem/web_page_module/test_drone_simulator_flight_js.xml
View file @
f159d4f2
...
@@ -246,7 +246,7 @@
...
@@ -246,7 +246,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
101
4.60681.20667.37171
</string>
</value>
<value>
<string>
101
5.15809.60561.48213
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -266,7 +266,7 @@
...
@@ -266,7 +266,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
17
09286436.53
</float>
<float>
17
10526207.55
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
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