videoRangePanel
Class VRControl

java.lang.Object
  extended by PamController.PamControlledUnit
      extended by videoRangePanel.VRControl
All Implemented Interfaces:
PamSettings

public class VRControl
extends PamControlledUnit
implements PamSettings


Nested Class Summary
private  class VRControl.AngleListener
           
 
Field Summary
protected  AngleDataBlock angleDataBlock
           
protected  VRControl.AngleListener angleListener
           
protected static int CALIBRATE
           
protected static int CALIBRATE_1
           
protected static int CALIBRATE_2
           
protected static int CALIBRATE_DONE
           
private  java.awt.Point calibratePoint1
           
private  java.awt.Point calibratePoint2
           
private  VRMeasurement candidateMeasurement
           
protected static int DBCOMMENTLENGTH
           
private  java.awt.Point horizonPoint1
           
private  java.awt.Point horizonPoint2
           
private  double horizonTilt
           
private  java.lang.Double imageAngle
           
private  java.lang.String imageName
           
protected  MapFileManager mapFileManager
           
protected static int MEASURE_ANIMAL
           
protected static int MEASURE_DONE
           
protected static int MEASURE_FROM_HORIZON
           
protected static int MEASURE_FROM_SHORE
           
protected static int MEASURE_HORIZON_1
           
protected static int MEASURE_HORIZON_2
           
protected static int MEASURE_NONE
           
protected static int MEASURE_SHORE
           
private  java.util.ArrayList<VRMeasurement> measuredAnimals
           
protected static int NOIMAGE
           
protected  VRRangeMethods rangeMethods
           
protected  ShoreManager shoreManager
           
private  java.awt.Point shorePoint
           
private  double[] shoreRanges
           
protected  VRParameters vrParameters
           
protected  VRProcess vrProcess
           
protected  VRSidePanel vrSidePanel
           
private  int vrStatus
           
private  int vrSubStatus
           
protected  VRTabPanelControl vrTabPanelControl
           
 
Fields inherited from class PamController.PamControlledUnit
isViewer
 
Constructor Summary
VRControl(java.lang.String unitName)
           
 
Method Summary
 void autoSetVrStatus()
           
private  void calculateHorizonTilt()
          Gets called when a second horizon point is added and then calculates the horizon tilt, based on the two points.
protected  void clearHorizon()
           
private  void clearPoints()
           
protected  void clearShorePoint()
           
protected  void fileButton()
           
 java.awt.Point getCalibratePoint1()
           
 java.awt.Point getCalibratePoint2()
           
 VRMeasurement getCandidateMeasurement()
           
 java.awt.Point getHorizonPoint1()
           
 java.awt.Point getHorizonPoint2()
           
 double getHorizonTilt()
           
 java.lang.Double getImageAngle()
           
 java.lang.String getImageName()
           
(package private)  java.lang.String getInstruction()
           
 java.util.ArrayList<VRMeasurement> getMeasuredAnimals()
           
 java.io.Serializable getSettingsReference()
           
 long getSettingsVersion()
           
 java.awt.Point getShorePoint()
           
 java.lang.Double getShoreRange()
          Get the shore range we want to use - not necessarily the closest.
(package private)  java.lang.Double getshoreRange(double[] ranges)
           
 double[] getShoreRanges()
           
 int getVrStatus()
           
 int getVrSubStatus()
           
private  void horizonPointsFromShore(double tilt)
           
private  void loadFile(java.io.File file)
           
(package private)  void mouseClick(java.awt.Point mouseClick)
           
private  boolean newAnimalMeasurement_Horizon(java.awt.Point animalPoint)
           
private  boolean newAnimalMeasurement_Shore(java.awt.Point animalPoint)
          Can use horizon calculation since the shore data will have generated an artificial horizon.
private  boolean newAnimalMeasurement(java.awt.Point animalPoint)
           
private  void newCalibration()
           
private  void newImage()
           
(package private)  void newMousePoint(java.awt.Point mousePoint)
           
(package private)  void newSettings()
           
 void notifyModelChanged(int changeType)
          General notification when the PAMGAURD model changes.
protected  void pasteButton()
           
 boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
           
protected  void selectCalibration(VRCalibrationData vrCalibrationData)
           
