Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix complex displays not loading #7858

Merged
merged 23 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
cd08682
fix: add docs and allow historical requests thru
ozyx Sep 25, 2024
4db5676
refactor: update `waitForReady` to use the tick event
ozyx Sep 25, 2024
d88845a
refactor plan view to use resizeObserver instead of polling
davetsay Sep 28, 2024
e395cfe
revert aborting request for size=1
davetsay Sep 30, 2024
57b2c8a
allow 'latest' requests without clock being set
davetsay Sep 30, 2024
d6e08d2
Merge branch 'master' into vipergc-415-dave
davetsay Sep 30, 2024
9960c5d
Merge branch 'master' into vipergc-415
davetsay Sep 30, 2024
bf08498
Merge branch 'vipergc-415' into vipergc-415-dave
davetsay Sep 30, 2024
2d4b128
fix progress bar indeterminate progress cpu/gpu performance
charlesh88 Sep 30, 2024
3ae38a5
Closes vipergc-415
charlesh88 Oct 1, 2024
e9a74f0
provide a default time context if none is provided
davetsay Oct 1, 2024
258d621
change back prod source maps
davetsay Oct 1, 2024
ea14cfc
handle edge case of realtime clocks update not displaying
davetsay Oct 1, 2024
7d7607e
Merge branch 'master' into vipergc-415
davetsay Oct 2, 2024
abfe56e
add explanation for skipping interceptor
davetsay Oct 2, 2024
67e6213
telemetry api ensures we will have a timeContext
davetsay Oct 2, 2024
17a129b
telemetry api ensures telemetry collection will have timeContext
davetsay Oct 2, 2024
0d2a188
Merge branch 'master' into vipergc-415
akhenry Oct 3, 2024
a64e184
we DO need a default context here (thanks e2e)
davetsay Oct 3, 2024
8e86bbe
timeContext is added to request options if not provided
davetsay Oct 3, 2024
4049e4c
standardize requests first
davetsay Oct 7, 2024
dc7a07c
fix timeContexts in telemetryCollection and api
davetsay Oct 8, 2024
6269ecc
Merge branch 'master' into vipergc-415
davetsay Oct 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/api/telemetry/TelemetryAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,10 @@ export default class TelemetryAPI {
options.domain = this.openmct.time.getTimeSystem().key;
}

if (!Object.hasOwn(options, 'timeContext')) {
davetsay marked this conversation as resolved.
Show resolved Hide resolved
options.timeContext = this.openmct.time;
}

return options;
}

