mirror of
https://github.com/nasa/openmct.git
synced 2025-06-21 08:39:59 +00:00
always use timestamp from latest datum
This commit is contained in:
@ -208,29 +208,29 @@ export default class ConditionManager extends EventEmitter {
|
|||||||
handleConditionResult(resultObj) {
|
handleConditionResult(resultObj) {
|
||||||
let conditionCollection = this.domainObject.configuration.conditionCollection;
|
let conditionCollection = this.domainObject.configuration.conditionCollection;
|
||||||
let currentConditionIdentifier = conditionCollection[conditionCollection.length-1];
|
let currentConditionIdentifier = conditionCollection[conditionCollection.length-1];
|
||||||
// This sets timestamps for the default condition
|
|
||||||
let currentConditionResult = resultObj ? resultObj.data : {};
|
|
||||||
|
|
||||||
if (resultObj) {
|
if (resultObj) {
|
||||||
let idAsString = this.openmct.objects.makeKeyString(resultObj.id);
|
let idAsString = this.openmct.objects.makeKeyString(resultObj.id);
|
||||||
if (this.findConditionById(idAsString)) {
|
if (this.findConditionById(idAsString)) {
|
||||||
this.conditionResults[idAsString] = resultObj.data;
|
this.conditionResults[idAsString] = resultObj.data.result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i < conditionCollection.length - 1; i++) {
|
for (let i = 0; i < conditionCollection.length - 1; i++) {
|
||||||
let conditionIdAsString = this.openmct.objects.makeKeyString(conditionCollection[i]);
|
let conditionIdAsString = this.openmct.objects.makeKeyString(conditionCollection[i]);
|
||||||
if (this.conditionResults[conditionIdAsString] && this.conditionResults[conditionIdAsString].result) {
|
if (this.conditionResults[conditionIdAsString]) {
|
||||||
//first condition to be true wins
|
//first condition to be true wins
|
||||||
currentConditionIdentifier = conditionCollection[i];
|
currentConditionIdentifier = conditionCollection[i];
|
||||||
currentConditionResult = this.conditionResults[conditionIdAsString];
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.openmct.objects.get(currentConditionIdentifier).then((obj) => {
|
this.openmct.objects.get(currentConditionIdentifier).then((obj) => {
|
||||||
this.emit('conditionSetResultUpdated',
|
this.emit('conditionSetResultUpdated',
|
||||||
Object.assign(currentConditionResult, {output: obj.configuration.output})
|
Object.assign({},
|
||||||
|
resultObj.data,
|
||||||
|
{ output: obj.configuration.output }
|
||||||
|
)
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user