feat: restrict DTR/RTS to serial transport; allow manual port input; clean up tool binaries
- Only show DTR/RTS toggles when transport is Serial (not TCP/UDP) - Add manual port text entry next to serial port combo box - Reduce combo box width to 180px to make room for text input - Remove compiled ELF binaries from tools/ and add to .gitignore
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1 +1,5 @@
|
|||||||
/target
|
/target
|
||||||
|
|
||||||
|
# Compiled binaries in tools/
|
||||||
|
tools/test_plot_c
|
||||||
|
tools/test_text_c
|
||||||
|
|||||||
@@ -928,7 +928,9 @@ fn render_session_controls(
|
|||||||
tab.status = ConnectionStatus::Error(String::from("session not found"));
|
tab.status = ConnectionStatus::Error(String::from("session not found"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if matches!(tab.status, ConnectionStatus::Connected) {
|
if matches!(tab.status, ConnectionStatus::Connected)
|
||||||
|
&& matches!(tab.session_config.transport, TransportConfig::Serial { .. })
|
||||||
|
{
|
||||||
let dtr_changed = ui.checkbox(&mut tab.dtr, "DTR").changed();
|
let dtr_changed = ui.checkbox(&mut tab.dtr, "DTR").changed();
|
||||||
let rts_changed = ui.checkbox(&mut tab.rts, "RTS").changed();
|
let rts_changed = ui.checkbox(&mut tab.rts, "RTS").changed();
|
||||||
if dtr_changed || rts_changed {
|
if dtr_changed || rts_changed {
|
||||||
@@ -936,8 +938,12 @@ fn render_session_controls(
|
|||||||
let dtr = tab.dtr;
|
let dtr = tab.dtr;
|
||||||
let rts = tab.rts;
|
let rts = tab.rts;
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
if dtr_changed { let _ = handle.set_dtr(dtr).await; }
|
if dtr_changed {
|
||||||
if rts_changed { let _ = handle.set_rts(rts).await; }
|
let _ = handle.set_dtr(dtr).await;
|
||||||
|
}
|
||||||
|
if rts_changed {
|
||||||
|
let _ = handle.set_rts(rts).await;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
tab.status = ConnectionStatus::Error(String::from("session not found"));
|
tab.status = ConnectionStatus::Error(String::from("session not found"));
|
||||||
|
|||||||
@@ -547,7 +547,7 @@ fn render_serial_port_combo(ui: &mut Ui, form: &mut ConfigForm) {
|
|||||||
ui.horizontal(|ui| {
|
ui.horizontal(|ui| {
|
||||||
ui.label("Port:");
|
ui.label("Port:");
|
||||||
ComboBox::from_id_salt("serial_port")
|
ComboBox::from_id_salt("serial_port")
|
||||||
.width(220.0)
|
.width(180.0)
|
||||||
.selected_text(selected_text)
|
.selected_text(selected_text)
|
||||||
.show_ui(ui, |ui| {
|
.show_ui(ui, |ui| {
|
||||||
if available_ports.is_empty() {
|
if available_ports.is_empty() {
|
||||||
@@ -570,6 +570,7 @@ fn render_serial_port_combo(ui: &mut Ui, form: &mut ConfigForm) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
ui.add(TextEdit::singleline(&mut form.port).desired_width(260.0));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user