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

    • SUBTABLECLAUSE_TIME Link icon

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

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

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

    • getSubLogging Link icon

      public SQLLogging getSubLogging()
      Returns:
      the subLogging
    • setSubLogging Link icon

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

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

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

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

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

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

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

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

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

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

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

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

      public void doSubTableUIDRepairs()
    • getEventEndTimeItem Link icon

      public PamTableItem getEventEndTimeItem()
      Returns:
      the eventEndTimeItem
    • setEventEndTimeItem Link icon

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

      public boolean isCreateDataUnits()
      Returns:
      the createDataUnits
    • setCreateDataUnits Link icon

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