]> gitweb.fperrin.net Git - GpsPrune.git/commitdiff
Merge branch 'srtm-multi-sources' into fp-integration
authorFrédéric Perrin <fred@fperrin.net>
Sat, 30 Nov 2019 20:50:21 +0000 (20:50 +0000)
committerFrédéric Perrin <fred@fperrin.net>
Sat, 30 Nov 2019 20:50:21 +0000 (20:50 +0000)
1  2 
src/tim/prune/FunctionLibrary.java
src/tim/prune/gui/MenuManager.java
src/tim/prune/lang/prune-texts_en.properties

index 0245b115e93d6eaadeceea290adefbdcfa324af4,ea78e9a175e0ba7b7f3d4edb6e95ac23c854bd78..4be286e479d036a8b37cabe8223f495872a2f361
@@@ -28,7 -28,6 +28,7 @@@ import tim.prune.function.PhotoPopupFun
  import tim.prune.function.PlayAudioFunction;
  import tim.prune.function.RearrangePhotosFunction;
  import tim.prune.function.RearrangeWaypointsFunction;
 +import tim.prune.function.RemoveAltitudes;
  import tim.prune.function.RemoveAudioFunction;
  import tim.prune.function.RemovePhotoFunction;
  import tim.prune.function.RotatePhoto;
@@@ -57,12 -56,12 +57,12 @@@ import tim.prune.function.settings.Save
  import tim.prune.function.settings.SetAltitudeTolerance;
  import tim.prune.function.settings.SetColours;
  import tim.prune.function.settings.SetDisplaySettings;
+ import tim.prune.function.settings.SetEarthdataAuthentication;
  import tim.prune.function.settings.SetLanguage;
  import tim.prune.function.settings.SetMapBgFunction;
  import tim.prune.function.settings.SetPathsFunction;
  import tim.prune.function.sew.SewTrackSegmentsFunction;
  import tim.prune.function.sew.SplitSegmentsFunction;
- import tim.prune.function.srtm.DownloadSrtmFunction;
  import tim.prune.function.srtm.LookupSrtmFunction;
  import tim.prune.function.weather.GetWeatherForecastFunction;
  import tim.prune.load.AudioLoader;
@@@ -104,14 -103,12 +104,13 @@@ public abstract class FunctionLibrar
        public static GenericFunction FUNCTION_DELETE_BY_DATE = null;
        public static SingleNumericParameterFunction FUNCTION_INTERPOLATE = null;
        public static GenericFunction FUNCTION_LOOKUP_SRTM = null;
-       public static GenericFunction FUNCTION_DOWNLOAD_SRTM = null;
        public static GenericFunction FUNCTION_NEARBY_WIKIPEDIA = null;
        public static GenericFunction FUNCTION_SEARCH_WIKIPEDIA = null;
        public static GenericFunction FUNCTION_SEARCH_OSMPOIS = null;
        public static GenericFunction FUNCTION_DOWNLOAD_OSM = null;
        public static GenericFunction FUNCTION_ADD_TIME_OFFSET  = null;
        public static GenericFunction FUNCTION_ADD_ALTITUDE_OFFSET  = null;
 +      public static GenericFunction FUNCTION_REMOVE_ALTITUDES = null;
        public static GenericFunction FUNCTION_CONVERT_NAMES_TO_TIMES  = null;
        public static GenericFunction FUNCTION_DELETE_FIELD_VALUES  = null;
        public static GenericFunction FUNCTION_PASTE_COORDINATES = null;
        public static GenericFunction FUNCTION_SET_COLOURS = null;
        public static GenericFunction FUNCTION_SET_LANGUAGE = null;
        public static SingleNumericParameterFunction FUNCTION_SET_ALTITUDE_TOLERANCE = null;
+       public static GenericFunction FUNCTION_SET_EARTHDATA_AUTH = null;
        public static GenericFunction FUNCTION_SET_TIMEZONE = null;
        public static GenericFunction FUNCTION_HELP   = null;
        public static GenericFunction FUNCTION_SHOW_KEYS = null;
                FUNCTION_DELETE_BY_DATE = new DeleteByDateFunction(inApp);
                FUNCTION_INTERPOLATE = new InterpolateFunction(inApp);
                FUNCTION_LOOKUP_SRTM = new LookupSrtmFunction(inApp);
