1
0
Fork 0

Fix PFD typo, correct bearing could go below zero or above 360

This commit is contained in:
legoboyvdlp R 2020-04-28 15:33:28 +01:00
parent 155e710d33
commit 9e9d514cdd
2 changed files with 9 additions and 3 deletions

View file

@ -1261,7 +1261,7 @@ var canvas_PFD_1 = {
tgt_ias = vapp;
tgt_kts = vapp;
} else if (FMGCphase.getValue() == 6) {
vapp = getprop("/FMGC/internal/computed-speeds/clean");
clean = getprop("/FMGC/internal/computed-speeds/clean");
tgt_ias = clean;
tgt_kts = clean;
} else {

View file

@ -71,10 +71,16 @@ var fplnItem = {
}
},
getBrg: func() {
return sprintf("%03.0f", math.round(fmgc.wpCourse[me.plan][me.index].getValue() - pts.Environment.magVar.getValue()));
me.brg = fmgc.wpCourse[me.plan][me.index].getValue() - pts.Environment.magVar.getValue();
if (me.brg < 0) { me.brg += 360; }
if (me.brg > 360) { me.brg -= 360; }
return sprintf("%03.0f", math.round(me.brg));
},
getTrack: func() {
return sprintf("%03.0f", math.round(fmgc.wpCoursePrev[me.plan][me.index].getValue() - pts.Environment.magVar.getValue()));
me.trk = fmgc.wpCoursePrev[me.plan][me.index].getValue() - pts.Environment.magVar.getValue();
if (me.trk < 0) { me.trk += 360; }
if (me.trk > 360) { me.trk -= 360; }
return sprintf("%03.0f", math.round(me.trk));
},
getSpd: func() {
return "---";