diff --git a/src/systems/systems/src/air_conditioning/acs_controller.rs b/src/systems/systems/src/air_conditioning/acs_controller.rs index fe3d68caddb..eb6be02f1e4 100644 --- a/src/systems/systems/src/air_conditioning/acs_controller.rs +++ b/src/systems/systems/src/air_conditioning/acs_controller.rs @@ -1752,8 +1752,8 @@ mod acs_controller_tests { for b in 0..station_quantity_b { pax_flag_b ^= 1 << b; } - self.write_by_name("PAX_TOTAL_ROWS_A", pax_flag_a); - self.write_by_name("PAX_TOTAL_ROWS_B", pax_flag_b); + self.write_by_name("PAX_FLAGS_A", pax_flag_a); + self.write_by_name("PAX_FLAGS_B", pax_flag_b); self.command(|a| a.test_cabin.update_number_of_passengers(pax_quantity)); } diff --git a/src/systems/systems/src/air_conditioning/cabin_air.rs b/src/systems/systems/src/air_conditioning/cabin_air.rs index 01583b0758a..1b8ae56e698 100644 --- a/src/systems/systems/src/air_conditioning/cabin_air.rs +++ b/src/systems/systems/src/air_conditioning/cabin_air.rs @@ -524,10 +524,20 @@ mod cabin_air_tests { self } - fn passengers(mut self, passengers: u8) -> Self { - self.write_by_name(&format!("PAX_TOTAL_ROWS_{}_{}", 1, 6), passengers / 2); - self.write_by_name(&format!("PAX_TOTAL_ROWS_{}_{}", 7, 13), passengers / 2); - self.command(|a| a.set_passengers(passengers)); + fn passengers(mut self, pax_quantity: u8) -> Self { + let mut pax_flag_a: u64 = 0; + let mut pax_flag_b: u64 = 0; + let station_quantity_a = pax_quantity / 2 + pax_quantity % 2; + let station_quantity_b = pax_quantity / 2; + for b in 0..station_quantity_a { + pax_flag_a ^= 1 << b; + } + for b in 0..station_quantity_b { + pax_flag_b ^= 1 << b; + } + self.write_by_name("PAX_FLAGS_A", pax_flag_a); + self.write_by_name("PAX_FLAGS_B", pax_flag_b); + self.command(|a| a.set_passengers(pax_quantity)); self }