]> gerrit.simantics Code Review - simantics/district.git/commitdiff
Add conductance to edge properties 11/4511/1
authorReino Ruusu <reino.ruusu@semantum.fi>
Thu, 24 Sep 2020 11:30:44 +0000 (14:30 +0300)
committerReino Ruusu <reino.ruusu@semantum.fi>
Thu, 24 Sep 2020 11:30:44 +0000 (14:30 +0300)
gitlab #99

Change-Id: I2ff9124ded117047988778bae6947400f2535a89

org.simantics.district.imports.ui/src/org/simantics/district/imports/ui/CSVImportWizardPage.java
org.simantics.district.imports/scl/Simantics/District/Import.scl
org.simantics.district.imports/src/org/simantics/district/imports/CSVImportModel.java
org.simantics.district.imports/src/org/simantics/district/imports/DistrictImportUtils.java
org.simantics.district.network.ontology/graph/DistrictNetwork.pgraph

index f0961fa5804380b6b05332b01ee827c519bae180..2fb3b47b4eaa94588f419fe6e373d316de3a2b11 100644 (file)
@@ -357,6 +357,7 @@ public class CSVImportWizardPage extends WizardPage {
         fieldSelectors.add(createComboField("wallThicknessValue", "Wall Thickness", model::setWallThicknessIndex, parent));
         fieldSelectors.add(createComboField("insulationConductivityValue", "Insulation Conductivity", model::setInsulationConductivityIndex, parent));
         fieldSelectors.add(createComboField("roughnessValue", "Roughness", model::setRoughnessIndex, parent));
+        fieldSelectors.add(createComboField("conductanceValue", "Conductance", model::setConductanceIndex, parent));
     }
 
     private void updateCombos() {
index d182e2614159e91b65c2d48d511c85ec198b141e..b0349bcc47690b71d744b387586206928b4ca2d7 100644 (file)
@@ -43,6 +43,7 @@ importJava "org.simantics.district.imports.CSVImportModel" where
     setPipeSizeDNIndex :: CSVImportModel -> Integer -> <Proc> ()
     setRoughnessIndex :: CSVImportModel -> Integer -> <Proc> ()
     setStructureIndex :: CSVImportModel -> Integer -> <Proc> ()
+    setConductanceIndex  :: CSVImportModel -> Integer -> <Proc> ()
     
     // Common
     setSourceCRS :: CSVImportModel -> String -> <Proc> ()
index ac422300f8b65a4c9586302b355cf3332e3a7ce0..21815b687f4769978fc1622af474e87e5b1c14e2 100644 (file)
@@ -83,6 +83,7 @@ public class CSVImportModel {
     private int pipeSizeDNIndex = -1;
     private int roughnessIndex = -1;
     private int structureIndex = -1;
+    private int conductanceIndex = -1;
     
     // Third page
 
@@ -599,4 +600,12 @@ public class CSVImportModel {
     public void setStructureIndex(int structureIndex) {
         this.structureIndex = structureIndex;
     }
+
+       public int getConductanceIndex() {
+               return conductanceIndex;
+       }
+
+       public void setConductanceIndex(int conductanceIndex) {
+               this.conductanceIndex = conductanceIndex;
+       }
 }
index 522fd66e46e8299fe522c340dc2edaf48654b2fd..9cee3120d645aef57d940968e03ec54f0c9f1055 100644 (file)
@@ -394,6 +394,7 @@ public class DistrictImportUtils {
         int pipeSizeDNIndex = model.getPipeSizeDNIndex();
         int roughnessIndex = model.getRoughnessIndex();
         int structureIndex = model.getStructureIndex();
+        int conductanceIndex = model.getConductanceIndex();
         
         int mappingColumn = model.getComponentMappingIndex();
         int idColumn = model.getIdIndex();
@@ -496,6 +497,7 @@ public class DistrictImportUtils {
                                     writeIntegerValue(graph, row, pipeSizeDNIndex, edge, DN.Edge_HasPipeSizeDN);
                                     writeValue(graph, row, roughnessIndex, edge, DN.Edge_HasRoughness);
                                     writeStringValue(graph, row, structureIndex, edge, DN.Edge_HasStructure);
+                                    writeValue(graph, row, conductanceIndex, edge, DN.Edge_HasConductance);
                                 }
                             }
                             return true;
index 7c205df8cd9b2b2392874f49fe82f14b2dcda37e..8a32414ccc9895c2629ea764c2d76c5faab3dcd9 100644 (file)
@@ -167,6 +167,8 @@ DN.Edge <T DN.Element
         @defProperty "Structure" L0.String
     >-- DN.Edge.HasInsulationClass
         @defProperty "Insulation Class" L0.String
+    >-- DN.Edge.HasConductance
+        @defProperty "Conductance" L0.Double
     @L0.assert DN.Edge.HasDiameter 100.0
     @L0.assert DN.Edge.HasOuterDiameter 125.0
 
@@ -546,6 +548,8 @@ DN.Mapping.EdgeMapping <T DN.Mapping.Base
         DN.Mapping.HasPropertyRelation DN.Edge.HasStructure
     >-- DN.Mapping.EdgeMapping.InsulationClassAttribute --> L0.String <R L0.HasProperty
         DN.Mapping.HasPropertyRelation DN.Edge.HasInsulationClass
+    >-- DN.Mapping.EdgeMapping.ConductanceAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Edge.HasConductance
 
 // Allowed connection types
 DN.SupplyConnectionType <T STR.ConnectionType