« GGroundPlotPanel » : différence entre les versions
Aller à la navigation
Aller à la recherche
Aucun résumé des modifications |
Aucun résumé des modifications |
||
(15 versions intermédiaires par le même utilisateur non affichées) | |||
Ligne 1 : | Ligne 1 : | ||
This widget exists since V1.8. It consists in plotting ground tracks above a planisphere represented by an image. To do this, we must: | This widget exists <font color=#FF0000>'''since V1.8'''</font>. It consists in plotting ground tracks above a planisphere represented by an image. To do this, we must: | ||
* create a GroundTrackDataProvider object in charge of reading | * get a file (or several ones) including a serie of latitudes and longitudes corresponding to the trajectoty we want to plot. | ||
* then calling the GGroundPlotPanel object | * 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 [{{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 specific | 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. | ||
<syntaxhighlight lang="java"> | <syntaxhighlight lang="java"> | ||
Ligne 26 : | Ligne 27 : | ||
plot = new GGroundPlotPanel(prov); | plot = new GGroundPlotPanel(prov); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Then loading data from a file including latitude/longitude, you may obtain this result: | |||
[[File:GGroundPlotPanel1.png]] | |||
<font color=#FF0000>'''Note that to unzoom this plot, the usual menus are not effective and you will have to click and drag towards the left.'''</font> |
Dernière version du 5 octobre 2018 à 11:55
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:
Note that to unzoom this plot, the usual menus are not effective and you will have to click and drag towards the left.