feat: 新增 Playwright 测试 + ModelStage UI 更新与 serial 小修
Some checks failed
Playwright Tests / test (push) Has been cancelled
Some checks failed
Playwright Tests / test (push) Has been cancelled
This commit is contained in:
@@ -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)?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user