Small bugfix

This commit is contained in:
2025-10-24 16:21:04 +02:00
parent 02391f813b
commit 7ce9003621
21 changed files with 601 additions and 10 deletions

View File

@@ -10,6 +10,8 @@ export class UnityWebSocket {
message?: string = 'Waiting for process...';
error?: string;
errorTriggerStartupDelay = 1000;
parameters: UnityParameters = {
timelineWatching: false,
timelineStanding: false,
@@ -113,6 +115,8 @@ export class UnityWebSocket {
this.state = state;
this.broadcastState();
if (error != null) this._Main.Twilio.sendError('UnityWebSocket', error);
if (state == 'FAILED' || state == 'DISCONNECTED')
console.warn(PREFIX, message ?? error);
else console.log(PREFIX, message ?? error);
@@ -146,7 +150,15 @@ export class UnityWebSocket {
this.parameters.outOfService =
message.heartbeat.showOutOfService ?? false;
this.parameters.sensors = message.heartbeat.dataSensors;
this.parameters.sliders = message.heartbeat.dataSliders;
this.parameters.sliders = message.heartbeat.dataSliders.map(
(slider) => {
return {
...slider,
decimalPlaces:
slider.min == 0 && slider.max == 1 ? 2 : null,
};
}
);
this.broadcastState();
break;
@@ -226,6 +238,8 @@ export class UnityWebSocket {
this.socket.on('open', () => {
this.startFetchClocks();
this._Main.Twilio.resetError('UnityWebSocket');
this.setInfo('Connected', null, 'CONNECTED');
});