[Time] Conductors and API Enhancements (#6768)
* Fixed #4975 - Compact Time Conductor styling * Fixed #5773 - Ubiquitous global clock * Mode functionality added to TimeAPI * TimeAPI modified to always have a ticking clock * Mode dropdown added to independent and regular time conductors * Overall conductor appearance modifications and enhancements * TimeAPI methods deprecated with warnings * Significant updates to markup, styling and behavior of main Time Conductor and independent version. --------- Co-authored-by: Charles Hacskaylo <charlesh88@gmail.com> Co-authored-by: Shefali <simplyrender@gmail.com> Co-authored-by: Andrew Henry <akhenry@gmail.com> Co-authored-by: John Hill <john.c.hill@nasa.gov> Co-authored-by: Scott Bell <scott@traclabs.com>
This commit is contained in:
@@ -156,9 +156,9 @@ export default function () {
|
||||
key: 'thumbnail',
|
||||
...formatThumbnail
|
||||
});
|
||||
openmct.telemetry.addProvider(getRealtimeProvider());
|
||||
openmct.telemetry.addProvider(getHistoricalProvider());
|
||||
openmct.telemetry.addProvider(getLadProvider());
|
||||
openmct.telemetry.addProvider(getRealtimeProvider(openmct));
|
||||
openmct.telemetry.addProvider(getHistoricalProvider(openmct));
|
||||
openmct.telemetry.addProvider(getLadProvider(openmct));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -207,14 +207,14 @@ function getImageLoadDelay(domainObject) {
|
||||
return imageLoadDelay;
|
||||
}
|
||||
|
||||
function getRealtimeProvider() {
|
||||
function getRealtimeProvider(openmct) {
|
||||
return {
|
||||
supportsSubscribe: (domainObject) => domainObject.type === 'example.imagery',
|
||||
subscribe: (domainObject, callback) => {
|
||||
const delay = getImageLoadDelay(domainObject);
|
||||
const interval = setInterval(() => {
|
||||
const imageSamples = getImageSamples(domainObject.configuration);
|
||||
const datum = pointForTimestamp(Date.now(), domainObject.name, imageSamples, delay);
|
||||
const datum = pointForTimestamp(openmct.time.now(), domainObject.name, imageSamples, delay);
|
||||
callback(datum);
|
||||
}, delay);
|
||||
|
||||
@@ -225,7 +225,7 @@ function getRealtimeProvider() {
|
||||
};
|
||||
}
|
||||
|
||||
function getHistoricalProvider() {
|
||||
function getHistoricalProvider(openmct) {
|
||||
return {
|
||||
supportsRequest: (domainObject, options) => {
|
||||
return domainObject.type === 'example.imagery' && options.strategy !== 'latest';
|
||||
@@ -233,17 +233,12 @@ function getHistoricalProvider() {
|
||||
request: (domainObject, options) => {
|
||||
const delay = getImageLoadDelay(domainObject);
|
||||
let start = options.start;
|
||||
const end = Math.min(options.end, Date.now());
|
||||
const end = Math.min(options.end, openmct.time.now());
|
||||
const data = [];
|
||||
while (start <= end && data.length < delay) {
|
||||
data.push(
|
||||
pointForTimestamp(
|
||||
start,
|
||||
domainObject.name,
|
||||
getImageSamples(domainObject.configuration),
|
||||
delay
|
||||
)
|
||||
);
|
||||
const imageSamples = getImageSamples(domainObject.configuration);
|
||||
const generatedDataPoint = pointForTimestamp(start, domainObject.name, imageSamples, delay);
|
||||
data.push(generatedDataPoint);
|
||||
start += delay;
|
||||
}
|
||||
|
||||
@@ -252,7 +247,7 @@ function getHistoricalProvider() {
|
||||
};
|
||||
}
|
||||
|
||||
function getLadProvider() {
|
||||
function getLadProvider(openmct) {
|
||||
return {
|
||||
supportsRequest: (domainObject, options) => {
|
||||
return domainObject.type === 'example.imagery' && options.strategy === 'latest';
|
||||
@@ -260,7 +255,7 @@ function getLadProvider() {
|
||||
request: (domainObject, options) => {
|
||||
const delay = getImageLoadDelay(domainObject);
|
||||
const datum = pointForTimestamp(
|
||||
Date.now(),
|
||||
openmct.time.now(),
|
||||
domainObject.name,
|
||||
getImageSamples(domainObject.configuration),
|
||||
delay
|
||||
|
||||
Reference in New Issue
Block a user