Skip to content

Commit

Permalink
ih/th - Import (#531)
Browse files Browse the repository at this point in the history
- Import of instrument and target height corrected
  • Loading branch information
loesler authored Nov 13, 2024
1 parent 1b2fd89 commit b71059c
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,10 @@ public void parse(String line) {
this.ih = 0;
this.targetHeights.clear();

if (key1.substring(2).matches("\\d+")) {
this.is2DStartPoint = key1.substring(2).matches("^9+$");
if (key1.matches("\\d+")) {
this.is2DStartPoint = key1.matches("^9+$");
if (!this.is2DStartPoint)
try {this.ih = 0.001 * Integer.parseInt(key1.substring(2).trim());} catch(Exception e){}
try {this.ih = 0.001 * Integer.parseInt(key1.trim(), 10);} catch(Exception e){}
}

if (line.length() > 71 && line.substring(70, 71).equals("|")) {
Expand All @@ -280,12 +280,12 @@ public void parse(String line) {
else if (this.startPointName != null && !this.startPointName.isEmpty() && line.length() >= 71 && c1 >= 2 && c1 <= 8 && c2 >= 0 && c2 <= 4 && line.charAt(68) != '*') {
String endPointId = key2;
double th = 0;
boolean is2DEndPoint = key1.substring(2).matches("^9+$");
boolean is2DEndPoint = key1.matches("^9+$");
if (!is2DEndPoint) {
if (key1.substring(2).matches("^0+$") && this.targetHeights.containsKey(endPointId))
if (key1.matches("^0+$") && this.targetHeights.containsKey(endPointId))
th = this.targetHeights.get(endPointId).doubleValue();
else if (key1.substring(2).matches("\\d+")) {
try {th = 0.001 * Integer.parseInt(key1.substring(2).trim());} catch(Exception e){}
else if (key1.matches("\\d+")) {
try {th = 0.001 * Integer.parseInt(key1.trim(), 10);} catch(Exception e){}
this.targetHeights.put(endPointId, th);
}
}
Expand Down

0 comments on commit b71059c

Please sign in to comment.