-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sigmet phenomenon description blocks
- Loading branch information
1 parent
09e87e7
commit 5726049
Showing
6 changed files
with
261 additions
and
23 deletions.
There are no files selected for viewing
136 changes: 136 additions & 0 deletions
136
src/main/java/org/gamc/spmi/iwxxmConverter/common/CoordPoint.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
package org.gamc.spmi.iwxxmConverter.common; | ||
|
||
import java.math.BigDecimal; | ||
|
||
public final class CoordPoint { | ||
|
||
private String latitude; | ||
private int laDeg; | ||
private int laMin; | ||
|
||
private String longitude; | ||
private int loDeg; | ||
private int loMin; | ||
|
||
public CoordPoint() { | ||
|
||
} | ||
|
||
public CoordPoint(String lat, int laDeg, int laMin, String lon, int loDeg, int loMin) { | ||
this.latitude=lat; | ||
this.laDeg = laDeg; | ||
this.laMin = laMin; | ||
|
||
this.longitude = lon; | ||
this.loDeg = loDeg; | ||
this.loMin = loMin; | ||
|
||
} | ||
|
||
@Override | ||
public String toString() { | ||
|
||
return String.format("%s%d%d %s%d%d", latitude,laDeg,laMin,longitude,loDeg,loMin); | ||
} | ||
|
||
/**Implement if need to get decimal coordinates*/ | ||
public BigDecimal getDecimalLatitude() { | ||
throw new RuntimeException("Not implemented yet"); | ||
} | ||
|
||
public BigDecimal getDecimalLongitude() { | ||
throw new RuntimeException("Not implemented yet"); | ||
} | ||
|
||
public String getLatitude() { | ||
return latitude; | ||
} | ||
|
||
public void setLatitude(String latitude) { | ||
this.latitude = latitude; | ||
} | ||
|
||
public int getLaDeg() { | ||
return laDeg; | ||
} | ||
|
||
public void setLaDeg(int laDeg) { | ||
this.laDeg = laDeg; | ||
} | ||
|
||
public int getLaMin() { | ||
return laMin; | ||
} | ||
|
||
public void setLaMin(int laMin) { | ||
this.laMin = laMin; | ||
} | ||
|
||
public String getLongitude() { | ||
return longitude; | ||
} | ||
|
||
public void setLongitude(String longitude) { | ||
this.longitude = longitude; | ||
} | ||
|
||
public int getLoDeg() { | ||
return loDeg; | ||
} | ||
|
||
public void setLoDeg(int loDeg) { | ||
this.loDeg = loDeg; | ||
} | ||
|
||
public int getLoMin() { | ||
return loMin; | ||
} | ||
|
||
public void setLoMin(int loMin) { | ||
this.loMin = loMin; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
final int prime = 31; | ||
int result = 1; | ||
result = prime * result + laDeg; | ||
result = prime * result + laMin; | ||
result = prime * result + ((latitude == null) ? 0 : latitude.hashCode()); | ||
result = prime * result + loDeg; | ||
result = prime * result + loMin; | ||
result = prime * result + ((longitude == null) ? 0 : longitude.hashCode()); | ||
return result; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) | ||
return true; | ||
if (obj == null) | ||
return false; | ||
if (getClass() != obj.getClass()) | ||
return false; | ||
CoordPoint other = (CoordPoint) obj; | ||
if (laDeg != other.laDeg) | ||
return false; | ||
if (laMin != other.laMin) | ||
return false; | ||
if (latitude == null) { | ||
if (other.latitude != null) | ||
return false; | ||
} else if (!latitude.equals(other.latitude)) | ||
return false; | ||
if (loDeg != other.loDeg) | ||
return false; | ||
if (loMin != other.loMin) | ||
return false; | ||
if (longitude == null) { | ||
if (other.longitude != null) | ||
return false; | ||
} else if (!longitude.equals(other.longitude)) | ||
return false; | ||
return true; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
...java/org/gamc/spmi/iwxxmConverter/sigmetconverter/SigmetHorizontalPhenomenonLocation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package org.gamc.spmi.iwxxmConverter.sigmetconverter; | ||
|
||
import java.io.Serializable; | ||
import java.math.BigDecimal; | ||
import java.util.LinkedList; | ||
|
||
import org.gamc.spmi.iwxxmConverter.common.CoordPoint; | ||
import org.gamc.spmi.iwxxmConverter.common.Line; | ||
import org.gamc.spmi.iwxxmConverter.iwxxmenums.RUMB_UNITS; | ||
|
||
|
||
/**Describes location of the sigmet phenomenon inside FIR/UIR/CTA*/ | ||
public class SigmetHorizontalPhenomenonLocation { | ||
|
||
|
||
/**Describes direction from certain line, e.g 'NE OF LINE ...'*/ | ||
public static final class DirectionFromLine implements Serializable { | ||
|
||
private RUMB_UNITS direction; | ||
private Line sigmetLine; | ||
|
||
public RUMB_UNITS getDirection() { | ||
return direction; | ||
} | ||
public void setDirection(RUMB_UNITS direction) { | ||
this.direction = direction; | ||
} | ||
public Line getSigmetLine() { | ||
return sigmetLine; | ||
} | ||
public void setSigmetLine(Line sigmetLine) { | ||
this.sigmetLine = sigmetLine; | ||
} | ||
|
||
|
||
} | ||
|
||
/**Phenomenon reported for entire FIR/UIR/CTA*/ | ||
private boolean entireFIR = false; | ||
|
||
/**Phenomenon reported for polygon inside (WI token)*/ | ||
private boolean inPolygon = false; | ||
|
||
/**Phenomenon reported for aisle(corridor) at both sides of certain line (e.g. WTN 45 NM OF LINE ...)*/ | ||
private boolean withinCorridor = false; | ||
|
||
/**Wideness of the aisle(corridor) or radius from certain line*/ | ||
private int wideness; | ||
|
||
/**Vertexes of polygon*/ | ||
private LinkedList<CoordPoint> polygonPoints = new LinkedList<>(); | ||
|
||
private LinkedList<DirectionFromLine> directionsFromLines = new LinkedList<>(); | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/main/java/org/gamc/spmi/iwxxmConverter/sigmetconverter/SigmetPhenomenonDescription.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package org.gamc.spmi.iwxxmConverter.sigmetconverter; | ||
|
||
import java.io.Serializable; | ||
|
||
|
||
import org.gamc.spmi.iwxxmConverter.iwxxmenums.RUMB_UNITS; | ||
import org.gamc.spmi.iwxxmConverter.iwxxmenums.SPEED_UNITS; | ||
import org.joda.time.DateTime; | ||
|
||
/**Description of meteorological phenomenon in the SIGMET*/ | ||
public class SigmetPhenomenonDescription implements Serializable { | ||
|
||
/** | ||
* | ||
*/ | ||
private static final long serialVersionUID = 7906212608215801464L; | ||
|
||
|
||
|
||
public enum Severity { | ||
ISOLATED,OBSCURED,SQALL,EMBEDDED,FREQUENT,SEVERE,HEAVY, NOTSET; | ||
} | ||
|
||
public enum ObservationType { | ||
FORECAST, OBSERVE, NOTSET; | ||
} | ||
|
||
|
||
|
||
private String phenomenon; | ||
private Severity phenomenonSeverity=Severity.NOTSET; | ||
private ObservationType phenomenonObservation=ObservationType.NOTSET; | ||
private DateTime phenomenonTimeStamp; | ||
|
||
private boolean isMoving=false; | ||
private RUMB_UNITS movingDirection; | ||
private int movingSpeed; | ||
private SPEED_UNITS speedUnits; | ||
} |
16 changes: 16 additions & 0 deletions
16
...n/java/org/gamc/spmi/iwxxmConverter/sigmetconverter/SigmetVerticalPhenomenonLocation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.gamc.spmi.iwxxmConverter.sigmetconverter; | ||
|
||
import java.util.Optional; | ||
|
||
/**Describes vertical location of the sigmet phenomenon e.g. from surface to FL or between two FLs*/ | ||
public class SigmetVerticalPhenomenonLocation { | ||
|
||
private boolean topMarginAboveFl = false; | ||
private boolean bottomMarginOnSurface = false; | ||
|
||
private Optional<Integer> bottomFL; | ||
private Optional<Integer> topFL; | ||
private Optional<Integer> topMarginMeters; | ||
|
||
|
||
} |