diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas index 87895b81..e89d88e0 100644 --- a/Nasal/FMGC/FMGC.nas +++ b/Nasal/FMGC/FMGC.nas @@ -24,7 +24,6 @@ var altitude = 0; var flap = 0; var flaps = 0; var ktsmach = 0; -var srsSPD = 0; var mng_alt_spd = 0; var mng_alt_mach = 0; var altsel = 0; @@ -284,6 +283,7 @@ var FMGCNodes = { slat: props.globals.getNode("/FMGC/internal/slat"), toFromSet: props.globals.initNode("/FMGC/internal/tofrom-set", 0, "BOOL"), toState: props.globals.initNode("/FMGC/internal/to-state", 0, "BOOL"), + togaSpd: props.globals.getNode("/it-autoflight/settings/togaspd", 1), tow: props.globals.getNode("/FMGC/internal/tow"), towClean: props.globals.getNode("/FMGC/internal/tow-clean"), towFlap2: props.globals.getNode("/FMGC/internal/flap-2-tow"), @@ -853,6 +853,12 @@ var masterFMGC = maketimer(0.2, func { } else { FMGCInternal.minspeed = FMGCNodes.minspeed.getValue(); } + + if (fmgc.FMGCInternal.v2set) { + FMGCNodes.togaSpd.setValue(FMGCInternal.v2); + } else { # This should never happen, but lets add a fallback just in case + FMGCNodes.togaSpd.setValue(FMGCNodes.vls.getValue() + 15); + } }); ############################ @@ -948,8 +954,6 @@ var reset_FMGC = func { ################# # Managed Speed # ################# -var srsSpeedNode = props.globals.getNode("/it-autoflight/settings/togaspd", 1); - var ktToMach = func(val) { return val * FMGCNodes.ktsToMachFactor.getValue(); } var machToKt = func(val) { return val * FMGCNodes.machToKtsFactor.getValue(); } @@ -958,7 +962,6 @@ var ManagedSPD = maketimer(0.25, func { if (Custom.Input.spdManaged.getBoolValue()) { altitude = pts.Instrumentation.Altimeter.indicatedFt.getValue(); ktsmach = Input.ktsMach.getValue(); - srsSPD = srsSpeedNode.getValue(); mng_alt_spd = math.round(FMGCNodes.mngSpdAlt.getValue(), 1); mng_alt_mach = math.round(FMGCNodes.mngMachAlt.getValue(), 0.001); @@ -979,7 +982,7 @@ var ManagedSPD = maketimer(0.25, func { if ((Modes.PFD.FMA.pitchMode == " " or Modes.PFD.FMA.pitchMode == "SRS") and (FMGCInternal.phase == 0 or FMGCInternal.phase == 1)) { FMGCInternal.mngKtsMach = 0; - FMGCInternal.mngSpdCmd = srsSPD; + FMGCInternal.mngSpdCmd = FMGCInternal.v2; } elsif ((FMGCInternal.phase == 2 or FMGCInternal.phase == 3) and altitude <= FMGCInternal.clbSpdLimAlt) { # Speed is maximum of greendot / climb speed limit FMGCInternal.mngKtsMach = 0; diff --git a/Nasal/MCDU/MCDU.nas b/Nasal/MCDU/MCDU.nas index 8797f0ed..9636916e 100644 --- a/Nasal/MCDU/MCDU.nas +++ b/Nasal/MCDU/MCDU.nas @@ -16,7 +16,6 @@ var MCDU_init = func(i) { var MCDU_reset = func(i) { setprop("/MCDU[" ~ i ~ "]/active", 0); setprop("/MCDU[" ~ i ~ "]/atsu-active", 0); - setprop("/it-autoflight/settings/togaspd", 157); #aka v2 clone setprop("/MCDU[" ~ i ~ "]/last-fmgc-page", "STATUS"); setprop("/MCDU[" ~ i ~ "]/last-atsu-page", "ATSUDLINK"); setprop("/MCDU[" ~ i ~ "]/active-system",""); diff --git a/Nasal/MCDU/PERFTO.nas b/Nasal/MCDU/PERFTO.nas index 57d059ed..34b41ed3 100644 --- a/Nasal/MCDU/PERFTO.nas +++ b/Nasal/MCDU/PERFTO.nas @@ -113,7 +113,6 @@ var perfTOInput = func(key, i) { if (scratchpad == "CLR") { fmgc.FMGCInternal.v2 = 0; fmgc.FMGCInternal.v2set = 0; - setprop("/it-autoflight/settings/togaspd", 157); mcdu_scratchpad.scratchpads[i].empty(); } else { var tfs = size(scratchpad); @@ -122,7 +121,6 @@ var perfTOInput = func(key, i) { fmgc.FMGCInternal.v2 = scratchpad; fmgc.FMGCInternal.v2set = 1; fmgc.setFmaText("pitchMode2Armed", fmgc.FMGCInternal.v2set ? "CLB" : " ", fmgc.genericCallback, "pitchMode2ArmedTime"); - setprop("/it-autoflight/settings/togaspd", scratchpad); mcdu_scratchpad.scratchpads[i].empty(); perfTOCheckVSpeedsConsistency(i);