Add 2/4-lead option to GUI.

This commit is contained in:
2025-10-18 17:52:29 +02:00
parent 7229d4cd33
commit 5d80fcdcd8
6 changed files with 438 additions and 127 deletions

View File

@@ -103,7 +103,7 @@ pub async fn communicate_with_hardware(
if gui_logging_enabled_clone.load(Ordering::Relaxed) {
let settings = *settings_clone.lock().unwrap();
match settings.frequency {
Some(StartStopSignal::StartSingle(freq, _)) => {
Some(StartStopSignal::StartSingle(freq, _, _)) => {
if let Err(e) = log_tx_clone.send(LoggingSignal::SingleImpedance(SystemTime::now(), freq, val.magnitude, val.phase)).await {
error!("Failed to send logging signal: {:?}", e);
}
@@ -177,11 +177,11 @@ pub async fn communicate_with_hardware(
select! {
Some(frequency) = run_impedancemeter_rx.recv() => {
match frequency {
StartStopSignal::StartSingle(freq, dft_num) => {
match workbook_client.start_impedancemeter_single(freq, dft_num).await {
StartStopSignal::StartSingle(freq, lead_mode, dft_num) => {
match workbook_client.start_impedancemeter_single(freq, lead_mode, dft_num).await {
Ok(Ok(periods)) => {
info!("Impedance meter started at frequency: {} with periods per DFT: {}", freq, periods);
settings.lock().unwrap().frequency = Some(StartStopSignal::StartSingle(freq, dft_num));
settings.lock().unwrap().frequency = Some(StartStopSignal::StartSingle(freq, lead_mode, dft_num));
*periods_per_dft.lock().unwrap() = Some(periods);
},
Ok(Err(e)) => {