mirror of
https://github.com/nasa/openmct.git
synced 2025-01-17 10:20:27 +00:00
add metadata provider
This commit is contained in:
parent
92ecf3af1d
commit
486dae54bd
37
src/plugins/condition/ConditionSetMetadataProvider.js
Normal file
37
src/plugins/condition/ConditionSetMetadataProvider.js
Normal file
@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
])
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
@ -21,6 +21,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
import ConditionSetViewProvider from './ConditionSetViewProvider.js';
|
import ConditionSetViewProvider from './ConditionSetViewProvider.js';
|
||||||
import ConditionSetCompositionPolicy from "./ConditionSetCompositionPolicy";
|
import ConditionSetCompositionPolicy from "./ConditionSetCompositionPolicy";
|
||||||
|
import ConditionSetMetadataProvider from './ConditionSetMetadataProvider';
|
||||||
import ConditionSetTelemetryProvider from './ConditionSetTelemetryProvider';
|
import ConditionSetTelemetryProvider from './ConditionSetTelemetryProvider';
|
||||||
|
|
||||||
export default function ConditionPlugin() {
|
export default function ConditionPlugin() {
|
||||||
@ -51,6 +52,7 @@ export default function ConditionPlugin() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
openmct.composition.addPolicy(new ConditionSetCompositionPolicy(openmct).allow);
|
openmct.composition.addPolicy(new ConditionSetCompositionPolicy(openmct).allow);
|
||||||
|
openmct.telemetry.addProvider(new ConditionSetMetadataProvider(openmct));
|
||||||
openmct.telemetry.addProvider(new ConditionSetTelemetryProvider(openmct));
|
openmct.telemetry.addProvider(new ConditionSetTelemetryProvider(openmct));
|
||||||
openmct.objectViews.addProvider(new ConditionSetViewProvider(openmct));
|
openmct.objectViews.addProvider(new ConditionSetViewProvider(openmct));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user