mirror of
https://github.com/nasa/openmct.git
synced 2025-01-26 06:09:27 +00:00
Merge remote-tracking branch 'khalidadil/extend-conditional' into combined-rodap-stuff
This commit is contained in:
commit
dba2cc236f
@ -24,7 +24,8 @@ import { EventEmitter } from 'eventemitter3';
|
|||||||
import { v4 as uuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
|
|
||||||
import Condition from './Condition.js';
|
import Condition from './Condition.js';
|
||||||
import HistoricalTelemetryProvider from './historicalTelemetryProvider.js';
|
import HistoricalTelemetryProvider from './HistoricalTelemetryProvider.js';
|
||||||
|
import { TELEMETRY_VALUE } from './utils/constants.js';
|
||||||
import { getLatestTimestamp } from './utils/time.js';
|
import { getLatestTimestamp } from './utils/time.js';
|
||||||
|
|
||||||
export default class ConditionManager extends EventEmitter {
|
export default class ConditionManager extends EventEmitter {
|
||||||
@ -392,7 +393,7 @@ export default class ConditionManager extends EventEmitter {
|
|||||||
|
|
||||||
const currentCondition = this.getCurrentConditionLAD(conditionResults);
|
const currentCondition = this.getCurrentConditionLAD(conditionResults);
|
||||||
let output = currentCondition?.configuration?.output;
|
let output = currentCondition?.configuration?.output;
|
||||||
if (output === 'telemetry value') {
|
if (output === TELEMETRY_VALUE) {
|
||||||
const { outputTelemetry, outputMetadata } = currentCondition.configuration;
|
const { outputTelemetry, outputMetadata } = currentCondition.configuration;
|
||||||
const outputTelemetryObject = await this.openmct.objects.get(outputTelemetry);
|
const outputTelemetryObject = await this.openmct.objects.get(outputTelemetry);
|
||||||
const telemetryOptions = {
|
const telemetryOptions = {
|
||||||
|
@ -113,7 +113,7 @@
|
|||||||
@change="persist"
|
@change="persist"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
<span v-if="selectedOutputSelection === 'telemetry value'" class="c-cdef__control">
|
<span v-if="selectedOutputSelection === TELEMETRY_VALUE" class="c-cdef__control">
|
||||||
<select
|
<select
|
||||||
v-model="condition.configuration.outputTelemetry"
|
v-model="condition.configuration.outputTelemetry"
|
||||||
aria-label="Output Telemetry Selection"
|
aria-label="Output Telemetry Selection"
|
||||||
@ -233,6 +233,7 @@ import { v4 as uuid } from 'uuid';
|
|||||||
|
|
||||||
import { TRIGGER, TRIGGER_LABEL } from '@/plugins/condition/utils/constants';
|
import { TRIGGER, TRIGGER_LABEL } from '@/plugins/condition/utils/constants';
|
||||||
|
|
||||||
|
import { TELEMETRY_VALUE } from '../utils/constants.js';
|
||||||
import ConditionDescription from './ConditionDescription.vue';
|
import ConditionDescription from './ConditionDescription.vue';
|
||||||
import Criterion from './CriterionItem.vue';
|
import Criterion from './CriterionItem.vue';
|
||||||
|
|
||||||
@ -288,7 +289,7 @@ export default {
|
|||||||
expanded: true,
|
expanded: true,
|
||||||
trigger: 'all',
|
trigger: 'all',
|
||||||
selectedOutputSelection: '',
|
selectedOutputSelection: '',
|
||||||
outputOptions: ['none', 'false', 'true', 'string', 'telemetry value'],
|
outputOptions: ['none', 'false', 'true', 'string', TELEMETRY_VALUE],
|
||||||
criterionIndex: 0,
|
criterionIndex: 0,
|
||||||
draggingOver: false,
|
draggingOver: false,
|
||||||
isDefault: this.condition.isDefault,
|
isDefault: this.condition.isDefault,
|
||||||
@ -329,7 +330,7 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
condition: {
|
condition: {
|
||||||
handler() {
|
handler() {
|
||||||
if (this.condition.configuration.output !== 'telemetry value') {
|
if (this.condition.configuration.output !== TELEMETRY_VALUE) {
|
||||||
this.condition.configuration.outputTelemetry = null;
|
this.condition.configuration.outputTelemetry = null;
|
||||||
this.condition.configuration.outputMetadata = null;
|
this.condition.configuration.outputMetadata = null;
|
||||||
}
|
}
|
||||||
@ -352,18 +353,12 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
setOutputSelection() {
|
setOutputSelection() {
|
||||||
let conditionOutput = this.condition.configuration.output;
|
let conditionOutput = this.condition.configuration.output;
|
||||||
if (conditionOutput) {
|
if (conditionOutput === undefined) {
|
||||||
if (
|
|
||||||
conditionOutput !== 'false' &&
|
|
||||||
conditionOutput !== 'true' &&
|
|
||||||
conditionOutput !== 'telemetry value'
|
|
||||||
) {
|
|
||||||
this.selectedOutputSelection = 'string';
|
|
||||||
} else {
|
|
||||||
this.selectedOutputSelection = conditionOutput;
|
|
||||||
}
|
|
||||||
} else if (conditionOutput === undefined) {
|
|
||||||
this.selectedOutputSelection = 'none';
|
this.selectedOutputSelection = 'none';
|
||||||
|
} else if (['false', 'true', TELEMETRY_VALUE].includes(conditionOutput)) {
|
||||||
|
this.selectedOutputSelection = conditionOutput;
|
||||||
|
} else {
|
||||||
|
this.selectedOutputSelection = 'string';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setOutputValue() {
|
setOutputValue() {
|
||||||
|
@ -63,7 +63,7 @@
|
|||||||
:key="index"
|
:key="index"
|
||||||
:value="telemetryOption.identifier"
|
:value="telemetryOption.identifier"
|
||||||
>
|
>
|
||||||
{{ telemetryPaths[index] || telemetryOption.name }}
|
{{ telemetryOption.path || telemetryOption.name }}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
</span>
|
</span>
|
||||||
@ -201,10 +201,6 @@ export default {
|
|||||||
this.telemetryMetadataOptions[id] = [];
|
this.telemetryMetadataOptions[id] = [];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.telemetry.forEach(async (telemetryOption, index) => {
|
|
||||||
const telemetryPath = await this.getFullTelemetryPath(telemetryOption);
|
|
||||||
this.telemetryPaths[index] = telemetryPath;
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
addTestInput(testInput) {
|
addTestInput(testInput) {
|
||||||
this.testInputs.push(
|
this.testInputs.push(
|
||||||
|
@ -15,14 +15,6 @@ export default class HistoricalTelemetryProvider {
|
|||||||
this.bounds = bounds;
|
this.bounds = bounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
refreshAllHistoricalTelemetries() {
|
|
||||||
const refreshPromises = [];
|
|
||||||
for (const [, value] of Object.entries(this.telemetryObjects)) {
|
|
||||||
refreshPromises.push(this.refreshHistoricalTelemetry(value));
|
|
||||||
}
|
|
||||||
return Promise.all(refreshPromises);
|
|
||||||
}
|
|
||||||
|
|
||||||
async refreshHistoricalTelemetry(domainObject, identifier) {
|
async refreshHistoricalTelemetry(domainObject, identifier) {
|
||||||
console.log('refreshHistoricalTelemetry');
|
console.log('refreshHistoricalTelemetry');
|
||||||
if (!domainObject && identifier) {
|
if (!domainObject && identifier) {
|
||||||
@ -201,7 +193,7 @@ export default class HistoricalTelemetryProvider {
|
|||||||
const conditionDetails = conditionCollectionMap.get(id);
|
const conditionDetails = conditionCollectionMap.get(id);
|
||||||
const { isDefault } = conditionDetails;
|
const { isDefault } = conditionDetails;
|
||||||
const conditionConfiguration = conditionDetails?.configuration;
|
const conditionConfiguration = conditionDetails?.configuration;
|
||||||
const { outputTelemetry, outputMetadata, output } = conditionConfiguration;
|
const { output } = conditionConfiguration;
|
||||||
if (isDefault) {
|
if (isDefault) {
|
||||||
const conditionOutput = {
|
const conditionOutput = {
|
||||||
condition,
|
condition,
|
||||||
@ -277,7 +269,7 @@ export default class HistoricalTelemetryProvider {
|
|||||||
const outputTelemetryList = [];
|
const outputTelemetryList = [];
|
||||||
const domainObject = this.conditionSetDomainObject;
|
const domainObject = this.conditionSetDomainObject;
|
||||||
outputTelemetryMap.forEach((outputMetadata, timestamp) => {
|
outputTelemetryMap.forEach((outputMetadata, timestamp) => {
|
||||||
const { condition, telemetry, value, result, isDefault } = outputMetadata;
|
const { condition, value, result, isDefault } = outputMetadata;
|
||||||
outputTelemetryList.push({
|
outputTelemetryList.push({
|
||||||
conditionId: condition.id,
|
conditionId: condition.id,
|
||||||
id: domainObject.identifier,
|
id: domainObject.identifier,
|
||||||
|
@ -62,3 +62,5 @@ export const ERROR = {
|
|||||||
|
|
||||||
export const IS_OLD_KEY = 'isStale';
|
export const IS_OLD_KEY = 'isStale';
|
||||||
export const IS_STALE_KEY = 'isStale.new';
|
export const IS_STALE_KEY = 'isStale.new';
|
||||||
|
|
||||||
|
export const TELEMETRY_VALUE = 'telemetry value';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user