Package rockBlock
Class RockBlockProcess2
java.lang.Object
PamguardMVC.PamProcess
rockBlock.RockBlockProcess2
- All Implemented Interfaces:
ModuleStatusManager
,PamObserver
,ProcessAnnotator
This version of RockBlockProcess uses the jSerialComm library instead of RXTX
- Author:
- mo55
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addOutgoingMessageToQueue
(String textMessage) Adds a new String object to the outgoing messages queue.void
Tell the RockBlock+ to check the signal strength.void
Clear both incoming and outgoing buffersvoid
Clear the incoming (MT) buffervoid
Clear the outgoing (MO) buffervoid
Close the communications channelGet the RockBlock status objectboolean
Return the commReady boolean, indicating whether or not we've successfully established communications with the RockBlockint
Returns the signal strength of the last signal check.void
pamStart()
Called for each process to tell it to start (may not be necessary for processes which are listening for data anyway).void
pamStop()
Stops the process.boolean
removeOutgoingMessageFromQueue
(RockBlockOutgoingMessage messageToRemove) Remove a message from the outgoing queue.void
Close the current serial port object and try to create a new oneMethods inherited from class PamguardMVC.PamProcess
absMillisecondsToSamples, absSamplesToMilliseconds, addData, addMultiPlexDataBlock, addOutputDataBlock, changedThreading, clearOldData, createAnnotations, destroyProcess, dumpBufferStatus, flushDataBlockBuffers, getAncestorDataBlock, getAnnotation, getChainPosition, getCompatibleDataUnits, getCpuPercent, getFrequencyRange, getLastSourceNotificationObject, getLastSourceNotificationType, getMuiltiplexDataBlock, getNumAnnotations, getNumMuiltiplexDataBlocks, getNumOutputDataBlocks, getObserverName, getObserverObject, getOfflineData, getOfflineData, getOutputDataBlock, getOutputDataBlocks, getPamControlledUnit, getParentDataBlock, getParentDataBlocks, getParentProcess, getProcessCheck, getProcessName, getRawSourceDataBlock, getRawSourceDataBlock, getRequiredDataHistory, getSampleRate, getSourceDataBlock, getSourceProcess, hasOutputDatablock, isCanMultiThread, isExternalProcess, isMultiplex, makePamProcess, masterClockUpdate, newData, noteNewSettings, notifyModelChanged, prepareProcess, prepareProcessOK, processNewBuoyData, receiveSourceNotification, relMillisecondsToSamples, relSamplesToMilliseconds, removeAllDataBlocks, removeAllMultiPlexDataBlocks, removeMultiPlexDataBlock, removeObservable, removeOutputDatablock, resetDataBlocks, saveViewerData, setCanMultiThread, setExternalProcess, setMultiplex, setParentDataBlock, setParentDataBlock, setProcessCheck, setProcessName, setSampleRate, setupProcess, toString, updateData
-
Constructor Details
-
RockBlockProcess2
- 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
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
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
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
- Specified by:
getStatus
in interfaceModuleStatusManager
-
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 classPamProcess
-
pamStop
public void pamStop()Description copied from class:PamProcess
Stops the process.- Specified by:
pamStop
in classPamProcess
-
getOutgoingMessages
- Returns:
- the outgoingMessages
-
getIncomingMessages
- Returns:
- the incomingMessages
-