Skip to content

Commit

Permalink
chore: update dev-env to 0.20.3.0 and tool chain versions (#7588)
Browse files Browse the repository at this point in the history
Co-authored-by: Pascal Störzbach <[email protected]>
Co-authored-by: Saschl <[email protected]>
  • Loading branch information
3 people authored Nov 16, 2022
1 parent 299b03d commit e423747
Show file tree
Hide file tree
Showing 38 changed files with 120 additions and 129 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ members = [

[profile.release]
lto = true
strip = true
35 changes: 19 additions & 16 deletions igniter.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,10 @@ export default new TaskOfTasks('a32nx', [
new ExecTask('efb-translation', 'npm run build:efb-translation'),
]),

new TaskOfTasks('build', [
new TaskOfTasks('instruments',
[...getInstrumentsIgniterTasks(),
new ExecTask('pfd',
'npm run build:pfd',
['src/instruments/src/PFD','flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/A32NX/PFD']
)
],
true),
new ExecTask('atsu','npm run build:atsu', ['src/atsu', 'flybywire-aircraft-a320-neo/html_ui/JS/atsu']),
new ExecTask('sentry-client','npm run build:sentry-client', ['src/sentry-client', 'flybywire-aircraft-a320-neo/html_ui/JS/sentry-client']),
new ExecTask('failures','npm run build:failures', ['src/failures', 'flybywire-aircraft-a320-neo/html_ui/JS/generated/failures.js']),
new ExecTask('behavior','node src/behavior/build.js', ['src/behavior', 'flybywire-aircraft-a320-neo/ModelBehaviorDefs/A32NX/generated']),
new ExecTask('model','node src/model/build.js', ['src/model', 'flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/model']),
new ExecTask('fmgc','npm run build:fmgc', ['src/fmgc', 'flybywire-aircraft-a320-neo/html_ui/JS/fmgc']),
new TaskOfTasks('wasm', [
new ExecTask('systems', [
'cargo build -p a320_systems_wasm --target wasm32-wasi --release',
'wasm-opt -O3 -o flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/panel/systems.wasm target/wasm32-wasi/release/a320_systems_wasm.wasm',
'wasm-opt -O1 -o flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/panel/systems.wasm target/wasm32-wasi/release/a320_systems_wasm.wasm',
], ['src/systems', 'Cargo.lock', 'Cargo.toml', 'flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/panel/systems.wasm']),
new ExecTask('systems-autopilot', [
'src/fbw/build.sh',
Expand All @@ -37,6 +23,23 @@ export default new TaskOfTasks('a32nx', [
'src/flypad-backend/build.sh',
'wasm-opt -O1 -o flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/panel/flypad-backend.wasm flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/panel/flypad-backend.wasm'
], ['src/flypad-backend', 'flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/panel/flypad-backend.wasm']),
], true),

new TaskOfTasks('build', [
new TaskOfTasks('instruments',
[...getInstrumentsIgniterTasks(),
new ExecTask('pfd',
'npm run build:pfd',
['src/instruments/src/PFD','flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/A32NX/PFD']
)
],
true),
new ExecTask('atsu','npm run build:atsu', ['src/atsu', 'flybywire-aircraft-a320-neo/html_ui/JS/atsu']),
new ExecTask('sentry-client','npm run build:sentry-client', ['src/sentry-client', 'flybywire-aircraft-a320-neo/html_ui/JS/sentry-client']),
new ExecTask('failures','npm run build:failures', ['src/failures', 'flybywire-aircraft-a320-neo/html_ui/JS/generated/failures.js']),
new ExecTask('behavior','node src/behavior/build.js', ['src/behavior', 'flybywire-aircraft-a320-neo/ModelBehaviorDefs/A32NX/generated']),
new ExecTask('model','node src/model/build.js', ['src/model', 'flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/model']),
new ExecTask('fmgc','npm run build:fmgc', ['src/fmgc', 'flybywire-aircraft-a320-neo/html_ui/JS/fmgc']),
new TaskOfTasks('simbridge', [
new ExecTask('client', ['npm run build:simbridge-client'], ['src/simbridge-client', 'flybywire-aircraft-a320-neo/html_ui/JS/simbridge-client']),
]),
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.55"
channel = "1.65"
targets = [ "wasm32-wasi" ]
2 changes: 1 addition & 1 deletion scripts/dev-env/run.cmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@echo off

set image="ghcr.io/flybywiresim/dev-env@sha256:8974895d1d870fee5c5655ffa22e3aebff1879ca689b86c0c8f4e19c0dd4b27a"
set image="ghcr.io/flybywiresim/dev-env@sha256:8eff8ed27dbe218e48876afe1234f260afad4588f15e45012e1f95fb85dcb569"

docker image inspect %image% 1> nul || docker system prune --filter label=flybywiresim=true -f
docker run --rm -it -v "%cd%:/external" %image% %*
2 changes: 1 addition & 1 deletion scripts/dev-env/run.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

IMAGE="ghcr.io/flybywiresim/dev-env@sha256:8974895d1d870fee5c5655ffa22e3aebff1879ca689b86c0c8f4e19c0dd4b27a"
IMAGE="ghcr.io/flybywiresim/dev-env@sha256:8eff8ed27dbe218e48876afe1234f260afad4588f15e45012e1f95fb85dcb569"

# only set `-it` if there is a tty
if [ -t 0 ] && [ -t 1 ];
Expand Down
2 changes: 1 addition & 1 deletion src/flypad-backend/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ clang++ \
-I "${DIR}/src" \
-I "${DIR}/src/Lighting" \
-I "${DIR}/src/Aircraft" \
-I "${DIR}/src/Pushback" \
"${DIR}/src/FlyPadBackend.cpp" \
"${DIR}/src/Lighting/LightPreset.cpp" \
"${DIR}/src/Aircraft/AircraftPreset.cpp" \
"${DIR}/src/Pushback/Pushback.cpp" \
"${DIR}/src/Pushback/InertialDampener.cpp"


# restore directory
popd

Expand Down
2 changes: 1 addition & 1 deletion src/systems/a320_hydraulic_simulation_graphs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "a320_hydraulic_simulation_graphs"
version = "0.1.0"
authors = ["davydecorps <[email protected]>"]
edition = "2018"
edition = "2021"

[[bin]]
name = "a320_hydraulic_simulation_graphs"
Expand Down
2 changes: 1 addition & 1 deletion src/systems/a320_hydraulic_simulation_graphs/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ impl Aircraft for A320SimpleMainElecHydraulicsTestAircraft {

self.hydraulic_circuit.update(
&context.with_delta(cur_time_step),
&mut vec![&mut self.elec_pump],
&mut [&mut self.elec_pump],
None::<&mut ElectricPump>,
None::<&mut ElectricPump>,
None,
Expand Down
2 changes: 1 addition & 1 deletion src/systems/a320_systems/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "a320_systems"
version = "0.1.0"
authors = ["FlyByWire Simulations"]
edition = "2018"
edition = "2021"

[dependencies]
uom = "0.33.0"
Expand Down
26 changes: 14 additions & 12 deletions src/systems/a320_systems/src/hydraulic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2288,7 +2288,7 @@ impl A320Hydraulic {
);
self.green_circuit.update(
context,
&mut vec![&mut self.engine_driven_pump_1],
&mut [&mut self.engine_driven_pump_1],
None::<&mut ElectricPump>,
None::<&mut ElectricPump>,
Some(&self.power_transfer_unit),
Expand All @@ -2304,7 +2304,7 @@ impl A320Hydraulic {
);
self.yellow_circuit.update(
context,
&mut vec![&mut self.engine_driven_pump_2],
&mut [&mut self.engine_driven_pump_2],
Some(&mut self.yellow_electric_pump),
None::<&mut ElectricPump>,
Some(&self.power_transfer_unit),
Expand All @@ -2320,7 +2320,7 @@ impl A320Hydraulic {
);
self.blue_circuit.update(
context,
&mut vec![&mut self.blue_electric_pump],
&mut [&mut self.blue_electric_pump],
Some(&mut self.ram_air_turbine),
None::<&mut ElectricPump>,
None,
Expand Down Expand Up @@ -2704,8 +2704,9 @@ impl A320EngineDrivenPumpController {

// Fault inhibited if on ground AND engine oil pressure is low (11KS1 elec relay)
self.has_pressure_low_fault = self.is_pressure_low
&& (!engine.oil_pressure_is_low()
|| !(lgciu.right_gear_compressed(false) && lgciu.left_gear_compressed(false)));
&& (!(engine.oil_pressure_is_low()
&& lgciu.right_gear_compressed(false)
&& lgciu.left_gear_compressed(false)));
}

fn update_low_air_pressure(
Expand Down Expand Up @@ -2876,11 +2877,12 @@ impl A320BlueElectricPumpController {
);

self.has_pressure_low_fault = self.is_pressure_low
&& (!is_both_engine_low_oil_pressure
|| (!(lgciu1.left_gear_compressed(false) && lgciu1.right_gear_compressed(false))
|| !(lgciu2.left_gear_compressed(false)
&& lgciu2.right_gear_compressed(false)))
|| overhead_panel.blue_epump_override_push_button_is_on());
&& (!(is_both_engine_low_oil_pressure
&& lgciu1.left_gear_compressed(false)
&& lgciu1.right_gear_compressed(false)
&& lgciu2.left_gear_compressed(false)
&& lgciu2.right_gear_compressed(false)
&& !overhead_panel.blue_epump_override_push_button_is_on()));
}

fn update_low_air_pressure(
Expand Down Expand Up @@ -4410,8 +4412,8 @@ impl SimulationElement for A320AutobrakeController {
let sec_1_gnd_splrs_out = reader.read(&self.ground_spoilers_out_sec1_id);
let sec_2_gnd_splrs_out = reader.read(&self.ground_spoilers_out_sec2_id);
let sec_3_gnd_splrs_out = reader.read(&self.ground_spoilers_out_sec3_id);
self.ground_spoilers_are_deployed = (sec_1_gnd_splrs_out && sec_2_gnd_splrs_out)
|| (sec_1_gnd_splrs_out && sec_3_gnd_splrs_out)
self.ground_spoilers_are_deployed = (sec_1_gnd_splrs_out
&& (sec_3_gnd_splrs_out || sec_2_gnd_splrs_out))
|| (sec_2_gnd_splrs_out && sec_3_gnd_splrs_out);
self.external_disarm_event = reader.read(&self.external_disarm_event_id);

Expand Down
2 changes: 1 addition & 1 deletion src/systems/a320_systems_wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "a320_systems_wasm"
version = "0.1.0"
authors = ["FlyByWire Simulations"]
edition = "2018"
edition = "2021"

[lib]
crate-type = ["cdylib"]
Expand Down
2 changes: 1 addition & 1 deletion src/systems/a380_systems/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "a380_systems"
version = "0.1.0"
authors = ["FlyByWire Simulations"]
edition = "2018"
edition = "2021"

[dependencies]
uom = "0.33.0"
Expand Down
13 changes: 7 additions & 6 deletions src/systems/a380_systems/src/hydraulic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2148,7 +2148,7 @@ impl A380Hydraulic {

self.green_circuit.update(
context,
&mut vec![
&mut [
&mut self.engine_driven_pump_1a,
&mut self.engine_driven_pump_1b,
&mut self.engine_driven_pump_2a,
Expand All @@ -2173,7 +2173,7 @@ impl A380Hydraulic {
);
self.yellow_circuit.update(
context,
&mut vec![
&mut [
&mut self.engine_driven_pump_3a,
&mut self.engine_driven_pump_3b,
&mut self.engine_driven_pump_4a,
Expand Down Expand Up @@ -2632,8 +2632,9 @@ impl A380EngineDrivenPumpController {

// TODO Fault inhibit copied from A320
self.has_pressure_low_fault = self.is_pressure_low
&& (!engines[self.pump_id.into_engine_index()].oil_pressure_is_low()
|| !(lgciu.right_gear_compressed(false) && lgciu.left_gear_compressed(false)));
&& (!(engines[self.pump_id.into_engine_index()].oil_pressure_is_low()
&& lgciu.right_gear_compressed(false)
&& lgciu.left_gear_compressed(false)));
}

fn update_low_air_pressure(
Expand Down Expand Up @@ -4074,8 +4075,8 @@ impl SimulationElement for A380AutobrakeController {
let sec_1_gnd_splrs_out = reader.read(&self.ground_spoilers_out_sec1_id);
let sec_2_gnd_splrs_out = reader.read(&self.ground_spoilers_out_sec2_id);
let sec_3_gnd_splrs_out = reader.read(&self.ground_spoilers_out_sec3_id);
self.ground_spoilers_are_deployed = (sec_1_gnd_splrs_out && sec_2_gnd_splrs_out)
|| (sec_1_gnd_splrs_out && sec_3_gnd_splrs_out)
self.ground_spoilers_are_deployed = sec_1_gnd_splrs_out
&& (sec_3_gnd_splrs_out || sec_2_gnd_splrs_out)
|| (sec_2_gnd_splrs_out && sec_3_gnd_splrs_out);
self.external_disarm_event = reader.read(&self.external_disarm_event_id);

Expand Down
2 changes: 1 addition & 1 deletion src/systems/a380_systems_wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "a380_systems_wasm"
version = "0.1.0"
authors = ["FlyByWire Simulations"]
edition = "2018"
edition = "2021"

[lib]
crate-type = ["cdylib"]
Expand Down
2 changes: 1 addition & 1 deletion src/systems/systems/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "systems"
version = "0.1.0"
authors = ["FlyByWire Simulations"]
edition = "2018"
edition = "2021"

[dependencies]
uom = "0.33.0"
Expand Down
6 changes: 3 additions & 3 deletions src/systems/systems/src/air_conditioning/acs_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ macro_rules! transition {
impl From<AirConditioningState<$from>> for AirConditioningState<$to> {
fn from(_: AirConditioningState<$from>) -> AirConditioningState<$to> {
AirConditioningState {
aircraft_state: $to,
aircraft_state: std::marker::PhantomData,
timer: Duration::from_secs(0),
}
}
Expand All @@ -239,7 +239,7 @@ macro_rules! transition {

#[derive(Copy, Clone)]
struct AirConditioningState<S> {
aircraft_state: S,
aircraft_state: std::marker::PhantomData<S>,
timer: Duration,
}

Expand All @@ -256,7 +256,7 @@ struct Initialisation;
impl AirConditioningState<Initialisation> {
fn init() -> Self {
Self {
aircraft_state: Initialisation,
aircraft_state: std::marker::PhantomData,
timer: Duration::from_secs(0),
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/systems/systems/src/apu/air_intake_flap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ mod air_intake_flap_tests {

#[test]
fn is_fully_open_returns_false_when_closed() {
let test_bed = SimulationTestBed::new(|electricity| TestAircraft::new(electricity));
let test_bed = SimulationTestBed::new(TestAircraft::new);

assert!(!test_bed.query(|a| a.flap_is_fully_open()))
}
Expand Down
2 changes: 1 addition & 1 deletion src/systems/systems/src/apu/electronic_control_box.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl ElectronicControlBox {
}

pub fn update_fuel_pressure_switch_state(&mut self, fuel_pressure_switch: &FuelPressureSwitch) {
if self.fault == None
if self.fault.is_none()
&& 3. <= self.n.get::<percent>()
&& !fuel_pressure_switch.has_pressure()
{
Expand Down
4 changes: 2 additions & 2 deletions src/systems/systems/src/apu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ pub trait Turbine {
fn bleed_air_pressure(&self) -> Pressure;
}

#[derive(PartialEq)]
#[derive(PartialEq, Eq)]
pub enum TurbineState {
Shutdown,
Starting,
Expand Down Expand Up @@ -2109,7 +2109,7 @@ pub mod tests {
let mut powered: bool = test_bed.apu_generator_output_within_normal_parameters();
while test_bed.n().normal_value().unwrap().get::<percent>() < 100. {
let still_powered: bool = test_bed.apu_generator_output_within_normal_parameters();
assert!(!powered || (powered && still_powered));
assert!(!powered || still_powered);
powered = still_powered;
test_bed.run_with_delta(Duration::from_millis(1));
}
Expand Down
13 changes: 5 additions & 8 deletions src/systems/systems/src/electrical/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,9 @@ impl ElectricalBus {
pub fn new(context: &mut InitContext, bus_type: ElectricalBusType) -> ElectricalBus {
ElectricalBus {
identifier: context.next_electrical_identifier_for_bus(bus_type),
bus_powered_id: context
.get_identifier(format!("ELEC_{}_BUS_IS_POWERED", bus_type.to_string())),
bus_potential_normal_id: context.get_identifier(format!(
"ELEC_{}_BUS_POTENTIAL_NORMAL",
bus_type.to_string()
)),
bus_powered_id: context.get_identifier(format!("ELEC_{}_BUS_IS_POWERED", bus_type)),
bus_potential_normal_id: context
.get_identifier(format!("ELEC_{}_BUS_POTENTIAL_NORMAL", bus_type)),
potential: ElectricPotential::new::<volt>(0.),
bus_type,
}
Expand Down Expand Up @@ -321,11 +318,11 @@ pub trait ElectricityTransformer: ElectricalElement {
pub struct ElectricalElementIdentifier(u32);
impl ElectricalElementIdentifier {
fn first() -> Self {
Self { 0: 1 }
Self(1)
}

fn next(&self) -> Self {
Self { 0: self.0 + 1 }
Self(self.0 + 1)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/systems/systems/src/failures/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::shared::{GearActuatorId, HydraulicColor, LgciuId, ProximityDetectorId};
use crate::simulation::SimulationElement;

#[derive(Clone, Copy, PartialEq)]
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum FailureType {
TransformerRectifier(usize),
ReservoirLeak(HydraulicColor),
Expand Down
14 changes: 7 additions & 7 deletions src/systems/systems/src/hydraulic/brake_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,12 @@ impl BrakeCircuit {
self.update_demands(brake_circuit_controller);

// The pressure available in brakes is the one of accumulator only if accumulator has fluid
let actual_pressure_available: Pressure;
if self.accumulator.fluid_volume() > Volume::new::<gallon>(0.) {
actual_pressure_available = self.accumulator.raw_gas_press();
} else {
actual_pressure_available = section.pressure();
}
let actual_pressure_available =
if self.accumulator.fluid_volume() > Volume::new::<gallon>(0.) {
self.accumulator.raw_gas_press()
} else {
section.pressure()
};

self.update_brake_actuators(context, actual_pressure_available);

Expand Down Expand Up @@ -330,7 +330,7 @@ impl SimulationElement for BrakeCircuit {
}
}

#[derive(PartialEq, Clone, Copy)]
#[derive(PartialEq, Eq, Clone, Copy)]
pub enum AutobrakeMode {
NONE = 0,
LOW = 1,
Expand Down
Loading

0 comments on commit e423747

Please sign in to comment.