dea.hc.jds
Class EchoProcessor

java.lang.Object
  extended bydea.hc.jds.EchoProcessor
All Implemented Interfaces:
IDebugLevels, java.lang.Runnable

public class EchoProcessor
extends java.lang.Object
implements java.lang.Runnable, IDebugLevels

Title: Echo Processor
Description: Class for logging echoes from the Time Commander to the DB and optionally queuing up non echoes in a local buffer
Copyright: Copyright (c) 2005
Company: RMRR

@author David Abigt
@version 1.0


Field Summary
 
Fields inherited from interface dea.common.IDebugLevels
BASIC, DEBUG_ALL, ERROR, METH_DETAIL, METH_ENTER, METH_EXIT, METH_EXT, METH_GET, METH_SET, METH_VARS, SHOW_PASS
 
Constructor Summary
EchoProcessor(TCPRead newTcpr)
          get last known bit mapped values from DB and store pointer to TCPRead object
 
Method Summary
static java.lang.String bmToInt(int cur, int base, int last)
          There should be only one change per echo
 boolean decodeEcho(java.lang.String str)
          Decode an echoed command.
static java.lang.String decodeIO(char c)
           
 java.lang.String getMsg()
          Read the entire message queue back as a string and clear queue.
 boolean isQueueMsgs()
           
 boolean isRunning()
           
static void main(java.lang.String[] args)
          Can be used to log echos from a Time Commander but mainly for testing
 ReadQueueObject popQueueHead()
          get first line from message queue
synchronized on lock
 void run()
          Thread entry point.
 void setQueueMsgs(boolean queueMsgs)
           
 void setRunning(boolean running)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EchoProcessor

public EchoProcessor(TCPRead newTcpr)
get last known bit mapped values from DB and store pointer to TCPRead object

Parameters:
newTcpr -
Method Detail

isRunning

public boolean isRunning()

setRunning

public void setRunning(boolean running)

isQueueMsgs

public boolean isQueueMsgs()

setQueueMsgs

public void setQueueMsgs(boolean queueMsgs)

getMsg

public java.lang.String getMsg()
Read the entire message queue back as a string and clear queue.
synchronized on lock

Returns:
String created from the message queue

popQueueHead

public ReadQueueObject popQueueHead()
get first line from message queue
synchronized on lock

Returns:
the top object from the queue

run

public void run()
Thread entry point.
Reads data from port interface thread (TCPRead), logs echos to DB and stores other messages to local queue for other classes to pull from.
queue addes synchronized on lock

Specified by:
run in interface java.lang.Runnable

decodeEcho

public boolean decodeEcho(java.lang.String str)
Decode an echoed command.
The format of the echoed command is:

!!mm/ddttttttjklm[cr]
0-1 = is echo
2-12 = date

as in:
!!03/240336980064 // C1 received
!!03/2403369801C4 // C-OFF received
!!03/240336980833 // P-16 transmitted
!!03/240336980923 // P-DIM transmitted
!!02/09074109c040 // DI-15 ON
!!02/09074109c000 // DI-15 OFF

Parameters:
str -

decodeIO

public static java.lang.String decodeIO(char c)

bmToInt

public static java.lang.String bmToInt(int cur,
                                       int base,
                                       int last)
There should be only one change per echo

Parameters:
cur -
base -
last -
Returns:
String in the format base + i + On or OFF

main

public static void main(java.lang.String[] args)
Can be used to log echos from a Time Commander but mainly for testing

Parameters:
args -


Copyright © 2001-2005 Round Mountain Rescue Ranch. All Rights Reserved.