]> 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 76c30d98113adb381a39b1c38c47b80b479ab54b..490c9505ecde9e459b1c9c2547d38e0e7b41278a 100644 (file)
@@ -92,6 +92,7 @@ public class CSVImportWizard extends Wizard implements IImportWizard {
                         int velocityIndex = model.getVelocityIndex();
                         int flowAreaIndex = model.getFlowAreaIndex();
                         int nominalPressureLossIndex = model.getNominalPressureLossIndex();
+                        int addressIndex = model.getAddressIndex();
                         
                         int startXCoordColumnIndex = model.getStartXCoordIndex();
                         int startYCoordColumnIndex = model.getStartYCoordIndex();
@@ -106,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();
@@ -198,6 +200,7 @@ public class CSVImportWizard extends Wizard implements IImportWizard {
                                             writeValue(graph, row, velocityIndex, vertex, DN.Vertex_HasVelocity);
                                             writeValue(graph, row, flowAreaIndex, vertex, DN.Vertex_HasFlowArea);
                                             writeValue(graph, row, nominalPressureLossIndex, vertex, DN.Vertex_HasNominalPressureLoss);
+                                            writeStringValue(graph, row, addressIndex, vertex, DN.Vertex_HasAddress);
 
                                         } else {
                                             String startXCoords = row.get(startXCoordColumnIndex);
@@ -228,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);
@@ -238,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);