Skip to content

Changing between imperial and metric units

Jim C K Flaten edited this page Sep 6, 2022 · 1 revision

Which units The Engine Simulator uses to show you power, speed, and pressure numbers is controlled by the theme you have selected, and you can change those units by passing certain parameters to it inside your main.mr file. An exhaustive list of units can be found in units.mr, but here I'll only show a typical metric setup.

import "engine_sim.mr"
import "assets/themes/default.mr"
import "assets/engines/audi/i5.mr"

unit_names units()

use_default_theme(
    speed_units: units.kph,
    pressure_units: units.bar,
    torque_units: units.Nm,
    power_units: units.kW
)

set_engine(audi_i5_2_2L())

Note that we're using unit_names, not units here.

Clone this wiki locally