Browse Source

autotest: improve output from wait_altitude

c415-sdk
Peter Barker 5 years ago committed by Peter Barker
parent
commit
e7ca2057ce
  1. 9
      Tools/autotest/common.py

9
Tools/autotest/common.py

@ -2121,11 +2121,12 @@ class AutoTest(ABC):
climb_rate = alt - previous_alt climb_rate = alt - previous_alt
previous_alt = alt previous_alt = alt
if self.get_sim_time_cached() - last_wait_alt_msg > 1: ok = alt >= alt_min and alt <= alt_max
self.progress("Wait Altitude: Cur:%.02f min_alt:%.02f climb_rate: %.02f" if ok or self.get_sim_time_cached() - last_wait_alt_msg > 1:
% (alt, alt_min, climb_rate)) self.progress("Wait Altitude: Cur:%.02f min:%.02f max:%.02f climb_rate: %.02f"
% (alt, alt_min, alt_max, climb_rate))
last_wait_alt_msg = self.get_sim_time_cached() last_wait_alt_msg = self.get_sim_time_cached()
if alt >= alt_min and alt <= alt_max: if ok:
self.progress("Altitude OK") self.progress("Altitude OK")
return True return True
raise WaitAltitudeTimout("Failed to attain altitude range") raise WaitAltitudeTimout("Failed to attain altitude range")

Loading…
Cancel
Save