From 69514895457a9dbd4789af6f3b3822061ff6ceb7 Mon Sep 17 00:00:00 2001 From: Astro Date: Wed, 30 Sep 2020 18:00:16 +0200 Subject: [PATCH] channels: add pid_output to Report --- src/channels.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/channels.rs b/src/channels.rs index f7bda93..4a96130 100644 --- a/src/channels.rs +++ b/src/channels.rs @@ -417,6 +417,9 @@ impl Channels { let i_tec = self.read_itec(channel); let tec_i = (i_tec - vref) / ElectricalResistance::new::(0.4); let state = self.channel_state(channel); + let pid_output = state.pid.last_output.map(|last_output| + ElectricCurrent::new::(last_output) + ); Report { channel, time: state.adc_time.total_millis(), @@ -431,6 +434,7 @@ impl Channels { i_tec, tec_i, tec_u_meas: self.read_tec_u_meas(channel), + pid_output, } } } @@ -449,9 +453,10 @@ pub struct Report { i_tec: ElectricPotential, tec_i: ElectricCurrent, tec_u_meas: ElectricPotential, + pid_output: Option, } -type JsonBuffer = heapless::Vec; +type JsonBuffer = heapless::Vec; impl Report { pub fn to_json(&self) -> Result {