Class McIdasXDataSource

java.lang.Object
ucar.unidata.collab.SharableImpl
ucar.unidata.data.DataSourceImpl
edu.wisc.ssec.mcidasv.data.McIdasXDataSource
All Implemented Interfaces:
ucar.unidata.collab.Sharable, ucar.unidata.data.DataSource, ucar.unidata.data.DataSourceFactory, ucar.unidata.xml.XmlPersistable

public class McIdasXDataSource extends ucar.unidata.data.DataSourceImpl
Used to cache a data choice and its data.
Version:
$Revision$
Author:
IDV development team
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    class 
    Class FrameDataInfo Holds an index and a McIdasFrame
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) ucar.unidata.idv.control.DisplayControlImpl
     
    private List
    list of McIDAS-X frames
    private List
    list of frames to load
    private boolean
     
    private int
     
    private static final org.slf4j.Logger
     
    private McIdasXInfo
    McIDAS-X connection info
    private Image
     
    private List
    list of 2D categories
    private List
    list of 2D time series categories
    private double[][]
    image data arrays

    Fields inherited from class ucar.unidata.data.DataSourceImpl

    changeDataPathsCbx, dataCacheKey, dataChoices, geoSelectionPanel, haveBeenUnPersisted, okToContinue, PARAM_SHOW_HIDE, PARAM_SHOW_NO, PARAM_SHOW_YES

    Fields inherited from interface ucar.unidata.data.DataSource

    DATAPATH_DATE_FORMAT, DATAPATH_DATE_PATTERN, MOST_RECENT, ordinalNames, PROP_AUTOCREATEDISPLAY, PROP_BASEDIRECTORY, PROP_CACHEABLE, PROP_DATACHOICENAME, PROP_DISPLAYPROPERTIES, PROP_DOCUMENTLINKS, PROP_FILEPATTERN, PROP_GEOLOCATION, PROP_ICON, PROP_NAME, PROP_POLLINFO, PROP_RESOLVERURL, PROP_SERVICE_HTTP, PROP_SUBPROPERTIES, PROP_TIMELABELS, PROP_TIMESTRIDE, PROP_TITLE
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default bean constructor; does nothing
    McIdasXDataSource(ucar.unidata.data.DataSourceDescriptor descriptor, String name, Hashtable properties)
    Create a McIdasXDataSource
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Create the set of DataChoice that represent the data held by this data source.
    private void
    doMakeDataChoices(ucar.unidata.data.CompositeDataChoice composite)
    Make the data choices and add them to the given composite
    protected Data
    getDataInner(ucar.unidata.data.DataChoice dataChoice, ucar.unidata.data.DataCategory category, ucar.unidata.data.DataSelection dataSelection, Hashtable requestProperties)
    Actually get the data identified by the given DataChoce.
    Get the name for the main data object
    private ucar.unidata.idv.control.DisplayControlImpl
     
    getFrame(int frameNumber)
    Get a frame from the frameList based on frame number
    private McIdasFrame
    getFrame(Object object)
    A utility method that helps us deal with legacy bundles that used to have String file names as the id of a data choice.
    Get frame numbers
    getMcIdasFrame(int frameNumber, FrameComponentInfo frameComponentInfo, FrameDirtyInfo frameDirtyInfo)
     
    getMcIdasSequence(int frameNumber, FrameComponentInfo frameComponentInfo, FrameDirtyInfo frameDirtyInfo)
    make a time series from selected McIdas-X frames
    Get McIdasXInfo object
    Return the list of DataCategory used for single time step data.
    Return the list of DataCategory used for multiple time step data.
    void
    Gets called after creation.
    void
    This is called after this datasource has been fully created and initialized after being unpersisted by the XmlEncoder.
    private void
    Initialize the connection to McIdas-X.
    protected void
    initDataSelectionComponents(List<ucar.unidata.data.DataSelectionComponent> components, ucar.unidata.data.DataChoice dataChoice)
    Add any data selection components
    private void
    Initialize the DataCategory objects that this data source uses.
    makeFrames(List inFrameNumbers)
    Make a list of McIDAS-X frames
    private void
    makePreviewImage(ucar.unidata.data.DataChoice dataChoice)
     
    void
    setFrame(int frameNumber, McIdasFrame inFrame)
    Set a frame in the framelist based on frame number
    protected boolean
    See if this DataSource should cache or not
    private List
    sortChoices(List choices)
    Sort the list of data choices on their frame numbers

    Methods inherited from class ucar.unidata.data.DataSourceImpl

    addActions, addDataChangeListener, addDataChoice, addPropertiesTabs, addReloadTab, applyFieldMask, applyProperties, beginWritingDataToLocalDisk, canAddCurrentName, canCacheDataToDisk, canChangeData, canDoAllLevels, canDoFieldMask, canDoGeoSelection, canDoGeoSelectionMap, canDoGeoSelectionStride, canPoll, canSaveDataToLocalDisk, canShowParameter, checkForInitAfterUnPersistence, clearCachedData, clearFileCache, clearTimes, convertSourceFile, convertToFilesIfDirectory, createAutoDisplay, createCacheKey, createElement, decrOutstandingGetDataCalls, doDirectory, doMakeDateTimes, doMakeGeoSelectionPanel, doMakeGeoSelectionPanel, doMakeGeoSelectionPanel, doMakeGeoSubsetPropertiesComponent, doRemove, endWritingDataToLocalDisk, equals, expandIfNeeded, findDataChoice, findDataChoices, flushCache, getAbsoluteDateTimes, getActions, getAlias, getAllDateTimes, getAllDateTimes, getAllLevels, getAllLevels, getAllTimesForTimeDriver, getCache, getCache, getCacheClearDelay, getCacheDataToDisk, getCompositeDataChoices, getData, getData, getDataCachePath, getDataChangeListeners, getDataChoices, getDataContext, getDataInner, getDataIsEditable, getDataPaths, getDataPrefix, getDataSelection, getDataSelectionComponents, getDataSource, getDateTimes, getDateTimeSelection, getDefaultSave, getDescription, getDescriptor, getErrorMessage, getEverChangedName, getExtraGeoSelectionComponent, getExtraTimesComponent, getFileFilterForPolling, getFullDescription, getid, getIdv, getInError, getLocalDirectory, getLocationForPolling, getLocationsForPolling, getMostRecentFiles, getName, getNameForDataSource, getNeedToShowErrorToUser, getNextId, getOutstandingGetDataCalls, getPartialDescription, getPassword, getPathsThatCanBeRelative, getPollingInfo, getProperties, getPropertiesComponents, getPropertiesHeader, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getRelativePaths, getSampleDataProjection, getSaveDataFileLabel, getSelectedDateTimes, getSelectedDateTimes, getTimesFromDataSelection, getTmpPaths, getTypeName, getUserName, handlePropertiesAction, hasPollingInfo, holdsDateTimes, holdsIndices, identifiedBy, identifiedByName, incrOutstandingGetDataCalls, initAfter, initDataChoice, initFromXml, isPolling, loadFieldMask, loadFieldMask, loadLatestFile, logException, logException, makeDerivedDataChoices, makeSaveLocalActions, newFileFromPolling, newFilesFromPolling, notifyDataChange, propertiesChanged, putCache, putCache, reloadData, reloadData, reloadProperties, removeCache, removeDataChangeListener, removeDataChoice, removeProperty, replaceDataChoice, resetTmpState, saveDataToLocalDisk, saveDataToLocalDisk, saveDataToLocalDisk, selectTimesFromList, setAlias, setAskToUpdate, setCacheClearDelay, setCacheDataToDisk, setDataEditableStrings, setDataIsEditable, setDataIsRelative, setDataRelativeStrings, setDataSelection, setDateTimeSelection, setDefaultSave, setDescription, setDescriptor, setDirectory, setEverChangedName, setInError, setInError, setInError, setName, setNewFiles, setObjectProperties, setObjectProperty, setPassword, setPollingInfo, setPollLocation, setProperties, setProperty, setProperty, setRelativePaths, setTemplateName, setTmpPaths, setUserName, shouldCache, showPasswordDialog, showPropertiesDialog, showPropertiesDialog, showPropertiesDialog, showWaitDialog, tick, toString, toStringTruncated, updateDetailsText, updateState, writeFieldMaskFile, writeFieldMaskFile

    Methods inherited from class ucar.unidata.collab.SharableImpl

    applySharableProperties, doShare, doShare, doShareExternal, doShareInternal, getReceiveShareTime, getSharablePropertiesComponent, getShareGroup, getSharing, getUniqueId, initSharable, receiveShareData, removeSharable, setReceiveShareTime, setShareGroup, setSharing, setUniqueId, showSharableDialog

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface ucar.unidata.data.DataSource

    getUniqueId
  • Field Details

  • Constructor Details

    • McIdasXDataSource

      Default bean constructor; does nothing
    • McIdasXDataSource

      public McIdasXDataSource(ucar.unidata.data.DataSourceDescriptor descriptor, String name, Hashtable properties)
      Create a McIdasXDataSource
      Parameters:
      descriptor - the datasource descriptor
      name - my name
      properties - my properties
  • Method Details

    • makeFrames

      public List makeFrames(List inFrameNumbers)
      Make a list of McIDAS-X frames
      Parameters:
      inFrameNumbers - List of frame numbers. Cannot be null.
      Returns:
      ImageDataset
    • getFrame

      public McIdasFrame getFrame(int frameNumber)
      Get a frame from the frameList based on frame number
    • setFrame

      public void setFrame(int frameNumber, McIdasFrame inFrame)
      Set a frame in the framelist based on frame number
    • initAfterUnpersistence

      public void initAfterUnpersistence()
      This is called after this datasource has been fully created and initialized after being unpersisted by the XmlEncoder.
      Specified by:
      initAfterUnpersistence in interface ucar.unidata.data.DataSource
      Overrides:
      initAfterUnpersistence in class ucar.unidata.data.DataSourceImpl
    • initAfterCreation

      public void initAfterCreation()
      Gets called after creation. Initialize the connection
      Specified by:
      initAfterCreation in interface ucar.unidata.data.DataSource
      Overrides:
      initAfterCreation in class ucar.unidata.data.DataSourceImpl
    • initConnection

      private void initConnection()
      Initialize the connection to McIdas-X. This gets called when the data source is newly created or decoded form a bundle.
    • shouldCache

      protected boolean shouldCache(Data data)
      Description copied from class: ucar.unidata.data.DataSourceImpl
      See if this DataSource should cache or not
      Overrides:
      shouldCache in class ucar.unidata.data.DataSourceImpl
      Parameters:
      data - Data to cache
      Returns:
      true
    • initDataSelectionComponents

      protected void initDataSelectionComponents(List<ucar.unidata.data.DataSelectionComponent> components, ucar.unidata.data.DataChoice dataChoice)
      Description copied from class: ucar.unidata.data.DataSourceImpl
      Add any data selection components
      Overrides:
      initDataSelectionComponents in class ucar.unidata.data.DataSourceImpl
      Parameters:
      components - list of components
      dataChoice - the data choice
    • makePreviewImage

      private void makePreviewImage(ucar.unidata.data.DataChoice dataChoice)
    • getDataInner

      protected Data getDataInner(ucar.unidata.data.DataChoice dataChoice, ucar.unidata.data.DataCategory category, ucar.unidata.data.DataSelection dataSelection, Hashtable requestProperties) throws VisADException, RemoteException
      Description copied from class: ucar.unidata.data.DataSourceImpl
      Actually get the data identified by the given DataChoce. The default is to call the getDataInner that does not take the requestProperties. This allows other, non unidata.data DataSource-s (that follow the old API) to work.
      Overrides:
      getDataInner in class ucar.unidata.data.DataSourceImpl
      Parameters:
      dataChoice - The data choice that identifies the requested data.
      category - The data category of the request.
      dataSelection - Identifies any subsetting of the data.
      requestProperties - Hashtable that holds any detailed request properties.
      Returns:
      The data
      Throws:
      RemoteException - Java RMI problem
      VisADException - VisAD problem
    • getMcIdasSequence

      private SingleBandedImage getMcIdasSequence(int frameNumber, FrameComponentInfo frameComponentInfo, FrameDirtyInfo frameDirtyInfo) throws VisADException, RemoteException
      make a time series from selected McIdas-X frames
      Throws:
      VisADException
      RemoteException
    • getDisplayControlImpl

      private ucar.unidata.idv.control.DisplayControlImpl getDisplayControlImpl()
    • getFrameNumbers

      Get frame numbers
      Returns:
      frame numbers
    • getDataName

      public String getDataName()
      Get the name for the main data object
      Returns:
      name of main data object
    • getMcIdasXInfo

      Get McIdasXInfo object
      Returns:
      mcidasxInfo
    • makeCategories

      private void makeCategories()
      Initialize the DataCategory objects that this data source uses.
    • getTwoDCategories

      Return the list of DataCategory used for single time step data.
      Returns:
      A list of categories.
    • getTwoDTimeSeriesCategories

      Return the list of DataCategory used for multiple time step data.
      Returns:
      A list of categories.
    • doMakeDataChoices

      public void doMakeDataChoices()
      Create the set of DataChoice that represent the data held by this data source.

      We create one top-level CompositeDataChoice that represents all of the image time steps. We create a set of children DirectDataChoice, one for each time step.

      Overrides:
      doMakeDataChoices in class ucar.unidata.data.DataSourceImpl
    • doMakeDataChoices

      private void doMakeDataChoices(ucar.unidata.data.CompositeDataChoice composite)
      Make the data choices and add them to the given composite
      Parameters:
      composite - The parent data choice to add to
    • sortChoices

      private List sortChoices(List choices)
      Sort the list of data choices on their frame numbers
      Parameters:
      choices - The data choices
      Returns:
      The data choices sorted
    • getFrame

      private McIdasFrame getFrame(Object object)
      A utility method that helps us deal with legacy bundles that used to have String file names as the id of a data choice.
      Parameters:
      object - May be an AddeImageDescriptor (for new bundles) or a String that is converted to an image descriptor.
      Returns:
      The image descriptor.
    • getMcIdasFrame

      public SingleBandedImage getMcIdasFrame(int frameNumber, FrameComponentInfo frameComponentInfo, FrameDirtyInfo frameDirtyInfo) throws VisADException, RemoteException
      Throws:
      VisADException
      RemoteException