openmct/src/plugins/condition/ConditionSetMetadataProvider.js

38 lines
908 B
JavaScript
Raw Normal View History

2020-02-25 17:27:08 -08:00
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',
2020-02-26 12:27:28 -08:00
format: 'string',
2020-02-25 17:27:08 -08:00
hints: {
range: 1
}
}
])
};
}
}