Nareshkumar Rao 7 months ago
parent
commit
df4061360e
  1. 2
      src/config.rs
  2. 10
      src/control/data_logging.rs
  3. 1
      src/main.rs

2
src/config.rs

@ -50,7 +50,6 @@ pub struct ControllerSettings {
pub temperature_set_point_lower: f32,
pub temperature_loop_mins: u64,
pub sunlight_hours: u64,
pub soil_loop_hours: u64,
pub watering_frequency_hours: u64,
pub watering_amount_grams: u64,
}
@ -116,7 +115,6 @@ impl Default for Configuration {
temperature_set_point_upper: 35.,
temperature_set_point_lower: 28.,
temperature_loop_mins: 60,
soil_loop_hours: 12,
sunlight_hours: 24,
watering_frequency_hours: 30,
watering_amount_grams: 200,

10
src/control/data_logging.rs

@ -24,16 +24,6 @@ pub struct DataRecords {
const FILE_PATH: &str = "./growpi.datalog.csv";
impl DataRecords {
fn load() -> GenericResult<DataRecords> {
let mut data = csv::ReaderBuilder::new()
.has_headers(true)
.from_path(FILE_PATH)?;
let mut result = Vec::new();
for record in data.deserialize() {
result.push(record?);
}
Ok(DataRecords { records: result })
}
pub fn push(program_state: ProgramStateShared) -> GenericResult<()> {
let program_state = lock_state(&program_state)?;
let config = &program_state.config;

1
src/main.rs

@ -1,5 +1,4 @@
#![feature(duration_constructors)]
#![allow(dead_code)]
use cli_mode::run_cli;
use config::Configuration;

Loading…
Cancel
Save