From: Reino Ruusu Date: Thu, 24 Sep 2020 11:30:44 +0000 (+0300) Subject: Add conductance to edge properties X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F11%2F4511%2F1;p=simantics%2Fdistrict.git Add conductance to edge properties gitlab #99 Change-Id: I2ff9124ded117047988778bae6947400f2535a89 --- diff --git a/org.simantics.district.imports.ui/src/org/simantics/district/imports/ui/CSVImportWizardPage.java b/org.simantics.district.imports.ui/src/org/simantics/district/imports/ui/CSVImportWizardPage.java index f0961fa5..2fb3b47b 100644 --- a/org.simantics.district.imports.ui/src/org/simantics/district/imports/ui/CSVImportWizardPage.java +++ b/org.simantics.district.imports.ui/src/org/simantics/district/imports/ui/CSVImportWizardPage.java @@ -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() { diff --git a/org.simantics.district.imports/scl/Simantics/District/Import.scl b/org.simantics.district.imports/scl/Simantics/District/Import.scl index d182e261..b0349bcc 100644 --- a/org.simantics.district.imports/scl/Simantics/District/Import.scl +++ b/org.simantics.district.imports/scl/Simantics/District/Import.scl @@ -43,6 +43,7 @@ importJava "org.simantics.district.imports.CSVImportModel" where setPipeSizeDNIndex :: CSVImportModel -> Integer -> () setRoughnessIndex :: CSVImportModel -> Integer -> () setStructureIndex :: CSVImportModel -> Integer -> () + setConductanceIndex :: CSVImportModel -> Integer -> () // Common setSourceCRS :: CSVImportModel -> String -> () diff --git a/org.simantics.district.imports/src/org/simantics/district/imports/CSVImportModel.java b/org.simantics.district.imports/src/org/simantics/district/imports/CSVImportModel.java index ac422300..21815b68 100644 --- a/org.simantics.district.imports/src/org/simantics/district/imports/CSVImportModel.java +++ b/org.simantics.district.imports/src/org/simantics/district/imports/CSVImportModel.java @@ -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; + } } diff --git a/org.simantics.district.imports/src/org/simantics/district/imports/DistrictImportUtils.java b/org.simantics.district.imports/src/org/simantics/district/imports/DistrictImportUtils.java index 522fd66e..9cee3120 100644 --- a/org.simantics.district.imports/src/org/simantics/district/imports/DistrictImportUtils.java +++ b/org.simantics.district.imports/src/org/simantics/district/imports/DistrictImportUtils.java @@ -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; diff --git a/org.simantics.district.network.ontology/graph/DistrictNetwork.pgraph b/org.simantics.district.network.ontology/graph/DistrictNetwork.pgraph index 7c205df8..8a32414c 100644 --- a/org.simantics.district.network.ontology/graph/DistrictNetwork.pgraph +++ b/org.simantics.district.network.ontology/graph/DistrictNetwork.pgraph @@ -167,6 +167,8 @@ DN.Edge -- 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 -- DN.Mapping.EdgeMapping.InsulationClassAttribute --> L0.String -- DN.Mapping.EdgeMapping.ConductanceAttribute --> L0.String