Expand Down
7 changes: 4 additions & 3 deletions src/plugins/plan/components/PlanView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ const INNER_TEXT_PADDING = 15;
const TEXT_LEFT_PADDING = 5;
const ROW_PADDING = 5;
const SWIMLANE_PADDING = 3;
const RESIZE_POLL_INTERVAL = 200;
const ROW_HEIGHT = 22;
const MAX_TEXT_WIDTH = 300;
const MIN_ACTIVITY_WIDTH = 2;
Expand Down Expand Up @@ -143,13 +142,15 @@ export default {
this.canvasContext = canvas.getContext('2d');
this.setDimensions();
this.setTimeContext();
this.resizeTimer = setInterval(this.resize, RESIZE_POLL_INTERVAL);
this.handleConfigurationChange(this.configuration);
this.planViewConfiguration.on('change', this.handleConfigurationChange);
this.loadComposition();

this.resizeObserver = new ResizeObserver(this.resize);
this.resizeObserver.observe(this.$refs.plan);
},
beforeUnmount() {
clearInterval(this.resizeTimer);
this.resizeObserver.disconnect();
ozyx marked this conversation as resolved.
Show resolved Hide resolved
this.stopFollowingTimeContext();
if (this.unlisten) {
this.unlisten();
Expand Down
21 changes: 12 additions & 9 deletions src/plugins/remoteClock/RemoteClock.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,18 @@
*/
#waitForReady() {
const waitForInitialTick = (resolve) => {
if (this.lastTick > 0) {
const offsets = this.openmct.time.getClockOffsets();
resolve({
start: this.lastTick + offsets.start,
end: this.lastTick + offsets.end
});
} else {
setTimeout(() => waitForInitialTick(resolve), 100);
}
const tickListener = () => {
if (this.lastTick > 0) {
const offsets = this.openmct.time.getClockOffsets();
this.openmct.time.off('tick', tickListener); // Unregister the tick listener
resolve({

Check warning on line 159 in src/plugins/remoteClock/RemoteClock.js

View check run for this annotation

Codecov / codecov/patch

src/plugins/remoteClock/RemoteClock.js#L155-L159

Added lines #L155 - L159 were not covered by tests
start: this.lastTick + offsets.start,
end: this.lastTick + offsets.end
});
}
};

this.openmct.time.on('tick', tickListener);

Check warning on line 166 in src/plugins/remoteClock/RemoteClock.js

View check run for this annotation

Codecov / codecov/patch

src/plugins/remoteClock/RemoteClock.js#L166

Added line #L166 was not covered by tests
akhenry marked this conversation as resolved.
Show resolved Hide resolved
};

return new Promise(waitForInitialTick);
Expand Down
29 changes: 28 additions & 1 deletion src/plugins/remoteClock/requestInterceptor.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,43 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/

/**
* Intercepts requests to ensure the remote clock is ready.
*
* @param {import('../../openmct').OpenMCT} openmct - The OpenMCT instance.
* @param {import('../../openmct').Identifier} _remoteClockIdentifier - The identifier for the remote clock.
* @param {Function} waitForBounds - A function that returns a promise resolving to the initial bounds.
* @returns {Object} The request interceptor.
*/
function remoteClockRequestInterceptor(openmct, _remoteClockIdentifier, waitForBounds) {
let remoteClockLoaded = false;

return {
appliesTo: () => {
/**
* Determines if the interceptor applies to the given request.
*
* @param {Object} _ - Unused parameter.
* @param {import('../../api/telemetry/TelemetryAPI').TelemetryRequestOptions} request - The request object.
* @returns {boolean} True if the interceptor applies, false otherwise.
*/
appliesTo: (_, request) => {
// Get the activeClock from the Global Time Context
/** @type {import("../../api/time/TimeContext").default} */
const { activeClock } = openmct.time;
const timeContext = request?.timeContext ?? openmct.time;

Check warning on line 46 in src/plugins/remoteClock/requestInterceptor.js

View check run for this annotation

Codecov / codecov/patch

src/plugins/remoteClock/requestInterceptor.js#L46

Added line #L46 was not covered by tests
davetsay marked this conversation as resolved.
Show resolved Hide resolved

if (request.strategy === 'latest' && timeContext.isRealTime()) {
return false;

Check warning on line 49 in src/plugins/remoteClock/requestInterceptor.js

View check run for this annotation

Codecov / codecov/patch

src/plugins/remoteClock/requestInterceptor.js#L48-L49

Added lines #L48 - L49 were not covered by tests
davetsay marked this conversation as resolved.
Show resolved Hide resolved
}

return activeClock?.key === 'remote-clock' && !remoteClockLoaded;
},
/**
* Invokes the interceptor to modify the request.
*
* @param {Object} request - The request object.
* @returns {Promise<Object>} The modified request object.
*/
invoke: async (request) => {
const timeContext = request?.timeContext ?? openmct.time;

Expand Down
4 changes: 3 additions & 1 deletion src/plugins/timeConductor/ConductorInputsRealtime.vue
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export default {
mounted() {
this.handleNewBounds = _.throttle(this.handleNewBounds, 300, {
leading: true,
trailing: false
trailing: true
});
this.setTimeSystem(this.copy(this.openmct.time.getTimeSystem()));
this.openmct.time.on(TIME_CONTEXT_EVENTS.timeSystemChanged, this.setTimeSystem);
Expand Down Expand Up @@ -181,6 +181,8 @@ export default {
}
},
stopFollowingTime() {
this.handleNewBounds.cancel();

if (this.timeContext) {
this.timeContext.off(TIME_CONTEXT_EVENTS.boundsChanged, this.handleNewBounds);
this.timeContext.off(TIME_CONTEXT_EVENTS.clockOffsetsChanged, this.setViewFromOffsets);
Expand Down
14 changes: 5 additions & 9 deletions src/ui/components/progress-bar.scss
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
/******************************************************** PROGRESS BAR */
@keyframes progressIndeterminate {
0% {
left: 0;
width: 0;
transform:scaleX(0);
}
70% {
left: 0;
width: 100%;
90% {
transform:scaleX(1);
davetsay marked this conversation as resolved.
Show resolved Hide resolved
opacity: 1;
}
100% {
left: 100%;
opacity: 0;
}
}
Expand All @@ -24,11 +21,10 @@

&__bar {
background: $colorProgressBar;
height: 100%;
min-height: $progressBarMinH;
transform-origin: left;

&.--indeterminate {
position: absolute;
@include abs();
animation: progressIndeterminate 1.5s ease-in infinite;
}
}
Expand Down
Loading