public class CommunicationsHandler extends SendEvent implements SystemHandlerInterface, SecsEventListener, MessageResponseInterface, java.lang.Runnable, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static int |
COMMUNICATING
Constant COMMUNICATING.
|
static int |
DISABLED
Constant DISABLED.
|
static int |
EQUIPMENT_INITIATED_CONNECT
Constant EQUIPMENT_INITIATED_CONNECT.
|
static int |
EQUIPMENT_INITIATED_CONNECT_WAIT_CRA
Constant EQUIPMENT_INITIATED_CONNECT_WAIT_CRA.
|
static int |
EQUIPMENT_INITIATED_CONNECT_WAIT_DELAY
Constant EQUIPMENT_INITIATED_CONNECT_WAIT_DELAY.
|
static int |
HOST_INITIATED_CONNECT
Constant HOST_INITIATED_CONNECT.
|
static int |
initialState
The initial state NOT_COMMUNICATING.
|
static int |
MAX_STATE
Constant MAX_STATE (COMMUNICATING).
|
static int |
NOT_COMMUNICATING
Constant NOT_COMMUNICATING.
|
static int |
WAIT_CR_FROM_HOST
Constant WAIT_CR_FROM_HOST.
|
equipmentName
cvsRev
cvsRev
cvsRev
Constructor and Description |
---|
CommunicationsHandler()
General Constructor.
|
CommunicationsHandler(java.lang.String equipmentName)
General Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addStateChangeNotifier(StateChangeNotification notifier)
Object added will recieve notification of state changes.
|
void |
changeState(int state)
Changes the state to the specified state.
|
void |
commDelayTracker(int commDelayVal)
This method tracks changes to "EstablishCommunicationsTimeout" and will start the thread
if the delay is non-zero and the thread is not already running.
|
void |
commDelayTracker(ValueChangedEvent e)
This method tracks changes to "EstablishCommunicationsTimeout" and will start the thread
if the delay is non-zero and the thread is not already running.
|
void |
destroy()
Remove all listeners and clean up the connection manager.
|
int |
getCurrentState()
This will return the current state of the machine.
|
java.lang.String |
getEquipmentName() |
boolean |
isEnabled()
This will return true if we are enabled.
|
boolean |
processMessage(SecsTrigger msg)
this method will make sure that we will not forward any messages if we are
DISABLEDS or NOT_COMMUNICATING.
|
void |
removeStateChangeNotifier(StateChangeNotification notifier)
Removes an object that was recieving notification of state changes.
|
boolean |
responseReceived(int status,
SecsMsg primary,
SecsMsg response)
This method receives the response to the S1F13 sent out in "Not Communicating"
and will change the state to "Wait Delay" if appropriate.
|
void |
run()
Send S1F13 until we are no long in "ATTEMPT_ONLINE" state.
|
void |
secsEvent(SecsEvent e)
This will receive a PORT_ERROR.
|
void |
setEnabled(boolean newValue)
This will set our state to enabled or disabled (based on newValue).
|
void |
setEquipmentName(java.lang.String equipmentName) |
boolean |
verifyMessage(SecsMsg msg)
This checks outgoing messages to make sure that we allow them to go out.
|
addClockAsDVVAL, equals, getAllExtendedAttributes, getExtendedAttribute, hashCode, sendEvent, setAlarm, setExtendedAttribute
public static final int COMMUNICATING
public static final int DISABLED
public static final int EQUIPMENT_INITIATED_CONNECT
public static final int EQUIPMENT_INITIATED_CONNECT_WAIT_CRA
public static final int EQUIPMENT_INITIATED_CONNECT_WAIT_DELAY
public static final int HOST_INITIATED_CONNECT
public static int initialState
public static final int MAX_STATE
public static final int NOT_COMMUNICATING
public static final int WAIT_CR_FROM_HOST
public CommunicationsHandler()
public CommunicationsHandler(java.lang.String equipmentName)
public void addStateChangeNotifier(StateChangeNotification notifier)
public void changeState(int state) throws DeclinedStateChangeException
DeclinedStateChangeException
- thrown if the state change is rejectedpublic void commDelayTracker(int commDelayVal)
public void commDelayTracker(ValueChangedEvent e)
public void destroy()
public int getCurrentState()
public java.lang.String getEquipmentName()
public boolean isEnabled()
public boolean processMessage(SecsTrigger msg)
public void removeStateChangeNotifier(StateChangeNotification notifier)
public boolean responseReceived(int status, SecsMsg primary, SecsMsg response)
responseReceived
in interface MessageResponseInterface
public void run()
run
in interface java.lang.Runnable
public void secsEvent(SecsEvent e)
secsEvent
in interface SecsEventListener
public void setEnabled(boolean newValue)
public void setEquipmentName(java.lang.String equipmentName)
equipmentName
- The equipmentName to set.public boolean verifyMessage(SecsMsg msg) throws SecsException
verifyMessage
in interface SystemHandlerInterface
SecsException
Copyright © 1999-2025 ErgoTech Systems, Inc. All Rights Reserved.