| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
package footleg.cavesurvey.data.model; |
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
public class SurveyStation { |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
public SurveyStation(int id) { |
| 38 |
super(); |
| 39 |
this.id = id; |
| 40 |
} |
| 41 |
|
| 42 |
private int id = -1; |
| 43 |
private String name = ""; |
| 44 |
private String comment = ""; |
| 45 |
|
| 46 |
|
| 47 |
private FixType fixType = FixType.NONE; |
| 48 |
private double easting; |
| 49 |
private double northing; |
| 50 |
private double altitude; |
| 51 |
|
| 52 |
private boolean entrance = false; |
| 53 |
|
| 54 |
public enum FixType { |
| 55 |
NONE (0), |
| 56 |
GPS (1), |
| 57 |
OTHER (2); |
| 58 |
|
| 59 |
FixType( int type ) { |
| 60 |
} |
| 61 |
} |
| 62 |
|
| 63 |
public boolean isEntrance() { |
| 64 |
return ( entrance ); |
| 65 |
} |
| 66 |
public void setEntrance(boolean entrance) { |
| 67 |
this.entrance = entrance; |
| 68 |
} |
| 69 |
public boolean isFixed() { |
| 70 |
return ( fixType != FixType.NONE ); |
| 71 |
} |
| 72 |
public FixType getFixType() { |
| 73 |
return fixType; |
| 74 |
} |
| 75 |
public double getEasting() { |
| 76 |
return easting; |
| 77 |
} |
| 78 |
public double getNorthing() { |
| 79 |
return northing; |
| 80 |
} |
| 81 |
public double getAltitude() { |
| 82 |
return altitude; |
| 83 |
} |
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
public void setFixed(FixType fixType, double easting, double northing, double altitude) { |
| 94 |
this.fixType = fixType; |
| 95 |
this.easting = easting; |
| 96 |
this.northing = northing; |
| 97 |
this.altitude = altitude; |
| 98 |
} |
| 99 |
|
| 100 |
public void clearFixedStn() { |
| 101 |
this.fixType = FixType.NONE; |
| 102 |
this.easting = 0; |
| 103 |
this.northing = 0; |
| 104 |
this.altitude = 0; |
| 105 |
} |
| 106 |
|
| 107 |
public int getId() { |
| 108 |
return id; |
| 109 |
} |
| 110 |
|
| 111 |
public void setId(int id) { |
| 112 |
this.id = id; |
| 113 |
} |
| 114 |
|
| 115 |
public String getName() { |
| 116 |
String stnName = this.name; |
| 117 |
|
| 118 |
if (stnName.length() == 0) { |
| 119 |
stnName = "" + this.id; |
| 120 |
} |
| 121 |
return stnName; |
| 122 |
} |
| 123 |
|
| 124 |
public void setName(String name) { |
| 125 |
this.name = name; |
| 126 |
} |
| 127 |
|
| 128 |
public String getComment() { |
| 129 |
return comment; |
| 130 |
} |
| 131 |
|
| 132 |
public void setComment(String comment) { |
| 133 |
this.comment = comment; |
| 134 |
} |
| 135 |
|
| 136 |
public SurveyStation clone() { |
| 137 |
SurveyStation clone = new SurveyStation( this.id ); |
| 138 |
|
| 139 |
clone.name = this.name; |
| 140 |
clone.comment = this.comment; |
| 141 |
clone.entrance = this.entrance; |
| 142 |
clone.fixType = this.fixType; |
| 143 |
clone.easting = this.easting; |
| 144 |
clone.northing = this.northing; |
| 145 |
clone.altitude = this.altitude; |
| 146 |
|
| 147 |
return clone; |
| 148 |
} |
| 149 |
|
| 150 |
} |