Class SuperDetLogging

java.lang.Object
generalDatabase.SQLLogging
generalDatabase.SuperDetLogging
Direct Known Subclasses:
ClickTrainDetLogging, CPODClickTrainLogging, DetectionGroupLogging, Group3DLogging, MarkGroupSQLLogging, OfflineEventLogging, QASequenceLogging, QATestLogging

public abstract class SuperDetLogging extends SQLLogging
Extensions to SQLLogging to be used with datablocks that log sub detections. All such blocks will be instances of SuperDetDatablock
Author:
Dougl
  • Field Details

    • SUBTABLECLAUSE_TIME

      public static final int SUBTABLECLAUSE_TIME
      When loading sub table data, load data using the same between times clause as was applied to the super datablock
      See Also:
    • SUBTABLECLAUSE_PARENTUID

      public static final int SUBTABLECLAUSE_PARENTUID
      When loading sub table data, load data using a clause which will guarantee loading of all sub detections of loaded super detections based around UID's
      See Also:
    • SUBTABLECLAUSE_PARENTDATABASEID

      public static final int SUBTABLECLAUSE_PARENTDATABASEID
      When loading sub table data, load data using a clause which will guarantee loading of all sub detections of loaded super detections based around database indexes.
      See Also:
  • Method Details

    • getSubLogging

      public SQLLogging getSubLogging()
      Returns:
      the subLogging
    • setSubLogging

      public void setSubLogging(SQLLogging subLogging)
      Parameters:
      subLogging - the subLogging to set
    • logData

      public boolean logData(PamConnection con, PamDataUnit dataUnit, PamDataUnit superDetection)
      Description copied from class: SQLLogging
      Called when a new PamDataUnit is added to a PamDataBlock to write those data to the database. Functionality moved down to PamCursor so that exact writing method can become database specific if necessary.
      Overrides:
      logData in class SQLLogging
      Parameters:
      con - Database Connection
      dataUnit - Pamguard Data unit.
      superDetection - reference to a super detection so additional cross referencing can be filled
      Returns:
      true if written and new index of dataUnit retrieved OK
      See Also:
    • reLogData

      public boolean reLogData(PamConnection con, PamDataUnit dataUnit, PamDataUnit superDetection)
      Description copied from class: SQLLogging
      Called when an old PamDataUnit is updated. The record is either updated or a new record is written, but cross referenced to the old unit for bookkeeping purposes based on the updatePolicy flag.
      Overrides:
      reLogData in class SQLLogging
      Parameters:
      con - Database Connection
      dataUnit - Pamguard Data unit.
      superDetection - reference to a super detection so additional cross referencing can be filled
      Returns:
      the number of rows written to the database.
      See Also:
    • saveOfflineData

      public boolean saveOfflineData(DBControlUnit dbControlUnit, PamConnection connection)
      Description copied from class: SQLLogging
      Save offline data in viewer mode.

      This is a pretty basic function which assumes pretty much a 1:1 correspondence between data loaded into the viewer and data to be saved.

      Three types of saving to do

      1. Pre existing 1:1 correspondence between data in memory and database
      2. Viewer will have added or removed data (e.g. map comments may easily have added data)
      3. Weird stuff like in the click detector where the database is only holding information about a subset of clicks held in the binary data files

      Should be able to deal with first two here, but functions must override for 3.

      Overrides:
      saveOfflineData in class SQLLogging
      Returns:
    • loadViewData

      public boolean loadViewData(PamConnection con, PamViewParameters pamViewParameters, ViewLoadObserver loadObserver)
      Description copied from class: SQLLogging
      Load viewer data for a single datablock.

      this executes in a Swing Worker thread, so needs to send notification objects to that thread, and not direct to the Controller so that they can be published back in the AWT thread.

      Overrides:
      loadViewData in class SQLLogging
      Parameters:
      con - database connection
      pamViewParameters - viewer parameters.
      Returns:
    • deleteData

      public boolean deleteData(PAMSelectClause pvp)
      Overrides:
      deleteData in class SQLLogging
    • deleteIndexedItems

      public boolean deleteIndexedItems(PamConnection connection, int[] deleteIndexes)
      Description copied from class: SQLLogging
      Delete one or more rows from the database based on their indexes.
      Overrides:
      deleteIndexedItems in class SQLLogging
      Parameters:
      deleteIndexes - list of Id's
      Returns:
      true if no exception
    • checkSubTableCount

      public int checkSubTableCount(int databaseIndex)
      Check the number of entries in the sub table which have this database index.
      Parameters:
      databaseIndex -
      Returns:
      number of sub detections.
    • anySubTableItems

      public Boolean anySubTableItems(PAMSelectClause mainTableClause, PAMSelectClause subTableClause)
      find if any sub table items that satisfy a particular clause.
      Parameters:
      mainTableClause -
      subTableClause -
      Returns:
      true if any items satisfy clause.
    • countSubTableItems

      public Integer countSubTableItems(PAMSelectClause mainTableClause, PAMSelectClause subTableClause)
      Count the number of sub table items that satisfy a particular clause.
      Parameters:
      mainTableClause -
      subTableClause -
      Returns:
      count of items.
    • getSubTableClausePolicy

      public int getSubTableClausePolicy()
      Returns:
      the subTableClausePolicy
      See Also:
    • setSubTableClausePolicy

      public void setSubTableClausePolicy(int subTableClausePolicy)
      Parameters:
      subTableClausePolicy - the subTableClausePolicy to set
      See Also:
    • doSubTableUIDRepairs

      public void doSubTableUIDRepairs()
    • getEventEndTimeItem

      public PamTableItem getEventEndTimeItem()
      Returns:
      the eventEndTimeItem
    • setEventEndTimeItem

      public void setEventEndTimeItem(PamTableItem eventEndTimeItem)
      Parameters:
      eventEndTimeItem - the eventEndTimeItem to set
    • isCreateDataUnits

      public boolean isCreateDataUnits()
      Returns:
      the createDataUnits
    • setCreateDataUnits

      public void setCreateDataUnits(boolean createDataUnits)
      Parameters:
      createDataUnits - the createDataUnits to set