unit coluns in telem tables, need to add config options for those columns

This commit is contained in:
Jamie Vigliotta
2020-07-13 14:24:51 -07:00
parent 0d9558b891
commit d7c266d70f
8 changed files with 183 additions and 11 deletions

View File

@ -52,6 +52,12 @@
>
<div class="c-telemetry-view__value-text">
{{ telemetryValue }}
<span
v-if="unit && showUnits"
class="c-telemetry-view__value-text__unit"
>
{{ unit }}
</span>
</div>
</div>
</div>
@ -117,7 +123,8 @@ export default {
datum: undefined,
formats: undefined,
domainObject: undefined,
currentObjectPath: undefined
currentObjectPath: undefined,
showUnits: true
}
},
computed: {
@ -129,6 +136,11 @@ export default {
let displayMode = this.item.displayMode;
return displayMode === 'all' || displayMode === 'value';
},
unit() {
let value = this.item.value,
unit = this.metadata.value(value).unit;
return unit;
},
styleObject() {
return Object.assign({}, {
fontSize: this.item.size
@ -248,7 +260,9 @@ export default {
item: domainObject,
layoutItem: this.item,
index: this.index,
updateTelemetryFormat: this.updateTelemetryFormat
updateTelemetryFormat: this.updateTelemetryFormat,
toggleUnits: this.toggleUnits,
showUnits: this.showUnits
};
this.removeSelectable = this.openmct.selection.selectable(
this.$el, this.context, this.immediatelySelect || this.initSelect);
@ -259,6 +273,9 @@ export default {
},
showContextMenu(event) {
this.openmct.contextMenu._showContextMenuForObjectPath(this.currentObjectPath, event.x, event.y, CONTEXT_MENU_ACTIONS);
},
toggleUnits(show) {
this.showUnits = show;
}
}
}