mirror of
https://github.com/nasa/openmct.git
synced 2025-06-04 08:30:48 +00:00
adding works
This commit is contained in:
parent
ce5e435ae0
commit
69db534042
@ -47,9 +47,11 @@ export default class CompsManager extends EventEmitter {
|
|||||||
return underlyingTelemetry;
|
return underlyingTelemetry;
|
||||||
}
|
}
|
||||||
|
|
||||||
#telemetryProcessor(telemetryObjects) {
|
#telemetryProcessor = (telemetryObjects) => {
|
||||||
|
// new data!
|
||||||
|
console.debug(`🎉 new data!`, telemetryObjects);
|
||||||
this.emit('underlyingTelemetryUpdated', telemetryObjects);
|
this.emit('underlyingTelemetryUpdated', telemetryObjects);
|
||||||
}
|
};
|
||||||
|
|
||||||
#clearData() {
|
#clearData() {
|
||||||
console.debug('Clear Data');
|
console.debug('Clear Data');
|
||||||
|
@ -32,16 +32,16 @@ function calculate(telemetryForComps, expression) {
|
|||||||
const dataSet2 = Object.values(telemetryForComps)[1];
|
const dataSet2 = Object.values(telemetryForComps)[1];
|
||||||
|
|
||||||
// Organize data by utc for quick access
|
// Organize data by utc for quick access
|
||||||
const utcMap1 = new Map(dataSet1.map((item) => [item.utc, item.sin]));
|
const utcMap1 = new Map(dataSet1.map((item) => [item.utc, item]));
|
||||||
const utcMap2 = new Map(dataSet2.map((item) => [item.utc, item.sin]));
|
const utcMap2 = new Map(dataSet2.map((item) => [item.utc, item]));
|
||||||
|
|
||||||
const sumResults = [];
|
const sumResults = [];
|
||||||
|
|
||||||
// Iterate over the first dataset and check for matching utc in the second dataset
|
// Iterate over the first dataset and check for matching utc in the second dataset
|
||||||
for (const [utc, sin1] of utcMap1.entries()) {
|
for (const [utc, item1] of utcMap1.entries()) {
|
||||||
if (utcMap2.has(utc)) {
|
if (utcMap2.has(utc)) {
|
||||||
const sin2 = utcMap2.get(utc);
|
const item2 = utcMap2.get(utc);
|
||||||
const output = evaluate(expression, { a: sin1, b: sin2 });
|
const output = evaluate(expression, { a: item1.sin, b: item2.sin });
|
||||||
sumResults.push({ utc, output });
|
sumResults.push({ utc, output });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user