X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.district.imports.ui%2Fsrc%2Forg%2Fsimantics%2Fdistrict%2Fimports%2Fui%2FCSVImportModel.java;h=2f13692bd0af5f49dcc3f8289084c3bccc551a69;hb=231b9da5dfd8129e24cb5a9d2ec87ff9afa7afd9;hp=53de5cfe27714ad2be556b34b065a564174a7bfe;hpb=e6378bf9c77ffd2d33d81ab882e6a2243506a0a8;p=simantics%2Fdistrict.git diff --git a/org.simantics.district.imports.ui/src/org/simantics/district/imports/ui/CSVImportModel.java b/org.simantics.district.imports.ui/src/org/simantics/district/imports/ui/CSVImportModel.java index 53de5cfe..2f13692b 100644 --- a/org.simantics.district.imports.ui/src/org/simantics/district/imports/ui/CSVImportModel.java +++ b/org.simantics.district.imports.ui/src/org/simantics/district/imports/ui/CSVImportModel.java @@ -20,9 +20,9 @@ public class CSVImportModel { // Second page fills these private char delimiter; - private boolean read; + private boolean readFirstAsHeader = true; private Map delimiters; - private Path wktFile; +// private Path wktFile; // Vertex import private int xCoordIndex = -1; @@ -41,6 +41,12 @@ public class CSVImportModel { private int componentMappingIndex = -1; private Map componentMappings = new HashMap<>(); private boolean isVertexImport; + private String sourceCRS; + private int tempIndex; + private int pressureIndex; + private int diameterIndex; + private int outerDiamterIndex; + private int nominalMassFlowIndex; // Third page @@ -57,7 +63,7 @@ public class CSVImportModel { } public void setReadFirstAsHeader(boolean read) { - this.read = read; + this.readFirstAsHeader = read; } public Path getSource() { @@ -73,7 +79,7 @@ public class CSVImportModel { public Map> getHeaderAndRows(int amount) throws IOException { if (source != null) - return DistrictImportUtils.readCSVHeaderAndRows(source, delimiter, read, amount); + return DistrictImportUtils.readCSVHeaderAndRows(source, delimiter, readFirstAsHeader, amount); else return Collections.emptyMap(); } @@ -81,14 +87,14 @@ public class CSVImportModel { public Map getHeader() throws IOException { Map header = null; if (source != null) - header = DistrictImportUtils.readCSVHeader(source, delimiter, read); + header = DistrictImportUtils.readCSVHeader(source, delimiter, readFirstAsHeader); if (header == null) header = Collections.emptyMap(); return header; } public boolean getReadFirstAsHeader() { - return read; + return readFirstAsHeader; } public String[] getDelimiterFormats() { @@ -101,7 +107,7 @@ public class CSVImportModel { public List> readRows(int amount) throws IOException { if (source != null) - return DistrictImportUtils.readRows(source, delimiter, read, amount); + return DistrictImportUtils.readRows(source, delimiter, readFirstAsHeader, amount); else return Collections.emptyList(); } @@ -110,9 +116,9 @@ public class CSVImportModel { return delimiter; } - public Path getWKTFile() { - return wktFile; - } +// public Path getWKTFile() { +// return wktFile; +// } public int getXCoordIndex() { return xCoordIndex; @@ -154,9 +160,9 @@ public class CSVImportModel { return targetDiagram; } - public void setWKTFile(Path wktFile) { - this.wktFile = wktFile; - } +// public void setWKTFile(Path wktFile) { +// this.wktFile = wktFile; +// } public void setComponentMappings(String value, Resource resource) { componentMappings.put(value, resource); @@ -222,4 +228,52 @@ public class CSVImportModel { return endZCoordIndex; } + public void setSourceCRS(String crs) { + this.sourceCRS = crs; + } + + public String getSourceCRS() { + return sourceCRS; + } + + public void setTempIndex(int tempIndex) { + this.tempIndex = tempIndex; + } + + public int getTempIndex() { + return tempIndex; + } + + public void setPressureIndex(int pressureIndex) { + this.pressureIndex = pressureIndex; + } + + public int getPressureIndex() { + return pressureIndex; + } + + public void setDiameterIndex(int parseInt) { + this.diameterIndex = parseInt; + } + + public int getDiameterIndex() { + return diameterIndex; + } + + public void setOuterDiameterIndex(int parseInt) { + this.outerDiamterIndex = parseInt; + } + + public int getOuterDiamterIndex() { + return outerDiamterIndex; + } + + public void setNominalMassFlowIndex(int parseInt) { + this.nominalMassFlowIndex = parseInt; + } + + public int getNominalMassFlowIndex() { + return nominalMassFlowIndex; + } + }