timesystem works

This commit is contained in:
Scott Bell 2024-08-15 14:04:50 -05:00
parent 87dc272a5a
commit df3ca84fda
2 changed files with 10 additions and 6 deletions

View File

@ -9,7 +9,7 @@ export default class CompsManager extends EventEmitter {
#dataFrame = {};
#batchedNewData = {};
#batchPromises = {};
#BATCH_DEBOUNCE_MS = 100;
#BATCH_DEBOUNCE_MS = 1;
#telemetryLoadedPromises = [];
constructor(openmct, domainObject) {
@ -23,9 +23,9 @@ export default class CompsManager extends EventEmitter {
const metaData = this.#openmct.telemetry.getMetadata(telemetryObject);
const specificTelemetryCollection = this.#telemetryCollections[keyString];
const specificTimeKey = specificTelemetryCollection.timeKey;
const timeMetaData = metaData.valueMetadatas.find(
(metaDatum) => metaDatum.key === specificTimeKey
);
const timeMetaData = metaData.valueMetadatas.find((metaDatum) => {
return metaDatum.key === specificTimeKey || metaDatum.source === specificTimeKey;
});
const random4Digit = Math.floor(1000 + Math.random() * 9000);
this.#domainObject.configuration.comps.parameters.push({
keyString,

View File

@ -19,6 +19,7 @@
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
import CompsManager from './CompsManager.js';
export default class CompsMetadataProvider {
#openmct = null;
@ -47,8 +48,11 @@ export default class CompsMetadataProvider {
}
getMetadata(domainObject) {
const keyString = this.#openmct.objects.makeKeyString(domainObject.identifier);
const specificCompsManager = this.#compsManagerPool[keyString];
const specificCompsManager = CompsManager.getCompsManager(
domainObject,
this.#openmct,
this.#compsManagerPool
);
console.debug('📦 CompsMetadataProvider: getMetadata', specificCompsManager);
// if there are any parameters, grab the first one's timeMetaData
const timeMetaData = specificCompsManager?.getParameters()[0]?.timeMetaData;