File tree Expand file tree Collapse file tree 3 files changed +25
-17
lines changed Expand file tree Collapse file tree 3 files changed +25
-17
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ const tick = new Timer(
3535
3636 if ( delta ) {
3737 windowPost ( {
38- msg : EMsg . TELEMETRY ,
38+ msg : EMsg . TELEMETRY_DELTA ,
3939 timeOfCollection : now ,
4040 telemetryDelta : delta ,
4141 } ) ;
Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ export enum EMsg {
9696 START_OBSERVE ,
9797 STOP_OBSERVE ,
9898 TELEMETRY ,
99+ TELEMETRY_DELTA ,
99100 TELEMETRY_ACKNOWLEDGED ,
100101 MEDIA_COMMAND ,
101102 RESET_WRAPPER_HISTORY ,
@@ -122,8 +123,12 @@ export interface TMsgLoaded {
122123export interface TMsgTelemetry {
123124 msg : EMsg . TELEMETRY ;
124125 timeOfCollection : number ;
125- telemetry ?: TTelemetry ;
126- telemetryDelta ?: Delta ;
126+ telemetry : TTelemetry ;
127+ }
128+ export interface TMsgTelemetryDelta {
129+ msg : EMsg . TELEMETRY_DELTA ;
130+ timeOfCollection : number ;
131+ telemetryDelta : Delta ;
127132}
128133export interface TMsgTelemetryAcknowledged {
129134 msg : EMsg . TELEMETRY_ACKNOWLEDGED ;
@@ -141,6 +146,7 @@ export interface TMsgMediaCommand {
141146}
142147export type TMsgOptions =
143148 | TMsgTelemetry
149+ | TMsgTelemetryDelta
144150 | TMsgTelemetryAcknowledged
145151 | TMsgStartObserve
146152 | TMsgStopObserve
Original file line number Diff line number Diff line change 3232 }
3333 });
3434 } else if (o .msg === EMsg .TELEMETRY ) {
35- if (o .telemetry ) {
36- telemetryProgressive = structuredClone (o .telemetry );
37- telemetry = o .telemetry ;
38- } else if (o .telemetryDelta ) {
39- diff .patch (telemetryProgressive , o .telemetryDelta );
40- telemetry = structuredClone (telemetryProgressive );
41- }
42-
43- portPost ({
44- msg: EMsg .TELEMETRY_ACKNOWLEDGED ,
45- timeOfCollection: o .timeOfCollection ,
46- });
47-
48- spinnerEl ?.tick ();
35+ telemetryProgressive = structuredClone (o .telemetry );
36+ telemetry = o .telemetry ;
37+ acknowledgeTelemetry (o .timeOfCollection );
38+ } else if (o .msg === EMsg .TELEMETRY_DELTA ) {
39+ diff .patch (telemetryProgressive , o .telemetryDelta );
40+ telemetry = structuredClone (telemetryProgressive );
41+ acknowledgeTelemetry (o .timeOfCollection );
4942 }
5043 });
5144
5952 });
6053 });
6154
55+ function acknowledgeTelemetry(timeOfCollection : number ) {
56+ portPost ({
57+ msg: EMsg .TELEMETRY_ACKNOWLEDGED ,
58+ timeOfCollection ,
59+ });
60+
61+ spinnerEl ?.tick ();
62+ }
63+
6264 function onTogglePause() {
6365 paused = ! paused ;
6466 setSettings ({ paused });
You can’t perform that action at this time.
0 commit comments