« GGroundPlotPanel » : différence entre les versions
Aller à la navigation
Aller à la recherche
Aucun résumé des modifications |
Aucun résumé des modifications |
||
Ligne 2 : | Ligne 2 : | ||
* get a file (or several ones) including a serie of latitudes and longitudes corresponding to the trajectoty we want to plot. | * get a file (or several ones) including a serie of latitudes and longitudes corresponding to the trajectoty we want to plot. | ||
* create a GroundTrackDataProvider object in charge of reading the date included in the file(s). Note that the format of the file is not dependant of <font color=#556B2F>'''GENIUS'''</font> as the way to read it will be defined via the <font color=#4169E1>getData()</font> method of the GroundTrackDataProvider class. Anyway, we will have the possibility to use <font color=#556B2F>'''GENIUS'''</font> methods proposed in the [[http://genius.cnes.fr/index.php/ResultsFileManagement Results File Management]] paragraph. | * create a [{{PathCurrentJavaDoc}}/fr/cnes/genius/plots/GroundTrackDataProvider.html GroundTrackDataProvider]] object in charge of reading the date included in the file(s). Note that the format of the file is not dependant of <font color=#556B2F>'''GENIUS'''</font> as the way to read it will be defined via the <font color=#4169E1>getData()</font> method of the GroundTrackDataProvider class. Anyway, we will have the possibility to use <font color=#556B2F>'''GENIUS'''</font> methods proposed in the [[http://genius.cnes.fr/index.php/ResultsFileManagement Results File Management]] paragraph. | ||
* then calling the GGroundPlotPanel object to be displayed | * then calling the [{{PathCurrentJavaDoc}}/fr/cnes/genius/plots/GGroundPlotPanel.html GGroundPlotPanel]] object to be displayed | ||
The following example shows how to do it. In order to give an example with several ground tracks (here two) our GroundTrackDataProvider object will be in charge to read a single file then to store read data in two different coordinates list, the second one shifted by 90 degrees from the first one. To see détails of the <font color=#4169E1>openDbFile()</font> and <font color=#4169E1>scanFile()</font> methods, see the specific example in tutorials. | The following example shows how to do it. In order to give an example with several ground tracks (here two) our GroundTrackDataProvider object will be in charge to read a single file then to store read data in two different coordinates list, the second one shifted by 90 degrees from the first one. To see détails of the <font color=#4169E1>openDbFile()</font> and <font color=#4169E1>scanFile()</font> methods, see the specific example in tutorials. |
Version du 26 septembre 2018 à 14:47
This widget exists since V1.8. It consists in plotting ground tracks above a planisphere represented by an image. To do this, we must:
- get a file (or several ones) including a serie of latitudes and longitudes corresponding to the trajectoty we want to plot.
- create a GroundTrackDataProvider] object in charge of reading the date included in the file(s). Note that the format of the file is not dependant of GENIUS as the way to read it will be defined via the getData() method of the GroundTrackDataProvider class. Anyway, we will have the possibility to use GENIUS methods proposed in the [Results File Management] paragraph.
- then calling the GGroundPlotPanel] object to be displayed
The following example shows how to do it. In order to give an example with several ground tracks (here two) our GroundTrackDataProvider object will be in charge to read a single file then to store read data in two different coordinates list, the second one shifted by 90 degrees from the first one. To see détails of the openDbFile() and scanFile() methods, see the specific example in tutorials.
GroundTrackDataProvider prov = new GroundTrackDataProvider() {
@Override
public List<GCoordinatesData> getData(String fileName) {
final ArrayList<GCoordinatesData> listOfData = new ArrayList<GCoordinatesData>();
// Open, read and plot trajectory
openDbFile(fileName);
ArrayList<Double[]> data1 = scanFile(0, 0.);
ArrayList<Double[]> data2 = scanFile(0, 90.); // 90 degrees shift
listOfData.add(new GCoordinatesData("Nominal", data1, Color.RED, null, DEG180, DEG90));
listOfData.add(new GCoordinatesData("Shifted", data2, Color.GREEN, null, DEG180, DEG90));
return listOfData;
}
};
plot = new GGroundPlotPanel(prov);
Then loading data from a file including latitude/longitude, you may obtain this result: