GGroundPlotPanel

De Wiki
Aller à : navigation, rechercher

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:

GGroundPlotPanel1.png


Note that to unzoom this plot, the usual menus are not effective and you will have to click and drag towards the left.