mirror of
https://github.com/nasa/openmct.git
synced 2024-12-24 15:26:39 +00:00
inspector and colors work
This commit is contained in:
parent
2776cc8ac9
commit
5b006b69b7
@ -12,8 +12,6 @@ export default function EventInspectorViewProvider(openmct) {
|
||||
return false;
|
||||
}
|
||||
|
||||
console.debug(`🧟 Event Inspector received selection`, selection);
|
||||
|
||||
const selectionType = selection[0][0].context?.type;
|
||||
const event = selection[0][0].context?.event;
|
||||
return selectionType === 'time-strip-event-selection' && event;
|
||||
|
@ -78,6 +78,12 @@ export default {
|
||||
this.setTimeContext = this.setTimeContext.bind(this);
|
||||
this.setTimeContext();
|
||||
|
||||
this.limitEvaluator = this.openmct.telemetry.limitEvaluator(this.domainObject);
|
||||
const metadata = this.openmct.telemetry.getMetadata(this.domainObject);
|
||||
if (metadata) {
|
||||
this.valueMetadata =
|
||||
metadata.valuesForHints(['range'])[0] || this.firstNonDomainAttribute(metadata);
|
||||
}
|
||||
this.updateViewBounds();
|
||||
|
||||
this.resize = _.debounce(this.resize, 400);
|
||||
@ -106,6 +112,11 @@ export default {
|
||||
this.timeContext.on('timeSystem', this.setScaleAndPlotEvents);
|
||||
this.timeContext.on('boundsChanged', this.updateViewBounds);
|
||||
},
|
||||
firstNonDomainAttribute(metadata) {
|
||||
return metadata
|
||||
.values()
|
||||
.find((metadatum) => metadatum.hints.domain === undefined && metadatum.key !== 'name');
|
||||
},
|
||||
stopFollowingTimeContext() {
|
||||
if (this.timeContext) {
|
||||
this.timeContext.off('timeSystem', this.setScaleAndPlotEvents);
|
||||
@ -294,15 +305,6 @@ export default {
|
||||
element.setAttributeNS(null, key, attributes[key]);
|
||||
});
|
||||
},
|
||||
setStyles(element, styles) {
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
|
||||
Object.keys(styles).forEach((key) => {
|
||||
element.style[key] = styles[key];
|
||||
});
|
||||
},
|
||||
getEventWrapper(item) {
|
||||
const id = `${ID_PREFIX}${item.time}`;
|
||||
|
||||
@ -384,6 +386,12 @@ export default {
|
||||
eventTickElement.style.height = `${String(ROW_HEIGHT - 10)}px`;
|
||||
eventWrapper.appendChild(eventTickElement);
|
||||
|
||||
const limitEvaluation = this.limitEvaluator.evaluate(event, this.valueMetadata);
|
||||
const limitClass = limitEvaluation?.cssClass;
|
||||
if (limitClass) {
|
||||
eventWrapper.classList.add(limitClass);
|
||||
}
|
||||
|
||||
eventWrapper.addEventListener('click', (mouseEvent) => {
|
||||
mouseEvent.stopPropagation();
|
||||
this.createSelectionForInspector(event);
|
||||
|
Loading…
Reference in New Issue
Block a user