mirror of
https://github.com/nasa/openmct.git
synced 2025-06-21 16:49:42 +00:00
[Telemetry Tables][Plots] Display units where applicable (#3198)
* added unit columns in telemetry tables * added unit column hiding in telemetry tables, added units to lad tables and sets * added units to plots and plot legends
This commit is contained in:
@ -32,6 +32,12 @@
|
||||
class="js-third-data"
|
||||
:class="valueClass"
|
||||
>{{ value }}</td>
|
||||
<td
|
||||
v-if="hasUnits"
|
||||
class="js-units"
|
||||
>
|
||||
{{ unit }}
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
|
||||
@ -48,6 +54,10 @@ export default {
|
||||
domainObject: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
hasUnits: {
|
||||
type: Boolean,
|
||||
requred: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -59,7 +69,8 @@ export default {
|
||||
timestamp: undefined,
|
||||
value: '---',
|
||||
valueClass: '',
|
||||
currentObjectPath
|
||||
currentObjectPath,
|
||||
unit: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -101,6 +112,10 @@ export default {
|
||||
.subscribe(this.domainObject, this.updateValues);
|
||||
|
||||
this.requestHistory();
|
||||
|
||||
if (this.hasUnits) {
|
||||
this.setUnit();
|
||||
}
|
||||
},
|
||||
destroyed() {
|
||||
this.stopWatchingMutation();
|
||||
@ -186,6 +201,9 @@ export default {
|
||||
|
||||
return false;
|
||||
}
|
||||
},
|
||||
setUnit() {
|
||||
this.unit = this.valueMetadata.unit || '';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user