aquarium_control/sensors/sensor_manager_config.rs
1/* Copyright 2025 Uwe Martin
2
3Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
5The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
7THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8*/
9use serde_derive::Deserialize;
10
11#[derive(Deserialize, Debug)]
12/// Holds the configuration data for the measurement of ambient signals from DHT sensor
13/// The configuration is loaded from the .toml configuration file.
14/// This struct does not contain any implementation.
15pub struct SensorManagerConfig {
16 /// flag to determine if the application shall communicate with hardware directly or via TCP with a simulator
17 pub use_simulator: bool,
18
19 /// indicates if the thread shall be started or not
20 pub execute: bool,
21
22 /// replacement value for ambient temperature in case reading from DHT22 sensor fails
23 pub replacement_value_ambient_temperature: f32,
24
25 /// replacement value for ambient humidity in case reading from DHT22 sensor fails
26 pub replacement_value_ambient_humidity: f32,
27
28 /// replacement value for water temperature in case reading from I2C fails
29 pub replacement_value_water_temperature: f32,
30
31 /// replacement value for pH in case reading from I2C fails
32 pub replacement_value_ph: f32,
33
34 /// replacement value for conductivity in case reading from I2C fails
35 pub replacement_value_conductivity: f32,
36
37 /// definition of the source for the water temperature - valid values are "ds18b20" or "atlas_scientific".
38 pub source_water_temperature: String,
39
40 /// definition of the source for the ambient temperature - valid values are "ds18b20" or "dht".
41 pub source_ambient_temperature: String,
42}