]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.district.imports/src/org/simantics/district/imports/DistrictImportUtils.java
Add support for setting pipeType from CSV import
[simantics/district.git] / org.simantics.district.imports / src / org / simantics / district / imports / DistrictImportUtils.java
index c3ce3dad2084d175f63e261aa48483b61741b5ab..836ebd02dd758e609ec4e12341acc348722ee720 100644 (file)
@@ -379,6 +379,7 @@ public class DistrictImportUtils {
         int lengthIndex = model.getLengthIndex();
         int detailedGeometryIndex = model.getDetailedGeometryIndex();
         int regionIndex = model.getRegionIndex();
+        int pipeTypeIndex = model.getPipeTypeIndex();
         
         int mappingColumn = model.getComponentMappingIndex();
         int idColumn = model.getIdIndex();
@@ -456,10 +457,6 @@ public class DistrictImportUtils {
                                 // Switch to (longitude, latitude)
                                 flipAxes(startCoords);
                                 flipAxes(endCoords);
-                                    
-                                if ("6993003.00000".equals(idValue)) {
-                                    System.err.println("ghere we are!!");
-                                }
                                 
                                 Optional<Resource> oedge = DNEdgeBuilder.create(graph, existingVertices, model.getParentDiagram(), model.getComponentMappings().get(mappingValue), startCoords, startZCoord, endCoords, endZCoord, new double[0], padding, true);
                                 if (oedge.isPresent()) {
@@ -476,6 +473,7 @@ public class DistrictImportUtils {
                                     writeValue(graph, row, edgeFlowAreaIndex, edge, DN.Edge_HasFlowArea);
                                     writeValue(graph, row, lengthIndex, edge, DN.Edge_HasLength);
                                     writeStringValue(graph, row, regionIndex, edge, DN.HasRegion);
+                                    writeStringValue(graph, row, pipeTypeIndex, edge, DN.Edge_HasType);
                                     writeDoubleArrayFromString(graph, row, detailedGeometryIndex, edge, DN.Edge_HasGeometry, actualTransform);
                                 }
                             }