mirror of
https://github.com/nasa/openmct.git
synced 2025-01-19 03:06:54 +00:00
[Conditionals] Only provide telemetry for incoming telemetry that is used (#2914)
* Ensures that results for a specific datapoint are evaluated atomically. * Removes timestamp based evalutation from conditionManager * Remove unused code * remove generating timestamp for telemetry data * get results directly instead of using events * remove unused listeners, events, and helpers * linting * remove commented code * telemetry criterion stores its own result * refactor all/any telemetry criterion to use new evaluator * tie in requests and eliminate unused code * use current timesystem to compare latest * scope function names * AllTelemetryCriterion extends TelemetryCriterion * fix telemetrycriterion and unit testing * fix unit tests * check if telemetry is used at condition manager level * move check to condition manager * remove whitespace Co-authored-by: Joshi <simplyrender@gmail.com> Co-authored-by: Andrew Henry <akhenry@gmail.com>
This commit is contained in:
parent
26838635b6
commit
1842d3923c
@ -69,9 +69,7 @@ export default class ConditionClass extends EventEmitter {
|
|||||||
console.log('no data received');
|
console.log('no data received');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!this.isTelemetryUsed(datum.id)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.criteria.forEach(criterion => {
|
this.criteria.forEach(criterion => {
|
||||||
if (this.isAnyOrAllTelemetry(criterion)) {
|
if (this.isAnyOrAllTelemetry(criterion)) {
|
||||||
criterion.getResult(datum, this.conditionManager.telemetryObjects);
|
criterion.getResult(datum, this.conditionManager.telemetryObjects);
|
||||||
|
@ -248,7 +248,21 @@ export default class ConditionManager extends EventEmitter {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isTelemetryUsed(id) {
|
||||||
|
for(const condition of this.conditionClassCollection) {
|
||||||
|
if (condition.isTelemetryUsed(id)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
telemetryReceived(id, datum) {
|
telemetryReceived(id, datum) {
|
||||||
|
if (!this.isTelemetryUsed(id)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const normalizedDatum = this.createNormalizedDatum(datum, id);
|
const normalizedDatum = this.createNormalizedDatum(datum, id);
|
||||||
const timeSystemKey = this.openmct.time.timeSystem().key;
|
const timeSystemKey = this.openmct.time.timeSystem().key;
|
||||||
let timestamp = {};
|
let timestamp = {};
|
||||||
|
Loading…
Reference in New Issue
Block a user