protected  void selectHeight(int heightIndex)
           
 void setCalibratePoint1(java.awt.Point calibratePoint1)
           
 void setCalibratePoint2(java.awt.Point calibratePoint2)
           
 void setHorizonPoint1(java.awt.Point horizonPoint1)
           
 void setHorizonPoint2(java.awt.Point horizonPoint2)
           
 void setHorizonTilt(double horizonTilt)
           
 void setImageAngle(java.lang.Double shoreAngle)
           
protected  void setImageBrightness(float brightness, float contrast)
           
 void setImageName(java.lang.String imageName)
           
protected  void setMeasurementType(int measuremntType)
           
 void setShorePoint(java.awt.Point shorePoint)
           
protected  void settingsButton(javax.swing.JFrame frame)
           
 void setVrStatus(int vrStatus)
           
 void setVrSubStatus(int vrSubStatus)
           
(package private)  void showVRTab()
          Force the video range tab to be selected.
protected  void stepImageAngle(double step)
           
 
Methods inherited from class PamController.PamControlledUnit
addOtherRelatedMenuItems, addPamProcess, addRelatedMenuItems, canClose, createDetectionMenu, createDisplayMenu, createFileMenu, createHelpMenu, fillXMLElement, fillXMLParameters, getFrameNumber, getNumPamProcesses, getPamController, getPamModuleInfo, getPamProcess, getPamView, getSidePanel, getTabClipCopier, getTabPanel, getTabSpecificMenuBar, getUnitName, getUnitType, gotoTab, notifyArrayChanged, pamHasStopped, pamToStart, removePamProcess, removeUnit, rename, saveViewerData, setFrameNumber, setPamController, setPamModuleInfo, setPamView, setSidePanel, setTabPanel, setupControlledUnit, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface PamController.PamSettings
getUnitName, getUnitType
 

Field Detail

vrTabPanelControl

protected VRTabPanelControl vrTabPanelControl

vrParameters

protected VRParameters vrParameters

vrSidePanel

protected VRSidePanel vrSidePanel

rangeMethods

protected VRRangeMethods rangeMethods

vrProcess

protected VRProcess vrProcess

angleListener

protected VRControl.AngleListener angleListener

angleDataBlock

protected AngleDataBlock angleDataBlock

mapFileManager

protected MapFileManager mapFileManager

shoreManager

protected ShoreManager shoreManager

shoreRanges

private double[] shoreRanges

imageAngle

private java.lang.Double imageAngle

NOIMAGE

protected static final int NOIMAGE
See Also:
Constant Field Values

MEASURE_FROM_HORIZON

protected static final int MEASURE_FROM_HORIZON
See Also:
Constant Field Values

MEASURE_FROM_SHORE

protected static final int MEASURE_FROM_SHORE
See Also:
Constant Field Values

CALIBRATE

protected static final int CALIBRATE
See Also:
Constant Field Values

MEASURE_NONE

protected static final int MEASURE_NONE
See Also:
Constant Field Values

MEASURE_HORIZON_1

protected static final int MEASURE_HORIZON_1
See Also:
Constant Field Values

MEASURE_HORIZON_2

protected static final int MEASURE_HORIZON_2
See Also:
Constant Field Values

MEASURE_ANIMAL

protected static final int MEASURE_ANIMAL
See Also:
Constant Field Values

MEASURE_DONE

protected static final int MEASURE_DONE
See Also:
Constant Field Values

MEASURE_SHORE

protected static final int MEASURE_SHORE
See Also:
Constant Field Values

CALIBRATE_1

protected static final int CALIBRATE_1
See Also:
Constant Field Values

CALIBRATE_2

protected static final int CALIBRATE_2
See Also:
Constant Field Values

CALIBRATE_DONE

protected static final int CALIBRATE_DONE
See Also:
Constant Field Values

DBCOMMENTLENGTH

protected static final int DBCOMMENTLENGTH
See Also:
Constant Field Values

vrStatus

private int vrStatus

vrSubStatus

private int vrSubStatus

imageName

private java.lang.String imageName

horizonPoint1

private java.awt.Point horizonPoint1

horizonPoint2

private java.awt.Point horizonPoint2

calibratePoint1

private java.awt.Point calibratePoint1

calibratePoint2

private java.awt.Point calibratePoint2

shorePoint

private java.awt.Point shorePoint

horizonTilt

private double horizonTilt