-               FUNCTION_DOWNLOAD_SRTM = new DownloadSrtmFunction(inApp);
                FUNCTION_NEARBY_WIKIPEDIA = new GetWikipediaFunction(inApp);
                FUNCTION_SEARCH_WIKIPEDIA = new SearchWikipediaNames(inApp);
                FUNCTION_SEARCH_OSMPOIS = new SearchOsmPoisFunction(inApp);
                FUNCTION_DOWNLOAD_OSM = new DownloadOsmFunction(inApp);
                FUNCTION_ADD_TIME_OFFSET = new AddTimeOffset(inApp);
                FUNCTION_ADD_ALTITUDE_OFFSET = new AddAltitudeOffset(inApp);
 +              FUNCTION_REMOVE_ALTITUDES = new RemoveAltitudes(inApp);
                FUNCTION_CONVERT_NAMES_TO_TIMES = new ConvertNamesToTimes(inApp);
                FUNCTION_DELETE_FIELD_VALUES = new DeleteFieldValues(inApp);
                FUNCTION_PASTE_COORDINATES = new PasteCoordinates(inApp);
                FUNCTION_SET_LANGUAGE = new SetLanguage(inApp);
                FUNCTION_SET_ALTITUDE_TOLERANCE = new SetAltitudeTolerance(inApp);
                FUNCTION_SET_TIMEZONE = new SelectTimezoneFunction(inApp);
+               FUNCTION_SET_EARTHDATA_AUTH = new SetEarthdataAuthentication(inApp);
                FUNCTION_HELP   = new HelpScreen(inApp);
                FUNCTION_SHOW_KEYS = new ShowKeysScreen(inApp);
                FUNCTION_ABOUT  = new AboutScreen(inApp);
index 404a4fa77e72938f35191a7f656b1d1940b50849,b24c7184998a67c7d04f5cf8f8260c269002d6c9..bd0d37813d40c8d9259707999a7285bafddec348
@@@ -34,6 -34,9 +34,9 @@@ import tim.prune.function.SearchOpenCac
  import tim.prune.function.browser.UrlGenerator;
  import tim.prune.function.browser.WebMapFunction;
  import tim.prune.function.search.SearchMapillaryFunction;
