diff --git a/src/plugins/condition/ConditionSetMetadataProvider.js b/src/plugins/condition/ConditionSetMetadataProvider.js new file mode 100644 index 0000000000..6f58db3655 --- /dev/null +++ b/src/plugins/condition/ConditionSetMetadataProvider.js @@ -0,0 +1,37 @@ +export default class ConditionSetMetadataProvider { + constructor(openmct) { + this.openmct = openmct; + } + + supportsMetadata(domainObject) { + return domainObject.type === 'conditionSet'; + } + + getDomains(domainObject) { + return this.openmct.time.getAllTimeSystems().map(function (ts, i) { + return { + key: ts.key, + name: ts.name, + format: ts.timeFormat, + hints: { + domain: i + } + }; + }); + } + + getMetadata(domainObject) { + return { + values: this.getDomains().concat([ + { + name: 'Output', + key: 'output', + type: 'string', + hints: { + range: 1 + } + } + ]) + }; + } +} diff --git a/src/plugins/condition/plugin.js b/src/plugins/condition/plugin.js index 60172d5132..691e088d0c 100644 --- a/src/plugins/condition/plugin.js +++ b/src/plugins/condition/plugin.js @@ -21,6 +21,7 @@ *****************************************************************************/ import ConditionSetViewProvider from './ConditionSetViewProvider.js'; import ConditionSetCompositionPolicy from "./ConditionSetCompositionPolicy"; +import ConditionSetMetadataProvider from './ConditionSetMetadataProvider'; import ConditionSetTelemetryProvider from './ConditionSetTelemetryProvider'; export default function ConditionPlugin() { @@ -51,6 +52,7 @@ export default function ConditionPlugin() { }); openmct.composition.addPolicy(new ConditionSetCompositionPolicy(openmct).allow); + openmct.telemetry.addProvider(new ConditionSetMetadataProvider(openmct)); openmct.telemetry.addProvider(new ConditionSetTelemetryProvider(openmct)); openmct.objectViews.addProvider(new ConditionSetViewProvider(openmct));