diff options
Diffstat (limited to 'vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts')
-rw-r--r-- | vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts index 864472505..d543991b5 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts @@ -477,17 +477,34 @@ export class SharedTreeService { }); } + getModelVersionEitherFromInstanceOrFromHierarchy(selectedNodeData, model): string | undefined { + if (selectedNodeData && selectedNodeData.instanceModelInfo && selectedNodeData.instanceModelInfo.modelVersion) { + return selectedNodeData.instanceModelInfo.modelVersion; + } else if (model && model.version) { + return model.version; + } + return undefined; + } + + getModelCustomizationIdEitherFromInstanceOrFromHierarchy(selectedNodeData, model): string | undefined { + if (selectedNodeData && selectedNodeData.instanceModelInfo && selectedNodeData.instanceModelInfo.modelCustomizationId) { + return selectedNodeData.instanceModelInfo.modelCustomizationId; + } else if (model && model.customizationUuid) { + return model.customizationUuid; + } + return undefined; + } - addGeneralInfoItems(modelInfoSpecificItems: ModelInformationItem[], type: ComponentInfoType, model, instance):ComponentInfoModel { + addGeneralInfoItems(modelInfoSpecificItems: ModelInformationItem[], type: ComponentInfoType, model, selectedNodeData):ComponentInfoModel { let modelInfoItems: ModelInformationItem[] = [ - ModelInformationItem.createInstance("Model version", model ? model.version : null), - ModelInformationItem.createInstance("Model customization ID", model ? model.customizationUuid : null), - ModelInformationItem.createInstance("Instance ID", instance ? instance.instanceId : null), - ModelInformationItem.createInstance("Instance type", instance ? instance.instanceType : null), - ModelInformationItem.createInstance("In maintenance", instance? instance.inMaint : null), + ModelInformationItem.createInstance("Model version", this.getModelVersionEitherFromInstanceOrFromHierarchy(selectedNodeData, model)), + ModelInformationItem.createInstance("Model customization ID", this.getModelCustomizationIdEitherFromInstanceOrFromHierarchy(selectedNodeData, model)), + ModelInformationItem.createInstance("Instance ID", selectedNodeData ? selectedNodeData.instanceId : null), + ModelInformationItem.createInstance("Instance type", selectedNodeData ? selectedNodeData.instanceType : null), + ModelInformationItem.createInstance("In maintenance", selectedNodeData? selectedNodeData.inMaint : null), ]; modelInfoItems = modelInfoItems.concat(modelInfoSpecificItems); - return this.getComponentInfoModelByModelInformationItems(modelInfoItems, type, instance); + return this.getComponentInfoModelByModelInformationItems(modelInfoItems, type, selectedNodeData); } getComponentInfoModelByModelInformationItems(modelInfoItems: ModelInformationItem[], type: ComponentInfoType, instance){ |