mirror of
https://github.com/nasa/openmct.git
synced 2024-12-24 07:16:39 +00:00
Evaluate all criteria
This commit is contained in:
parent
d0768032c4
commit
7508b01e6f
@ -1,3 +1,5 @@
|
|||||||
|
import { evaluateResults } from './utils/evaluator.js';
|
||||||
|
|
||||||
export default class HistoricalTelemetryProvider {
|
export default class HistoricalTelemetryProvider {
|
||||||
#telemetryOptions;
|
#telemetryOptions;
|
||||||
#telemetryObjects = {};
|
#telemetryObjects = {};
|
||||||
@ -70,12 +72,17 @@ export default class HistoricalTelemetryProvider {
|
|||||||
for (let conditionIndex = 0; conditionIndex < this.#conditions.length; conditionIndex++) {
|
for (let conditionIndex = 0; conditionIndex < this.#conditions.length; conditionIndex++) {
|
||||||
const condition = this.#conditions[conditionIndex];
|
const condition = this.#conditions[conditionIndex];
|
||||||
const { id } = condition;
|
const { id } = condition;
|
||||||
const conditionCriteria = condition.criteria?.[0];
|
const conditionCriteria = condition?.criteria.length > 0;
|
||||||
let result = false;
|
let result = false;
|
||||||
let defaultHit = false;
|
let defaultHit = false;
|
||||||
if (conditionCriteria) {
|
if (conditionCriteria) {
|
||||||
const inputTelemetry = this.#getInputTelemetry(conditionCriteria, dataFrame, timestamp);
|
result = evaluateResults(
|
||||||
result = conditionCriteria.computeResult({ id, ...inputTelemetry });
|
condition.criteria.map((criterion) => {
|
||||||
|
const inputTelemetry = this.#getInputTelemetry(criterion, dataFrame, timestamp);
|
||||||
|
return criterion.computeResult({ id, ...inputTelemetry });
|
||||||
|
}),
|
||||||
|
condition?.trigger
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
// default criteria is 'all'
|
// default criteria is 'all'
|
||||||
defaultHit = true;
|
defaultHit = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user