feat: 新增 Playwright 测试 + ModelStage UI 更新与 serial 小修
Some checks failed
Playwright Tests / test (push) Has been cancelled

This commit is contained in:
lenn
2026-06-23 09:57:51 +08:00
parent 91307f1985
commit f55bd20288
12 changed files with 377 additions and 5 deletions

View File

@@ -24,7 +24,7 @@ const DEFAULT_TACTILE_REPLY_TIMEOUT_MS: u64 = 140;
// MCU currently uses a fixed node layout. Update this list to match the firmware:
// one entry per Config bit, containing that node's number of u16 samples.
const DEFAULT_HAND_GATEWAY_NODE_SAMPLE_COUNTS: &[u16] = &[84];
const DEFAULT_HAND_GATEWAY_NODE_SAMPLE_COUNTS: &[u16] = &[84, 84, 84, 84, 84, 70, 44];
type SharedTactileRecording = Arc<Mutex<TactileARecording>>;

View File

@@ -241,13 +241,28 @@ pub async fn run_hand_gateway_serial(
frame.valid_config,
frame.block_count,
);
for node in frame.nodes {
let mut pressure_matrix = Vec::new();
for node in &frame.nodes {
info!(
"[hand_gateway][node] mask=0x{:08X} valid={} payload={:02X?}",
node.config_mask,
node.valid,
node.payload,
);
if node.valid {
pressure_matrix.extend(
HandGatewayCodec::parse_node_payload(&node.payload)?
.into_iter()
.map(f32::from),
);
} else {
let sample_count = node.payload.len() / 2;
pressure_matrix.extend(std::iter::repeat(0.0).take(sample_count));
}
}
if !pressure_matrix.is_empty() {
app.emit("hand_gateway_pressure_matrix", pressure_matrix)?;
}
}
}