]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.district.imports.ui/src/org/simantics/district/imports/ui/CSVImportWizard.java
Make optional to calculate elevation for edge during CSV import
[simantics/district.git] / org.simantics.district.imports.ui / src / org / simantics / district / imports / ui / CSVImportWizard.java
index ffed0c3a14e21da671ab207b7cab185e6b5587f9..490c9505ecde9e459b1c9c2547d38e0e7b41278a 100644 (file)
@@ -107,6 +107,7 @@ public class CSVImportWizard extends Wizard implements IImportWizard {
                         int edgeFlowAreaIndex = model.getEdgeFlowAreaIndex();
                         int kReturnIndex = model.getkReturnIndex();
                         int kSupplyIndex = model.getkSupplyIndex();
+                        int lengthIndex = model.getLengthIndex();
                         
                         int mappingColumn = model.getComponentMappingIndex();
                         int idColumn = model.getIdIndex();
@@ -230,7 +231,7 @@ public class CSVImportWizard extends Wizard implements IImportWizard {
                                                 endCoords = new double[] { endXCoord , endYCoord };
                                             }
 
-                                            Resource edge = DNEdgeBuilder.create(graph, vv, model.getParentDiagram(), model.getComponentMappings().get(mappingValue), startCoords, endCoords, padding);
+                                            Resource edge = DNEdgeBuilder.create(graph, vv, model.getParentDiagram(), model.getComponentMappings().get(mappingValue), startCoords, endCoords, padding, true);
                                             writeStringValue(graph, row, idColumn, edge, DN.HasId);
                                             
                                             writeValue(graph, row, diameterColumnIndex, edge, DN.Edge_HasDiameter);
@@ -240,6 +241,7 @@ public class CSVImportWizard extends Wizard implements IImportWizard {
                                             writeValue(graph, row, kReturnIndex, edge, DN.Edge_HasKReturn);
                                             writeValue(graph, row, kSupplyIndex, edge, DN.Edge_HasKSupply);
                                             writeValue(graph, row, edgeFlowAreaIndex, edge, DN.Edge_HasFlowArea);
+                                            writeValue(graph, row, lengthIndex, edge, DN.Edge_HasLength);
                                         }
                                     } catch (MismatchedDimensionException | TransformException | DatabaseException e) {
                                         throw new DatabaseException(e);