mirror of
https://github.com/nasa/openmct.git
synced 2025-02-25 19:11:35 +00:00
fix test data
This commit is contained in:
parent
d4b2986651
commit
a9d63b9272
@ -9,7 +9,6 @@ export default class CompsManager extends EventEmitter {
|
||||
#dataFrame = {};
|
||||
#telemetryLoadedPromises = [];
|
||||
#loaded = false;
|
||||
#valid = false;
|
||||
#telemetryProcessors = {};
|
||||
|
||||
constructor(openmct, domainObject) {
|
||||
@ -19,11 +18,11 @@ export default class CompsManager extends EventEmitter {
|
||||
}
|
||||
|
||||
isValid() {
|
||||
return this.#valid;
|
||||
return this.#domainObject.configuration.comps.valid;
|
||||
}
|
||||
|
||||
setValid(valid) {
|
||||
this.#valid = valid;
|
||||
this.#domainObject.configuration.comps.valid = valid;
|
||||
}
|
||||
|
||||
#getNextAlphabeticalParameterName() {
|
||||
|
@ -26,7 +26,10 @@
|
||||
<div class="c-cs__content c-cs__current-output-value">
|
||||
<span class="c-cs__current-output-value__label">Current Output</span>
|
||||
<span class="c-cs__current-output-value__value" aria-label="Current Output Value">
|
||||
<template v-if="testDataApplied">
|
||||
<template v-if="testDataApplied && currentTestOutput">
|
||||
{{ currentTestOutput }}
|
||||
</template>
|
||||
<template v-else-if="currentCompOutput && !testDataApplied">
|
||||
{{ currentCompOutput }}
|
||||
</template>
|
||||
<template v-else> --- </template>
|
||||
@ -128,6 +131,7 @@ const domainObject = inject('domainObject');
|
||||
const compsManagerPool = inject('compsManagerPool');
|
||||
const compsManager = CompsManager.getCompsManager(domainObject, openmct, compsManagerPool);
|
||||
const currentCompOutput = ref(null);
|
||||
const currentTestOutput = ref(null);
|
||||
const testDataApplied = ref(false);
|
||||
const parameters = ref(null);
|
||||
const expression = ref(null);
|
||||
@ -210,12 +214,15 @@ function applyTestData() {
|
||||
}, {});
|
||||
try {
|
||||
const testOutput = evaluate(expression.value, scope);
|
||||
currentCompOutput.value = testOutput;
|
||||
currentTestOutput.value = testOutput;
|
||||
expressionOutput.value = null;
|
||||
compsManager.setValid(true);
|
||||
compsManager.persist(domainObject);
|
||||
} catch (error) {
|
||||
console.error('👎 Error applying test data', error);
|
||||
currentCompOutput.value = null;
|
||||
currentTestOutput.value = null;
|
||||
compsManager.setValid(false);
|
||||
compsManager.persist(domainObject);
|
||||
expressionOutput.value = error.message;
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,8 @@ export default function CompsPlugin() {
|
||||
domainObject.configuration = {
|
||||
comps: {
|
||||
expression: '',
|
||||
parameters: []
|
||||
parameters: [],
|
||||
valid: false
|
||||
}
|
||||
};
|
||||
domainObject.composition = [];
|
||||
|
Loading…
x
Reference in New Issue
Block a user