wonderly.jeaprs.aprs
Class HamHud

java.lang.Object
  |
  +--wonderly.jeaprs.ClientImpl
        |
        +--wonderly.jeaprs.aprs.HamHud
All Implemented Interfaces:
Client

public class HamHud
extends ClientImpl


Field Summary
static int BEACMENU_LEN
           
static int BLK_CURSOR_ON
           
static int BPBTN2
           
static int CSR_MYSPDHDG
           
static int CURSOR_OFF
           
static int DIGICNT_MAX
           
static int DIGID
           
static int EE_BEACON_CTL
           
static int EE_BEACON_FAST
           
static int EE_BEACON_HIGH_SPD
           
static int EE_BEACON_LOW_SPD
           
static int EE_BEACON_STOP
           
static int EE_BLT_ICON_1
           
static int EE_BLT_PATH_1
           
static int EE_BRIGHT
           
static int EE_CHK
           
static int EE_CONTRAST
           
static int EE_LAT
           
static int EE_LINE2
           
static int EE_LON
           
static int EE_MSG_TABLE
           
static int EE_MYCALL
           
static int EE_NUM_MSGS
           
static int EE_SB
           
static int EE_SB_END
           
static int EE_TURNMIN
           
static int EE_TURNSLOPE
           
static int EE_TURNTIME
           
static int EXT_EE
           
static int GOTO_LINE1
           
static int GOTO_LINE2
           
static int GOTO_LINE3
           
static int GOTO_LINE4
           
static int GPSQLEN
           
static int IGATED
           
static int INT_EE
           
static int INT_FLASH
           
static int L2MENU_LEN
           
static int LATX
           
static int LCD_CLEAR
           
static int LCD_E
           
static int LCD_RS
           
static int LED1
           
static int LED2
           
static int LN2_MISC
           
static int LN2_PATH
           
static int LN2_POS
           
static int LN2_SB
           
static int LONX
           
static int MENU_LEN
           
static int MSG_REPEAT
           
static int msgdelay
           
static int MYCALL_STARTLINE
           
static int MYPOS
           
static int OTHERS_STARTLINE
           
static int PUTCH_BOTH
           
static int PUTCH_LCD
           
static int PUTCH_UART
           
static int RTS
           
static int RXPOS
           
static int SBUFLEN
           
static int scroll_delay
           
static int SERIAL_TMO
           
static int TEMPERATURE_UNIT
           
static int TICKS_PER_SEC
           
static int TMR0_RELOAD
           
static int UI_BUTTON
           
static int UNL_CURSOR_ON
           
 
Fields inherited from class wonderly.jeaprs.ClientImpl
actions, APRS, dirty, evLis, ins, me, name, outs, stopped, strmLis
 
Constructor Summary
HamHud()
           
 
Method Summary
 void buildActions()
          Put code in here to register all of the actions that you want to use.
 javax.swing.JPanel buildPanel(javax.swing.JFrame parent)
          Builds the applications user interface.
 wonderly.jeaprs.aprs.packet.APRSEventListener createEventListener()
          This method needs to be implemented by subclasses and should return an APRSEventListener implementation that is applicable for their client.
 java.io.OutputStream createStreamListener()
          This method needs to be implemented by subclasses and should return an OutputStream implementation that is applicable for their client.
 void init(wonderly.jeaprs.aprs.JLCDDisplay l, wonderly.jeaprs.aprs.JWhizWheel wh)
           
 void savePacket(wonderly.jeaprs.aprs.packet.APRSPacket pkt)
           
 void stop()
          Stops the client when the user closes the window or deactivates it via the menus
 java.lang.String toString()
          Returns name of Client for display in lists
 
Methods inherited from class wonderly.jeaprs.ClientImpl
addAPRSEventGenerator, addAPRSOutputStream, buildMenu, getAction, getAPRSEventGenerators, getAPRSOutputStreams, getName, getUIFactory, isDirty, isInputUser, isOutputUser, removeAPRSEventGenerator, removeAPRSOutputStream, setDirty, setName, start, write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MSG_REPEAT

public static final int MSG_REPEAT
See Also:
Constant Field Values

TMR0_RELOAD

public static final int TMR0_RELOAD
See Also:
Constant Field Values

TICKS_PER_SEC

public static final int TICKS_PER_SEC
See Also:
Constant Field Values

SERIAL_TMO

public static final int SERIAL_TMO
See Also:
Constant Field Values

SBUFLEN

public static final int SBUFLEN
See Also:
Constant Field Values

DIGID

public static final int DIGID
See Also:
Constant Field Values

