Class MultiSpectralControl.CsvTask

java.lang.Object
javax.swing.SwingWorker<String,Object>
edu.wisc.ssec.mcidasv.control.MultiSpectralControl.CsvTask
All Implemented Interfaces:
Runnable, Future<String>, RunnableFuture<String>
Enclosing class:
MultiSpectralControl

  • Field Details

  • Constructor Details

    • CsvTask

      public CsvTask(String path)
      Creates a CSV exporting task that's meant to store its values in the file specified by path.
      Parameters:
      path - File to write to. Cannot be null.
  • Method Details

    • doInBackground

      Does the work of exporting and formatting CSV values from a MultiSpectralControl in a background thread.
      Specified by:
      doInBackground in class SwingWorker<String,Object>
      Returns:
      String representing the contents to write to a CSV file. May be null.
    • done

      protected void done()
      Called (on the event dispatch thread) when doInBackground() has completed.
      Overrides:
      done in class SwingWorker<String,Object>
    • writeToPath

      private void writeToPath(String csvContents)
      Write the given string to path.
      Parameters:
      csvContents - CSV file contents. Should not be null.
    • collectValues

      private double[][] collectValues(double[] wavelengths) throws VisADException, RemoteException
      Iterates through each channel/wavenumber and extracts the value of the existing ReadoutProbes at their current positions.

      Be warned, this can be slow when there are thousands of channels. Definitely do not run this method on the event dispatch thread.

      Parameters:
      wavelengths - Array containing all the channels/wavenumbers. Cannot be null.
      Returns:
      Two-dimensional array of doubles. First array represents the probes, second dimension is the value of a probe at each channel/wavenumber.
      Throws:
      VisADException - if there was a problem
      RemoteException - if there was somehow an RMI problem
    • exportSpectra

      private String exportSpectra() throws Exception
      Coordinates the collecting of probe data as well as creating a string representing the contents of the CSV file.
      Returns:
      String value that can be written to a CSV file.
      Throws:
      Exception - if there was some problem