Skip to content

Commit

Permalink
Fix AP disconnect message
Browse files Browse the repository at this point in the history
This fixes the condition (always indicated when the autopilot comes off), but
it does not fix the sound and warning. We need a separate warning light for
this that will flash master warning, but only temporarily and will not play
the cricket sound, only the cavalry charge.

This fixes the condition for #5, but not the presentation.
  • Loading branch information
jan-hudec committed Aug 27, 2015
1 parent 40cb656 commit e51b851
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions Nasal/warnings.nas
Original file line number Diff line number Diff line change
Expand Up @@ -373,11 +373,16 @@ var warning_system = {

var ap_off = warning.new("AP 1+2 OFF", "ap_disc", "caution", "ap-off");
ap_off.condition = func() {
return ((getprop("/flight-management/control/ap1-master") == "off") and
(getprop("/flight-management/control/ap2-master") == "off") and
(((getprop("/position/altitude-agl-ft") > 400) and (getprop("/velocities/vertical-speed-fps") < -5)) or
((getprop("/position/altitude-agl-ft") > 10000) and (getprop("/velocities/vertical-speed-fps") > 5)) or
((getprop('flight-management/phase') == 'APP') and (getprop("/velocities/airspeed-kt") > 70))));
if((getprop("/flight-management/control/ap1-master") == "off") and
(getprop("/flight-management/control/ap2-master") == "off")) {
if(var armed = getprop(me.prop~"armed")) {
setprop(me.prop~"armed", armed - 1);
return 1;
}
} else {
setprop(me.prop~"armed", 5);
}
return 0;
};

var athr_off = warning.new("A/THR OFF", "chime", "caution", "athr-off");
Expand Down

0 comments on commit e51b851

Please sign in to comment.