Class CalibrationHandler

java.lang.Object
tethys.CollectionHandler
tethys.calibration.CalibrationHandler
All Implemented Interfaces:
TethysStateObserver

public class CalibrationHandler extends CollectionHandler implements TethysStateObserver
  • Field Details

    • updateOptions

      public static final String[] updateOptions
    • calibrationMethods

      public static final String[] calibrationMethods
    • qaTypes

      public static final String[] qaTypes
    • helpPoint

      public static final String helpPoint
      See Also:
  • Constructor Details

    • CalibrationHandler

      public CalibrationHandler(TethysControl tethysControl)
      Parameters:
      tethysControl -
  • Method Details

    • updateState

      public void updateState(TethysState tethysState)
      Description copied from interface: TethysStateObserver
      Receive state updates when Tethys has done something (made a connection, moved some data, etc.)
      Note that this is for RECEIVING state updates, not for sending them. To avoid infinite notifications loops, use tethysControl.sendStateUpdate(TethysState) to send out state notifications.
      Specified by:
      updateState in interface TethysStateObserver
    • exportAllCalibrations

      public int exportAllCalibrations()
    • formatDate

      public static String formatDate(long timeInMillis)
      Format the data in the dd MMMM yyyy format
      Parameters:
      timeInMillis - time in milliseconds
      Returns:
      formatted string.
    • createCalibrationDocumentRoot

      public String createCalibrationDocumentRoot()
      Get a start of name for a calibration document. This will be used in the document name with a date and a channel, and the document Id just of the root and the channel.
      Returns:
      root string for document names and document id's.
    • createCalibrationDocument

      public nilus.Calibration createCalibrationDocument(int channelIndex)
      Create a calibration document for a single hydrophone channel.
      Parameters:
      channelIndex - channel id. One document per channel for a multi hydrophone array.
      pDeployment - deployment, for cross referencing.
      Returns:
      Calibration document.
    • createCalibrationDocument

      public nilus.Calibration createCalibrationDocument(AcquisitionControl soundAcquisition, int channelIndex)
      Create a calibration document for a single hydrophone channel.
      Parameters:
      soundAcquisition - Daq information - needed to get the ADC calibration information.
      channelIndex - channel id. One document per channel for a multi hydrophone array.
      pDeployment - deployment, for cross referencing.
      Returns:
      Calibration document.
    • calDocumentExists

      public boolean calDocumentExists(String documentName)
      See if a document already exists. This should only occur if you try to export the same document twice with the same calibration date.
      Parameters:
      documentName -
      Returns:
      true if a document already exists.
    • haveAllChannelCalibrations

      public boolean haveAllChannelCalibrations()
      Return if we have at least one document for every channel.
      Returns:
      true if all cal documents exist.
    • haveChannelCalibration

      public boolean haveChannelCalibration(int iChan)
      Find whether we have a document for this instrument and channel.
      Parameters:
      iChan -
      Returns:
      true if we have an appropriate doc.
    • getHydrophoneId

      public String getHydrophoneId(int channelIndex)
      Get an id based on the instrument identifiers and channel number. This is the internal id of the document, not the document name which includes an additional date part in the name.
      Parameters:
      channelIndex -
      Returns:
      id string - instrument type + instrument id + channel
    • makeChannelNamePart

      public String makeChannelNamePart(int channelIndex)
      Make the final part of the document name / id which is the channel number.
      Parameters:
      channelIndex - channel index
      Returns:
      string in the form ch%02d (e.g. ch03)
    • getCalibrationDataList

      public ArrayList<DocumentNilusObject<nilus.Calibration>> getCalibrationDataList()
      Returns:
      the calibrationDataBlock
    • getHelpPoint

      public String getHelpPoint()
      Specified by:
      getHelpPoint in class CollectionHandler