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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
81707283
Commit
81707283
authored
Nov 23, 2022
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_drone_simulator: jslint
parent
fecbc426
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
22 deletions
+25
-22
bt5/erp5_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_droneaaailefixe_js.js
...tem/web_page_module/drone_simulator_droneaaailefixe_js.js
+5
-4
bt5/erp5_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_droneaaailefixe_js.xml
...em/web_page_module/drone_simulator_droneaaailefixe_js.xml
+2
-2
bt5/erp5_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_logic_js.js
...hTemplateItem/web_page_module/drone_simulator_logic_js.js
+16
-14
bt5/erp5_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_logic_js.xml
...TemplateItem/web_page_module/drone_simulator_logic_js.xml
+2
-2
No files found.
bt5/erp5_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_droneaaailefixe_js.js
View file @
81707283
...
@@ -2,14 +2,14 @@
...
@@ -2,14 +2,14 @@
/*jslint nomen: true, indent: 2, maxlen: 80, white: true */
/*jslint nomen: true, indent: 2, maxlen: 80, white: true */
/************************** DRONE A AILE FIXE API ****************************/
/************************** DRONE A AILE FIXE API ****************************/
var
DroneAaileFixeAPI
=
/** @class */
(
function
()
{
"
use strict
"
;
var
TAKEOFF_RADIUS
=
60
,
//
var TAKEOFF_RADIUS = 60,
LOITER_LIMIT
=
30
,
var
LOITER_LIMIT
=
30
,
LOITER_RADIUS_FACTOR
=
0.60
,
LOITER_RADIUS_FACTOR
=
0.60
,
LOITER_SPEED_FACTOR
=
1.5
;
LOITER_SPEED_FACTOR
=
1.5
;
var
DroneAaileFixeAPI
=
/** @class */
(
function
()
{
"
use strict
"
;
//** CONSTRUCTOR
//** CONSTRUCTOR
function
DroneAaileFixeAPI
(
gameManager
,
drone_info
,
flight_parameters
,
id
)
{
function
DroneAaileFixeAPI
(
gameManager
,
drone_info
,
flight_parameters
,
id
)
{
this
.
_gameManager
=
gameManager
;
this
.
_gameManager
=
gameManager
;
...
@@ -29,6 +29,7 @@ var DroneAaileFixeAPI = /** @class */ (function () {
...
@@ -29,6 +29,7 @@ var DroneAaileFixeAPI = /** @class */ (function () {
** Function called on start phase of the drone, just before onStart AI script
** Function called on start phase of the drone, just before onStart AI script
*/
*/
DroneAaileFixeAPI
.
prototype
.
internal_start
=
function
()
{
DroneAaileFixeAPI
.
prototype
.
internal_start
=
function
()
{
return
;
};
};
/*
/*
** Function called on every drone update, right after onUpdate AI script
** Function called on every drone update, right after onUpdate AI script
...
...
bt5/erp5_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_droneaaailefixe_js.xml
View file @
81707283
...
@@ -244,7 +244,7 @@
...
@@ -244,7 +244,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
1004.
25224.30173.1314
</string>
</value>
<value>
<string>
1004.
32328.6567.2218
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -262,7 +262,7 @@
...
@@ -262,7 +262,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
166
8701317.95
</float>
<float>
166
9127569.3
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_logic_js.js
View file @
81707283
/*global BABYLON, RSVP, console, DroneAaileFixeAPI, DroneLogAPI*/
/*global BABYLON, RSVP, console, DroneAaileFixeAPI, DroneLogAPI, document*/
/*jslint nomen: true, indent: 2, maxlen: 80, white: true, evil: false */
/*jslint nomen: true, indent: 2, maxlen: 80, white: true, todo: true,
unparam: true */
/******************************* DRONE MANAGER ********************************/
var
GAMEPARAMETERS
=
{};
var
GAMEPARAMETERS
=
{};
/******************************* DRONE MANAGER ********************************/
var
DroneManager
=
/** @class */
(
function
()
{
var
DroneManager
=
/** @class */
(
function
()
{
"
use strict
"
;
"
use strict
"
;
//** CONSTRUCTOR
//** CONSTRUCTOR
function
DroneManager
(
scene
,
id
,
API
)
{
function
DroneManager
(
scene
,
id
,
API
)
{
this
.
_mesh
=
null
;
this
.
_mesh
=
null
;
...
@@ -224,8 +224,7 @@ var DroneManager = /** @class */ (function () {
...
@@ -224,8 +224,7 @@ var DroneManager = /** @class */ (function () {
if
(
!
this
.
_canCommunicate
)
{
if
(
!
this
.
_canCommunicate
)
{
return
;
return
;
}
}
if
(
id
>=
0
)
{
}
if
(
id
<
0
)
{
else
{
id
=
-
1
;
id
=
-
1
;
}
}
if
(
_this
.
infosMesh
)
{
if
(
_this
.
infosMesh
)
{
...
@@ -322,20 +321,21 @@ var DroneManager = /** @class */ (function () {
...
@@ -322,20 +321,21 @@ var DroneManager = /** @class */ (function () {
/**
/**
* Function called on game start
* Function called on game start
*/
*/
DroneManager
.
prototype
.
onStart
=
function
()
{
};
DroneManager
.
prototype
.
onStart
=
function
()
{
return
;
};
/**
/**
* Function called on game update
* Function called on game update
* @param timestamp The tic value
*/
*/
DroneManager
.
prototype
.
onUpdate
=
function
(
timestamp
)
{
};
DroneManager
.
prototype
.
onUpdate
=
function
(
)
{
return
;
};
/**
/**
* Function called when drone crashes
* Function called when drone crashes
*/
*/
DroneManager
.
prototype
.
onTouched
=
function
()
{
};
DroneManager
.
prototype
.
onTouched
=
function
()
{
return
;
};
/**
/**
* Function called when a message is received
* Function called when a message is received
* @param msg The message
* @param msg The message
*/
*/
DroneManager
.
prototype
.
onGetMsg
=
function
(
msg
)
{
};
DroneManager
.
prototype
.
onGetMsg
=
function
(
)
{
return
;
};
return
DroneManager
;
return
DroneManager
;
}());
}());
...
@@ -592,7 +592,7 @@ var GameManager = /** @class */ (function () {
...
@@ -592,7 +592,7 @@ var GameManager = /** @class */ (function () {
GameManager
.
prototype
.
_update
=
function
(
delta_time
)
{
GameManager
.
prototype
.
_update
=
function
(
delta_time
)
{
var
_this
=
this
,
var
_this
=
this
,
queue
=
new
RSVP
.
Queue
(),
queue
=
new
RSVP
.
Queue
(),
i
,
drone_position
;
i
;
this
.
_updateTimeAndLog
(
delta_time
);
this
.
_updateTimeAndLog
(
delta_time
);
// trigger all deferred calls if it is time
// trigger all deferred calls if it is time
...
@@ -652,7 +652,7 @@ var GameManager = /** @class */ (function () {
...
@@ -652,7 +652,7 @@ var GameManager = /** @class */ (function () {
}
}
if
(
GAMEPARAMETERS
.
draw_flight_path
)
{
if
(
GAMEPARAMETERS
.
draw_flight_path
)
{
//draw drone position every some seconds
//draw drone position every some seconds
if
(
seconds
-
this
.
_last_position_drawn
[
drone
]
>
3
)
{
if
(
seconds
-
this
.
_last_position_drawn
[
drone
]
>
0.2
)
{
this
.
_last_position_drawn
[
drone
]
=
seconds
;
this
.
_last_position_drawn
[
drone
]
=
seconds
;
position_obj
=
BABYLON
.
MeshBuilder
.
CreateBox
(
"
obs_
"
+
seconds
,
position_obj
=
BABYLON
.
MeshBuilder
.
CreateBox
(
"
obs_
"
+
seconds
,
{
size
:
1
},
{
size
:
1
},
...
@@ -670,7 +670,7 @@ var GameManager = /** @class */ (function () {
...
@@ -670,7 +670,7 @@ var GameManager = /** @class */ (function () {
material
.
diffuseColor
=
color
;
material
.
diffuseColor
=
color
;
position_obj
.
material
=
material
;
position_obj
.
material
=
material
;
if
(
GAMEPARAMETERS
.
temp_flight_path
)
{
if
(
GAMEPARAMETERS
.
temp_flight_path
)
{
if
(
this
.
_trace_objects_per_drone
[
drone
].
length
===
2
0
)
{
if
(
this
.
_trace_objects_per_drone
[
drone
].
length
===
1
0
)
{
this
.
_trace_objects_per_drone
[
drone
][
0
].
dispose
();
this
.
_trace_objects_per_drone
[
drone
][
0
].
dispose
();
this
.
_trace_objects_per_drone
[
drone
].
splice
(
0
,
1
);
this
.
_trace_objects_per_drone
[
drone
].
splice
(
0
,
1
);
}
}
...
@@ -914,12 +914,14 @@ var GameManager = /** @class */ (function () {
...
@@ -914,12 +914,14 @@ var GameManager = /** @class */ (function () {
code_eval
+=
code
+
"
}; droneMe(Date, drone, Math, {});
"
;
code_eval
+=
code
+
"
}; droneMe(Date, drone, Math, {});
"
;
base
+=
"
};ctx._droneList.push(drone)
"
;
base
+=
"
};ctx._droneList.push(drone)
"
;
code_eval
+=
"
ctx._droneList.push(drone)
"
;
code_eval
+=
"
ctx._droneList.push(drone)
"
;
/*jslint evil: true*/
try
{
try
{
eval
(
code_eval
);
eval
(
code_eval
);
}
}
catch
(
error
)
{
catch
(
error
)
{
eval
(
base
);
eval
(
base
);
}
}
/*jslint evil: false*/
}
}
function
randomSpherePoint
(
x0
,
y0
,
z0
,
rx0
,
ry0
,
rz0
)
{
function
randomSpherePoint
(
x0
,
y0
,
z0
,
rx0
,
ry0
,
rz0
)
{
var
u
=
Math
.
random
(),
v
=
Math
.
random
(),
var
u
=
Math
.
random
(),
v
=
Math
.
random
(),
...
...
bt5/erp5_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_logic_js.xml
View file @
81707283
...
@@ -244,7 +244,7 @@
...
@@ -244,7 +244,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
1004.
26851.10414.26504
</string>
</value>
<value>
<string>
1004.
32347.13889.60603
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -262,7 +262,7 @@
...
@@ -262,7 +262,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
166
8798987.44
</float>
<float>
166
9128788.73
</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