mirror of
https://github.com/nasa/openmct.git
synced 2025-06-21 08:39:59 +00:00
final changes from PR comments
This commit is contained in:
@ -85,13 +85,11 @@ export default {
|
|||||||
item.key = this.openmct.objects.makeKeyString(domainObject.identifier);
|
item.key = this.openmct.objects.makeKeyString(domainObject.identifier);
|
||||||
|
|
||||||
this.items.push(item);
|
this.items.push(item);
|
||||||
// this.checkForUnits();
|
|
||||||
},
|
},
|
||||||
removeItem(identifier) {
|
removeItem(identifier) {
|
||||||
let index = this.items.findIndex(item => this.openmct.objects.makeKeyString(identifier) === item.key);
|
let index = this.items.findIndex(item => this.openmct.objects.makeKeyString(identifier) === item.key);
|
||||||
|
|
||||||
this.items.splice(index, 1);
|
this.items.splice(index, 1);
|
||||||
// this.checkForUnits();
|
|
||||||
},
|
},
|
||||||
reorder(reorderPlan) {
|
reorder(reorderPlan) {
|
||||||
let oldItems = this.items.slice();
|
let oldItems = this.items.slice();
|
||||||
|
@ -65,8 +65,25 @@ export default {
|
|||||||
return {
|
return {
|
||||||
primaryTelemetryObjects: [],
|
primaryTelemetryObjects: [],
|
||||||
secondaryTelemetryObjects: {},
|
secondaryTelemetryObjects: {},
|
||||||
compositions: [],
|
compositions: []
|
||||||
hasUnits: false
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
hasUnits() {
|
||||||
|
for(let telemetryObject in this.secondaryTelemetryObjects) {
|
||||||
|
if(this.secondaryTelemetryObjects[telemetryObject]) {
|
||||||
|
let objects = this.secondaryTelemetryObjects[telemetryObject];
|
||||||
|
for(let current of objects) {
|
||||||
|
let metadata = this.openmct.telemetry.getMetadata(current.domainObject);
|
||||||
|
for(let metadatum of metadata.valueMetadatas) {
|
||||||
|
if(metadatum.unit) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@ -111,7 +128,6 @@ export default {
|
|||||||
this.$set(this.secondaryTelemetryObjects, primary.key, undefined);
|
this.$set(this.secondaryTelemetryObjects, primary.key, undefined);
|
||||||
this.primaryTelemetryObjects.splice(index,1);
|
this.primaryTelemetryObjects.splice(index,1);
|
||||||
primary = undefined;
|
primary = undefined;
|
||||||
this.checkForUnits();
|
|
||||||
},
|
},
|
||||||
reorderPrimary(reorderPlan) {
|
reorderPrimary(reorderPlan) {
|
||||||
let oldComposition = this.primaryTelemetryObjects.slice();
|
let oldComposition = this.primaryTelemetryObjects.slice();
|
||||||
@ -129,9 +145,6 @@ export default {
|
|||||||
array.push(secondary);
|
array.push(secondary);
|
||||||
|
|
||||||
this.$set(this.secondaryTelemetryObjects, primary.key, array);
|
this.$set(this.secondaryTelemetryObjects, primary.key, array);
|
||||||
if(!this.hasUnits) {
|
|
||||||
this.checkForUnits(domainObject);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
removeSecondary(primary) {
|
removeSecondary(primary) {
|
||||||
@ -142,9 +155,6 @@ export default {
|
|||||||
array.splice(index, 1);
|
array.splice(index, 1);
|
||||||
|
|
||||||
this.$set(this.secondaryTelemetryObjects, primary.key, array);
|
this.$set(this.secondaryTelemetryObjects, primary.key, array);
|
||||||
if(this.hasUnits) {
|
|
||||||
this.checkForUnits();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
checkForUnits() {
|
checkForUnits() {
|
||||||
|
Reference in New Issue
Block a user