Subversion Repositories Projects

Rev

Rev 1564 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1564 Rev 1568
Line 13... Line 13...
13
import java.util.List;
13
import java.util.List;
Line 14... Line 14...
14
 
14
 
15
import dongfang.mkt.comm.FrameQueue;
15
import dongfang.mkt.comm.FrameQueue;
16
import dongfang.mkt.comm.MKConnection;
16
import dongfang.mkt.comm.MKConnection;
-
 
17
import dongfang.mkt.comm.serial.RXTXSerialPort;
17
import dongfang.mkt.comm.serial.RXTXSerialPort;
18
import dongfang.mkt.comm.tcp.MKTCPConnection;
18
import dongfang.mkt.frames.OSDDataRequestFrame;
19
import dongfang.mkt.frames.OSDDataRequestFrame;
Line 19... Line 20...
19
import dongfang.mkt.frames.OSDDataResponseFrame;
20
import dongfang.mkt.frames.OSDDataResponseFrame;
20
 
21
 
Line 62... Line 63...
62
                                return;
63
                                return;
63
                        w.write("  <dataset timestamp=\"" + timestamp + "\" version=\"" + f.getVersion() + "\">\n");
64
                        w.write("  <dataset timestamp=\"" + timestamp + "\" version=\"" + f.getVersion() + "\">\n");
64
                        w.write("    <currentPosition " + f.getCurrentPosition().toXML() + "/>\n");
65
                        w.write("    <currentPosition " + f.getCurrentPosition().toXML() + "/>\n");
65
                        w.write("    <targetPosition " + f.getTargetPosition().toXML() + " " + f.getCurrentToTarget().toXML() + "/>\n");
66
                        w.write("    <targetPosition " + f.getTargetPosition().toXML() + " " + f.getCurrentToTarget().toXML() + "/>\n");
66
                        w.write("    <homePosition " + f.getHomePosition().toXML() + " " + f.getCurrentToHome().toXML() + "/>\n");
67
                        w.write("    <homePosition " + f.getHomePosition().toXML() + " " + f.getCurrentToHome().toXML() + "/>\n");
67
                        w.write("    <heading compass=\"" + f.getCompassHeading() + "\" flight=\"" + f.getDirectionOfFlight() + "\" groundSpeed=\"" + ((double)f.getGroundSpeed())/100 + "\"/>\n");
68
                        w.write("    <heading compass=\"" + f.getCompassHeading() + "\" flight=\"" + f.getDirectionOfFlight() + "\" groundSpeed=\"" + f.getGroundSpeed() + "\"/>\n");
Line 68... Line 69...
68
 
69
 
-
 
70
                        w.write("    <waypoints index=\"" + f.getWaypointIndex() + "\" count=\"" + f.getWaypointCount() + "\"/>\n");
-
 
71
                       
69
                        w.write("    <waypoints index=\"" + f.getWaypointIndex() + "\" count=\"" + f.getWaypointCount() + "\"/>\n");
72
                        double gpsHeight = f.getCurrentPosition().getAltitude() - f.getHomePosition().getAltitude();
Line 70... Line 73...
70
                        w.write("    <height barometric=\"" + f.getHeightByPressure() + "\" barometricVerticalVelocity=\"" + f.getVerticalVelocityByPressure() + "\" gpsVerticalVelocity=\"" + f.getVerticalVelocityByGPS() + "\"/>\n");
73
                        w.write("    <height barometric=\"" + f.getHeightByPressure() + "\" gps=\"" + gpsHeight + "\" barometricVerticalVelocity=\"" + f.getVerticalVelocityByPressure() + "\" gpsVerticalVelocity=\"" + f.getVerticalVelocityByGPS() + "\"/>\n");
71
 
74
 
Line 72... Line 75...
72
                        w.write("    <status rcQuality=\"" + f.getRcQuality() + "\" fcflags=\"" + f.getFcFlags() + "\" fcflags2=\"" + f.getFcFlags2() + "\" ncflags=\"" + f.getNcFlags() + "\" errorCode=\"" + f.getErrorCode() + "\" numberOfSatellites=\"" + f.getNumberOfSatellites() + "\"/>\n");
75
                        w.write("    <status rcQuality=\"" + f.getRcQuality() + "\" fcflags=\"" + f.getFcFlags() + "\" fcflags2=\"" + f.getFcFlags2() + "\" ncflags=\"" + f.getNcFlags() + "\" errorCode=\"" + f.getErrorCode() + "\" numberOfSatellites=\"" + f.getNumberOfSatellites() + "\"/>\n");
Line 158... Line 161...
158
        }
161
        }
Line 159... Line 162...
159
 
162
 
160
        public static void main(String[] args) throws IOException {
163
        public static void main(String[] args) throws IOException {
Line 161... Line 164...
161
                OSDLogger test = new OSDLogger();
164
                OSDLogger test = new OSDLogger();
162
 
165
 
Line 163... Line 166...
163
                MKConnection _port = new RXTXSerialPort();
166
                MKConnection _port = new MKTCPConnection(); //RXTXSerialPort();
164
                _port.init(null);
167
                _port.init("8080");
Line 165... Line 168...
165
 
168