Ticket #21772: 21772.patch
| File 21772.patch, 4.4 KB (added by , 4 years ago) |
|---|
-
build.xml
4 4 <!-- enter the SVN commit message --> 5 5 <property name="commit.message" value="Changed constructor signature of plugin main class"/> 6 6 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 7 <property name="plugin.main.version" value="1 4153"/>7 <property name="plugin.main.version" value="15496"/> 8 8 9 9 <!-- Configure these properties (replace "..." accordingly). 10 10 See https://josm.openstreetmap.de/wiki/DevelopersGuide/DevelopingPlugins -
src/org/openstreetmap/josm/plugins/globalsat/GlobalsatDg100.java
22 22 import org.kaintoch.gps.globalsat.dg100.Response; 23 23 import org.openstreetmap.josm.data.coor.LatLon; 24 24 import org.openstreetmap.josm.data.gpx.GpxData; 25 import org.openstreetmap.josm.data.gpx. ImmutableGpxTrack;25 import org.openstreetmap.josm.data.gpx.GpxTrack; 26 26 import org.openstreetmap.josm.data.gpx.WayPoint; 27 27 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 28 import org.openstreetmap.josm.tools.Logging; 28 29 29 30 import gnu.io.CommPortIdentifier; 30 31 import gnu.io.PortInUseException; … … 66 67 , (byte) 0x01, (byte) 0x00, (byte) 0xBD, (byte) 0xB0, (byte) 0xB3 67 68 };*/ 68 69 /** delete file: A0 A2 00 03 BA FF FF 02 B8 B0 B3 */ 69 private static byte[] dg100CmdDelFile =70 private static final byte[] dg100CmdDelFile = 70 71 {(byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x03, (byte) 0xBA, 71 72 (byte) 0xFF, (byte) 0xFF, (byte) 0x02, (byte) 0xB8, (byte) 0xB0, (byte) 0xB3 72 73 }; 73 74 /** get file info: A0 A2 00 03 BB 00 00 00 BB B0 B3 */ 74 private static byte[] dg100CmdGetFileInfo =75 private static final byte[] dg100CmdGetFileInfo = 75 76 {(byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x03, (byte) 0xBB, 76 77 (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xBB, (byte) 0xB0, (byte) 0xB3 77 78 }; 78 79 /** get gps recs: A0 A2 00 03 B5 00 02 00 B7 B0 B3 */ 79 private static byte[] dg100CmdGetGpsRecs =80 private static final byte[] dg100CmdGetGpsRecs = 80 81 {(byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x03, (byte) 0xB5, 81 82 (byte) 0x00, (byte) 0x02, (byte) 0x00, (byte) 0xB7, (byte) 0xB0, (byte) 0xB3 82 83 }; 83 84 /** read config: A0 A2 00 01 B7 00 B7 B0 B3 */ 84 private static byte[] dg100CmdGetConfig =85 private static final byte[] dg100CmdGetConfig = 85 86 {(byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x01, (byte) 0xB7, 86 87 (byte) 0x00, (byte) 0xB7, (byte) 0xB0, (byte) 0xB3 }; 87 88 /** set config: A0 A2 00 2A B8 jj kk ll ll ll ll mm nn nn nn nn … … 88 89 aa aa aa aa bb bb bb bb cc cc cc cc 00 00 gg hh 89 90 ii dd dd dd dd ee ee ee ee ff ff ff ff 01 xx xx 90 91 B0 B3 */ 91 private static byte[] dg100CmdSetConfig =92 private static final byte[] dg100CmdSetConfig = 92 93 {(byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x2A, (byte) 0xB8, 93 94 (byte) 0x02, 94 95 (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, … … 115 116 , (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00 116 117 , (byte) 0x00, (byte) 0xC0, (byte) 0xB0, (byte) 0xB3};*/ 117 118 118 private byte[] response = new byte[65536];119 private final byte[] response = new byte[65536]; 119 120 120 private CommPortIdentifier portIdentifier;121 private final CommPortIdentifier portIdentifier; 121 122 private SerialPort port = null; 122 123 123 124 private boolean canceled = false; … … 165 166 last = r; 166 167 progressMonitor.worked(1); 167 168 } 168 result.tracks.add(new ImmutableGpxTrack(Collections.singleton(seg), Collections.<String, Object>emptyMap()));169 result.tracks.add(new GpxTrack(Collections.singleton(seg), Collections.emptyMap())); 169 170 } 170 171 return result; 171 172 } finally { … … 245 246 } 246 247 247 248 private Response<?> sendCmdDelFiles() throws IOException, UnsupportedCommOperationException { 248 System.out.println("deleting data...");249 Logging.info("GlobalSat: GlobalsatDg100: deleting data..."); 249 250 int len = sendCmd(dg100CmdDelFile, response, -1); 250 251 return Response.parseResponse(response, len); 251 252 }
