fix: 修复编译错误 + cargo check 通过
- Recorder::new() 需要 RecordingMode 参数 → 改用 Recorder::full() - export_path 借用问题 → clone 后传入 import_csv - Result 未处理警告 → 添加 let _ = - 安装 pkg-config + libudev-dev 系统依赖 - 配置 USTC cargo 国内镜像源
This commit is contained in:
@@ -12,7 +12,7 @@ use crate::{
|
|||||||
ui::{
|
ui::{
|
||||||
ConfigPanelState, ConnectPanelState, FloatingPanelState, MatrixConfigState,
|
ConfigPanelState, ConnectPanelState, FloatingPanelState, MatrixConfigState,
|
||||||
draw_config_panel, draw_connect_panel, draw_export_panel, draw_matrix_config_panel,
|
draw_config_panel, draw_connect_panel, draw_export_panel, draw_matrix_config_panel,
|
||||||
draw_scene_panel, draw_signal_chart, draw_stats_panel, draw_recording_toolbar,
|
draw_scene_panel, draw_stats_panel,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ impl EskinDesktopApp {
|
|||||||
config_panel: FloatingPanelState::new([840.0, 48.0], [128.0, 48.0]),
|
config_panel: FloatingPanelState::new([840.0, 48.0], [128.0, 48.0]),
|
||||||
config_state: ConfigPanelState::default(),
|
config_state: ConfigPanelState::default(),
|
||||||
stats_panel: FloatingPanelState::new([16.0, 520.0], [240.0, 48.0]),
|
stats_panel: FloatingPanelState::new([16.0, 520.0], [240.0, 48.0]),
|
||||||
recorder: Recorder::new(),
|
recorder: Recorder::full(),
|
||||||
export_panel: FloatingPanelState::new([16.0, 280.0], [16.0, 280.0]),
|
export_panel: FloatingPanelState::new([16.0, 280.0], [16.0, 280.0]),
|
||||||
export_path: String::new(),
|
export_path: String::new(),
|
||||||
matrix_config_panel: FloatingPanelState::new([840.0, 280.0], [400.0, 48.0]),
|
matrix_config_panel: FloatingPanelState::new([840.0, 280.0], [400.0, 48.0]),
|
||||||
|
|||||||
15
src/ui.rs
15
src/ui.rs
@@ -3,7 +3,7 @@ use eframe::egui;
|
|||||||
use crate::{
|
use crate::{
|
||||||
connection::{ConnectionManager, ConnectionState},
|
connection::{ConnectionManager, ConnectionState},
|
||||||
recording::Recorder,
|
recording::Recorder,
|
||||||
theme::{ONE_DARK_PRO, ACCENT_BLUE, ACCENT_CYAN, ACCENT_GREEN, ACCENT_ORANGE, ACCENT_RED, accent_text, dim_text, group_frame, panel_frame, tag_button},
|
theme::{ONE_DARK_PRO, ACCENT_BLUE, ACCENT_GREEN, ACCENT_ORANGE, ACCENT_RED, accent_text, dim_text, group_frame, panel_frame, tag_button},
|
||||||
utils::serial_enum,
|
utils::serial_enum,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1068,9 +1068,9 @@ pub fn draw_recording_toolbar(
|
|||||||
};
|
};
|
||||||
if ui.add(rec_btn).clicked() {
|
if ui.add(rec_btn).clicked() {
|
||||||
if is_recording {
|
if is_recording {
|
||||||
recorder.stop_recording();
|
let _ = recorder.stop_recording();
|
||||||
} else {
|
} else {
|
||||||
recorder.start_full_recording();
|
let _ = recorder.start_full_recording();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1087,9 +1087,9 @@ pub fn draw_recording_toolbar(
|
|||||||
};
|
};
|
||||||
if ui.add(snap_btn).clicked() {
|
if ui.add(snap_btn).clicked() {
|
||||||
if is_recording {
|
if is_recording {
|
||||||
recorder.stop_recording();
|
let _ = recorder.stop_recording();
|
||||||
} else {
|
} else {
|
||||||
recorder.start_snapshot_recording();
|
let _ = recorder.start_snapshot_recording();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1098,7 +1098,7 @@ pub fn draw_recording_toolbar(
|
|||||||
// Pause/Resume
|
// Pause/Resume
|
||||||
if is_recording {
|
if is_recording {
|
||||||
if ui.add(tag_button("⏸ 暂停")).clicked() {
|
if ui.add(tag_button("⏸ 暂停")).clicked() {
|
||||||
recorder.pause_recording();
|
let _ = recorder.pause_recording();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1138,7 +1138,8 @@ pub fn draw_recording_toolbar(
|
|||||||
)
|
)
|
||||||
.clicked()
|
.clicked()
|
||||||
{
|
{
|
||||||
if let Err(e) = recorder.import_csv(export_path) {
|
let import_path = export_path.clone();
|
||||||
|
if let Err(e) = recorder.import_csv(&import_path) {
|
||||||
eprintln!("[import] error: {e}");
|
eprintln!("[import] error: {e}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user