display computed pH in status when LSV sweep completes
This commit is contained in:
parent
1441c5ec42
commit
c0a0904a44
|
|
@ -174,7 +174,14 @@ final class AppState {
|
||||||
if !lsvManualPeaks {
|
if !lsvManualPeaks {
|
||||||
lsvPeaks = detectLsvPeaks(lsvPoints)
|
lsvPeaks = detectLsvPeaks(lsvPoints)
|
||||||
}
|
}
|
||||||
status = "LSV complete: \(lsvPoints.count) points"
|
var st = "LSV complete: \(lsvPoints.count) points"
|
||||||
|
if let s = phSlope, let o = phOffset, abs(s) > 1e-6 {
|
||||||
|
if let peak = detectQhqPeak(lsvPoints) {
|
||||||
|
let ph = (Double(peak) - o) / s
|
||||||
|
st += String(format: " | pH=%.2f", ph)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
status = st
|
||||||
|
|
||||||
case .ampStart(let vHold):
|
case .ampStart(let vHold):
|
||||||
ampPoints.removeAll()
|
ampPoints.removeAll()
|
||||||
|
|
|
||||||
|
|
@ -660,7 +660,16 @@ impl App {
|
||||||
if !self.lsv_manual_peaks {
|
if !self.lsv_manual_peaks {
|
||||||
self.lsv_peaks = crate::lsv_analysis::detect_peaks(&self.lsv_points);
|
self.lsv_peaks = crate::lsv_analysis::detect_peaks(&self.lsv_points);
|
||||||
}
|
}
|
||||||
self.status = format!("LSV complete: {} points", self.lsv_points.len());
|
let mut st = format!("LSV complete: {} points", self.lsv_points.len());
|
||||||
|
if let (Some(s), Some(o)) = (self.ph_slope, self.ph_offset) {
|
||||||
|
if let Some(peak) = crate::lsv_analysis::detect_qhq_peak(&self.lsv_points) {
|
||||||
|
if s.abs() > 1e-6 {
|
||||||
|
let ph = (peak - o) / s;
|
||||||
|
write!(st, " | pH={:.2}", ph).ok();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self.status = st;
|
||||||
}
|
}
|
||||||
EisMessage::AmpStart { v_hold } => {
|
EisMessage::AmpStart { v_hold } => {
|
||||||
self.amp_points.clear();
|
self.amp_points.clear();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue