Rev 1562 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1559 | - | 1 | package dongfang.mkt.frames; |
2 | |||
3 | public class OSDDataResponseFrame extends ResponseFrame { |
||
4 | |||
5 | public static class GPSPosition { |
||
6 | int longitude; // in 1E-7 degrees. 32 bit signed. |
||
7 | int latitude; // in 1E-7 degrees. 32 bit signed. |
||
8 | long altitude; // in mm. 32 bit signed. |
||
9 | int status; |
||
10 | public int getLongitude() { |
||
11 | return longitude; |
||
12 | } |
||
13 | public int getLatitude() { |
||
14 | return latitude; |
||
15 | } |
||
16 | public long getAltitude() { |
||
17 | return altitude; |
||
18 | } |
||
19 | public int getStatus() { |
||
20 | return status; |
||
21 | } |
||
22 | public void setLongitude(int longitude) { |
||
23 | this.longitude = longitude; |
||
24 | } |
||
25 | public void setLatitude(int latitude) { |
||
26 | this.latitude = latitude; |
||
27 | } |
||
28 | public void setAltitude(long altitude) { |
||
29 | this.altitude = altitude; |
||
30 | } |
||
31 | public void setStatus(int status) { |
||
32 | this.status = status; |
||
33 | } |
||
34 | } |
||
35 | |||
36 | public static class GPSDistanceAndBearing { |
||
37 | int distance; // in m/10. 16 bit unsigned. |
||
38 | int bearing; // in degrees. 16 bit signed. |
||
39 | public int getDistance() { |
||
40 | return distance; |
||
41 | } |
||
42 | public int getBearing() { |
||
43 | return bearing; |
||
44 | } |
||
45 | public void setDistance(int distance) { |
||
46 | this.distance = distance; |
||
47 | } |
||
48 | public void setBearing(int bearing) { |
||
49 | this.bearing = bearing; |
||
50 | } |
||
51 | } |
||
52 | |||
53 | private int version; |
||
54 | private GPSPosition currentPosition; |
||
55 | private GPSPosition targetPosition; |
||
56 | private GPSDistanceAndBearing currentToTarget; |
||
57 | private GPSPosition homePosition; |
||
58 | private GPSDistanceAndBearing currentToHome; |
||
59 | |||
60 | private int waypointIndex; |
||
61 | private int waypointCount; |
||
62 | |||
63 | private int numberOfSatellites; |
||
64 | private int heightByPressure; // 16 bit signed. |
||
65 | private int verticalVelocityByPressure; // 16 bit signed. |
||
66 | |||
67 | private int flightTime; // in secs. 16 bit unsigned. |
||
68 | private int batteryVoltage; // in 0.1 volts. |
||
69 | |||
70 | private int groundSpeed; // in cm/s. 16 bit unsigned. |
||
71 | private int heading; // of movement. 16 bit signed. |
||
72 | private int compassHeading;// 16 bit signed. |
||
73 | |||
74 | private int pitchAngle; |
||
75 | private int rollAngle; |
||
76 | |||
77 | private int rcQuality; |
||
78 | private int fcFlags; |
||
79 | private int ncFlags; |
||
80 | private int errorCode; |
||
81 | |||
82 | private int operatingRadius; |
||
83 | private int verticalVelocityByGPS; // 16 bit signed. |
||
84 | |||
85 | private int targetLoiterTime; |
||
86 | private int fcFlags2; |
||
87 | private int setpointForAltitude; // 16 bit signed. |
||
88 | |||
89 | private int throttle; |
||
90 | private int current; // 16 bit unsigned. |
||
91 | private int capacityUsed; // 16 bit unsigned. |
||
92 | |||
93 | public OSDDataResponseFrame(int address) { |
||
94 | super(address); |
||
95 | } |
||
96 | |||
97 | public int getVersion() { |
||
98 | return version; |
||
99 | } |
||
100 | public GPSPosition getCurrentPosition() { |
||
101 | return currentPosition; |
||
102 | } |
||
103 | public GPSPosition getTargetPosition() { |
||
104 | return targetPosition; |
||
105 | } |
||
106 | public GPSDistanceAndBearing getCurrentToTarget() { |
||
107 | return currentToTarget; |
||
108 | } |
||
109 | public GPSPosition getHomePosition() { |
||
110 | return homePosition; |
||
111 | } |
||
112 | public GPSDistanceAndBearing getCurrentToHome() { |
||
113 | return currentToHome; |
||
114 | } |
||
115 | public int getWaypointIndex() { |
||
116 | return waypointIndex; |
||
117 | } |
||
118 | public int getWaypointCount() { |
||
119 | return waypointCount; |
||
120 | } |
||
121 | public int getNumberOfSatellites() { |
||
122 | return numberOfSatellites; |
||
123 | } |
||
124 | public int getHeightByPressure() { |
||
125 | return heightByPressure; |
||
126 | } |
||
127 | public int getVerticalVelocityByPressure() { |
||
128 | return verticalVelocityByPressure; |
||
129 | } |
||
130 | public int getFlightTime() { |
||
131 | return flightTime; |
||
132 | } |
||
133 | public int getBatteryVoltage() { |
||
134 | return batteryVoltage; |
||
135 | } |
||
136 | public int getGroundSpeed() { |
||
137 | return groundSpeed; |
||
138 | } |
||
139 | public int getHeading() { |
||
140 | return heading; |
||
141 | } |
||
142 | public int getCompassHeading() { |
||
143 | return compassHeading; |
||
144 | } |
||
145 | public int getPitchAngle() { |
||
146 | return pitchAngle; |
||
147 | } |
||
148 | public int getRollAngle() { |
||
149 | return rollAngle; |
||
150 | } |
||
151 | public int getRcQuality() { |
||
152 | return rcQuality; |
||
153 | } |
||
154 | public int getFcFlags() { |
||
155 | return fcFlags; |
||
156 | } |
||
157 | public int getNcFlags() { |
||
158 | return ncFlags; |
||
159 | } |
||
160 | public int getErrorCode() { |
||
161 | return errorCode; |
||
162 | } |
||
163 | public int getOperatingRadius() { |
||
164 | return operatingRadius; |
||
165 | } |
||
166 | public int getVerticalVelocityByGPS() { |
||
167 | return verticalVelocityByGPS; |
||
168 | } |
||
169 | public int getTargetLoiterTime() { |
||
170 | return targetLoiterTime; |
||
171 | } |
||
172 | public int getFcFlags2() { |
||
173 | return fcFlags2; |
||
174 | } |
||
175 | public int getSetpointForAltitude() { |
||
176 | return setpointForAltitude; |
||
177 | } |
||
178 | public int getThrottle() { |
||
179 | return throttle; |
||
180 | } |
||
181 | public int getCurrent() { |
||
182 | return current; |
||
183 | } |
||
184 | public int getCapacityUsed() { |
||
185 | return capacityUsed; |
||
186 | } |
||
187 | public void setVersion(int version) { |
||
188 | this.version = version; |
||
189 | } |
||
190 | public void setCurrentPosition(GPSPosition currentPosition) { |
||
191 | this.currentPosition = currentPosition; |
||
192 | } |
||
193 | public void setTargetPosition(GPSPosition targetPosition) { |
||
194 | this.targetPosition = targetPosition; |
||
195 | } |
||
196 | public void setCurrentToTarget(GPSDistanceAndBearing currentToTarget) { |
||
197 | this.currentToTarget = currentToTarget; |
||
198 | } |
||
199 | public void setHomePosition(GPSPosition homePosition) { |
||
200 | this.homePosition = homePosition; |
||
201 | } |
||
202 | public void setCurrentToHome(GPSDistanceAndBearing currentToHome) { |
||
203 | this.currentToHome = currentToHome; |
||
204 | } |
||
205 | public void setWaypointIndex(int waypointIndex) { |
||
206 | this.waypointIndex = waypointIndex; |
||
207 | } |
||
208 | public void setWaypointCount(int waypointCount) { |
||
209 | this.waypointCount = waypointCount; |
||
210 | } |
||
211 | public void setNumberOfSatellites(int numberOfSatellites) { |
||
212 | this.numberOfSatellites = numberOfSatellites; |
||
213 | } |
||
214 | public void setHeightByPressure(int heightByPressure) { |
||
215 | this.heightByPressure = heightByPressure; |
||
216 | } |
||
217 | public void setVerticalVelocityByPressure(int verticalVelocityByPressure) { |
||
218 | this.verticalVelocityByPressure = verticalVelocityByPressure; |
||
219 | } |
||
220 | public void setFlightTime(int flightTime) { |
||
221 | this.flightTime = flightTime; |
||
222 | } |
||
223 | public void setBatteryVoltage(int batteryVoltage) { |
||
224 | this.batteryVoltage = batteryVoltage; |
||
225 | } |
||
226 | public void setGroundSpeed(int groundSpeed) { |
||
227 | this.groundSpeed = groundSpeed; |
||
228 | } |
||
229 | public void setHeading(int heading) { |
||
230 | this.heading = heading; |
||
231 | } |
||
232 | public void setCompassHeading(int compassHeading) { |
||
233 | this.compassHeading = compassHeading; |
||
234 | } |
||
235 | public void setPitchAngle(int pitchAngle) { |
||
236 | this.pitchAngle = pitchAngle; |
||
237 | } |
||
238 | public void setRollAngle(int rollAngle) { |
||
239 | this.rollAngle = rollAngle; |
||
240 | } |
||
241 | public void setRcQuality(int rcQuality) { |
||
242 | this.rcQuality = rcQuality; |
||
243 | } |
||
244 | public void setFcFlags(int fcFlags) { |
||
245 | this.fcFlags = fcFlags; |
||
246 | } |
||
247 | public void setNcFlags(int ncFlags) { |
||
248 | this.ncFlags = ncFlags; |
||
249 | } |
||
250 | public void setErrorCode(int errorCode) { |
||
251 | this.errorCode = errorCode; |
||
252 | } |
||
253 | public void setOperatingRadius(int operatingRadius) { |
||
254 | this.operatingRadius = operatingRadius; |
||
255 | } |
||
256 | public void setVerticalVelocityByGPS(int verticalVelocityByGPS) { |
||
257 | this.verticalVelocityByGPS = verticalVelocityByGPS; |
||
258 | } |
||
259 | public void setTargetLoiterTime(int targetLoiterTime) { |
||
260 | this.targetLoiterTime = targetLoiterTime; |
||
261 | } |
||
262 | public void setFcFlags2(int fcFlags2) { |
||
263 | this.fcFlags2 = fcFlags2; |
||
264 | } |
||
265 | public void setSetpointForAltitude(int setpointForAltitude) { |
||
266 | this.setpointForAltitude = setpointForAltitude; |
||
267 | } |
||
268 | public void setThrottle(int throttle) { |
||
269 | this.throttle = throttle; |
||
270 | } |
||
271 | public void setCurrent(int current) { |
||
272 | this.current = current; |
||
273 | } |
||
274 | public void setCapacityUsed(int capacityUsed) { |
||
275 | this.capacityUsed = capacityUsed; |
||
276 | } |
||
277 | } |
||
278 |