1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-16 04:45:18 +03:00

MP version 1.3

This commit is contained in:
ArnoTlse 2021-05-13 14:25:08 +02:00
parent 8224e28a35
commit db82c254c7

View file

@ -341,7 +341,7 @@ let WaypointCollection = function () {
let n = 0 ; let n = 0 ;
let startCount = true; let startCount = true;
while (startCount && (nLoop!=-1)) { while (startCount && (nLoop!=-1)) {
if (nStart > data[data.length -1].getNumber()) { if (nStart > data[data.length -1].getNumber() ) {
startCount = false; startCount = false;
break; break;
} }
@ -351,27 +351,24 @@ let WaypointCollection = function () {
nStart++; nStart++;
} }
else if (self.getWaypoint(nStart).getAction() == MWNP.WPTYPE.JUMP) { else if (self.getWaypoint(nStart).getAction() == MWNP.WPTYPE.JUMP) {
console.log("TITI"); if (!Object.keys(jumpDict).includes(String(self.getWaypoint(nStart).getNumber())) ) {
console.log(jumpDict);
if (!Object.keys(jumpDict).includes(self.getWaypoint(nStart).getNumber()) ) {
jumpDict[self.getWaypoint(nStart).getNumber()] = {nStart: self.getWaypoint(nStart).getP1(), nLoop : self.getWaypoint(nStart).getP2(), n : 0}; jumpDict[self.getWaypoint(nStart).getNumber()] = {nStart: self.getWaypoint(nStart).getP1(), nLoop : self.getWaypoint(nStart).getP2(), n : 0};
} }
console.log(jumpDict);
if (Object.keys(jumpDict).includes(String(self.getWaypoint(nStart).getNumber())) ) { if (Object.keys(jumpDict).includes(String(self.getWaypoint(nStart).getNumber())) ) {
console.log("TOTO"); if (jumpDict[self.getWaypoint(nStart).getNumber()]["nLoop"] == -1) {
console.log((jumpDict[self.getWaypoint(nStart).getNumber()]["n"]>=jumpDict[self.getWaypoint(nStart).getNumber()]["nLoop"] || jumpDict[self.getWaypoint(nStart).getNumber()]["nLoop"] == 0)); nLoop = -1;
}
if ( (jumpDict[self.getWaypoint(nStart).getNumber()]["n"]>=jumpDict[self.getWaypoint(nStart).getNumber()]["nLoop"] || jumpDict[self.getWaypoint(nStart).getNumber()]["nLoop"] ==0) ) { if ( (jumpDict[self.getWaypoint(nStart).getNumber()]["n"]>=jumpDict[self.getWaypoint(nStart).getNumber()]["nLoop"] || jumpDict[self.getWaypoint(nStart).getNumber()]["nLoop"] ==0) ) {
nStart++; nStart++;
//jumpDict[self.getWaypoint(nStart).getNumber()]["n"] = 0; //jumpDict[self.getWaypoint(nStart).getNumber()]["n"] = 0;
} }
else { else {
jumpDict[self.getWaypoint(nStart).getNumber()]["n"]++; jumpDict[self.getWaypoint(nStart).getNumber()]["n"] = jumpDict[self.getWaypoint(nStart).getNumber()]["n"]+1;
console.log(jumpDict[self.getWaypoint(nStart).getNumber()]["nStart"]); let nStartTemp = jumpDict[self.getWaypoint(nStart).getNumber()]["nStart"];
//nStart = 0; //jumpDict[self.getWaypoint(nStart).getNumber()]["nStart"]; nStart = nStartTemp;
} }
} }
//nStart++;
console.log(jumpDict);
} }
else { else {
nStart++; nStart++;