[][src]Struct lrl_test_compiler::environment::Environment

pub struct Environment {
    pub config: Config,
    pub drivers_file: Option<DriversFile>,
    pub table_cache: HashMap<PathBuf, Calibration>,
}

Represents the contextual information for interpretting a test descriptor file. This is really just a wrapper around Config with an in memory cache of all the calibration tables needed.

Fields

config: Configdrivers_file: Option<DriversFile>table_cache: HashMap<PathBuf, Calibration>

Implementations

impl Environment[src]

const HEADER_LEN: u32[src]

Length of the binary config header in bytes

const SECTION_HEADER: u32[src]

Length of the binary config section headers in bytes

const RELAY_LEN: u32[src]

Length of a single relay in bytes

const SENSOR_LEN: u32[src]

Length of a single sensor in bytes

const GLOBAL_BOUNDS_LEN: u32[src]

Length of a single global bounds entry in bytes

fn append_header_to_buffer(&self, buffer: &mut BitWriter)[src]

Appends the binary config header to a buffer

fn append_relays_to_buffer(&self, buffer: &mut BitWriter)[src]

Appends the relays to a buffer

fn append_sensors_to_buffer(&self, buffer: &mut BitWriter)[src]

Appends the sensors to a buffer

fn append_v_relays_to_buffer(&self, buffer: &mut BitWriter)[src]

Appends the virtual relays to a buffer

fn append_v_sensors_to_buffer(&self, buffer: &mut BitWriter)[src]

Appends the virtual sensors to a buffer

fn append_safe_state_to_buffer(&self, buffer: &mut BitWriter)[src]

Appends the safe state to a buffer

fn append_global_bounds_to_buffer(
    &self,
    buffer: &mut BitWriter
) -> CompilerResult<()>
[src]

Appends the global bounds to a buffer

Appends the binary config footer to the buffer

pub fn append_to_buffer(&self, buffer: &mut BitWriter) -> u32[src]

Appends the body of the config to a buffer

impl Environment[src]

pub fn get_calibration(
    &self,
    sensor_id: &str
) -> CompilerResult<Option<&Calibration>>
[src]

Get calibration for provided sensor id

pub fn boolean_calibration_lookup(
    calibration: &BooleanCalibration,
    bool_value: bool
) -> CompilerResult<(u16, u16)>
[src]

Attempt to perform a calibration lookup on the boolean input value using the provided boolean calibration table.

pub fn numeric_calibration_lookup(
    calibration: &NumericCalibration,
    constraint: (f64, f64)
) -> CompilerResult<(u16, u16)>
[src]

Attempt to perform a calibration lookup on the sensor constraint using the input numeric calibration.

pub fn raw_calibration_lookup(
    constraint: (f64, f64)
) -> CompilerResult<(u16, u16)>
[src]

Trait Implementations

impl Debug for Environment[src]

impl PartialEq<Environment> for Environment[src]

impl StructuralPartialEq for Environment[src]

Auto Trait Implementations

impl RefUnwindSafe for Environment

impl Send for Environment

impl Sync for Environment

impl Unpin for Environment

impl UnwindSafe for Environment

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<Src, Dst> LosslessTryInto<Dst> for Src where
    Dst: LosslessTryFrom<Src>, 
[src]

impl<Src, Dst> LossyInto<Dst> for Src where
    Dst: LossyFrom<Src>, 
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]