Package rockBlock

Class RockBlockProcess2

java.lang.Object
PamguardMVC.PamProcess
rockBlock.RockBlockProcess2
All Implemented Interfaces:
ModuleStatusManager, PamObserver, ProcessAnnotator

public class RockBlockProcess2 extends PamProcess implements ModuleStatusManager
This version of RockBlockProcess uses the jSerialComm library instead of RXTX
Author:
mo55
  • Constructor Details

    • RockBlockProcess2

      public RockBlockProcess2(RockBlockControl rockBlockControl)
      Parameters:
      rockBlockControl -
      parentDataBlock -
      processName -
  • Method Details

    • isRockBlockCommReady

      public boolean isRockBlockCommReady()
      Return the commReady boolean, indicating whether or not we've successfully established communications with the RockBlock
      Returns:
    • resetRockBlock

      public void resetRockBlock()
      Close the current serial port object and try to create a new one
    • getRbStatus

      public RockBlockStatus getRbStatus()
      Get the RockBlock status object
      Returns:
    • lastSignalStrength

      public int lastSignalStrength()
      Returns the signal strength of the last signal check. Note that this does NOT initiate a new signal check - for that, we need to call checkSignal() first, wait a few seconds, and then call this.
      Returns:
    • checkSignal

      public void checkSignal()
      Tell the RockBlock+ to check the signal strength. This does not return a value, because it can take awhile before the signal strength is returned. To get the actual value of the signal strength, call lastSignalStrength() after calling this (and waiting a bit)
    • addOutgoingMessageToQueue

      public void addOutgoingMessageToQueue(String textMessage)
      Adds a new String object to the outgoing messages queue. Check to make sure that the passed String is not too long - cannot be longer than MAX_NUM_BYTES_OUTGOING-2 (we subtract 2 so that we can later add the \r onto the end).
      Parameters:
      textMessage -
    • removeOutgoingMessageFromQueue

      public boolean removeOutgoingMessageFromQueue(RockBlockOutgoingMessage messageToRemove)
      Remove a message from the outgoing queue. Note that this method is passed the RockBlockOutgoingMessage object to remove from the datablock, not simply the text contained in the message. This method also removes the message from the database.
      Parameters:
      messageToRemove - The RockBlockOutgoingMessage to remove
      Returns:
      true if successful, false if it failed
    • closeComms

      public void closeComms()
      Close the communications channel
    • getStatus

      public ModuleStatus getStatus()
      Specified by:
      getStatus in interface ModuleStatusManager
    • clearIncomingBuffer

      public void clearIncomingBuffer()
      Clear the incoming (MT) buffer
    • clearOutgoingBuffer

      public void clearOutgoingBuffer()
      Clear the outgoing (MO) buffer
    • clearBothBuffers

      public void clearBothBuffers()
      Clear both incoming and outgoing buffers
    • pamStart

      public void pamStart()
      Description copied from class: PamProcess
      Called for each process to tell it to start (may not be necessary for processes which are listening for data anyway).
      Specified by:
      pamStart in class PamProcess
    • pamStop

      public void pamStop()
      Description copied from class: PamProcess
      Stops the process.
      Specified by:
      pamStop in class PamProcess
    • getOutgoingMessages

      public RockBlockOutgoingDataBlock getOutgoingMessages()
      Returns:
      the outgoingMessages
    • getIncomingMessages

      public RockBlockDataBlock<RockBlockIncomingMessage> getIncomingMessages()
      Returns:
      the incomingMessages