Class GlobalMediumManager

java.lang.Object
PamController.soundMedium.GlobalMediumManager
All Implemented Interfaces:
PamSettings, SettingsNameProvider

public class GlobalMediumManager extends Object implements PamSettings
Manages the global medium @see GlobalMedium
Author:
Jamie Macaulay
  • Field Details Link icon

    • warning Link icon

      public String warning
  • Constructor Details Link icon

    • GlobalMediumManager Link icon

      public GlobalMediumManager(PamController pamController)
  • Method Details Link icon

    • addGlobalMediumMenuItems Link icon

      public void addGlobalMediumMenuItems(JMenu menu, JFrame frame)
      Add menu items to the swing menu
      Parameters:
      menu - - the menu item to add to
    • setCurrentMedium Link icon

      public void setCurrentMedium(GlobalMedium.SoundMedium currentMedium)
      Set the current medium and notify all modules of the change.
      Parameters:
      currentMedium - - the current medium.
      notify - - notify of a medium change.
    • setCurrentMedium Link icon

      public void setCurrentMedium(GlobalMedium.SoundMedium currentMedium, boolean notify)
      Set the current medium
      Parameters:
      currentMedium - - the current medium.
      notify - - notify of a medium change.
    • getRecieverString Link icon

      public String getRecieverString(boolean caps)
      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 Link icon

      public String getRecieverString()
      Get the string for the receiver type for the current medium e.g. hydrophone, microphone.
      Returns:
      the reciever name.
    • getdBSensString Link icon

      public String 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 Link icon

      public String getdBRefString()
      Get the string for the default dB reference unit e.g. dB re 1uPa.
      Returns:
      the string for dB values.
    • getZCoeff Link icon

      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 Link icon

      public String 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 Link icon

      public String getZString(boolean caps)
      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 Link icon

      public double getDefaultSoundSpeed()
      Get the default sound speed for the current medium.
      Returns:
      the default sound speed in meters per second.
    • getDefaultRecieverSens Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      public GlobalMedium.SoundMedium getCurrentMedium()
      Get the current medium sound is travelling through.
      Returns:
      the current soun medium.
    • getDefaultAmplitudeScales Link icon

      public double[] getDefaultAmplitudeScales()
    • getGlobalMediumParameters Link icon

      public GlobalMediumParams getGlobalMediumParameters()
      Returns:
      the globalMediumParameters
    • getUnitName Link icon

      public String getUnitName()
      Specified by:
      getUnitName in interface SettingsNameProvider
      Returns:
      A Name specific to this instance of the particular class, e.g. Sperm whale detector, Beaked whale detector, etc.
    • getUnitType Link icon

      public String getUnitType()
      Specified by:
      getUnitType in interface PamSettings
      Returns:
      A Name specific to the type, e.g. Click detector
    • 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