Package PamController

Interface PamControllerInterface

All Known Implementing Classes:
PamController

public interface PamControllerInterface
Author:
Doug Gillespie

Contoller interface for Pamguard. Any controller working with the Pamguard MVC should implement these methods in order that the model and the view can communicate with the controller

  • Field Details Link icon

    • CHANGED_PROCESS_SETTINGS Link icon

      static final int CHANGED_PROCESS_SETTINGS
      Should be sent by the developer when a process alters it's configuration in any way so that downstream processes can adjust acordingly
      See Also:
    • ADD_PROCESS Link icon

      static final int ADD_PROCESS
      Automatically sent when a PamProcess is added
      See Also:
    • REMOVE_PROCESS Link icon

      static final int REMOVE_PROCESS
      Automatically sent when a PamProcess is removed
      See Also:
    • ADD_DATABLOCK Link icon

      static final int ADD_DATABLOCK
      Automatically sent when a PamDataBlock is added
      See Also:
    • REMOVE_DATABLOCK Link icon

      static final int REMOVE_DATABLOCK
      Automatically sent when a PamDataBlock is removed
      See Also:
    • ADD_CONTROLLEDUNIT Link icon

      static final int ADD_CONTROLLEDUNIT
      Automatically sent when a PamControlledUnit is added
      See Also:
    • REMOVE_CONTROLLEDUNIT Link icon

      static final int REMOVE_CONTROLLEDUNIT
      Automatically sent when a PamControlledUnit is removed
      See Also:
    • REORDER_CONTROLLEDUNITS Link icon

      static final int REORDER_CONTROLLEDUNITS
      Automatically added when PamControlledUnits are re-ordered
      See Also:
    • INITIALIZATION_COMPLETE Link icon

      static final int INITIALIZATION_COMPLETE
      Automatically sent when PAMGAURD has finished loading it's initial settings file and created the GUI. It's a good time for modules to subscribe to their data sources, but they shouldn't do much else since these go around in order, so when this arrives in the first module, other modules may not yet be setup.
      See Also:
    • DESTROY_EVERYTHING Link icon

      static final int DESTROY_EVERYTHING
      Sent when all PamControlledUnits have been removed from the model.
      See Also:
    • RENAME_CONTROLLED_UNIT Link icon

      static final int RENAME_CONTROLLED_UNIT
      Automatically sent when a PamControlledUnit is renamed.
      See Also:
    • INITIALIZE_LOADDATA Link icon

      static final int INITIALIZE_LOADDATA
      Called at startup in the viewer in the AWT thread should come after the data maps have been made.
      See Also:
    • OFFLINE_DATA_LOADED Link icon

      static final int OFFLINE_DATA_LOADED
      Notification sent out when new offline data have been loaded. This is sent in the AWT thread after the worker thread loading the data has completed.

      Also see DATA__LOAD_COMPLETE which is sent around within the same worker thread and therefore executes BEFORE this one.

      See Also:
    • CHANGED_DISPLAY_SETTINGS Link icon

      static final int CHANGED_DISPLAY_SETTINGS
      Sent when display settings are changed (for instance altering of a symbol) so that graphic components can redraw.
      See Also:
    • CHANGED_MULTI_THREADING Link icon

      static final int CHANGED_MULTI_THREADING
      Sent when the data model has changed between single and multi threading.
      See Also:
    • CHANGED_OFFLINE_DATASTORE Link icon

      static final int CHANGED_OFFLINE_DATASTORE
      Sent when either the database or the binary store has updated and finished making a new map of its data.
      See Also:
    • NEW_SCROLL_TIME Link icon

      static final int NEW_SCROLL_TIME
      Sent in viewer mode when the view time slider is dragged
      See Also:
    • DATA_LOAD_COMPLETE Link icon

      static final int DATA_LOAD_COMPLETE
      Notification sent out when new offline data have been loaded. This is sent in the Swing Worker thread once data have been loaded for every changed data block .

      also see OFFLINE_DATA_LOADED which is sent around a little later in the AWT thread once the worker thread has completed.

      See Also:
    • HYDROPHONE_ARRAY_CHANGED Link icon

      static final int HYDROPHONE_ARRAY_CHANGED
      Called whenever the dialog box of the hydrophone array editor is closed (not cancelled). Primarily designed to inform localisers of possible changes to a hydrophone array values.
      See Also:
    • MASTER_REFERENCE_CHANGED Link icon

      static final int MASTER_REFERENCE_CHANGED
      Master reference point has updated (either changed type of reference or been updated in some way).
      See Also:
    • EXTERNAL_DATA_IMPORTED Link icon

      static final int EXTERNAL_DATA_IMPORTED
      Called whenever external data is imported into PAMGUARD and saved into the database and/or binary store. Usually occurs in viewer mode.
      See Also:
    • OFFLINE_PROCESS_COMPLETE Link icon

      static final int OFFLINE_PROCESS_COMPLETE
      Notification that offline processing has ended.
      See Also:
    • GLOBAL_TIME_UPDATE Link icon

      static final int GLOBAL_TIME_UPDATE
      Notification sent whenever the PC clock offset is updated.
      See Also:
    • GLOBAL_MEDIUM_UPDATE Link icon

      static final int GLOBAL_MEDIUM_UPDATE
      The medium has been updated.
      See Also:
    • READY_TO_RUN Link icon

      static final int READY_TO_RUN
      Sent shortly after the main PAMGUard setup has been completed, but this point all modules will have received INITIALIZATION_COMPLETE and should be ready to go.
      See Also:
    • PROJECT_META_UPDATE Link icon

      static final int PROJECT_META_UPDATE
      Sent when project metadata has been updated.
      See Also:
  • Method Details Link icon

    • addControlledUnit Link icon

      void addControlledUnit(PamControlledUnit controlledUnit)
      Adds a PamControlledUnit to the controller.
      Parameters:
      controlledUnit - - Reference to a PamcontrolledUnit
    • addView Link icon

      void addView(PamViewInterface newView)
      Adds a new view to the system
      Parameters:
      newView -
    • removeControlledUnt Link icon

      void removeControlledUnt(PamControlledUnit controlledUnit)
      Removes a PamControlledUnit from the controller
      Parameters:
      controlledUnit -
    • getControlledUnit Link icon

      PamControlledUnit getControlledUnit(int iUnit)
      Returns a reference to a PamControlledUnit within the COntroller
      Parameters:
      iUnit - Index of the unit
      Returns:
      reference to a PamControlledUnit
    • findControlledUnit Link icon

      PamControlledUnit findControlledUnit(String unitType)
      Finds a PamControlledUnit of a given type but with any name
      Parameters:
      unitType - Type of PamControlledUnit
      Returns:
      reference to PamControlledUnit
    • findControlledUnit Link icon

      PamControlledUnit findControlledUnit(String unitType, String unitName)
      Finds a PamControlledUnit of a given type and name
      Parameters:
      unitType - Type of PamControlledUnit
      unitName - Name of PamControlledUnit
      Returns:
      reference to PamControlledUnit
    • getNumControlledUnits Link icon

      int getNumControlledUnits()
      Gets the total number of PamControlledUnits
      Returns:
      the number of PamControlledUnits
    • getModelInterface Link icon

      PamModel getModelInterface()
      Gets a reference to the PamModel (where all the data are stored and the algorithms are running)
      Returns:
      Reference to the PamGuard model
    • pamStart Link icon

      boolean pamStart()
      Instruction to the controller (probably from a menu command inthe view) that data collection should start.
      Returns:
      true if successful
    • pamStop Link icon

      void pamStop()
      Instruction to the controller (probably from a menu command inthe view) that data collection should stop.
    • modelSettings Link icon

      boolean modelSettings(JFrame frame)
      Menu command to open dialog to adjust model settings
      Returns:
      true if dialog returned Ok.
    • pamStarted Link icon

      void pamStarted()
      Notification received from the model that data collection has started.
    • pamEnded Link icon

      void pamEnded()
      Sent from the model when Pam ends - this can happen when a file finishes or after Pam ends following a PamStop command sent by the controller
    • orderModules Link icon

      boolean orderModules(Frame parentFrame)
      Take actions to alow the user to change the order modules apear in.
    • addModule Link icon

      PamControlledUnit addModule(Frame parentFrame, PamModuleInfo moduleInfo)
      Add a new PamControlledUnit
      Parameters:
      moduleInfo - Information about the PamControlled unit to add
      Returns:
      true if created sucessfully
    • getGuiFrameManager Link icon

      GuiFrameManager getGuiFrameManager()
      Get the GUI Frame manager.
      Returns:
      GUIFrameManager
    • getFFTDataBlocks Link icon

      ArrayList<PamDataBlock> getFFTDataBlocks()
      Returns:
      List of PamDataBlocks in all PamProcesses in all PamControlledUnits that contain FFT data.
    • getFFTDataBlock Link icon

      PamDataBlock getFFTDataBlock(int id)
      Gets a specific data block from the list, or null.
      Parameters:
      id -
      Returns:
      an FFT data block at index id within Pamguards list of FFT type data blocks
    • getFFTDataBlock Link icon

      PamDataBlock getFFTDataBlock(String name)
      Gets a specific data block from the list, or null.
      Parameters:
      name -
      Returns:
      the first FFT data block at with the given name within Pamguards list of FFT type data blocks
    • getRawDataBlocks Link icon

      ArrayList<PamDataBlock> getRawDataBlocks()
      Returns:
      List of PamDataBlocks in all PamProcesses in all PamControlledUnits that contain raw audio data.
    • getRawDataBlock Link icon

      PamRawDataBlock getRawDataBlock(int id)
      Gets a specific data block from the list, or null.
      Parameters:
      id -
      Returns:
      a raw data block at index id within Pamguards list of RAW type data blocks
    • getRawDataBlock Link icon

      PamRawDataBlock getRawDataBlock(String name)
      Gets a specific data block from the list, or null.
      Parameters:
      name -
      Returns:
      the first raw data block at with the given name within Pamguards list of RAW type data blocks
    • getDetectorDataBlocks Link icon

      ArrayList<PamDataBlock> getDetectorDataBlocks()
      Returns:
      List of PamDataBlocks in all PamProcesses in all PamControlledUnits that contain detector output data.
    • getDetectorDataBlock Link icon

      PamDataBlock getDetectorDataBlock(int id)
      Gets a specific data block from the list, or null.
      Parameters:
      id -
      Returns:
      PamDataBlock -- a detector data block at index id within Pamguard's list of RAW type data blocks.
    • getDetectorDataBlock Link icon

      PamDataBlock getDetectorDataBlock(String name)
      Gets a specific data block from the list, or null.
      Parameters:
      name -
      Returns:
      PamDataBlock -- the first detector data block with the given name within Pamguard's list of DETECTOR type data blocks.
    • getDetectorEventDataBlocks Link icon

      ArrayList<PamDataBlock> getDetectorEventDataBlocks()
      Returns:
      List of PamDataBlocks in all PamProcesses in all PamControlledUnits that contain data of a specific type.
    • getDetectorEventDataBlock Link icon

      PamDataBlock getDetectorEventDataBlock(int id)
    • getDetectorEventDataBlock Link icon

      PamDataBlock getDetectorEventDataBlock(String name)
    • getDataBlocks Link icon

      ArrayList<PamDataBlock> getDataBlocks(Class blockType, boolean includeSubClasses)
      Returns an ArrayList of PamDataBlocks from all PamProcesses in all PamControlledUnits that contain data of a specific type. In order to return a list of PamDataBlocks that contain objects implementing a certain interface (such as AcousticDataUnit or PamDetection), the includeSubClasses boolean must be TRUE
      Parameters:
      blockType - DataType of PamDatablock
      includeSubClasses - whether or not to include classes that extend/implement the blockType parameter.
      Returns:
      List of PamDataBlocks in all PamProcesses in all PamControlledUnits that contain data of a specific type.
    • getDataBlock Link icon

      PamDataBlock getDataBlock(Class blockType, int id)
      Find a block of a given type with the id number, or null if the number is out of range.
      Parameters:
      blockType -
      id - -- the block id number
      Returns:
      PamDataBlock block, which you may want to cast to a subtype
    • getDataBlock Link icon

      PamDataBlock getDataBlock(Class blockType, String name)
      Find a block of a given type with the given name, or null if it doesn't exist.
      Parameters:
      blockType - -- RAW, FFT, DETECTOR, null, etc.
      name - -- the block name
      Returns:
      PamDataBlock block, which you may want to cast to a subtype
    • getDataBlocks Link icon

      ArrayList<PamDataBlock> getDataBlocks()
      Returns:
      All data blocks
    • notifyModelChanged Link icon

      void notifyModelChanged(int changeType)
      Tell the controller that the model may have changed (i.e. a process connection changed, or a process added, etc.) This will be passes on to the view and used by the controller as necessary.

      See Also:
      • invalid reference
        values are
         
        1. CHANGED_PROCESS_SETTINGS
        2. ADD_PROCESS
        3. REMOVE_PROCESS
        4. ADD_DATABLOCK
        5. REMOVE_DATABLOCK
        6. ADD_CONTROLLEDUNIT
        7. REMOVE_CONTROLLEDUNIT
        8. REORDER_CONTROLLEDUNITS
        9. INITIALIZATION_COMPLETE
        10. DESTROY_EVERYTHING
        11. RENAME_CONTROLLED_UNIT
        12. NEW_VIEW_TIMES
        13. NEW_VIEW_TIME
        14. CHANGED_DISPLAY_SETTINGS
        15. CHANGED_MULTI_THREADING
        16. HYDROPHONE_ARRAY_CHANGED
        17. EXTERNAL_DATA_LOADED
    • totalModelRebuild Link icon

      void totalModelRebuild()
      Do a total rebuild of the Pam model based on the contents of the set settings file.
    • pamClose Link icon

      void pamClose()
      Close all modules and free up resources.
    • manualStart Link icon

      boolean manualStart()
      Start function called from button to do a bit of extra book keeping
      Returns:
    • manualStop Link icon

      void manualStop()
      Stop function called from button to do a bit of extra book keeping