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:
31
src/Main.ts
31
src/Main.ts
@@ -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.');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user