Lots of changes

-    Feedback van dataSensor array
-    dataSliders min/max and unit
-    Camera before Unity
-    Restart knop buiten service mode
-    Operator phonenumber button
-    Gracefull shutdown
-    Out of service control
This commit is contained in:
2025-10-23 17:45:35 +02:00
parent f07ba57168
commit cd33670361
36 changed files with 1444 additions and 277 deletions

View File

@@ -31,4 +31,35 @@ export class Main {
this.UnityRunner.start();
}, this.Config.unity.executable.startUpDelay ?? 0);
}
async restart() {
console.log('Stopping UnityRunner...');
await this.UnityRunner.stop();
const doReboot = !process.argv.includes('--no-reboot');
console.log(`${doReboot ? 'Rebooting' : 'Restarting'} CameraRunner...`);
const succeed = await new Promise((resolve) => {
this.CameraRunner.sendCommand(
doReboot ? 'reboot' : 'restart',
(response: { succeed: boolean; message?: string }) => {
if (!response.succeed) {
console.error(
'Failed to reboot CameraRunner:',
response.message
);
resolve(false);
} else {
console.log('CameraRunner rebooted successfully.');
resolve(true);
}
}
);
});
if (!succeed) return;
console.log('Starting UnityRunner...');
await this.UnityRunner.start();
console.log('Restart complete.');
}
}