don't list non animation files

node_mode
Jake 2025-11-02 16:17:43 +08:00
parent 5a9eee688b
commit 7a619886c6
1 changed files with 19 additions and 16 deletions

View File

@ -420,7 +420,9 @@ window.onload = () => {
clearFileList();
files.forEach(filename => {
if (filename) addFileToList(filename);
if (filename && filename.toLowerCase().endsWith(".anim")) {
addFileToList(filename);
}
});
break;
@ -517,19 +519,20 @@ logBox.scrollTop = logBox.scrollHeight;
});
function handlePositionStreamPacket(data) {
const motorCount = Math.floor(data.length / 2); // Each motor uses 2 bytes
//console.log(data);
const motorCount = Math.floor(data.length / 2); // Each motor uses 2 bytes
let d = [];
for (let i = 0; i < motorCount; i++) {
const high = data[i * 2]; // High byte
const low = data[i * 2 + 1]; // Low byte
const value = (high << 8) | low; // Combine into uint16_t
const value = (low << 8) | high; // Combine into uint16_t
d.push(value);
if (dials[i]) {
dials[i].value = value;
}
}
console.log(data);
}
function handleLoadedFile(data) {