Changeset 35938 in osm for applications/editors/josm


Ignore:
Timestamp:
2022-03-22T19:33:24+01:00 (2 years ago)
Author:
taylor.smock
Message:

Fix #21772: Update deprecated functions in globalsat

This primarily changes ImmutableGpxTrack to GpxTrack,
along with some lint issues.

Location:
applications/editors/josm/plugins/globalsat
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/globalsat/build.xml

    r35519 r35938  
    55    <property name="commit.message" value="Changed constructor signature of plugin main class"/>
    66    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    7     <property name="plugin.main.version" value="14153"/>
     7    <property name="plugin.main.version" value="15496"/>
    88
    99    <!-- Configure these properties (replace "..." accordingly).
  • applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatDg100.java

    r34120 r35938  
    2323import org.openstreetmap.josm.data.coor.LatLon;
    2424import org.openstreetmap.josm.data.gpx.GpxData;
    25 import org.openstreetmap.josm.data.gpx.ImmutableGpxTrack;
     25import org.openstreetmap.josm.data.gpx.GpxTrack;
    2626import org.openstreetmap.josm.data.gpx.WayPoint;
    2727import org.openstreetmap.josm.gui.progress.ProgressMonitor;
     28import org.openstreetmap.josm.tools.Logging;
    2829
    2930import gnu.io.CommPortIdentifier;
     
    6768    };*/
    6869    /** delete file: A0 A2 00 03 BA FF FF 02 B8 B0 B3 */
    69     private static byte[] dg100CmdDelFile =
     70    private static final byte[] dg100CmdDelFile =
    7071    {(byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x03, (byte) 0xBA,
    7172     (byte) 0xFF, (byte) 0xFF, (byte) 0x02, (byte) 0xB8, (byte) 0xB0, (byte) 0xB3
    7273    };
    7374    /** 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 =
    7576    {(byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x03, (byte) 0xBB,
    7677     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xBB, (byte) 0xB0, (byte) 0xB3
    7778    };
    7879    /** 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 =
    8081    {(byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x03, (byte) 0xB5,
    8182     (byte) 0x00, (byte) 0x02, (byte) 0x00, (byte) 0xB7, (byte) 0xB0, (byte) 0xB3
    8283    };
    8384    /** read config: A0 A2 00 01 B7 00 B7 B0 B3 */
    84     private static byte[] dg100CmdGetConfig =
     85    private static final byte[] dg100CmdGetConfig =
    8586    {(byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x01, (byte) 0xB7,
    8687     (byte) 0x00, (byte) 0xB7, (byte) 0xB0, (byte) 0xB3 };
     
    8990        ii dd dd dd dd ee ee ee ee ff ff ff ff 01 xx xx
    9091        B0 B3 */
    91     private static byte[] dg100CmdSetConfig =
     92    private static final byte[] dg100CmdSetConfig =
    9293    {(byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x2A, (byte) 0xB8,
    9394     (byte) 0x02,
     
    116117      , (byte) 0x00, (byte) 0xC0, (byte) 0xB0, (byte) 0xB3};*/
    117118
    118     private byte[] response = new byte[65536];
    119 
    120     private CommPortIdentifier portIdentifier;
     119    private final byte[] response = new byte[65536];
     120
     121    private final CommPortIdentifier portIdentifier;
    121122    private SerialPort port = null;
    122123
     
    166167                    progressMonitor.worked(1);
    167168                }
    168                 result.tracks.add(new ImmutableGpxTrack(Collections.singleton(seg), Collections.<String, Object>emptyMap()));
     169                result.tracks.add(new GpxTrack(Collections.singleton(seg), Collections.emptyMap()));
    169170            }
    170171            return result;
     
    246247
    247248    private Response<?> sendCmdDelFiles() throws IOException, UnsupportedCommOperationException {
    248         System.out.println("deleting data...");
     249        Logging.info("GlobalSat: GlobalsatDg100: deleting data...");
    249250        int len = sendCmd(dg100CmdDelFile, response, -1);
    250251        return Response.parseResponse(response, len);
Note: See TracChangeset for help on using the changeset viewer.