Ignore:
Timestamp:
2019-07-14T02:26:22+02:00 (5 years ago)
Author:
Don-vip
Message:

see #17829 - support RTKLib Positioning Solution files. Add new "Quality" GPX color mode

Location:
trunk/src/org/openstreetmap/josm/gui/layer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java

    r15045 r15247  
    7979import org.openstreetmap.josm.gui.io.importexport.JpgImporter;
    8080import org.openstreetmap.josm.gui.io.importexport.NMEAImporter;
     81import org.openstreetmap.josm.gui.io.importexport.RtkLibImporter;
    8182import org.openstreetmap.josm.gui.layer.GpxLayer;
    8283import org.openstreetmap.josm.gui.layer.Layer;
     
    267268            ExtensionFileFilter gpxFilter = GpxImporter.getFileFilter();
    268269            AbstractFileChooser fc = new FileChooserManager(true, null).createFileChooser(false, null,
    269                     Arrays.asList(gpxFilter, NMEAImporter.FILE_FILTER), gpxFilter, JFileChooser.FILES_ONLY).openFileChooser();
     270                    Arrays.asList(gpxFilter, NMEAImporter.FILE_FILTER, RtkLibImporter.FILE_FILTER), gpxFilter, JFileChooser.FILES_ONLY)
     271                    .openFileChooser();
    270272            if (fc == null)
    271273                return;
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java

    r15001 r15247  
    126126    /** Colors (without custom alpha channel, if given) for HDOP painting. **/
    127127    private ColorScale hdopScale;
     128    private ColorScale qualityScale;
    128129    private ColorScale dateScale;
    129130    private ColorScale directionScale;
     
    177178    private static Color[] heatMapLutColorJosmRed2Blue = createColorFromResource("red2blue");
    178179
     180    private static Color[] rtkLibQualityColors = new Color[] {
     181        Color.GREEN, // Fixed, solution by carrier‐based relative positioning and the integer ambiguity is properly resolved.
     182        Color.ORANGE, // Float, solution by carrier‐based relative positioning but the integer ambiguity is not resolved.
     183        Color.PINK, // Reserved
     184        Color.BLUE, // DGPS, solution by code‐based DGPS solutions or single point positioning with SBAS corrections
     185        Color.RED, // Single, solution by single point positioning
     186        Color.CYAN // PPP
     187    };
     188
    179189    // user defined heatmap color
    180190    private Color[] heatMapLutColor = createColorLut(0, Color.BLACK, Color.WHITE);
     
    188198        /** Colors (without custom alpha channel, if given) for HDOP painting. **/
    189199        hdopScale = ColorScale.createHSBScale(256).makeReversed().addTitle(tr("HDOP"));
     200        qualityScale = ColorScale.createFixedScale(rtkLibQualityColors).addTitle(tr("Quality"));
    190201        dateScale = ColorScale.createHSBScale(256).addTitle(tr("Time"));
    191202        directionScale = ColorScale.createCyclicScale(256).setIntervalCount(4).addTitle(tr("Direction"));
     
    228239         * Color using a heatmap instead of normal lines
    229240         */
    230         HEATMAP;
     241        HEATMAP,
     242        /**
     243         * Color by quality (RTKLib)
     244         */
     245        QUALITY;
    231246
    232247        static ColorMode fromIndex(final int index) {
     
    343358        dateScale.setNoDataColor(neutralColor);
    344359        hdopScale.setNoDataColor(neutralColor);
     360        qualityScale.setNoDataColor(neutralColor);
    345361        directionScale.setNoDataColor(neutralColor);
    346362
     
    557573            velocityScale.setRange(0, colorTracksTune);
    558574            hdopScale.setRange(0, hdoprange);
     575            qualityScale.setRange(1, rtkLibQualityColors.length);
    559576        }
    560577        double now = System.currentTimeMillis()/1000.0;
     
    586603
    587604                if (colored == ColorMode.HDOP) {
    588                     Float hdop = (Float) trkPnt.get(GpxConstants.PT_HDOP);
    589                     color = hdopScale.getColor(hdop);
     605                    color = hdopScale.getColor((Float) trkPnt.get(GpxConstants.PT_HDOP));
     606                } else if (colored == ColorMode.QUALITY) {
     607                    color = qualityScale.getColor((Integer) trkPnt.get(GpxConstants.RTKLIB_Q));
    590608                }
    591609                if (oldWp != null) { // other coloring modes need segment for calcuation
     
    15061524        if (colored == ColorMode.HDOP) {
    15071525            hdopScale.drawColorBar(g, w-30, 50, 20, 100, 1.0);
     1526        } else if (colored == ColorMode.QUALITY) {
     1527            qualityScale.drawColorBar(g, w-30, 50, 20, 100, 1.0);
    15081528        } else if (colored == ColorMode.VELOCITY) {
    15091529            SystemOfMeasurement som = SystemOfMeasurement.getSystemOfMeasurement();
Note: See TracChangeset for help on using the changeset viewer.