public class NetLogger extends java.lang.Object implements LoggerInterface, SecsEventListener, java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
cvsRev |
Constructor and Description |
---|
NetLogger(java.lang.String receiveString,
java.lang.String sendString,
int port) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
displayBytes(byte[] data) |
boolean |
getDisplayBytes() |
boolean |
getDisplayMessages() |
void |
log(java.lang.String msg)
Send the given string to the listening ports.
|
static void |
main(java.lang.String[] args)
Used for debugging only.
|
void |
received(byte[] data)
This will be called wheneever raw bytes of data are read from the port.
|
void |
received(SecsMsg msg)
Called whenever a message is received.
|
void |
register() |
void |
register(SecsEventHandler theHandler) |
void |
registerForId(int id) |
void |
registerForId(SecsEventHandler theHandler,
int id) |
void |
run()
runs the server and waits for input on the selected port.
|
void |
secsEvent(SecsEvent theEvent)
This method will be called when a SecsEvent accurs.
|
void |
sent(byte[] data)
Called whenever data is sent through the port.
|
void |
sent(SecsMsg msg)
Called whenever a message is sent.
|
void |
setDisplayBytes(boolean newValue)
This allows the logger to control the display of byte data.
|
void |
setDisplayEvents(boolean newValue)
This method will turn on the display of all events.
|
void |
setDisplayMessages(boolean newValue)
This allows the logger to control the display of message data.
|
public static final java.lang.String cvsRev
public NetLogger(java.lang.String receiveString, java.lang.String sendString, int port)
public java.lang.String displayBytes(byte[] data)
public boolean getDisplayBytes()
public boolean getDisplayMessages()
public void log(java.lang.String msg)
public static void main(java.lang.String[] args)
public void received(byte[] data)
LoggerInterface
received
in interface LoggerInterface
public void received(SecsMsg msg)
LoggerInterface
received
in interface LoggerInterface
public void register()
public void register(SecsEventHandler theHandler)
public void registerForId(int id)
public void registerForId(SecsEventHandler theHandler, int id)
public void run()
run
in interface java.lang.Runnable
public void secsEvent(SecsEvent theEvent)
SecsEventListener
secsEvent
in interface SecsEventListener
public void sent(byte[] data)
LoggerInterface
sent
in interface LoggerInterface
public void sent(SecsMsg msg)
LoggerInterface
sent
in interface LoggerInterface
public void setDisplayBytes(boolean newValue)
LoggerInterface
setDisplayBytes
in interface LoggerInterface
public void setDisplayEvents(boolean newValue)
setDisplayEvents
in interface LoggerInterface
public void setDisplayMessages(boolean newValue)
LoggerInterface
setDisplayMessages
in interface LoggerInterface
Copyright © 1999-2025 ErgoTech Systems, Inc. All Rights Reserved.