measuredAnimals

private java.util.ArrayList<VRMeasurement> measuredAnimals

candidateMeasurement

private VRMeasurement candidateMeasurement
Constructor Detail

VRControl

public VRControl(java.lang.String unitName)
Method Detail

settingsButton

protected void settingsButton(javax.swing.JFrame frame)

pasteButton

protected void pasteButton()

fileButton

protected void fileButton()

showVRTab

void showVRTab()
Force the video range tab to be selected.


setMeasurementType

protected void setMeasurementType(int measuremntType)

clearHorizon

protected void clearHorizon()

clearShorePoint

protected void clearShorePoint()

selectCalibration

protected void selectCalibration(VRCalibrationData vrCalibrationData)

selectHeight

protected void selectHeight(int heightIndex)

setImageBrightness

protected void setImageBrightness(float brightness,
                                  float contrast)

loadFile

private void loadFile(java.io.File file)

newImage

private void newImage()

getSettingsReference

public java.io.Serializable getSettingsReference()
Specified by:
getSettingsReference in interface PamSettings
Returns:
The serialisable object that will be stored

getSettingsVersion

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

restoreSettings

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

newSettings

void newSettings()

notifyModelChanged

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

autoSetVrStatus

public void autoSetVrStatus()

getVrStatus

public int getVrStatus()

setVrStatus

public void setVrStatus(int vrStatus)

getVrSubStatus

public int getVrSubStatus()

setVrSubStatus

public void setVrSubStatus(int vrSubStatus)

getInstruction

java.lang.String getInstruction()

newMousePoint

void newMousePoint(java.awt.Point mousePoint)

mouseClick

void mouseClick(java.awt.Point mouseClick)

horizonPointsFromShore

private void horizonPointsFromShore(double tilt)

newAnimalMeasurement

private boolean newAnimalMeasurement(java.awt.Point animalPoint)

newAnimalMeasurement_Shore

private boolean newAnimalMeasurement_Shore(java.awt.Point animalPoint)
Can use horizon calculation since the shore data will have generated an artificial horizon.

Parameters:
animalPoint - Clicked point on image
Returns:
true if calculation completed and range accepted bu uper.

newAnimalMeasurement_Horizon

private boolean newAnimalMeasurement_Horizon(java.awt.Point animalPoint)
Parameters:
animalPoint - Clicked point on image
Returns:
true if calculation completed and range accepted bu uper.

newCalibration

private void newCalibration()

getImageName

public java.lang.String getImageName()

setImageName

public void setImageName(java.lang.String imageName)

getCalibratePoint1

public java.awt.Point getCalibratePoint1()

setCalibratePoint1

public void setCalibratePoint1(java.awt.Point calibratePoint1)

getCalibratePoint2

public java.awt.Point getCalibratePoint2()

setCalibratePoint2

public void setCalibratePoint2(java.awt.Point calibratePoint2)

getHorizonPoint1

public java.awt.Point getHorizonPoint1()

setHorizonPoint1

public void setHorizonPoint1(java.awt.Point horizonPoint1)

getHorizonPoint2

public java.awt.Point getHorizonPoint2()

setHorizonPoint2

public void setHorizonPoint2(java.awt.Point horizonPoint2)

getShorePoint

public java.awt.Point getShorePoint()

setShorePoint

public void setShorePoint(java.awt.Point shorePoint)

getMeasuredAnimals

public java.util.ArrayList<VRMeasurement> getMeasuredAnimals()

clearPoints

private void clearPoints()

getCandidateMeasurement

public VRMeasurement getCandidateMeasurement()

getImageAngle

public java.lang.Double getImageAngle()

setImageAngle

public void setImageAngle(java.lang.Double shoreAngle)

stepImageAngle

protected void stepImageAngle(double step)

getShoreRanges

public double[] getShoreRanges()

getShoreRange

public java.lang.Double getShoreRange()
Get the shore range we want to use - not necessarily the closest.

Returns:
shore range to use in VR calculations.

getshoreRange

java.lang.Double getshoreRange(double[] ranges)

calculateHorizonTilt

private void calculateHorizonTilt()
Gets called when a second horizon point is added and then calculates the horizon tilt, based on the two points.


getHorizonTilt

public double getHorizonTilt()

setHorizonTilt

public void setHorizonTilt(double horizonTilt)