Class VRControl

All Implemented Interfaces:
PamSettings, SettingsNameProvider

public class VRControl extends PamControlledUnit implements PamSettings
The videoRange module determines location information based on photographs of objects (photogrammetry). The ideal for determining the location of an animal is to know the heading, pitch, roll, focal length, GPS location and height of a camera along with the height of the tide.

However, not all these parameters are necessarily needed to gain some sort of location information. For example, tilt and pitch, focal length and height can determine the distance to animal without the need for heading information or a GPS location.

There are various ways a user can determine required parameters, either directly from a photograph or external data. The simplest example is using the horizon to determine the pitch and tilt of the camera and manually inputting height data along with a calibration (pixels per degree/rad) value. Users may want to use external IMU data, either in real time or for post processing. Geo-tagged photos are another option.

This module is designed to provide a framework for photogrammetry. The core functionality allows users to open and view photographs/images along with any meta data. VRMethod classes are then used to provide the user interface for determining the l.ocation of an object

VRmethods use a JLayer over the photograph to allow users to select locations, draw lines etc. Each VRMethod has it's own side panel and ribbon panel to allow users to input information and select relevant. The VRMethod is responsible for calculating location information which is passed back to VRControl to be saved as a generic video range data unit.

Generic Information Handled outside VRMethods (these are used by one or more VRMethods but handled solely within a VRMethod class)

GPS location of camera

Calibration Values

Landmark Locations

Tide Information

Imported Maps

External Sensor data

Photo meta data