IGATED

public static final int IGATED
See Also:
Constant Field Values

msgdelay

public static final int msgdelay
See Also:
Constant Field Values

scroll_delay

public static final int scroll_delay
See Also:
Constant Field Values

MYPOS

public static final int MYPOS
See Also:
Constant Field Values

RXPOS

public static final int RXPOS
See Also:
Constant Field Values

GPSQLEN

public static final int GPSQLEN
See Also:
Constant Field Values

LED2

public static final int LED2
See Also:
Constant Field Values

LCD_RS

public static final int LCD_RS
See Also:
Constant Field Values

LCD_E

public static final int LCD_E
See Also:
Constant Field Values

LED1

public static final int LED1
See Also:
Constant Field Values

BPBTN2

public static final int BPBTN2
See Also:
Constant Field Values

RTS

public static final int RTS
See Also:
Constant Field Values

UI_BUTTON

public static final int UI_BUTTON
See Also:
Constant Field Values

LCD_CLEAR

public static final int LCD_CLEAR
See Also:
Constant Field Values

BLK_CURSOR_ON

public static final int BLK_CURSOR_ON
See Also:
Constant Field Values

UNL_CURSOR_ON

public static final int UNL_CURSOR_ON
See Also:
Constant Field Values

CURSOR_OFF

public static final int CURSOR_OFF
See Also:
Constant Field Values

GOTO_LINE1

public static final int GOTO_LINE1
See Also:
Constant Field Values

GOTO_LINE2

public static final int GOTO_LINE2
See Also:
Constant Field Values

GOTO_LINE3

public static final int GOTO_LINE3
See Also:
Constant Field Values

GOTO_LINE4

public static final int GOTO_LINE4
See Also:
Constant Field Values

DIGICNT_MAX

public static final int DIGICNT_MAX
See Also:
Constant Field Values

CSR_MYSPDHDG

public static final int CSR_MYSPDHDG
See Also:
Constant Field Values

MYCALL_STARTLINE

public static final int MYCALL_STARTLINE
See Also:
Constant Field Values

OTHERS_STARTLINE

public static final int OTHERS_STARTLINE
See Also:
Constant Field Values

PUTCH_LCD

public static final int PUTCH_LCD
See Also:
Constant Field Values

PUTCH_UART

public static final int PUTCH_UART
See Also:
Constant Field Values

PUTCH_BOTH

public static final int PUTCH_BOTH
See Also:
Constant Field Values

TEMPERATURE_UNIT

public static final int TEMPERATURE_UNIT
See Also:
Constant Field Values

INT_EE

public static final int INT_EE
See Also:
Constant Field Values

EXT_EE

public static final int EXT_EE
See Also:
Constant Field Values

INT_FLASH

public static final int INT_FLASH
See Also:
Constant Field Values

EE_CHK

public static final int EE_CHK
See Also:
Constant Field Values

EE_CONTRAST

public static final int EE_CONTRAST
See Also:
Constant Field Values

EE_BRIGHT

public static final int EE_BRIGHT
See Also:
Constant Field Values

EE_LINE2

public static final int EE_LINE2
See Also:
Constant Field Values

EE_BEACON_CTL

public static final int EE_BEACON_CTL
See Also:
Constant Field Values

EE_BLT_ICON_1

public static final int EE_BLT_ICON_1
See Also:
Constant Field Values

EE_BLT_PATH_1

public static final int EE_BLT_PATH_1
See Also:
Constant Field Values

EE_LAT

public static final int EE_LAT
See Also:
Constant Field Values

EE_LON

public static final int EE_LON
See Also:
Constant Field Values

EE_SB

public static final int EE_SB
See Also:
Constant Field Values

EE_TURNMIN

public static final int EE_TURNMIN
See Also:
Constant Field Values

EE_TURNSLOPE

public static final int EE_TURNSLOPE
See Also:
Constant Field Values

EE_TURNTIME

public static final int EE_TURNTIME
See Also:
Constant Field Values

EE_BEACON_FAST

public static final int EE_BEACON_FAST
See Also:
Constant Field Values

EE_BEACON_STOP

public static final int EE_BEACON_STOP
See Also:
Constant Field Values

EE_BEACON_LOW_SPD

public static final int EE_BEACON_LOW_SPD
See Also:
Constant Field Values

EE_BEACON_HIGH_SPD

public static final int EE_BEACON_HIGH_SPD
See Also:
Constant Field Values

EE_SB_END

public static final int EE_SB_END
See Also:
Constant Field Values

EE_MYCALL

public static final int EE_MYCALL
See Also:
Constant Field Values

