Small bugfix
This commit is contained in:
@@ -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');
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user