Refactor to hand-mode UI and reorganize WGSL shader
Replace spatial force / stats panels with unified hand force panels; simplify app.rs wiring and reorganize shader.wgsl for the hand rendering layout.
This commit is contained in:
29
src/ui.rs
29
src/ui.rs
@@ -104,10 +104,10 @@ impl Default for ConfigPanelState {
|
||||
.unwrap_or_else(|| "COM3".to_owned());
|
||||
|
||||
Self {
|
||||
mode: SerialMode::Finger,
|
||||
mode: SerialMode::Hand,
|
||||
port,
|
||||
available_ports,
|
||||
baud_rate: 921_600,
|
||||
baud_rate: SerialMode::Hand.baud_rate(),
|
||||
data_bits: 8,
|
||||
stop_bits: 1,
|
||||
parity: Parity::None,
|
||||
@@ -126,7 +126,7 @@ impl Default for ConnectPanelState {
|
||||
let port = serial_enum().unwrap_or_default();
|
||||
let selected_port = port.first().cloned().unwrap_or_default();
|
||||
Self {
|
||||
mode: SerialMode::Finger,
|
||||
mode: SerialMode::Hand,
|
||||
port,
|
||||
selected_port,
|
||||
duration: 10,
|
||||
@@ -499,27 +499,14 @@ pub fn draw_spatial_force_panel(
|
||||
}
|
||||
|
||||
fn draw_mode_row(ui: &mut egui::Ui, config: &mut ConfigPanelState) -> Option<SerialMode> {
|
||||
let mut changed_to = None;
|
||||
config.mode = SerialMode::Hand;
|
||||
config.baud_rate = SerialMode::Hand.baud_rate();
|
||||
ui.horizontal_wrapped(|ui| {
|
||||
ui.colored_label(dim_text(), "模式");
|
||||
ui.colored_label(dim_text(), "Mode");
|
||||
ui.add_space(12.0);
|
||||
|
||||
if mode_button(ui, &mut config.mode, SerialMode::Finger, "指尖模块") {
|
||||
changed_to = Some(SerialMode::Finger)
|
||||
}
|
||||
if mode_button(ui, &mut config.mode, SerialMode::Hand, "游戏体验") {
|
||||
changed_to = Some(SerialMode::Hand)
|
||||
}
|
||||
// mode_button(ui, &mut config.mode, SerialMode::Model, "模型");
|
||||
|
||||
// Legacy reconnect controls. Current sensors run fixed 921600 baud without auto-reconnect UI.
|
||||
// ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
|
||||
// ui.checkbox(&mut config.auto_reconnect, "自动");
|
||||
// ui.colored_label(dim_text(), "重连");
|
||||
// });
|
||||
ui.label(style::panel_title("Hand Gateway"));
|
||||
});
|
||||
|
||||
changed_to
|
||||
None
|
||||
}
|
||||
|
||||
fn draw_connection_row(
|
||||
|
||||
Reference in New Issue
Block a user