EE_NUM_MSGS

public static final int EE_NUM_MSGS
See Also:
Constant Field Values

EE_MSG_TABLE

public static final int EE_MSG_TABLE
See Also:
Constant Field Values

MENU_LEN

public static final int MENU_LEN
See Also:
Constant Field Values

L2MENU_LEN

public static final int L2MENU_LEN
See Also:
Constant Field Values

BEACMENU_LEN

public static final int BEACMENU_LEN
See Also:
Constant Field Values

LN2_PATH

public static final int LN2_PATH
See Also:
Constant Field Values

LN2_POS

public static final int LN2_POS
See Also:
Constant Field Values

LN2_MISC

public static final int LN2_MISC
See Also:
Constant Field Values

LN2_SB

public static final int LN2_SB
See Also:
Constant Field Values

LATX

public static final int LATX
See Also:
Constant Field Values

LONX

public static final int LONX
See Also:
Constant Field Values
Constructor Detail

HamHud

public HamHud()
       throws java.io.IOException
Method Detail

createEventListener

public wonderly.jeaprs.aprs.packet.APRSEventListener createEventListener()
Description copied from class: ClientImpl
This method needs to be implemented by subclasses and should return an APRSEventListener implementation that is applicable for their client. Many times, a simple inner class is all that is needed as in.
  return new APRSEventAdapter() {
		public void message( APRSPacket pkt, APRSMessage msg ) {
			// Do something with message
		}
	};
	
This will create a new object that is an instance of the APRSEventAdapter class. That class implements the APRSEventListener interface with empty methods so that you can just override the methods that you want APRS packets for, and not have to deal with implementing all methods. Just return null here if you don't need an event listener.

Specified by:
createEventListener in class ClientImpl
See Also:
APRSEventAdapter, APRSEventListener

createStreamListener

public java.io.OutputStream createStreamListener()
Description copied from class: ClientImpl
This method needs to be implemented by subclasses and should return an OutputStream implementation that is applicable for their client. This stream will be written to as data comes through a TNC implementatation, receiving copies of the text lines received by the TNC implementation. A simple mechanism is typically to use a thread and a PipedInputStream and PipedOutputStream pair to receive the data and process it. Just return null if you don't need raw stream events.
	public OutputStream createStreamListener() throws IOException {
		final PipedOutputStream pipe = new PipedOutputStream();
		final PipedInputStream is = new PipedInputStream(pipe);
		new Thread("TNC Stream listener") {
			public void run() {
				try {
					BufferedReader rd = new BufferedReader( new InputStreamReader(is) );
					String str;
					while( (str = rd.readLine()) != null ) {
						System.out.println( "Got TNC line: "+str );
					}
					System.out.println("End of TNC Stream, exiting");
				} finally {
					try {
						is.close();
						pipe.close();
					} catch( Exception ex ) {
						JeAPRS.getUI().reportException(ex);
					}
				}
			}
		}.start();
		return pipe;
	}
	

Specified by:
createStreamListener in class ClientImpl

buildActions

public void buildActions()
Description copied from class: ClientImpl
Put code in here to register all of the actions that you want to use.
                actions.put(  "MyAction", act = new AbstractAction( "MyAction" ) {
                        public void actionPerformed( ActionEvent ev ) {
                                //...do something here
                        }
                });
                act.putValue( Action.NAME, "MyAction" );
 

Specified by:
buildActions in class ClientImpl
See Also:
ClientImpl.getAction(String)

buildPanel

public javax.swing.JPanel buildPanel(javax.swing.JFrame parent)
Description copied from class: ClientImpl
Builds the applications user interface. The returned panel should contain all of the controls needed to provide the user with convienent access to the features of this client/module, except for a menu bar. The buildMenu() method can be used to create a menu bar if neededed.

Specified by:
buildPanel in class ClientImpl
See Also:
ClientImpl.buildMenu()

init

public void init(wonderly.jeaprs.aprs.JLCDDisplay l,
                 wonderly.jeaprs.aprs.JWhizWheel wh)
          throws java.io.IOException
java.io.IOException

stop

public void stop()
Description copied from class: ClientImpl
Stops the client when the user closes the window or deactivates it via the menus

Specified by:
stop in interface Client
Overrides:
stop in class ClientImpl

savePacket

public void savePacket(wonderly.jeaprs.aprs.packet.APRSPacket pkt)

toString

public java.lang.String toString()
Description copied from interface: Client
Returns name of Client for display in lists

Specified by:
toString in interface Client
Overrides:
toString in class ClientImpl
Returns:
the name of the client