Author:
Doug Gillespie and Jamie Macaulay
  • Field Details Link icon

    • vrTabPanelControl Link icon

      public VRTabPane vrTabPanelControl
      Panel containing all gui components
    • SETTINGS_CHANGE Link icon

      public static final int SETTINGS_CHANGE
      Some settings in the vrparams may have changed
      See Also:
    • IMAGE_CHANGE Link icon

      public static final int IMAGE_CHANGE
      The image has changed
      See Also:
    • IMAGE_SCALE_CHANGE Link icon

      public static final int IMAGE_SCALE_CHANGE
      The scale of the image has been changed.
      See Also:
    • IMAGE_TIME_CHANGE Link icon

      public static final int IMAGE_TIME_CHANGE
      The time of the image has been changed.
      See Also:
    • HEADING_UPDATE Link icon

      public static final int HEADING_UPDATE
      The heading of the image has been changed (usually manually).
      See Also:
    • PITCH_UPDATE Link icon

      public static final int PITCH_UPDATE
      The pitch of the image has been changed (usually manually)
      See Also:
    • TILT_UPDATE Link icon

      public static final int TILT_UPDATE
      The roll of the image has been changed (usually manually), note: roll is often referred to as tilt.
      See Also:
    • METHOD_CHANGED Link icon

      public static final int METHOD_CHANGED
      The vrMethod has changed
      See Also:
    • REPAINT Link icon

      public static final int REPAINT
      A repaint has been called.
      See Also:
    • NOIMAGE Link icon

      public static final int NOIMAGE
      See Also:
    • MOUSEMOVED Link icon

      public static final int MOUSEMOVED
      The mouse has moved on the display.
      See Also:
    • LANDMARKGROUP_CHANGE Link icon

      public static final int LANDMARKGROUP_CHANGE
      The landmark group selection has been changed
      See Also:
    • HEIGHT_CHANGE Link icon

      public static final int HEIGHT_CHANGE
      The height has been changed
      See Also:
    • DBCOMMENTLENGTH Link icon

      public static final int DBCOMMENTLENGTH
      See Also:
  • Constructor Details Link icon

    • VRControl Link icon

      public VRControl(String unitName)
  • Method Details Link icon

    • getMethods Link icon

      public ArrayList<VRMethod> getMethods()
      Get an arraylist of all the vr methods currently available.
      Returns:
    • setVRMethod Link icon

      public void setVRMethod(int method)
      Set the current method.
      Parameters:
      method - - integer specifying method position in vrMethods ArrayList.
    • getCurrentMethod Link icon

      public VRMethod getCurrentMethod()
      Get the current vr Method.
      Returns:
    • getCalibrationMethod Link icon

      public AddCalibrationMethod getCalibrationMethod()
      Get the calibration method. Some dialogs require this.
      Returns:
      the AddCalibration vrmethod
    • settingsButtonAWT Link icon

      public void settingsButtonAWT(Frame frame, int tab)
      Opens the settings dialog and updates the module if new settings are saved.
      Parameters:
      frame -
      tab - - the tab to open the settings dialog on.
    • settingsButtonFX Link icon

      public void settingsButtonFX(int tab)
      Opens settings pane which updates module settings
      Parameters:
      tab - - which tab to open on. e.g. VRSettingsPane.HEIGHTTAB;
    • setVRParams Link icon

      public void setVRParams(VRParameters newParams)
      Parameters:
      newParams -
    • pasteButton Link icon

      public void pasteButton()
      Pastes an image from the computers clipboard.
    • findNextFile Link icon

      public File findNextFile(File file, ImageFileFilter filefilter, boolean forward)
      Find the next file which is approved by the Image file filter in the folder. Returns null if no file is found.
      Parameters:
      file - - current file selected in the directory. If null the first file in the directory is chosen.
      filefilter - - the file filter.
      forward - - true move forward in the folder, false move backward in the folder.
      Returns:
      the image file
    • selectHeight Link icon

      public void selectHeight(int heightIndex)
      Set the current selected height
      Parameters:
      heightIndex -
    • getCurrentHeight Link icon

      public double getCurrentHeight()
      Get the current height of the camera from sea level. Includes any offset calulated by the tide manager.
      Returns:
      the current height oif the camera from sea level- (this is fiorm the current sea level)
    • loadFile Link icon

      public void loadFile(File file)
      Load an image file
      Parameters:
      file - - image file.
    • getSettingsReference Link icon

      public Serializable getSettingsReference()
      Specified by:
      getSettingsReference in interface PamSettings
      Returns:
      The serialisable object that will be stored
    • getSettingsVersion Link icon

      public long getSettingsVersion()
      Specified by:
      getSettingsVersion in interface PamSettings
      Returns:
      An integer version number for the settings
    • restoreSettings Link icon

      public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
      Specified by:
      restoreSettings in interface PamSettings
      Returns:
      true if successful The object performs final checks (if needed) and then casts the settings data pamcontrolledunitSettings.settings into the correct type and uses as required
    • update Link icon

      public void update(int updateType)
      Updates the VRControl depending on flag and passes update flag to the VRTabPanel (gui) and the VRMethods.
      Parameters:
      updateType -
    • notifyModelChanged Link icon

      public void notifyModelChanged(int changeType)
      Description copied from class: PamControlledUnit
      General notification when the PAMGAURD model changes.
      Overrides:
      notifyModelChanged in class PamControlledUnit
      Parameters:
      changeType - type of change
    • getVrSubStatus Link icon

      public int getVrSubStatus()
    • newMousePoint Link icon

      public void newMousePoint(Point mousePoint)
    • getImageName Link icon

      public String getImageName()
      Returns:
    • getImageTimeString Link icon

      public String getImageTimeString()
      Get the time of the current image.
      Returns:
      the image date and time string.
    • getMeasuredAnimals Link icon

      public ArrayList<VRMeasurement> getMeasuredAnimals()
      Get a list of the current measurements on the image
      Returns:
      the current measurements on the image
    • getVRParams Link icon

      public VRParameters getVRParams()
      Get the VR paramters class.
      Returns:
      the vr params.
    • getVRPanel Link icon

      public VRPane getVRPanel()
      Get the vr panel.
      Returns:
    • getVRProcess Link icon

      public VRProcess getVRProcess()
      Get the VRProcess.
      Returns:
      the vr process.
    • setMeasuredAnimals Link icon

      public void setMeasuredAnimals(ArrayList<VRMeasurement> measuredAnimals)
    • getRangeMethods Link icon

      public VRHorzMethods getRangeMethods()
    • setRangeMethods Link icon

      public void setRangeMethods(VRHorzMethods rangeMethods)
    • getMapFileManager Link icon

      public MapFileManager getMapFileManager()
      Get the file manager for shore based method maps.
      Returns:
      the map manager
    • getLocationManager Link icon

      public LocationManager getLocationManager()
      Get the location manager. This handles the location of the images.
      Returns:
      the location manager
    • getTideManager Link icon

      public TideManager getTideManager()
      Get the tide manager. This handles tide imports.
      Returns:
      tide imports.
    • setCurrentImage Link icon

      public void setCurrentImage(PamImage image)
      Set the current image.
      Parameters:
      image - - the current displayed image.
    • getCurrentImage Link icon

      public PamImage getCurrentImage()
      Get the current pam image.
      Returns:
      the current image.
    • getVRTabPanel Link icon

      public VRTabPane getVRTabPanel()
    • getImageTime Link icon

      public long getImageTime()
      Get the current image time in millis.
      Returns:
      the current image time.
    • getImageDate Link icon

      public Date getImageDate()
      Get the date of the image.
      Returns:
      the date of the image
    • getIMUListener Link icon

      public IMUListener getIMUListener()
    • isFX Link icon

      public boolean isFX()
      Check whether the GUI is FX or not.
      Returns:
    • getTideImport Link icon

      public ImportDataSystem<String> getTideImport()
      Get the import system for tide data.
      Returns:
      the tideImport
    • getImageTimeParser Link icon

      public ImageTimeParser getImageTimeParser()
      Get the current image time aprser
      Returns: