public class OnlineHandler extends SendEvent implements SystemHandlerInterface, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static int |
ATTEMPT_ONLINE
ATTEMPT_ONLINE value is 2 matching E5 definition.
|
static int |
DEFAULT_INITIAL_STATE
The default initial state.
|
static int |
EQUIPMENT_OFFLINE
EQUIPMENT_OFFLINE value is 1 matching E5 definition.
|
static int |
HOST_OFFLINE
HOST_OFFLINE value is 3 matching E5 definition.
|
static int |
LOCAL_ONLINE
LOCAL_ONLINE value is 4 matching E5 definition.
|
static int |
MAX_STATE
MAX_STATE value is REMOTE_ONLINE
|
boolean |
permissiveLocalOnlineMessageVerification
if this flag is true, then all messages are permitted in local-online unless specifically excluded.
|
static int |
REMOTE_ONLINE
REMOTE_ONLINE value is 5 matching E5 definition.
|
equipmentName
cvsRev
Constructor and Description |
---|
OnlineHandler()
The default constructor.
|
OnlineHandler(java.lang.String equipmentName,
int initialState)
Creates the handler with the specified initial state.
|
Modifier and Type | Method and Description |
---|---|
void |
addStateChangeNotifier(StateChangeNotification notifier)
Object added will recieve notification of state changes.
|
void |
allowUnsafeAndPossiblyDangerousViolationsOfTheGEMControlStateModel(boolean flag)
Enable unsafe and possibily dangerous violations of the GEM control state model.
|
void |
attemptOnlineAndWait()
This will return true if we are online...
|
boolean |
blockOnVerify(SecsMsg msg,
int state)
Returns false if the message verifiers exist and the message is acceptable
to the verifiers.
|
void |
changeState(int state)
This does not check if the transition is valid, it just goes into the new
state and sends an event.
|
void |
controlStateValueInput(ValueChangedEvent event)
This is the input to this component from the "ControlState" server.
|
void |
destroy()
Remove clean up the handler.
|
int |
getCurrentState()
This will return the current state.
|
int |
getDefaultOfflineState()
The control state will transition to this state if an attempt online fails.
|
java.lang.String |
getEquipmentName() |
boolean |
getLocal()
This will return if we consider ourselves in local state.
|
boolean |
getOnline()
Returns true if the state is one of the two online states.
|
void |
localRemoteStateValueInput(ValueChangedEvent event)
This is an input that can be used to control the current local/remote substate.
|
void |
onlineOfflineStateValueInput(ValueChangedEvent event)
This is an input that can be used to control the current online/offline state.
|
boolean |
processMessage(SecsTrigger msg)
All messages will go through here.
|
void |
registerCEID(SecsFormat3x5x controlStateChangedCEID,
SecsFormat3x5x equipmentOffLineCEID,
SecsFormat3x5x equipmentOnLineCEID,
SecsFormat3x5x controlStateLocalCEID,
SecsFormat3x5x controlStateRemoteCEID,
SecsFormat3x5x attemptOnlineCEID)
Sets the four CEIDs, that are associated with the state transitions.
|
void |
registerCEIDs()
Attempts to identify the CEIDs.
|
void |
registerIncomingMsg(int state,
java.lang.String msg,
MessageVerifier verifier)
All messages registered will be halted when the machine is in the state
provided.
|
void |
registerIncomingOnlineLocalMsg(java.lang.String msg,
MessageVerifier verifier)
All messages registered will be halted when the machine is in online-local
mode.
|
void |
registerOutgoingMsg(int state,
java.lang.String msg,
MessageVerifier verifier)
All messages registered will be halted when the machine is in the state
provided.
|
void |
registerOutgoingOnlineLocalMsg(java.lang.String msg,
MessageVerifier verifier)
All messages registered will be halted when the machine is in online-local
mode.
|
void |
removeStateChangeNotifier(StateChangeNotification notifier)
Removes an object that was recieving notification of state changes.
|
boolean |
S1F13(SecsMsg msg)
This will allow S1F13's to go through if offline.
|
boolean |
S1F14(SecsMsg msg)
This will allow the replys to a S1F14 to go through.
|
boolean |
S1F15(SecsMsg msg)
Request OFF-LINE.
|
boolean |
S1F17(SecsMsg msg)
Request ON-LINE.
|
boolean |
sendingAllowed(SecsMsg msg,
java.util.Map<java.lang.String,MessageVerifier> verifiers)
This will return true if the msg is allowed to be sent based on the verifiers.
|
void |
sendSxF0(SecsMsg msg)
Send the SxF0 message.
|
void |
setDefaultOfflineState(int defaultOfflineState)
The control state will transition to this state if an attempt online fails.
|
void |
setEquipmentName(java.lang.String equipmentName) |
void |
setLocal()
This will change to local state.
|
void |
setLocal(boolean local)
This will change to local or remote (true or false);
|
void |
setOnline(boolean newValue)
This will set the system online or equipment offline.
|
void |
setRemote()
This will change to remote state.
|
java.lang.String |
toString() |
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 ATTEMPT_ONLINE
public static final int DEFAULT_INITIAL_STATE
public static final int EQUIPMENT_OFFLINE
public static final int HOST_OFFLINE
public static final int LOCAL_ONLINE
public static final int MAX_STATE
public boolean permissiveLocalOnlineMessageVerification
public static final int REMOTE_ONLINE
public OnlineHandler()
public OnlineHandler(java.lang.String equipmentName, int initialState)
public void addStateChangeNotifier(StateChangeNotification notifier)
public void allowUnsafeAndPossiblyDangerousViolationsOfTheGEMControlStateModel(boolean flag)
flag
- set to true to enable unsafe and possibly dangerous violations of the GEM control state model.public void attemptOnlineAndWait() throws SecsException
SecsException
public boolean blockOnVerify(SecsMsg msg, int state)
public void changeState(int state) throws DeclinedStateChangeException
DeclinedStateChangeException
- thrown if the state change is rejectedpublic void controlStateValueInput(ValueChangedEvent event) throws VIBUpdateFailedException
VIBUpdateFailedException
public void destroy()
public int getCurrentState()
public int getDefaultOfflineState()
public java.lang.String getEquipmentName()
public boolean getLocal()
public boolean getOnline()
public void localRemoteStateValueInput(ValueChangedEvent event) throws VIBUpdateFailedException
VIBUpdateFailedException
public void onlineOfflineStateValueInput(ValueChangedEvent event) throws VIBUpdateFailedException
VIBUpdateFailedException
public boolean processMessage(SecsTrigger msg)
public void registerCEID(SecsFormat3x5x controlStateChangedCEID, SecsFormat3x5x equipmentOffLineCEID, SecsFormat3x5x equipmentOnLineCEID, SecsFormat3x5x controlStateLocalCEID, SecsFormat3x5x controlStateRemoteCEID, SecsFormat3x5x attemptOnlineCEID)
public void registerCEIDs()
public void registerIncomingMsg(int state, java.lang.String msg, MessageVerifier verifier)
state
- a value between EQUIPMENT_OFFLINE and REMOTE_ONLINEmsg
- a string representation of the message in SxFy format (case sensitive)verifier
- a message verifier, probably MessageVerifier.getDefault();public void registerIncomingOnlineLocalMsg(java.lang.String msg, MessageVerifier verifier)
public void registerOutgoingMsg(int state, java.lang.String msg, MessageVerifier verifier)
state
- a value between EQUIPMENT_OFFLINE and REMOTE_ONLINEmsg
- a string representation of the message in SxFy format (case sensitive)verifier
- a message verifier, probably MessageVerifier.getDefault();public void registerOutgoingOnlineLocalMsg(java.lang.String msg, MessageVerifier verifier)
public void removeStateChangeNotifier(StateChangeNotification notifier)
public boolean S1F13(SecsMsg msg)
public boolean S1F14(SecsMsg msg)
public boolean S1F15(SecsMsg msg)
public boolean S1F17(SecsMsg msg)
public boolean sendingAllowed(SecsMsg msg, java.util.Map<java.lang.String,MessageVerifier> verifiers)
public void sendSxF0(SecsMsg msg)
public void setDefaultOfflineState(int defaultOfflineState)
defaultOfflineState
- the default offline statepublic void setEquipmentName(java.lang.String equipmentName)
equipmentName
- The equipmentName to set.public void setLocal()
public void setLocal(boolean local) throws VIBUpdateFailedException
VIBUpdateFailedException
public void setOnline(boolean newValue) throws DeclinedStateChangeException
DeclinedStateChangeException
public void setRemote()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean verifyMessage(SecsMsg msg) throws SecsException
verifyMessage
in interface SystemHandlerInterface
SecsException
Copyright © 1999-2025 ErgoTech Systems, Inc. All Rights Reserved.