Changeset 36120 in osm
- Timestamp:
- 2023-08-15T18:00:16+02:00 (17 months ago)
- Location:
- applications/editors/josm/plugins/livegps
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/livegps/build.xml
r36107 r36120 17 17 <import file="../build-common.xml"/> 18 18 19 <target name="checkstyle" depends="checkstyle-compile"> 20 <taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties"> 21 <classpath refid="checkstyle.classpath"/> 22 <classpath path="${checkstyle-build.dir}"/> 23 </taskdef> 24 <checkstyle config="checkstyle-config.xml"> 25 <fileset dir="${basedir}/src" includes="**/*.java" /> 26 <formatter type="xml" toFile="checkstyle-josm-${ant.project.name}.xml"/> 27 </checkstyle> 28 </target> 29 19 30 </project> -
applications/editors/josm/plugins/livegps/src/livegps/LiveGpsAcquirer.java
r36117 r36120 24 24 import org.openstreetmap.josm.tools.Logging; 25 25 26 /** 27 * Acquires NMEA data from a GPSD 28 */ 26 29 public class LiveGpsAcquirer implements Runnable { 27 30 private String gpsdHost; … … 153 156 154 157 if (JSONProtocol == true) 155 gpsData = ParseJSON(line);158 gpsData = parseJSON(line); 156 159 else 157 gpsData = ParseOld(line);160 gpsData = parseOld(line); 158 161 159 162 if (gpsData == null) … … 278 281 } 279 282 280 private LiveGpsData ParseJSON(String line) {283 private LiveGpsData parseJSON(String line) { 281 284 JsonObject report; 282 285 double lat, lon; … … 319 322 } 320 323 321 private LiveGpsData ParseOld(String line) {324 private LiveGpsData parseOld(String line) { 322 325 String[] words; 323 326 double lat = 0; -
applications/editors/josm/plugins/livegps/src/livegps/LiveGpsAcquirerNMEA.java
r36117 r36120 142 142 int c = serReader.read(); 143 143 if (c == '$') { 144 Logging.trace("Parsing NMEA: " + sb.toString().replaceAll("[\r\n]", ""));144 Logging.trace("Parsing NMEA: " + sb.toString().replaceAll("[\r\n]", "")); 145 145 parser.parseNMEASentence(sb.toString()); 146 146 sb.delete(0, sb.length()); … … 155 155 Collection<WayPoint> wpts = parser.getAndDropWaypoints(); 156 156 for (WayPoint w : wpts) { 157 if (w.getInstant() == null)157 if (w.getInstant() == null) 158 158 continue; 159 159 if (w.getInstant().equals(lasttime)) { -
applications/editors/josm/plugins/livegps/src/livegps/LiveGpsData.java
r36117 r36120 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.awt.Point;7 6 import java.text.DecimalFormat; 8 7 … … 14 13 import org.openstreetmap.josm.data.osm.IWay; 15 14 import org.openstreetmap.josm.data.osm.Node; 16 import org.openstreetmap.josm.data.osm.OsmPrimitive;17 15 import org.openstreetmap.josm.data.osm.Way; 18 16 import org.openstreetmap.josm.data.osm.WaySegment; 19 17 import org.openstreetmap.josm.gui.MainApplication; 20 import org.openstreetmap.josm.gui.MapFrame;21 18 import org.openstreetmap.josm.spi.preferences.Config; 22 19 import org.openstreetmap.josm.tools.Geometry; … … 33 30 private float epx, epy; 34 31 private String wayString; 35 private WayPoint w p;32 private WayPoint waypoint; 36 33 private static final DecimalFormat offsetFormat = new DecimalFormat("0.00"); 37 34 … … 57 54 */ 58 55 public WayPoint getWaypoint() { 59 return this.w p;56 return this.waypoint; 60 57 } 61 58 62 59 /** 63 60 * Set the waypoint to transfer additional data form NMEA input 64 * @param w pwaypoint to set65 */ 66 public void setWaypoint(WayPoint w p) {67 this.w p = wp;61 * @param waypoint waypoint to set 62 */ 63 public void setWaypoint(WayPoint waypoint) { 64 this.waypoint = waypoint; 68 65 } 69 66 … … 186 183 protected void decorateNameWithId(StringBuilder name, IPrimitive primitive) { 187 184 } 185 188 186 @Override 189 187 protected void decorateNameWithNodes(StringBuilder name, IWay way) { -
applications/editors/josm/plugins/livegps/src/livegps/LiveGpsDialog.java
r36117 r36120 140 140 public void run() { 141 141 /* prevent flickering - skip the connecting message when NMEA input is working */ 142 if (!(oldStatus.getStatus() == LiveGpsStatus.GpsStatus.CONNECTION_FAILED && status.getStatus() == LiveGpsStatus.GpsStatus.CONNECTING && nmeaStatus.getStatus() == LiveGpsStatus.GpsStatus.CONNECTED)) 142 if (!(oldStatus.getStatus() == LiveGpsStatus.GpsStatus.CONNECTION_FAILED 143 && status.getStatus() == LiveGpsStatus.GpsStatus.CONNECTING 144 && nmeaStatus.getStatus() == LiveGpsStatus.GpsStatus.CONNECTED)) 143 145 statusLabel.setText(status.getStatusMessage()); 144 if (status.getStatus() != LiveGpsStatus.GpsStatus.CONNECTED && nmeaStatus.getStatus() != LiveGpsStatus.GpsStatus.CONNECTED) { 146 if (status.getStatus() != LiveGpsStatus.GpsStatus.CONNECTED 147 && nmeaStatus.getStatus() != LiveGpsStatus.GpsStatus.CONNECTED) { 145 148 panel.setBackground(Color.RED); 146 149 } else { -
applications/editors/josm/plugins/livegps/src/livegps/LiveGpsDrawHelper.java
r36117 r36120 14 14 import org.openstreetmap.josm.spi.preferences.Config; 15 15 16 /** 17 * Painting the LiveGPS data layer, especially the current position arrow 18 */ 16 19 public class LiveGpsDrawHelper extends GpxDrawHelper { 17 20 private final LiveGpsLayer layer; -
applications/editors/josm/plugins/livegps/src/livegps/LiveGpsLayer.java
r36117 r36120 22 22 import org.openstreetmap.josm.spi.preferences.Config; 23 23 24 /** 25 * The LiveGPS layer 26 */ 24 27 public class LiveGpsLayer extends GpxLayer implements PropertyChangeListener { 25 28 public static final String LAYER_NAME = tr("LiveGPS layer"); -
applications/editors/josm/plugins/livegps/src/livegps/LiveGpsPlugin.java
r36117 r36120 29 29 import org.openstreetmap.josm.tools.Shortcut; 30 30 31 /** 32 * Main LiveGPS plugin class 33 */ 31 34 public class LiveGpsPlugin extends Plugin implements LayerChangeListener { 32 35 private boolean enabled = false; -
applications/editors/josm/plugins/livegps/src/livegps/SingleSegmentGpxTrack.java
r35221 r36120 11 11 import org.openstreetmap.josm.data.gpx.WithAttributes; 12 12 13 /** 14 * LiveGPS track which gets step by step expanded with new data 15 */ 13 16 public class SingleSegmentGpxTrack extends WithAttributes implements IGpxTrack { 14 17
Note:
See TracChangeset
for help on using the changeset viewer.