+ import tim.prune.function.srtm.DownloadSrtmFunction;
+ import tim.prune.function.srtm.SrtmGl1Source;
+ import tim.prune.function.srtm.Srtm3Source;
  
  /**
   * Class to manage the menu bar and tool bar,
@@@ -77,7 -80,6 +80,7 @@@ public class MenuManager implements Dat
        private JMenuItem _reverseItem = null;
        private JMenuItem _addTimeOffsetItem = null;
        private JMenuItem _addAltitudeOffsetItem = null;
 +      private JMenuItem _removeAltitudesItem = null;
        private JMenuItem _mergeSegmentsItem = null;
        private JMenuItem _rearrangeWaypointsItem = null;
        private JMenuItem _splitSegmentsItem = null;
@@@ -94,7 -96,7 +97,7 @@@
        private JMenuItem _getGpsiesItem = null;
        private JMenuItem _uploadGpsiesItem = null;
        private JMenuItem _lookupSrtmItem = null;
-       private JMenuItem _downloadSrtmItem = null;
+       private JMenu     _downloadSrtmMenu = null;
        private JMenuItem _nearbyWikipediaItem = null;
        private JMenuItem _nearbyOsmPoiItem = null;
        private JMenuItem _showPeakfinderItem = null;
                // SRTM
                _lookupSrtmItem = makeMenuItem(FunctionLibrary.FUNCTION_LOOKUP_SRTM, false);
                onlineMenu.add(_lookupSrtmItem);
-               _downloadSrtmItem = makeMenuItem(FunctionLibrary.FUNCTION_DOWNLOAD_SRTM, false);
-               onlineMenu.add(_downloadSrtmItem);
+               // Download SRTM sub-menu
+               _downloadSrtmMenu = new JMenu(I18nManager.getText("function.downloadsrtm"));
+               _downloadSrtmMenu.setEnabled(false);
+               JMenuItem downloadStrmGl1Item = makeMenuItem(new DownloadSrtmFunction(_app, new SrtmGl1Source()));
+               _downloadSrtmMenu.add(downloadStrmGl1Item);
+               JMenuItem downloadStrm3Item = makeMenuItem(new DownloadSrtmFunction(_app, new Srtm3Source()));
+               _downloadSrtmMenu.add(downloadStrm3Item);
+               onlineMenu.add(_downloadSrtmMenu);
                // Get gpsies tracks
                _getGpsiesItem = makeMenuItem(FunctionLibrary.FUNCTION_GET_GPSIES, false);
                onlineMenu.add(_getGpsiesItem);
                rangeMenu.add(_addTimeOffsetItem);
                _addAltitudeOffsetItem = makeMenuItem(FunctionLibrary.FUNCTION_ADD_ALTITUDE_OFFSET, false);
                rangeMenu.add(_addAltitudeOffsetItem);
 +              _removeAltitudesItem = makeMenuItem(FunctionLibrary.FUNCTION_REMOVE_ALTITUDES, false);
 +              rangeMenu.add(_removeAltitudesItem);
                _mergeSegmentsItem = new JMenuItem(I18nManager.getText("menu.range.mergetracksegments"));
                _mergeSegmentsItem.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e) {
                settingsMenu.add(makeMenuItem(new ChooseSingleParameter(_app, FunctionLibrary.FUNCTION_SET_ALTITUDE_TOLERANCE)));
                // Set timezone
                settingsMenu.add(makeMenuItem(FunctionLibrary.FUNCTION_SET_TIMEZONE));
+               // Set Earthdata authentication
+               settingsMenu.add(makeMenuItem(FunctionLibrary.FUNCTION_SET_EARTHDATA_AUTH));
                settingsMenu.addSeparator();
                // Save configuration
                settingsMenu.add(makeMenuItem(FunctionLibrary.FUNCTION_SAVECONFIG));
                _getWeatherItem.setEnabled(hasData);
                _findWaypointItem.setEnabled(hasData && _track.hasWaypoints());
                // have we got a cache?
-               _downloadSrtmItem.setEnabled(hasData && Config.getConfigString(Config.KEY_DISK_CACHE) != null);
+               _downloadSrtmMenu.setEnabled(hasData && Config.getConfigString(Config.KEY_DISK_CACHE) != null);
                // have we got any timestamps?
                _deleteByDateItem.setEnabled(hasData && _track.hasData(Field.TIMESTAMP));
  
                _reverseItem.setEnabled(hasRange);
                _addTimeOffsetItem.setEnabled(hasRange);
                _addAltitudeOffsetItem.setEnabled(hasRange);
 +              _removeAltitudesItem.setEnabled(hasRange);
                _convertNamesToTimesItem.setEnabled(hasRange && _track.hasWaypoints());
                _deleteFieldValuesItem.setEnabled(hasRange);
                _fullRangeDetailsItem.setEnabled(hasRange);
index 63bb73f66b313436e53619a2f03d40de0996139f,736c145151a73dffe163871ef251fa95069c5a62..82219b22e3f7c71411c364f7f0d5d4cc5b4686d9
@@@ -94,7 -94,6 +94,7 @@@ function.interpolate=Interpolate point
  function.deletebydate=Delete points by date
  function.addtimeoffset=Add time offset
  function.addaltitudeoffset=Add altitude offset
 +function.removealtitudes=Remove altitudes
  function.findwaypoint=Find waypoint
  function.rearrangewaypoints=Rearrange waypoints
  function.convertnamestotimes=Convert waypoint names to times
@@@ -115,6 -114,9 +115,9 @@@ function.getgpsies=Get Gpsies track
  function.uploadgpsies=Upload track to Gpsies
  function.lookupsrtm=Get altitudes from SRTM
  function.downloadsrtm=Download SRTM tiles
+ function.downloadsrtm.SRTMGL1_v003=Download SRTM 1 arc-second tiles
+ function.downloadsrtm.SRTMGL1_v003.needsetup=An Earthdata account is necessary to download SRTM 1 arc-second tiles
+ function.downloadsrtm.SRTM3_v21=Download SRTM 3 arc-second tiles
  function.getwikipedia=Get nearby Wikipedia articles
  function.searchwikipedianames=Search Wikipedia by name
  function.searchosmpois=Get nearby OSM points
@@@ -151,6 -153,7 +154,7 @@@ function.managetilecache=Manage tile ca
  function.getweatherforecast=Get weather forecast
  function.setaltitudetolerance=Set altitude tolerance
  function.selecttimezone=Set timezone
+ function.setearthdataauthentication=Set Earthdata authentication
  
  # Dialogs
  dialog.exit.confirm.title=Exit GpsPrune
@@@ -576,6 -579,11 +580,11 @@@ dialog.displaysettings.size.small=Smal
  dialog.displaysettings.size.medium=Medium
  dialog.displaysettings.size.large=Large
  dialog.downloadosm.desc=Confirm to download the raw OSM data for the specified area:
+ dialog.earthdataauth.intro=<p>Configure username and password to access your NASA Earthdata login account.</p><p> Create an account at <tt>https://urs.earthdata.nasa.gov/users/new</tt>.</p>
+ dialog.earthdataauth.user=Username
+ dialog.earthdataauth.password=Password
+ dialog.earthdataauth.authaccepted=Username and password accepted
+ dialog.earthdataauth.authrejected=Username and password rejected
  dialog.searchwikipedianames.search=Search for:
  dialog.weather.location=Location
  dialog.weather.update=Forecast updated
@@@ -633,7 -641,6 +642,7 @@@ confirm.mergetracksegments=Track segmen
  confirm.reverserange=Range reversed
  confirm.addtimeoffset=Time offset added
  confirm.addaltitudeoffset=Altitude offset added
 +confirm.removealtitudes=Altitudes removed
  confirm.rearrangewaypoints=Waypoints rearranged
  confirm.rearrangephotos=Photos rearranged
  confirm.splitsegments=%d segment splits were made
@@@ -854,7 -861,6 +863,7 @@@ undo.splitsegments=split track segment
  undo.sewsegments=sew track segments
  undo.addtimeoffset=add time offset
  undo.addaltitudeoffset=add altitude offset
 +undo.removealtitudes=remove altitudes
  undo.rearrangewaypoints=rearrange waypoints
  undo.cutandmove=move section
  undo.connect=connect