get_i -> get_i_set

This commit is contained in:
atse 2024-08-06 12:50:51 +08:00
parent 9de872f469
commit ef362643a7
2 changed files with 4 additions and 4 deletions

View File

@ -139,7 +139,7 @@ impl Channels {
voltage voltage
} }
pub fn get_i(&mut self, channel: usize) -> ElectricCurrent { pub fn get_i_set(&mut self, channel: usize) -> ElectricCurrent {
let i_set = self.channel_state(channel).i_set; let i_set = self.channel_state(channel).i_set;
i_set i_set
} }
@ -474,7 +474,7 @@ impl Channels {
} }
fn report(&mut self, channel: usize) -> Report { fn report(&mut self, channel: usize) -> Report {
let i_set = self.get_i(channel); let i_set = self.get_i_set(channel);
let i_tec = self.adc_read(channel, PinsAdcReadTarget::ITec, 16); let i_tec = self.adc_read(channel, PinsAdcReadTarget::ITec, 16);
let tec_i = self.get_tec_i(channel); let tec_i = self.get_tec_i(channel);
let dac_value = self.get_dac(channel); let dac_value = self.get_dac(channel);
@ -529,7 +529,7 @@ impl Channels {
PwmSummary { PwmSummary {
channel, channel,
center: CenterPointJson(self.channel_state(channel).center.clone()), center: CenterPointJson(self.channel_state(channel).center.clone()),
i_set: (self.get_i(channel), MAX_TEC_I).into(), i_set: (self.get_i_set(channel), MAX_TEC_I).into(),
max_v: self.get_max_v(channel).into(), max_v: self.get_max_v(channel).into(),
max_i_pos: self.get_max_i_pos(channel).into(), max_i_pos: self.get_max_i_pos(channel).into(),
max_i_neg: self.get_max_i_neg(channel).into(), max_i_neg: self.get_max_i_neg(channel).into(),

View File

@ -207,7 +207,7 @@ impl Handler {
channel: usize, channel: usize,
center: CenterPoint, center: CenterPoint,
) -> Result<Handler, Error> { ) -> Result<Handler, Error> {
let i_set = channels.get_i(channel); let i_set = channels.get_i_set(channel);
let state = channels.channel_state(channel); let state = channels.channel_state(channel);
state.center = center; state.center = center;
if !state.pid_engaged { if !state.pid_engaged {