don't list non animation files
parent
5a9eee688b
commit
7a619886c6
13
script.js
13
script.js
|
|
@ -420,7 +420,9 @@ window.onload = () => {
|
||||||
clearFileList();
|
clearFileList();
|
||||||
|
|
||||||
files.forEach(filename => {
|
files.forEach(filename => {
|
||||||
if (filename) addFileToList(filename);
|
if (filename && filename.toLowerCase().endsWith(".anim")) {
|
||||||
|
addFileToList(filename);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
@ -517,19 +519,20 @@ logBox.scrollTop = logBox.scrollHeight;
|
||||||
});
|
});
|
||||||
|
|
||||||
function handlePositionStreamPacket(data) {
|
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++) {
|
for (let i = 0; i < motorCount; i++) {
|
||||||
const high = data[i * 2]; // High byte
|
const high = data[i * 2]; // High byte
|
||||||
const low = data[i * 2 + 1]; // Low 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]) {
|
if (dials[i]) {
|
||||||
dials[i].value = value;
|
dials[i].value = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleLoadedFile(data) {
|
function handleLoadedFile(data) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue