mirror of
https://github.com/nasa/openmct.git
synced 2025-03-25 05:25:45 +00:00
can add two sin waves
This commit is contained in:
parent
74c3a95ca3
commit
ce5e435ae0
@ -59,7 +59,7 @@ export default class CompsManager extends EventEmitter {
|
||||
return 'a + b';
|
||||
}
|
||||
|
||||
#addTelemetryObject = (telemetryObject) => {
|
||||
#addTelemetryObject = async (telemetryObject) => {
|
||||
console.debug('📢 CompsManager: #addTelemetryObject', telemetryObject);
|
||||
const keyString = this.#openmct.objects.makeKeyString(telemetryObject.identifier);
|
||||
this.#telemetryObjects[keyString] = telemetryObject;
|
||||
@ -68,7 +68,7 @@ export default class CompsManager extends EventEmitter {
|
||||
|
||||
this.#telemetryCollections[keyString].on('add', this.#telemetryProcessor);
|
||||
this.#telemetryCollections[keyString].on('clear', this.#clearData);
|
||||
this.#telemetryCollections[keyString].load();
|
||||
await this.#telemetryCollections[keyString].load();
|
||||
};
|
||||
|
||||
static getCompsManager(domainObject, openmct, compsManagerPool) {
|
||||
|
@ -41,8 +41,8 @@ function calculate(telemetryForComps, expression) {
|
||||
for (const [utc, sin1] of utcMap1.entries()) {
|
||||
if (utcMap2.has(utc)) {
|
||||
const sin2 = utcMap2.get(utc);
|
||||
const sumSin = evaluate(expression, { a: sin1, b: sin2 });
|
||||
sumResults.push({ utc, sumSin });
|
||||
const output = evaluate(expression, { a: sin1, b: sin2 });
|
||||
sumResults.push({ utc, output });
|
||||
}
|
||||
}
|
||||
return sumResults;
|
||||
|
@ -64,7 +64,8 @@ export default class CompsTelemetryProvider {
|
||||
const telemetryForComps = specificCompsManager.requestUnderlyingTelemetry();
|
||||
const expression = specificCompsManager.getExpression();
|
||||
// need to create callbackID with a promise for future execution
|
||||
console.debug('🏟️ Telemetry for comps:', telemetryForComps);
|
||||
console.debug('🏟️ 1 Telemetry for comps:', telemetryForComps);
|
||||
console.debug('🏟️ 2 Telemetry for comps:', specificCompsManager.requestUnderlyingTelemetry());
|
||||
this.#requestPromises[callbackID] = { resolve, reject };
|
||||
this.#sharedWorker.port.postMessage({
|
||||
type: 'calculateRequest',
|
||||
|
@ -19,6 +19,7 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
import CompsMetadataProvider from './CompsMetadataProvider.js';
|
||||
import CompsTelemetryProvider from './CompsTelemetryProvider.js';
|
||||
import CompsViewProvider from './CompsViewProvider.js';
|
||||
|
||||
@ -45,6 +46,7 @@ export default function CompsPlugin() {
|
||||
}
|
||||
return true;
|
||||
});
|
||||
openmct.telemetry.addProvider(new CompsMetadataProvider(openmct));
|
||||
openmct.telemetry.addProvider(new CompsTelemetryProvider(openmct, compsManagerPool));
|
||||
openmct.objectViews.addProvider(new CompsViewProvider(openmct, compsManagerPool));
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user