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
147
Merge Requests
147
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
2eb3d717
Commit
2eb3d717
authored
Nov 16, 2022
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_drone_simulator: jslint
parent
116d8e0d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
39 deletions
+38
-39
bt5/erp5_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_logic_js.js
...hTemplateItem/web_page_module/drone_simulator_logic_js.js
+36
-37
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_logic_js.js
View file @
2eb3d717
/*global BABYLON, RSVP, console, DroneAaileFixeAPI, DroneLogAPI*/
/*jslint nomen: true, indent: 2, maxlen: 80, white: true, evil: false */
/*********************** DRONE SIMULATOR LOGIC ********************************/
var
runGame
,
updateGame
;
(
function
()
{
"
use strict
"
;
console
.
log
(
'
game logic
'
);
var
game_manager_instance
;
runGame
=
function
(
canvas
,
game_parameters_json
)
{
if
(
!
game_manager_instance
)
{
game_manager_instance
=
new
GameManager
(
canvas
,
game_parameters_json
);
}
return
game_manager_instance
.
run
();
};
updateGame
=
function
()
{
if
(
game_manager_instance
)
{
return
game_manager_instance
.
update
();
}
};
/*// Resize canvas on window resize
window.addEventListener('resize', function () {
engine.resize();
});*/
}(
this
));
/******************************************************************************/
/******************************* DRONE MANAGER ********************************/
...
...
@@ -403,8 +371,8 @@ var MapManager = /** @class */ (function () {
}
//** CONSTRUCTOR
function
MapManager
(
scene
)
{
var
_this
=
this
,
drone
,
map_size
,
map_info
,
max_sky
,
skybox
,
skybox
Mat
,
largeGround
Mat
,
largeGround
Bottom
,
width
,
depth
,
terrain
,
max
;
var
_this
=
this
,
max_sky
,
skybox
,
skyboxMat
,
largeGround
Mat
,
largeGroundBottom
,
width
,
depth
,
terrain
,
max
;
_this
.
map_info
=
calculateMapInfo
(
_this
,
GAMEPARAMETERS
.
map
,
GAMEPARAMETERS
.
initialPosition
);
max
=
_this
.
map_info
.
width
;
...
...
@@ -659,8 +627,7 @@ var GameManager = /** @class */ (function () {
function
(
delta_time
)
{
this
.
_game_duration
+=
delta_time
;
var
seconds
=
Math
.
floor
(
this
.
_game_duration
/
1000
),
drone
,
drone_position
,
map_info
,
lat
,
lon
,
position_obj
,
material
,
color
;
drone_position
,
map_info
,
geo_coordinates
,
position_obj
,
material
,
color
;
if
(
GAMEPARAMETERS
.
log_drone_flight
||
GAMEPARAMETERS
.
draw_flight_path
)
{
for
(
drone
=
0
;
drone
<
GAMEPARAMETERS
.
droneList
.
length
;
drone
+=
1
)
{
if
(
this
.
_droneList
[
drone
].
can_play
)
{
...
...
@@ -670,7 +637,7 @@ var GameManager = /** @class */ (function () {
if
(
this
.
_log_count
[
drone
]
===
0
||
this
.
_game_duration
/
this
.
_log_count
[
drone
]
>
1
)
{
this
.
_log_count
[
drone
]
+=
GAMEPARAMETERS
.
log_interval_time
;
var
geo_coordinates
=
this
.
_mapManager
.
convertToGeoCoordinates
(
geo_coordinates
=
this
.
_mapManager
.
convertToGeoCoordinates
(
drone_position
.
x
,
drone_position
.
y
,
drone_position
.
z
,
map_info
);
this
.
_flight_log
[
drone
].
push
(
[
this
.
_game_duration
,
geo_coordinates
.
x
,
geo_coordinates
.
y
,
...
...
@@ -976,4 +943,36 @@ var GameManager = /** @class */ (function () {
return
GameManager
;
}());
/******************************************************************************/
/*********************** DRONE SIMULATOR LOGIC ********************************/
var
runGame
,
updateGame
;
(
function
()
{
"
use strict
"
;
console
.
log
(
'
game logic
'
);
var
game_manager_instance
;
runGame
=
function
(
canvas
,
game_parameters_json
)
{
if
(
!
game_manager_instance
)
{
game_manager_instance
=
new
GameManager
(
canvas
,
game_parameters_json
);
}
return
game_manager_instance
.
run
();
};
updateGame
=
function
()
{
if
(
game_manager_instance
)
{
return
game_manager_instance
.
update
();
}
};
/*// Resize canvas on window resize
window.addEventListener('resize', function () {
engine.resize();
});*/
}(
this
));
/******************************************************************************/
\ No newline at end of file
bt5/erp5_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_logic_js.xml
View file @
2eb3d717
...
...
@@ -244,7 +244,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
1004.
13840.6563.58350
</string>
</value>
<value>
<string>
1004.
23884.17798.30515
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -262,7 +262,7 @@
</tuple>
<state>
<tuple>
<float>
1668
018316.27
</float>
<float>
1668
620936.14
</float>
<string>
UTC
</string>
</tuple>
</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