mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-13 11:29:53 +03:00
cli filename fix
This commit is contained in:
parent
30765ae731
commit
1f3c55b075
2 changed files with 47 additions and 18 deletions
|
@ -24,7 +24,7 @@ function zeroPad(value, width) {
|
|||
return value;
|
||||
}
|
||||
|
||||
function generateFilename(prefix, suffix) {
|
||||
function generateFilename(prefix, suffix) { // TODO, code used directly in cli.js instead
|
||||
var date = new Date();
|
||||
var filename = prefix;
|
||||
|
||||
|
@ -32,7 +32,7 @@ function generateFilename(prefix, suffix) {
|
|||
if (CONFIG.flightControllerIdentifier) {
|
||||
filename = CONFIG.flightControllerIdentifier + '_' + CONFIG.flightControllerVersion + "_" + filename;
|
||||
}
|
||||
|
||||
|
||||
if (CONFIG.name && CONFIG.name.trim() !== '') {
|
||||
filename = filename + '_' + CONFIG.name.trim().replace(' ', '_');
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ function distanceOnLine(start, end, distance)
|
|||
var px = start[0] + vx * (mag + distance);
|
||||
var py = start[1] + vy * (mag + distance);
|
||||
|
||||
return [px, py];
|
||||
return [px, py];
|
||||
}
|
||||
|
||||
function wrap_360(angle)
|
||||
|
@ -77,7 +77,7 @@ function wrap_360(angle)
|
|||
return angle;
|
||||
}
|
||||
|
||||
function rad2Deg(rad)
|
||||
function rad2Deg(rad)
|
||||
{
|
||||
return rad * (180 / Math.PI);
|
||||
}
|
||||
|
@ -92,8 +92,8 @@ function calculate_new_cooridatnes(coord, bearing, distance)
|
|||
var lat = deg2Rad(coord.lat);
|
||||
var lon = deg2Rad(coord.lon);
|
||||
bearing = deg2Rad(bearing);
|
||||
var delta = distance / 637100000; // Earth radius in cm
|
||||
|
||||
var delta = distance / 637100000; // Earth radius in cm
|
||||
|
||||
var latNew = Math.asin(Math.sin(lat) * Math.cos(delta) + Math.cos(lat) * Math.sin(delta) * Math.cos(bearing));
|
||||
var lonNew = lon + Math.atan2(Math.sin(bearing) * Math.sin(delta) * Math.cos(lat), Math.cos(delta) - Math.sin(lat) * Math.sin(lat));
|
||||
return {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue