[−][src]Struct lrl_test_compiler::environment::config::Config
Represents a configuration TOML file.
Fields
relay_micros: u32
Maximum micro seconds to process a relay statement
sensor_micros: u32
Maximum micro seconds to process a sensor statement
max_segment_length_micros: u32
Maximum micro seconds to process an entire segment
safe_state: Vec<String>
A vector of relay names for firmware to set in the safe state
drivers_path: Option<PathBuf>
Path to drivers.toml
relays: HashMap<String, RelayRecord>
The mapping from relay name to relay device address
sensors: HashMap<String, SensorRecord>
The mapping from sensor name to sensor metadata
virtuals: Virtual
Mapping to virtual sensors and relays
global_bounds: Option<HashMap<String, ConfigSensorBound>>
The mapping from sensor name to a global bound
Implementations
impl Config
[src]
pub fn get_sensor_device_address(
&self,
sensor_id: &str
) -> CompilerResult<DeviceAddress>
[src]
&self,
sensor_id: &str
) -> CompilerResult<DeviceAddress>
Convert sensor id used in TDF file to virtual address
pub fn get_relay_device_address(
&self,
relay_id: &str
) -> CompilerResult<DeviceAddress>
[src]
&self,
relay_id: &str
) -> CompilerResult<DeviceAddress>
Convert relay id used in TDF file to virtual address
pub fn get_safe_state_relay_records(&self) -> Vec<&RelayRecord>
[src]
Function to get a vector containing every physical relay record for relays in the safe state
pub fn get_safe_state_v_relay_records(&self) -> Vec<&VirtualRelayRecord>
[src]
Function to get a vector containing every virtual relay record for relays in the safe state
pub fn get_relay_records(&self) -> Vec<&RelayRecord>
[src]
Function to get a vector of every relay record in the config.toml. The vector is output in sorted order by device address values
pub fn get_sensor_records(&self) -> Vec<&SensorRecord>
[src]
Function to get a vector of every sensor record in the config.toml. The vector is output in sorted order by device address values
pub fn get_v_relay_records(&self) -> Vec<&VirtualRelayRecord>
[src]
Function to get a vector of every virtual relay record in the config.toml. The vector is output in sorted order by device address values
pub fn get_v_sensor_records(&self) -> Vec<&VirtualSensorRecord>
[src]
Function to get a vector of every virtual sensor record in the config.toml. The vector is output in sorted order by device address values
pub fn validate_device_addresses(
&self,
file_name: &String
) -> CompilerResult<()>
[src]
&self,
file_name: &String
) -> CompilerResult<()>
Function to validate that no physical relay or sensor shares the same device address value.
pub fn validate_v_device_addresses(
&self,
file_name: &String
) -> CompilerResult<()>
[src]
&self,
file_name: &String
) -> CompilerResult<()>
Function to validate that device addresses are valid and no virtual relay or sensor shares the same device address value.
fn validate_device_address_values(
device_addresses: Vec<ConfigDeviceAddress>,
file_name: &String
) -> CompilerResult<()>
[src]
device_addresses: Vec<ConfigDeviceAddress>,
file_name: &String
) -> CompilerResult<()>
Validate that every channel value in the config is no more than 3 bits large
fn find_duplicate_device_address_values(
device_addresses1: Vec<u16>,
device_addresses2: Vec<u16>
) -> HashSet<u16>
[src]
device_addresses1: Vec<u16>,
device_addresses2: Vec<u16>
) -> HashSet<u16>
Return the duplicated device addresses provided across both vectors
pub fn validate_device_ids(&self, file_name: &String) -> CompilerResult<()>
[src]
Function to ensure all device ids in the config.toml do not violate any naming constraints such as an identical relay or sensor name
pub fn validate_safe_state(&mut self, file_name: &String) -> CompilerResult<()>
[src]
Function to ensure every relay in the safe state actually exists
pub fn validate_global_bounds(
&mut self,
file_name: &String
) -> CompilerResult<()>
[src]
&mut self,
file_name: &String
) -> CompilerResult<()>
Function to ensure every sensor in the global bounds actually exists
fn find_missing<T: Clone + Hash + Eq>(
to_check: Vec<T>,
given_values: Vec<T>
) -> HashSet<T>
[src]
to_check: Vec<T>,
given_values: Vec<T>
) -> HashSet<T>
Given a vector of given values and a second vector, returns all values in the to_check vector that do not exist in the given_values vector.
Trait Implementations
impl Debug for Config
[src]
impl<'de> Deserialize<'de> for Config
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl PartialEq<Config> for Config
[src]
impl StructuralPartialEq for Config
[src]
Auto Trait Implementations
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<Src, Dst> LosslessTryInto<Dst> for Src where
Dst: LosslessTryFrom<Src>,
[src]
Dst: LosslessTryFrom<Src>,
pub fn lossless_try_into(self) -> Option<Dst>
[src]
impl<Src, Dst> LossyInto<Dst> for Src where
Dst: LossyFrom<Src>,
[src]
Dst: LossyFrom<Src>,
pub fn lossy_into(self) -> Dst
[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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,