@@ -621,11 +621,47 @@ bool Satellites::configureGui(bool show)
621
621
void Satellites::restoreDefaults (void )
622
622
{
623
623
restoreDefaultSettings ();
624
+ restoreDefaultTleSources ();
624
625
restoreDefaultCatalog ();
625
626
loadCatalog ();
626
627
loadSettings ();
627
628
}
628
629
630
+ void Satellites::restoreDefaultTleSources ()
631
+ {
632
+ // Format: group name, auto-add flag
633
+ const QMap<QString, bool > celestrak={
634
+ { " visual" , true }, { " stations" , true }, { " last-30-days" , false }, { " active" , false }, { " analyst" , false },
635
+ { " science" , true }, { " noaa" , false }, { " goes" , false }, { " amateur" , true }, { " gnss" , true },
636
+ { " gps-ops" , true }, { " galileo" , true }, { " iridium" , false }, { " iridium-NEXT" , false }, { " geo" , false },
637
+ { " weather" , false }, { " resource" , false }, { " sarsat" , false }, { " dmc" , false }, { " tdrss" , false },
638
+ { " argos" , false }, { " intelsat" , false }, { " gorizont" , false }, { " raduga" , false }, { " molniya" , false },
639
+ { " orbcomm" , false }, { " globalstar" , false }, { " x-comm" , false }, { " other-comm" , false }, { " glo-ops" , true },
640
+ { " beidou" , true }, { " sbas" , false }, { " nnss" , false }, { " engineering" , false }, { " education" , false },
641
+ { " geodetic" , false }, { " radar" , false }, { " cubesat" , false }, { " other" , false }, { " oneweb" , true },
642
+ { " starlink" , true }, { " planet" , false }, { " spire" , false }
643
+ };
644
+ // Details: https://www.celestrak.com/NORAD/documentation/gp-data-formats.php
645
+ QString celestrackBaseURL = " https://www.celestrak.com/NORAD/elements/gp.php?GROUP=%1&FORMAT=TLE" ;
646
+ QStringList urls;
647
+ // TLE sources from Celestrak
648
+ for (auto group = celestrak.begin (); group != celestrak.end (); ++group)
649
+ {
650
+ QString url = celestrackBaseURL.arg (group.key ());
651
+ if (group.value ()) // Auto-add ON!
652
+ urls << QString (" 1,%1" ).arg (url);
653
+ else
654
+ urls << url;
655
+ }
656
+ // Other sources and supplemental data from Celestrack
657
+ urls << " 1,http://www.celestrak.com/NORAD/elements/supplemental/starlink.txt"
658
+ << " https://www.amsat.org/amsat/ftp/keps/current/nasabare.txt"
659
+ << " https://www.prismnet.com/~mmccants/tles/classfd.zip" ;
660
+
661
+ saveTleSources (urls);
662
+ loadSettings ();
663
+ }
664
+
629
665
void Satellites::restoreDefaultSettings ()
630
666
{
631
667
QSettings* conf = StelApp::getInstance ().getSettings ();
@@ -682,55 +718,6 @@ void Satellites::restoreDefaultSettings()
682
718
conf->setValue (" cf_rcs_max" , 100 .);
683
719
684
720
conf->endGroup (); // saveTleSources() opens it for itself
685
-
686
- // TLE update sources
687
- QStringList urls;
688
- urls << " 1,http://www.celestrak.com/NORAD/elements/visual.txt" // Auto-add ON!
689
- << " http://www.celestrak.com/NORAD/elements/tle-new.txt"
690
- << " http://www.celestrak.com/NORAD/elements/active.txt"
691
- << " http://www.celestrak.com/NORAD/elements/analyst.txt"
692
- << " 1,http://www.celestrak.com/NORAD/elements/science.txt"
693
- << " http://www.celestrak.com/NORAD/elements/noaa.txt"
694
- << " http://www.celestrak.com/NORAD/elements/goes.txt"
695
- << " 1,http://www.celestrak.com/NORAD/elements/amateur.txt"
696
- << " 1,http://www.celestrak.com/NORAD/elements/gps-ops.txt"
697
- << " 1,http://www.celestrak.com/NORAD/elements/galileo.txt"
698
- << " http://www.celestrak.com/NORAD/elements/iridium.txt"
699
- << " http://www.celestrak.com/NORAD/elements/iridium-NEXT.txt"
700
- << " http://www.celestrak.com/NORAD/elements/geo.txt"
701
- << " 1,http://www.celestrak.com/NORAD/elements/stations.txt"
702
- << " http://www.celestrak.com/NORAD/elements/weather.txt"
703
- << " http://www.celestrak.com/NORAD/elements/resource.txt"
704
- << " http://www.celestrak.com/NORAD/elements/sarsat.txt"
705
- << " http://www.celestrak.com/NORAD/elements/dmc.txt"
706
- << " http://www.celestrak.com/NORAD/elements/tdrss.txt"
707
- << " http://www.celestrak.com/NORAD/elements/argos.txt"
708
- << " http://www.celestrak.com/NORAD/elements/intelsat.txt"
709
- << " http://www.celestrak.com/NORAD/elements/gorizont.txt"
710
- << " http://www.celestrak.com/NORAD/elements/raduga.txt"
711
- << " http://www.celestrak.com/NORAD/elements/molniya.txt"
712
- << " http://www.celestrak.com/NORAD/elements/orbcomm.txt"
713
- << " http://www.celestrak.com/NORAD/elements/globalstar.txt"
714
- << " http://www.celestrak.com/NORAD/elements/x-comm.txt"
715
- << " http://www.celestrak.com/NORAD/elements/other-comm.txt"
716
- << " 1,http://www.celestrak.com/NORAD/elements/glo-ops.txt"
717
- << " 1,http://www.celestrak.com/NORAD/elements/beidou.txt"
718
- << " http://www.celestrak.com/NORAD/elements/sbas.txt"
719
- << " http://www.celestrak.com/NORAD/elements/nnss.txt"
720
- << " http://www.celestrak.com/NORAD/elements/engineering.txt"
721
- << " http://www.celestrak.com/NORAD/elements/education.txt"
722
- << " http://www.celestrak.com/NORAD/elements/geodetic.txt"
723
- << " http://www.celestrak.com/NORAD/elements/radar.txt"
724
- << " http://www.celestrak.com/NORAD/elements/cubesat.txt"
725
- << " http://www.celestrak.com/NORAD/elements/other.txt"
726
- << " 1,http://www.celestrak.com/NORAD/elements/supplemental/starlink.txt"
727
- << " https://www.amsat.org/amsat/ftp/keps/current/nasabare.txt"
728
- << " http://www.celestrak.com/NORAD/elements/oneweb.txt"
729
- << " http://www.celestrak.com/NORAD/elements/planet.txt"
730
- << " http://www.celestrak.com/NORAD/elements/spire.txt"
731
- << " https://www.prismnet.com/~mmccants/tles/classfd.zip" ;
732
-
733
- saveTleSources (urls);
734
721
}
735
722
736
723
void Satellites::restoreDefaultCatalog ()
@@ -1373,7 +1360,19 @@ bool Satellites::add(const TleData& tleData)
1373
1360
if (tleData.sourceURL .contains (" celestrak.com" , Qt::CaseInsensitive))
1374
1361
{
1375
1362
// add groups, based on CelesTrak's groups
1376
- QString fileName = QUrl (tleData.sourceURL ).fileName ().toLower ().replace (" .txt" , " " );
1363
+ QString fileName;
1364
+ if (tleData.sourceURL .contains (" .txt" , Qt::CaseInsensitive))
1365
+ fileName = QUrl (tleData.sourceURL ).fileName ().toLower ().replace (" .txt" , " " );
1366
+ else
1367
+ {
1368
+ // New format of source: https://www.celestrak.com/NORAD/elements/gp.php?GROUP=GROUP_NAME&FORMAT=tle
1369
+ QStringList query = QUrl (tleData.sourceURL ).query ().toLower ().split (" &" );
1370
+ for (int i=0 ; i<query.size (); i++)
1371
+ {
1372
+ if (query.at (i).trimmed ().contains (" group" ))
1373
+ fileName = query.at (i).trimmed ().replace (" group=" , " " );
1374
+ }
1375
+ }
1377
1376
if (!satGroups.contains (fileName))
1378
1377
satGroups.append (fileName);
1379
1378
@@ -2830,14 +2829,14 @@ void Satellites::createSuperGroupsList()
2830
2829
earthresources = " earth resources" , gps = " gps" , glonass = " glonass" ,
2831
2830
geostationary = " geostationary" ;
2832
2831
satSuperGroupsMap = {
2833
- { " geo" , communications },
2834
- { " geo" , geostationary },
2835
- { " gpz" , communications },
2836
- { " gpz" , geostationary },
2832
+ { " geo" , communications },
2833
+ { " geo" , geostationary },
2834
+ { " gpz" , communications },
2835
+ { " gpz" , geostationary },
2837
2836
{ " gpz-plus" , communications },
2838
2837
{ " gpz-plus" , geostationary },
2839
2838
{ " intelsat" , communications },
2840
- { " ses" , communications },
2839
+ { " ses" , communications },
2841
2840
{ " iridium" , communications },
2842
2841
{ " iridium-NEXT" , communications },
2843
2842
{ " starlink" , communications },
@@ -2853,31 +2852,31 @@ void Satellites::createSuperGroupsList()
2853
2852
{ " raduga" , communications },
2854
2853
{ " raduga" , geostationary },
2855
2854
{ " molniya" , communications },
2856
- { " gnss" , navigation },
2857
- { " gps" , navigation },
2855
+ { " gnss" , navigation },
2856
+ { " gps" , navigation },
2858
2857
{ " gps-ops" , navigation },
2859
2858
{ " gps-ops" , gps },
2860
2859
{ " glonass" , navigation },
2861
2860
{ " glo-ops" , navigation },
2862
2861
{ " glo-ops" , glonass },
2863
- { " galileo" , navigation },
2864
- { " beidou" , navigation },
2865
- { " sbas" , navigation },
2866
- { " nnss" , navigation },
2862
+ { " galileo" , navigation },
2863
+ { " beidou" , navigation },
2864
+ { " sbas" , navigation },
2865
+ { " nnss" , navigation },
2867
2866
{ " musson" , navigation },
2868
2867
{ " science" , scientific },
2869
2868
{ " geodetic" , scientific },
2870
2869
{ " engineering" , scientific },
2871
2870
{ " education" , scientific },
2872
- { " goes" , scientific },
2873
- { " goes" , earthresources },
2871
+ { " goes" , scientific },
2872
+ { " goes" , earthresources },
2874
2873
{ " resource" , earthresources },
2875
- { " sarsat" , earthresources },
2876
- { " dmc" , earthresources },
2877
- { " tdrss" , earthresources },
2878
- { " argos" , earthresources },
2879
- { " planet" , earthresources },
2880
- { " spire" , earthresources }
2874
+ { " sarsat" , earthresources },
2875
+ { " dmc" , earthresources },
2876
+ { " tdrss" , earthresources },
2877
+ { " argos" , earthresources },
2878
+ { " planet" , earthresources },
2879
+ { " spire" , earthresources }
2881
2880
};
2882
2881
}
2883
2882
0 commit comments