rustybeans/src/config.rs

49 lines
936 B
Rust
Raw Normal View History

2023-01-24 13:13:39 +01:00
use serde::Deserialize;
use std::collections::HashMap;
#[derive(Deserialize)]
pub struct Shot {
pub filename: Option<String>,
pub json: Option<String>,
pub title: String,
pub cutoff: Option<f64>,
pub disable: Option<bool>,
}
#[derive(Deserialize)]
pub struct Chart {
pub title: String,
pub shots: Vec<u64>,
pub max_time: u64,
pub max_weight: u64,
pub max_flow: u64,
}
#[derive(Deserialize)]
pub struct Config {
pub shots: HashMap<String, Shot>,
pub charts: HashMap<String, Chart>,
pub shot_dir: String,
pub brew_dir: String,
pub output_dir: String,
pub main_json: String,
pub width: u32,
pub height: u32,
}
pub const WGHT_SHEET: usize = 0;
pub const FLOW_SHEET: usize = 1;
pub const TIME_COL: usize = 0;
pub const WGHT_COL: usize = 5;
pub const FLOW_COL: usize = 2;
pub struct Data {
pub weight: Vec<(f64, f64)>,
pub flowrate: Vec<(f64, f64)>,
}