mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-17 13:25:22 +03:00
MP version 1.8
This commit is contained in:
parent
2fb3cacf9a
commit
0087e53f57
2 changed files with 11 additions and 8 deletions
|
@ -138,7 +138,6 @@ let Waypoint = function (number, action, lat, lon, alt=0, p1=0, p2=0, p3=0, endM
|
||||||
|
|
||||||
self.getElevation = async function (globalSettings) {
|
self.getElevation = async function (globalSettings) {
|
||||||
let elevation;
|
let elevation;
|
||||||
console.log('http://dev.virtualearth.net/REST/v1/Elevation/List?points='+self.getLatMap()+','+self.getLonMap()+'&heights=ellipsoid&key='+globalSettings.mapApiKey);
|
|
||||||
if (globalSettings.mapProviderType == 'bing') {
|
if (globalSettings.mapProviderType == 'bing') {
|
||||||
const response = await fetch('http://dev.virtualearth.net/REST/v1/Elevation/List?points='+self.getLatMap()+','+self.getLonMap()+'&heights=ellipsoid&key='+globalSettings.mapApiKey);
|
const response = await fetch('http://dev.virtualearth.net/REST/v1/Elevation/List?points='+self.getLatMap()+','+self.getLonMap()+'&heights=ellipsoid&key='+globalSettings.mapApiKey);
|
||||||
const myJson = await response.json();
|
const myJson = await response.json();
|
||||||
|
@ -147,8 +146,6 @@ let Waypoint = function (number, action, lat, lon, alt=0, p1=0, p2=0, p3=0, endM
|
||||||
else {
|
else {
|
||||||
elevation = "NA";
|
elevation = "NA";
|
||||||
}
|
}
|
||||||
//$('#elevationValueAtWP').text(elevation);
|
|
||||||
console.log("getElevation");
|
|
||||||
return elevation;
|
return elevation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1720,8 +1720,12 @@ TABS.mission_control.initialize = function (callback) {
|
||||||
selectedMarker.setP3( $('#pointP3').prop("checked") ? 1.0 : 0.0);
|
selectedMarker.setP3( $('#pointP3').prop("checked") ? 1.0 : 0.0);
|
||||||
console.log($('#pointP3').prop("checked"));
|
console.log($('#pointP3').prop("checked"));
|
||||||
if ($('#pointP3').prop("checked")) {
|
if ($('#pointP3').prop("checked")) {
|
||||||
selectedMarker.getElevation(globalSettings);
|
(async () => {
|
||||||
$('#elevationAtWP').fadeIn(300);
|
const elevationAtWP = await selectedMarker.getElevation(globalSettings);
|
||||||
|
$('#elevationValueAtWP').text(elevationAtWP);
|
||||||
|
$('#elevationAtWP').fadeIn(300);
|
||||||
|
})()
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$('#elevationAtWP').fadeOut(300);
|
$('#elevationAtWP').fadeOut(300);
|
||||||
|
@ -2165,7 +2169,9 @@ TABS.mission_control.initialize = function (callback) {
|
||||||
function plotElevation() {
|
function plotElevation() {
|
||||||
(async () => {
|
(async () => {
|
||||||
const [lengthMission, totalMissionDistance, samples, elevation, altPoint2measure, namePoint2measure, refPoint2measure] = await mission.getElevation(globalSettings);
|
const [lengthMission, totalMissionDistance, samples, elevation, altPoint2measure, namePoint2measure, refPoint2measure] = await mission.getElevation(globalSettings);
|
||||||
|
console.log(elevation);
|
||||||
|
console.log(totalMissionDistance);
|
||||||
|
console.log(Array.from(Array(samples), (_,i)=> i*totalMissionDistance/samples));
|
||||||
var trace_WGS84 = {
|
var trace_WGS84 = {
|
||||||
x: Array.from(Array(samples), (_,i)=> i*totalMissionDistance/samples),
|
x: Array.from(Array(samples), (_,i)=> i*totalMissionDistance/samples),
|
||||||
y: elevation,
|
y: elevation,
|
||||||
|
@ -2176,10 +2182,10 @@ TABS.mission_control.initialize = function (callback) {
|
||||||
color: '#ff7f0e',
|
color: '#ff7f0e',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
console.log(altPoint2measure.map((x,i) => x / 100 + HOME.getAlt()*refPoint2measure[i]));
|
||||||
var trace_missionHeight = {
|
var trace_missionHeight = {
|
||||||
x: lengthMission,
|
x: lengthMission,
|
||||||
y: altPoint2measure.map(x => x / 100 + HOME.getAlt()) ,
|
y: altPoint2measure.map((x,i) => x / 100 + HOME.getAlt()*(1-refPoint2measure[i])) ,
|
||||||
type: 'scatter',
|
type: 'scatter',
|
||||||
mode: 'lines+markers+text',
|
mode: 'lines+markers+text',
|
||||||
name: 'Mission altitude',
|
name: 'Mission altitude',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue