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