aquarium_control/mineral/
balling_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*/
9
10//! Defines the configuration structure for the automated Balling mineral dosing system.
11//!
12//! This module contains the `BallingConfig` struct, which is used with `serde` to
13//! deserialize the `[balling]` section from the application's TOML configuration file.
14//! It holds all the parameters that control the behavior of the `Balling` thread,
15//! from its activation status to the dosing schedule for each pump.
16
17use serde_derive::Deserialize;
18
19/// Holds the configuration data for the balling dosing control.
20/// The configuration is loaded from the .toml configuration file.
21/// This struct does not contain any implementation.
22#[derive(Deserialize)]
23pub struct BallingConfig {
24    /// control will only be active when the flag is set to true
25    pub active: bool,
26
27    /// indicates if the thread shall be started or not
28    pub execute: bool,
29
30    /// pump #1 will only be used when the flag is set to true
31    pub pump1_active: bool,
32
33    /// pump #2 will only be used when the flag is set to true
34    pub pump2_active: bool,
35
36    /// pump #3 will only be used when the flag is set to true
37    pub pump3_active: bool,
38
39    /// pump #4 will only be used when the flag is set to true
40    pub pump4_active: bool,
41
42    /// interval for the main control in seconds
43    pub schedule_check_interval: u32,
44
45    /// inject Balling minerals with pump 1 after each period    
46    pub dosing_interval_pump1: u32,
47
48    /// inject Balling minerals with pump 2 after each period    
49    pub dosing_interval_pump2: u32,
50
51    /// inject Balling minerals with pump 3 after each period    
52    pub dosing_interval_pump3: u32,
53
54    /// inject Balling minerals with pump 4 after each period    
55    pub dosing_interval_pump4: u32,
56
57    /// wait for a fixed period between dosings from different pumps
58    pub pump_switch_delay_millis: u32,
59}