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