mirror of
https://github.com/nasa/openmct.git
synced 2024-12-19 21:27:52 +00:00
button works
This commit is contained in:
parent
0db301dea8
commit
e9f120a480
@ -119,12 +119,18 @@ export default {
|
||||
},
|
||||
enableExtendEventLines(keyStringToEnable) {
|
||||
if (this.keyString === keyStringToEnable) {
|
||||
console.debug('🚄 enabling extending event lines');
|
||||
this.extendLines = true;
|
||||
// now emit our lines
|
||||
this.emitExtendedLines();
|
||||
}
|
||||
},
|
||||
disableExtendEventLines(keyStringToDisable) {
|
||||
if (this.keyString === keyStringToDisable) {
|
||||
console.debug('🚄 disabling extended event lines');
|
||||
this.extendLines = false;
|
||||
// now emit an empty array to clear the lines
|
||||
this.emitExtendedLines();
|
||||
}
|
||||
},
|
||||
firstNonDomainAttribute(metadata) {
|
||||
@ -422,13 +428,20 @@ export default {
|
||||
return eventWrapper;
|
||||
},
|
||||
emitExtendedLines() {
|
||||
const lines = this.eventHistory
|
||||
.filter((e) => this.isEventInBounds(e))
|
||||
.map((e) => ({ x: this.xScale(e.time) }));
|
||||
this.timelineEventBus.emit('update-extended-lines', {
|
||||
lines,
|
||||
keyString: this.keyString
|
||||
});
|
||||
if (this.extendLines) {
|
||||
const lines = this.eventHistory
|
||||
.filter((e) => this.isEventInBounds(e))
|
||||
.map((e) => ({ x: this.xScale(e.time) }));
|
||||
this.extendedLinesBus.emit('update-extended-lines', {
|
||||
lines,
|
||||
keyString: this.keyString
|
||||
});
|
||||
} else {
|
||||
this.extendedLinesBus.emit('update-extended-lines', {
|
||||
lines: [],
|
||||
keyString: this.keyString
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -27,11 +27,9 @@ export default class ExtendedLinesBus extends EventEmitter {
|
||||
this.emit('update-extended-lines', { lineData, keyString });
|
||||
}
|
||||
disableExtendEventLines(keyString) {
|
||||
console.debug('🍯 ExtendedLines#disableExtendedLines');
|
||||
this.emit('disable-extended-lines', keyString);
|
||||
}
|
||||
enableExtendEventLines(keyString) {
|
||||
console.debug('🍯 ExtendedLines#enableExtendedLines');
|
||||
this.emit('enable-extended-lines', keyString);
|
||||
}
|
||||
}
|
||||
|
@ -140,12 +140,10 @@ export default {
|
||||
this.status = this.openmct.status.get(this.domainObject.identifier);
|
||||
},
|
||||
enableExtendEventLines() {
|
||||
console.debug('🚄 extending event lines');
|
||||
const keyString = this.openmct.objects.makeKeyString(this.item.domainObject.identifier);
|
||||
this.extendedLinesBus.enableExtendEventLines(keyString);
|
||||
},
|
||||
disableExtendEventLines() {
|
||||
console.debug('🚄 disabling extended event lines');
|
||||
const keyString = this.openmct.objects.makeKeyString(this.item.domainObject.identifier);
|
||||
this.extendedLinesBus.disableExtendEventLines(keyString);
|
||||
},
|
||||
|
@ -234,7 +234,7 @@ export default {
|
||||
this.timeContext.off('clockChanged', this.updateViewBounds);
|
||||
}
|
||||
},
|
||||
updateExtendedLines(lines) {
|
||||
updateExtendedLines({ keyString, lines }) {
|
||||
console.debug('🗺️ Updating extended lines', lines);
|
||||
this.extendedLines = lines;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user