Class BinaryUpdater

java.lang.Object
binaryFileStorage.checker.BinaryUpdater
All Implemented Interfaces:
PamSettings, SettingsNameProvider

public class BinaryUpdater extends Object implements PamSettings
Functions for updating all binary files to the latest PAMGuard binary file version.
Author:
dg50
  • Constructor Details

    • BinaryUpdater

      public BinaryUpdater(BinaryStore binaryStore)
  • Method Details

    • showDialog

      public boolean showDialog()
      Show the dialog that will control all the updating.
      Returns:
    • getBinaryDataBlocks

      public List<PamDataBlock> getBinaryDataBlocks()
      Get all datablocks in the model that have binary data.
      Returns:
    • getSelectedDataBlocks

      public ArrayList<PamDataBlock> getSelectedDataBlocks(BinaryUpdateParams params)
      Get a list of selected datablocks.
      Parameters:
      params -
      Returns:
    • getCurrentFolder

      public String getCurrentFolder()
      Get current binary storage folder.
      Returns:
    • stopUpdate

      public void stopUpdate()
      Stop the background process
    • isRunning

      public boolean isRunning()
    • runUpdate

      public void runUpdate(UpdateWorkObserver updateObserver)
    • getBinaryUpdateParams

      public BinaryUpdateParams getBinaryUpdateParams()
      Returns:
      the binaryUpdateParams
    • setBinaryUpdateParams

      public void setBinaryUpdateParams(BinaryUpdateParams binaryUpdateParams)
      Parameters:
      binaryUpdateParams - the binaryUpdateParams to set
    • getUnitName

      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

      public String getUnitType()
      Specified by:
      getUnitType in interface PamSettings
      Returns:
      A Name specific to the type, e.g. Click detector
    • getSettingsReference

      public 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
      Parameters:
      pamControlledUnitSettings -
      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