Mercurial > templog
comparison rust/src/fridge.rs @ 615:f153aec221be rust
move Params, epoch code
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Tue, 07 Mar 2017 23:56:12 +0800 |
parents | f3e39e2107fd |
children | 8fda564cc46f |
comparison
equal
deleted
inserted
replaced
614:e1bab5b36352 | 615:f153aec221be |
---|---|
9 | 9 |
10 use futures::{Future,future,Sink,Stream}; | 10 use futures::{Future,future,Sink,Stream}; |
11 use tokio_core::reactor::{Timeout,Handle}; | 11 use tokio_core::reactor::{Timeout,Handle}; |
12 use futures::sync::{mpsc}; | 12 use futures::sync::{mpsc}; |
13 | 13 |
14 use ::Config; | 14 use config::Config; |
15 use params::Params; | |
15 use types::*; | 16 use types::*; |
16 | 17 |
17 #[derive(Debug)] | 18 #[derive(Debug)] |
18 pub enum Message { | 19 pub enum Message { |
19 Sensor {wort: Option<f32>, fridge: Option<f32>}, | 20 Sensor {wort: Option<f32>, fridge: Option<f32>}, |
55 impl Fridge { | 56 impl Fridge { |
56 pub fn new(config: &Config, nowait: bool, p: Params, handle: &Handle) -> Fridge { | 57 pub fn new(config: &Config, nowait: bool, p: Params, handle: &Handle) -> Fridge { |
57 let (s, r) = mpsc::channel(1); | 58 let (s, r) = mpsc::channel(1); |
58 let mut f = Fridge { | 59 let mut f = Fridge { |
59 config: config.clone(), | 60 config: config.clone(), |
60 params: p, | 61 params: p.clone(), |
61 temp_wort: None, | 62 temp_wort: None, |
62 temp_fridge: None, | 63 temp_fridge: None, |
63 | 64 |
64 handle: handle.clone(), | 65 handle: handle.clone(), |
65 timeout_s: s, | 66 timeout_s: s, |