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
 
- 
Field Summary
Fields inherited from class PamguardMVC.PamProcess
outputDataBlocks, parentDataBlock, processName, sampleRate - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidaddOutgoingMessageToQueue(String textMessage) Adds a new String object to the outgoing messages queue.voidTell the RockBlock+ to check the signal strength.voidClear both incoming and outgoing buffersvoidClear the incoming (MT) buffervoidClear the outgoing (MO) buffervoidClose the communications channelGet the RockBlock status objectbooleanReturn the commReady boolean, indicating whether or not we've successfully established communications with the RockBlockintReturns the signal strength of the last signal check.voidpamStart()Called for each process to tell it to start (may not be necessary for processes which are listening for data anyway).voidpamStop()Stops the process.booleanremoveOutgoingMessageFromQueue(RockBlockOutgoingMessage messageToRemove) Remove a message from the outgoing queue.voidClose 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:
 getStatusin 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:PamProcessCalled for each process to tell it to start (may not be necessary for processes which are listening for data anyway).- Specified by:
 pamStartin classPamProcess
 - 
pamStop
public void pamStop()Description copied from class:PamProcessStops the process.- Specified by:
 pamStopin classPamProcess
 - 
getOutgoingMessages
- Returns:
 - the outgoingMessages
 
 - 
getIncomingMessages
- Returns:
 - the incomingMessages
 
 
 -