From 395f829f76e72c0ab1e2483ae27291abe6f53eed Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 25 Aug 2023 12:02:43 +1000 Subject: [PATCH] autotest: factor out a setup_ICEngine_vehicle method for quadplane --- Tools/autotest/quadplane.py | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/Tools/autotest/quadplane.py b/Tools/autotest/quadplane.py index afedf93ce7..4bef619669 100644 --- a/Tools/autotest/quadplane.py +++ b/Tools/autotest/quadplane.py @@ -932,19 +932,24 @@ class AutoTestQuadPlane(AutoTest): raise NotAchievedException("Changed throttle output on mode change to QHOVER") self.disarm_vehicle() - def ICEngine(self): - '''Test ICE Engine support''' - rc_engine_start_chan = 11 + def setup_ICEngine_vehicle(self, start_chan): + '''restarts SITL with an IC Engine setup''' self.set_parameters({ - 'ICE_START_CHAN': rc_engine_start_chan, + 'ICE_START_CHAN': start_chan, }) - model = "quadplane-ice" + model = "quadplane-ice" self.customise_SITL_commandline( [], model=model, defaults_filepath=self.model_defaults_filepath(model), - wipe=False) + wipe=False, + ) + + def ICEngine(self): + '''Test ICE Engine support''' + rc_engine_start_chan = 11 + self.setup_ICEngine_vehicle(start_chan=rc_engine_start_chan) self.wait_ready_to_arm() self.wait_rpm(1, 0, 0, minimum_duration=1) @@ -983,18 +988,8 @@ class AutoTestQuadPlane(AutoTest): def ICEngineMission(self): '''Test ICE Engine Mission support''' rc_engine_start_chan = 11 - self.set_parameters({ - 'ICE_START_CHAN': rc_engine_start_chan, - }) - model = "quadplane-ice" + self.setup_ICEngine_vehicle(start_chan=rc_engine_start_chan) - self.customise_SITL_commandline( - [], - model=model, - defaults_filepath=self.model_defaults_filepath(model), - wipe=False) - - self.reboot_sitl() self.load_mission("mission.txt") self.wait_ready_to_arm() self.set_rc(rc_engine_start_chan, 2000)