feat: Enhance PropertyPanel, add RFID auto-gen, and fix node connections

This commit is contained in:
backuppc
2025-12-22 13:46:01 +09:00
parent df9be853ba
commit 4d1f131d3e
6 changed files with 1995 additions and 1515 deletions

View File

@@ -45,9 +45,9 @@ export class SerialPortHandler {
if (this.port.readable) {
this.reader = this.port.readable.getReader();
}
if (this.port.writable) {
this.writer = this.port.writable.getWriter();
this.writer = this.port.writable.getWriter();
}
this.isConnected = true;
@@ -86,19 +86,24 @@ export class SerialPortHandler {
} else {
payload = data;
}
await this.writer.write(payload);
try {
await this.writer.write(payload);
} catch (e) {
console.error("Serial Send Error", e);
throw e; // Re-throw to let caller know if needed, or handle gracefull
}
}
}
getPortInfo(): string | null {
if (this.port) {
const info = this.port.getInfo();
if (info.usbVendorId && info.usbProductId) {
return `ID:${info.usbVendorId.toString(16).padStart(4,'0').toUpperCase()}:${info.usbProductId.toString(16).padStart(4,'0').toUpperCase()}`;
}
return "USB Device";
if (this.port) {
const info = this.port.getInfo();
if (info.usbVendorId && info.usbProductId) {
return `ID:${info.usbVendorId.toString(16).padStart(4, '0').toUpperCase()}:${info.usbProductId.toString(16).padStart(4, '0').toUpperCase()}`;
}
return null;
return "USB Device";
}
return null;
}
private async readLoop() {