Merge branch 'telemetry-comps' into combined-rodap-stuff

This commit is contained in:
Scott Bell 2024-10-10 10:49:30 +02:00
commit 5803cd1de9
2 changed files with 15 additions and 4 deletions

View File

@ -62,7 +62,7 @@ export default class CompsManager extends EventEmitter {
testValue: 0,
timeMetaData,
accumulateValues: false,
sampleSize: null
sampleSize: 10
});
this.emit('parameterAdded', this.#domainObject);
}
@ -347,7 +347,9 @@ export default class CompsManager extends EventEmitter {
clearData(telemetryLoadedPromise) {
this.#loaded = false;
this.#telemetryLoadedPromises.push(telemetryLoadedPromise);
if (telemetryLoadedPromise) {
this.#telemetryLoadedPromises.push(telemetryLoadedPromise);
}
}
setOutputFormat(outputFormat) {

View File

@ -113,6 +113,9 @@
aria-label="Toggle Parameter Accumulation"
></span>
</label>
<div v-if="!isEditing && parameter.accumulateValues">
- accumulating values with sample size {{ parameter.sampleSize }}
</div>
<span v-if="isEditing && parameter.accumulateValues" class="c-test-datum__string"
>Sample Size</span
@ -207,8 +210,7 @@ const props = defineProps({
onBeforeMount(async () => {
const telemetryOptions = {
size: 1,
strategy: 'latest'
strategy: 'minmax'
};
outputTelemetryCollection = openmct.telemetry.requestCollection(domainObject, telemetryOptions);
outputTelemetryCollection.on('add', telemetryProcessor);
@ -264,6 +266,7 @@ function updateParameters() {
openmct.objects.mutate(domainObject, `configuration.comps.parameters`, parameters.value);
compsManager.setDomainObject(domainObject);
applyTestData();
reload();
}
function updateAccumulateValues(parameter) {
@ -295,6 +298,7 @@ function updateExpression() {
openmct.objects.mutate(domainObject, `configuration.comps.expression`, expression.value);
compsManager.setDomainObject(domainObject);
applyTestData();
reload();
}
function getValueFormatter() {
@ -352,6 +356,11 @@ function telemetryProcessor(data) {
currentCompOutput.value = formattedOutput;
}
function reload() {
clearData();
outputTelemetryCollection._requestHistoricalTelemetry();
}
function clearData() {
currentCompOutput.value = null;
}