/// <summary> /// Creates a SMD by reading the BillOfMaterial and getting the RelationshipElements and /// collecting the SimulationModels for the Relations in a list which is a property of the class /// </summary> /// <param name="host"></param> /// <param name="maschine"></param> public bool CreateSMD(String host, String maschine) { AASRestClient.Start(host); // Einlesen der billofmaterial der maschine und der zugehörigen RelElement BillOfMaterial = AASRestClient.GetBillofmaterialWithRelationshipElements(maschine); if (BillOfMaterial == null) { return(false); } RelationshipElements = BillOfMaterial.RelationshipElements; foreach (var bom in BillOfMaterial.BillOfMaterials.Values) { RelationshipElements = RelationshipElements.Concat(bom.RelationshipElements).ToList(); } foreach (var rel in RelationshipElements) { if (rel == null) { return(false); } } DeleteDuplicateRelationshipsElements(); // Einlesen der beiden simModelle für die einzelnen reletionships elemente in ein Dictionary SimulationsModels = GetSimulationModelsFromRelationshipElements(); return(true); }
/// <summary> /// Gets and adds the missing Boms to the BillOfMaterials list /// </summary> /// <param name="componentNames"></param> private static void setMissingBoms(HashSet <string> componentNames) { foreach (var component in componentNames) { if (!BillOfMaterials.ContainsKey(component)) { BillOfMaterial bom = AASRestClient.GetBillofmaterialWithRelationshipElements(component); BillOfMaterials.Add(component, bom); } } }