Package PamController.soundMedium
Class GlobalMediumManager
java.lang.Object
PamController.soundMedium.GlobalMediumManager
- All Implemented Interfaces:
PamSettings
,SettingsNameProvider
Manages the global medium @see GlobalMedium
- Author:
- Jamie Macaulay
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addGlobalMediumMenuItems
(JMenu menu, JFrame frame) Add menu items to the swing menuGet the current medium sound is travelling through.Get the string for the default dB reference unit e.g.double
Get the dB offset to convert form sensitivity value units to received amplitude units.Get the string for the default dB reference unit for receiver sensitivity e.g.double[]
double[]
Get default scales for dB/Hz.double
Get the default sensitivity of receivers.double
Get the default sound speed for the current medium.Get the string for the receiver type for the current medium e.g.getRecieverString
(boolean caps) Get the string for the receiver type for the current medium e.g.long
double
Get the height coefficient value for displays.Get the z string for displays.getZString
(boolean caps) Get the z string for displays.boolean
restoreSettings
(PamControlledUnitSettings pamControlledUnitSettings) void
setCurrentMedium
(GlobalMedium.SoundMedium currentMedium) Set the current medium and notify all modules of the change.void
setCurrentMedium
(GlobalMedium.SoundMedium currentMedium, boolean notify) Set the current medium
-
Field Details
-
warning
-
-
Constructor Details
-
GlobalMediumManager
-
-
Method Details
-
addGlobalMediumMenuItems
Add menu items to the swing menu- Parameters:
menu
- - the menu item to add to
-
setCurrentMedium
Set the current medium and notify all modules of the change.- Parameters:
currentMedium
- - the current medium.notify
- - notify of a medium change.
-
setCurrentMedium
Set the current medium- Parameters:
currentMedium
- - the current medium.notify
- - notify of a medium change.
-
getRecieverString
Get the string for the receiver type for the current medium e.g. hydrophone, microphone.- Parameters:
caps
- - true to have the first letter capitalised- Returns:
- the receiver name.
-
getRecieverString
Get the string for the receiver type for the current medium e.g. hydrophone, microphone.- Returns:
- the reciever name.
-
getdBSensString
Get the string for the default dB reference unit for receiver sensitivity e.g. dB re 1V/uPa- Returns:
- the string for sensitivity values.
-
getdBRefString
Get the string for the default dB reference unit e.g. dB re 1uPa.- Returns:
- the string for dB values.
-
getZCoeff
public double getZCoeff()Get the height coefficient value for displays. Heights are always stored so that +z points up (i.e. -g). In display height is input as depth as so must be multiplied by -1 before being stored. In air height is more sensible to think of as +z and so does not need multiplied (or multiplied by 1). The height coefficient is the value height inputs are multiplied before being stored. @see getZString- Returns:
- the height coefficient.
-
getZString
Get the z string for displays. Heights are always stored so that +z points up (i.e. -g). In display height is input as depth as so must be multiplied by -1 before being stored. In air height is more sensible to think of as +z and so does not need multiplied (or multiplied by 1). The height coefficient is the value height inputs are multiplied before being stored. @see getZString- Returns:
- the height coefficient.
-
getZString
Get the z string for displays. Heights are always stored so that +z points up (i.e. -g). In display height is input as depth as so must be multiplied by -1 before being stored. In air height is more sensible to think of as +z and so does not need multiplied (or multiplied by 1). The height coefficient is the value height inputs are multiplied before being stored. @see getZString- Parameters:
boolean
- caps - true to capitalise the first letter.- Returns:
- the height coefficient.
-
getDefaultSoundSpeed
public double getDefaultSoundSpeed()Get the default sound speed for the current medium.- Returns:
- the default sound speed in meters per second.
-
getDefaultRecieverSens
public double getDefaultRecieverSens()Get the default sensitivity of receivers. This is a very variable value but will be a few tens of dB out instead of a few hundred.- Returns:
- the default receiver sensitivity in getdBSensString() units.
-
getdBSensOffset
public double getdBSensOffset()Get the dB offset to convert form sensitivity value units to received amplitude units. Sensitivity values in PG are always stored in the same reference as received amplitude. However they may be different units in the display because terrestrial acoustics is annoying.Add this to input from display to get stored unit. Subtract to get display units.
- Returns:
- the daB offset.
-
getDefaultdBHzScales
public double[] getDefaultdBHzScales()Get default scales for dB/Hz. Typically this is used for spectrogram colour limits.- Returns:
- the default minim and maximum scale in dB/Hz
-
getCurrentMedium
Get the current medium sound is travelling through.- Returns:
- the current soun medium.
-
getDefaultAmplitudeScales
public double[] getDefaultAmplitudeScales() -
getGlobalMediumParameters
- Returns:
- the globalMediumParameters
-
getUnitName
- Specified by:
getUnitName
in interfaceSettingsNameProvider
- Returns:
- A Name specific to this instance of the particular class, e.g. Sperm whale detector, Beaked whale detector, etc.
-
getUnitType
- Specified by:
getUnitType
in interfacePamSettings
- Returns:
- A Name specific to the type, e.g. Click detector
-
getSettingsReference
- Specified by:
getSettingsReference
in interfacePamSettings
- Returns:
- The serialisable object that will be stored
-
getSettingsVersion
public long getSettingsVersion()- Specified by:
getSettingsVersion
in interfacePamSettings
- Returns:
- An integer version number for the settings
-
restoreSettings
- Specified by:
restoreSettings
in interfacePamSettings
- 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
-