public class TransSecsController
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
TransSecsController.ResponseWrapper
Register with the message bean and then calls the messageReceived.
|
Modifier and Type | Field and Description |
---|---|
static int |
ACTIVE_PORT
The host port.
|
static java.util.HashMap<VIBMessageBean,com.ergotech.transsecs.secs.InstanceStorage> |
allInstances
The hashtable of instances.
|
ConnectionConfig |
connectionConfig
A convenient place for subclasses to save this if they need it.
|
static java.lang.String |
csvFolder
The folder in which optional CSV files are stored.
|
static int |
debugLevel
The debug level for this object.
|
static int |
DEFAULT_TRANSSECS_APPLICATION
Application types.
|
static java.lang.Object |
defaultMessageHandler
The default message handler to use.
|
static int |
DEVICES_CLIENT_TRANSSECS_APPLICATION
Application types.
|
static int |
FILE_RECIPE_MANAGER
File Recipe Manager type.
|
static boolean |
invertHostOrEquipmentConnection
Set to true if want to simulate the equipment from files generated for the
host or the host if generated for the equipment.
|
VIBMessageBean |
lastProcessed
The last message that was processed.
|
static int |
PASSIVE_PORT
The equipment port.
|
static boolean |
passThroughGlobal
True if the application is configured as a pass-through application.
|
BroadcastServer |
recipeBaseDir
This server is used by a FileRecipeManager to set the base directory of the
file.
|
BroadcastServer |
recipeFileExtension
This server is used by a FileRecipeManager to set the extension of the file.
|
RecipeManagerInterface |
recipeManager
This is the recipe manager for this controller.
|
static int |
recipeManagerType
This is the recipe manager type.
|
static TestPanelInterface |
testPanel
The test panel.
|
static int |
transSecsApplicationType
Provides a type for the transecs application.
|
Constructor and Description |
---|
TransSecsController()
The bean constructor so that this bean can be used in development systems.
|
Modifier and Type | Method and Description |
---|---|
void |
addALID(long alid,
java.lang.String alidName,
java.lang.String altx,
int alcd,
long setCEID,
long clearCEID,
java.lang.Object source)
The register method for ALIDs.
|
void |
addALID(long alid,
java.lang.String alidName,
java.lang.String altx,
int alcd,
long setCEID,
long clearCEID,
java.lang.Object source,
java.util.List<SecsFormat> dvids)
The register method for ALIDs.
|
void |
addALIDsFromCSV(java.io.File csvFile)
Parse a csv file of ALIDs.
|
void |
addCEID(long ceid,
java.lang.String name,
java.lang.Object source)
The register method for CEIDs.
|
void |
addCEID(long ceid,
java.lang.String name,
java.lang.Object source,
java.util.List<SecsFormat> dvids)
The register method for CEIDs.
|
void |
addCEIDsFromCSV(java.io.File csvFile)
Parse a csv file of CEIDs.
|
void |
addDependentEInterface(LifeCycle eInterface)
Add a dependent interface that will be lifecycled as part of this controller.
|
void |
addDVID(long svid,
java.lang.String name,
java.lang.String units,
double limitMax,
double limitMin,
java.lang.String initialValue,
int valueType,
double deadband,
long ceid,
java.lang.Object source)
The register method for DVIDs/DVNAMEs.
|
void |
addECID(long ecid,
java.lang.String name,
java.lang.String units,
double limitMax,
double limitMin,
java.lang.String initialValue,
int valueType,
double deadband,
long ceid,
java.lang.Object source)
The register method for ECIDs.
|
void |
addSVID(long svid,
java.lang.String name,
java.lang.String units,
double limitMax,
double limitMin,
java.lang.String initialValue,
int valueType,
double deadband,
long ceid,
java.lang.Object source)
The register method for SVIDs.
|
void |
addVID(long vid,
int idType,
java.lang.String name,
java.lang.String units,
double limitMax,
double limitMin,
java.lang.String initialValue,
int valueType,
double deadband,
long ceid,
java.lang.Object source)
The register method for VIDs.
|
void |
addVIDsFromCSV(java.io.File csvFile)
Parse a csv file of VIDs.
|
void |
connect(boolean sendingMessage)
Connect to the equipment or listen for a connection from the host.
|
static SecsFormat |
createDataId(int format)
Return a unique unsigned data id .
|
boolean |
createDevices()
Return true if the ReferencedDevices needs to be instantiated.
|
static SecsFormat3x5x |
createSecsFormat3x5x(int format,
long value)
Return the correct SecsFormat5x for the given type and value.
|
void |
destroy()
Destroy the component and destroy all the messages.
|
void |
disconnect()
Disconnects from all wrappers (active if present and passive).
|
void |
disconnectPassive()
Disconnect the passiveWrapper and generally clean up.
|
static TransSecsController |
findController(java.lang.String name)
Find a passiveWrapper for a given name.
|
double |
getActiveConnectionRetryInterval()
Frequency of connection attempt of all active connections.
|
VIDBean |
getAlids() |
java.util.List<VIBMessageBean> |
getAllMessages()
Returns a list of all messages
|
java.util.List<VIBMessageBean> |
getAutoResponseMessages()
Returns a list of messages to which we are expected to automatically respond.
|
int |
getBaudRate()
return the baud rate.
|
VIDBean |
getCeids() |
java.lang.String |
getClassPackage()
Returns the class package.
|
ConnectionConfig |
getConnectionConfig() |
java.lang.String |
getControllerName()
Returns the passive port name.
|
int |
getDeviceId()
Returns the device id for this equipment.
|
WrapperInterface |
getEquipmentWrapper()
Returns the only passiveWrapper we know about, the passive (equipment)
passiveWrapper.
|
boolean |
getGemCompliant()
Returns the gem compliant.
|
EquipmentControlInterface |
getGemHandler()
Returns the gem handler, or null if we are not gem compliant.
|
double |
getLinkTestInterval()
The current link test interval for all HSMS connections
|
int |
getLocalDebug()
Returns the local debug level.
|
LoggerInterface |
getLogger() |
VIBMessageBean |
getMatchingPrimary(SecsMsg msg)
Returns the VIBMessageBean matching the system bytes of the provided SecsMsg
or null if there is no matching message.
|
VIBMessageBean |
getMatchingResponse(SecsMsg msg)
Returns VIBMessageBean that represents the response to the SecsMsg provided
or null if no response can be found.
|
<T extends VIBMessageBean> |
getMessageBean(java.lang.String name) |
double |
getPassiveT1() |
double |
getPassiveT2() |
double |
getPassiveT3() |
double |
getPassiveT4() |
int |
getPassiveT5() |
int |
getPassiveT6() |
int |
getPassiveT7() |
int |
getPassiveT8() |
java.lang.String |
getPassiveToolTarget()
Returns the tool that will be the target.
|
java.lang.String |
getPersistenceFileName()
Return the file name for GEM persistence.
|
int |
getPort()
Returns the port that this object will use to listen for active connections.
|
SimulationListener |
getSimulationListener()
Return the simulation listener, creating if necessary.
|
static TransSecsController |
getSingleController()
Return the controller.
|
java.util.Map<java.lang.Integer,VIBMessageBean> |
getUnhandledPrimaries() |
VIDBean |
getVids() |
WrapperInterface |
getWrapper(int whichWrapper)
Returns a passiveWrapper for the give defined constant.
|
static java.lang.String |
getWrapperDescription(WrapperInterface wrapper)
Get the wrapper description.
|
boolean |
handleHandCraftedMessage(SecsMsg msg) |
void |
init()
Subclasses will fill in the data needed to make a connection.
|
boolean |
isAllowDuplicateSECSIMessages()
Returns true if the system bytes of the message do not need to be unique
(mis-implemented SECSI messages).
|
boolean |
isDigitalTwin() |
boolean |
isPassThrough() |
static boolean |
isS1F3ReturnsValues()
The return will be true if the S1F3 method should return the values rather
than the IDs.
|
static void |
logInfo(java.lang.String message)
Log4J log information about this component.
|
VIBMessageBean |
newInstance(java.lang.String className)
Returns a new instance of a class with the given name in the class package of
this controller.
|
void |
println(java.lang.String s)
Prints out the provided string.
|
boolean |
processMessage(SecsMsg msg,
int whichPort)
Iterate through the messages.
|
boolean |
processMessage(SecsMsg msg,
SessionManager toSessionManager)
Process the message and send it to the appropriate wrapper.
|
boolean |
processMessage(SecsTrigger msg)
Process the message.
|
static void |
publish(java.lang.String toolName,
java.lang.String tagName,
ValueObjectInterface value)
Publish a VIB value object.
|
void |
publish(java.lang.String tagName,
ValueObjectInterface value)
Publish a VIB value object.
|
void |
publishReport(SecsMsg incoming)
This will be called by a recieved report to publish all the VIDs.
|
boolean |
register()
This will attempt to register this EquipmentController as the
EquipmentController for its name.
|
void |
registerEventComponents(VIBMessageBean source)
This will register all the RPTIDs and VID associated with a report message.
|
boolean |
registerForReceiveNotification(java.lang.String messageName,
MessageNotifier messageReceivedInterface)
Register to be notified of the receipt of a specific message by name.
|
static void |
registerInstance(VIBMessageBean messageBean)
Register an instance of a VIBMessageBean.
|
void |
removeDependentEInterface(LifeCycle eInterface)
Remove a dependent interface
|
boolean |
sendResponse(VIBMessageBean msg,
SecsMsg incoming)
/** This method will send a response to a received message.
|
void |
setActiveConnectionRetryInterval(double activeConnectionRetryInterval)
Sets the frequency of connection attempt of all active connections.
|
void |
setAllowDuplicateSECSIMessages(boolean allowDuplicateSECSIMessages)
Set to true if the system bytes of the message do not need to be unique
(mis-implemented SECSI messages).
|
void |
setBaudRate(int baudRate)
set the baud rate.
|
void |
setClassPackage(java.lang.String classPackage)
Sets the class package name.
|
void |
setConnectionConfig(ConnectionConfig connectionConfig) |
void |
setControllerName(java.lang.String controllerName)
Sets the passive port name.
|
void |
setDeviceId(int deviceId)
Sets the device id for this equipment.
|
void |
setDigitalTwin(boolean digitalTwin) |
void |
setFileRecipeManagerExtension(java.lang.String ext) |
void |
setFileRecipeManagerPath(java.lang.String path) |
void |
setGemCompliant(boolean flag)
Sets the gem compliance.
|
void |
setLinkTestInterval(double linkTestInterval)
Sets a new link test interval for all HSMS connections
|
void |
setLocalDebug(int level)
Sets the local debug level.
|
void |
setLogger(LoggerInterface l) |
void |
setPassiveT1(double newValue) |
void |
setPassiveT2(double newValue) |
void |
setPassiveT3(double newValue) |
void |
setPassiveT4(double newValue) |
void |
setPassiveT5(int newValue) |
void |
setPassiveT6(int newValue) |
void |
setPassiveT7(int newValue) |
void |
setPassiveT8(int newValue) |
void |
setPassiveToolTarget(java.lang.String passiveToolTarget)
Sets the tool that will be the target.
|
void |
setPassiveWrapperClassName(java.lang.String passiveWrapperClassName)
Set the passive wrapper class name; only useful before connect is called
|
void |
setPassThrough(boolean passThrough) |
void |
setPersistenceFileName(java.lang.String persistenceFileName)
Set the file name for GEM persistence.
|
void |
setPort(int port)
Sets the port that this object will use to listen for active connections.
|
static void |
setS1F3ReturnsValues(boolean returnsValues)
Set to true if the S1F3 method should return the values when a blank list is
passed to the method rather than the IDs.
|
void |
setSoftRevAndMDLN()
Allows subclasses to set parameters for S1F14 and S1F2.
|
void |
setT1(double newValue) |
void |
setT2(double newValue) |
void |
setT3(double newValue) |
void |
setT4(double newValue) |
void |
setT5(int newValue) |
void |
setT6(int newValue) |
void |
setT7(int newValue) |
void |
setT8(int newValue) |
void |
setupFileRecipeManager() |
void |
start()
Start the component.
|
void |
stop()
Stop the component.
|
java.lang.String |
toString()
Create a toString to be proud of...
|
static void |
unregisterInstance(VIBMessageBean messageBean)
Unregister an instance of a VIBMessageBean.
|
void |
valueInput(ValueChangedEvent event)
Sets the value for the given VID.
|
public static final int ACTIVE_PORT
public static java.util.HashMap<VIBMessageBean,com.ergotech.transsecs.secs.InstanceStorage> allInstances
public transient ConnectionConfig connectionConfig
public static java.lang.String csvFolder
public static int debugLevel
public static final int DEFAULT_TRANSSECS_APPLICATION
public static java.lang.Object defaultMessageHandler
public static final int DEVICES_CLIENT_TRANSSECS_APPLICATION
public static final int FILE_RECIPE_MANAGER
public static boolean invertHostOrEquipmentConnection
public transient VIBMessageBean lastProcessed
public static final int PASSIVE_PORT
public static boolean passThroughGlobal
public BroadcastServer recipeBaseDir
public BroadcastServer recipeFileExtension
public RecipeManagerInterface recipeManager
public static int recipeManagerType
public static TestPanelInterface testPanel
public static int transSecsApplicationType
public TransSecsController()
public void addALID(long alid, java.lang.String alidName, java.lang.String altx, int alcd, long setCEID, long clearCEID, java.lang.Object source)
public void addALID(long alid, java.lang.String alidName, java.lang.String altx, int alcd, long setCEID, long clearCEID, java.lang.Object source, java.util.List<SecsFormat> dvids)
public void addALIDsFromCSV(java.io.File csvFile) throws java.io.IOException
csvFileName
- the name of the file containing the csv alid descriptionsjava.io.IOException
- thrown if there is an error reading the file.public void addCEID(long ceid, java.lang.String name, java.lang.Object source)
public void addCEID(long ceid, java.lang.String name, java.lang.Object source, java.util.List<SecsFormat> dvids)
public void addCEIDsFromCSV(java.io.File csvFile) throws java.io.IOException
csvFileName
- the name of the file containing the csv ceid descriptionsjava.io.IOException
- thrown if there is an error reading the file.public void addDependentEInterface(LifeCycle eInterface)
eInterface
- a dependent interface, for example, E40, E87, etc.public void addDVID(long svid, java.lang.String name, java.lang.String units, double limitMax, double limitMin, java.lang.String initialValue, int valueType, double deadband, long ceid, java.lang.Object source)
public void addECID(long ecid, java.lang.String name, java.lang.String units, double limitMax, double limitMin, java.lang.String initialValue, int valueType, double deadband, long ceid, java.lang.Object source)
public void addSVID(long svid, java.lang.String name, java.lang.String units, double limitMax, double limitMin, java.lang.String initialValue, int valueType, double deadband, long ceid, java.lang.Object source)
public void addVID(long vid, int idType, java.lang.String name, java.lang.String units, double limitMax, double limitMin, java.lang.String initialValue, int valueType, double deadband, long ceid, java.lang.Object source)
svid
- the svid itself, must be an integer for GEM compliance,
eg 30001idType
- the type of the ID, should be one of SVID, ECID, DVID as
defined in the GemEquipmentInterface.name
- the name of the svid (used in some reports)initialValue
- the initial value of the svidvalueType
- the type of the value, can be any SecsFormat valid for
the ID typesource
- the object that is managing this value (probably a VIB
manipulator)GemEquipmentInterface
public void addVIDsFromCSV(java.io.File csvFile) throws java.io.IOException
csvFileName
- the name of the file containing the csv vid descriptionsjava.io.IOException
- thrown if there is an error reading the file.public void connect(boolean sendingMessage)
public static SecsFormat createDataId(int format)
public boolean createDevices()
public static SecsFormat3x5x createSecsFormat3x5x(int format, long value)
format
- 0,1,2,4 corresponding to the formats SecsFormat50,
SecsFormat51, SecsFormat52, SecsFormat54value
- the value to use when creating the SecsFormat.public void destroy() throws BadParameterException
BadParameterException
public void disconnect()
public void disconnectPassive()
public static TransSecsController findController(java.lang.String name)
public double getActiveConnectionRetryInterval()
public VIDBean getAlids()
public java.util.List<VIBMessageBean> getAllMessages()
public java.util.List<VIBMessageBean> getAutoResponseMessages()
public int getBaudRate()
public VIDBean getCeids()
public java.lang.String getClassPackage()
public ConnectionConfig getConnectionConfig()
public java.lang.String getControllerName()
public int getDeviceId()
public WrapperInterface getEquipmentWrapper()
public boolean getGemCompliant()
public EquipmentControlInterface getGemHandler()
public double getLinkTestInterval()
public int getLocalDebug()
public LoggerInterface getLogger()
public VIBMessageBean getMatchingPrimary(SecsMsg msg)
public VIBMessageBean getMatchingResponse(SecsMsg msg)
public <T extends VIBMessageBean> T getMessageBean(java.lang.String name) throws BadParameterException
BadParameterException
public double getPassiveT1()
public double getPassiveT2()
public double getPassiveT3()
public double getPassiveT4()
public int getPassiveT5()
public int getPassiveT6()
public int getPassiveT7()
public int getPassiveT8()
public java.lang.String getPassiveToolTarget()
public java.lang.String getPersistenceFileName()
public int getPort()
public SimulationListener getSimulationListener()
public static TransSecsController getSingleController()
public java.util.Map<java.lang.Integer,VIBMessageBean> getUnhandledPrimaries()
public VIDBean getVids()
public WrapperInterface getWrapper(int whichWrapper)
public static java.lang.String getWrapperDescription(WrapperInterface wrapper)
public boolean handleHandCraftedMessage(SecsMsg msg)
public void init() throws BadParameterException
BadParameterException
public boolean isAllowDuplicateSECSIMessages()
public boolean isDigitalTwin()
public boolean isPassThrough()
public static boolean isS1F3ReturnsValues()
public static void logInfo(java.lang.String message)
public VIBMessageBean newInstance(java.lang.String className)
className
- the name of the class to instantiatepublic void println(java.lang.String s)
public boolean processMessage(SecsMsg msg, int whichPort)
Recieved Primary (no autoresponse) this must be put on a screen and quick connected to the response. Recieved Primary (with autoresponse) this can be put on a screen and used to recieve a notification of the received message but is never quick connected to the response. Recieved Secondary this is never put on the screen. It is published from an instance that is newly created each time the message is received. It could be imagined that it is processed by the primary (which it is). Sent SecondaryNever comes through this method, but for completeness is put on the screen and triggered by a received primary that does not have an autoresponse.
public boolean processMessage(SecsMsg msg, SessionManager toSessionManager)
public boolean processMessage(SecsTrigger msg)
public static void publish(java.lang.String toolName, java.lang.String tagName, ValueObjectInterface value)
toolName
- the name of the tool (may be null)tagName
- the assigned named of the value being publishedvalue
- the value being publishedpublic void publish(java.lang.String tagName, ValueObjectInterface value)
tagName
- the assigned named of the value being publishedvalue
- the value being publishedpublic void publishReport(SecsMsg incoming)
public boolean register()
public void registerEventComponents(VIBMessageBean source)
public boolean registerForReceiveNotification(java.lang.String messageName, MessageNotifier messageReceivedInterface)
public static void registerInstance(VIBMessageBean messageBean)
public void removeDependentEInterface(LifeCycle eInterface)
eInterface
- a dependent interface, for example, E40, E87, etc.public boolean sendResponse(VIBMessageBean msg, SecsMsg incoming)
msg
- the incoming message.public void setActiveConnectionRetryInterval(double activeConnectionRetryInterval)
activeConnectionRetryInterval
- the connection attempt frequency in
seconds.public void setAllowDuplicateSECSIMessages(boolean allowDuplicateSECSIMessages)
allowDuplicateSECSIMessages
- set to true if duplicate system bytes are
permitted.public void setBaudRate(int baudRate)
public void setClassPackage(java.lang.String classPackage)
public void setConnectionConfig(ConnectionConfig connectionConfig)
public void setControllerName(java.lang.String controllerName)
public void setDeviceId(int deviceId)
public void setDigitalTwin(boolean digitalTwin)
digitalTwin
- the digitalTwin to setpublic void setFileRecipeManagerExtension(java.lang.String ext)
public void setFileRecipeManagerPath(java.lang.String path)
public void setGemCompliant(boolean flag)
public void setLinkTestInterval(double linkTestInterval)
linkTestInterval
- the new link test intervalpublic void setLocalDebug(int level)
public void setLogger(LoggerInterface l)
public void setPassiveT1(double newValue)
public void setPassiveT2(double newValue)
public void setPassiveT3(double newValue)
public void setPassiveT4(double newValue)
public void setPassiveT5(int newValue)
public void setPassiveT6(int newValue)
public void setPassiveT7(int newValue)
public void setPassiveT8(int newValue)
public void setPassiveToolTarget(java.lang.String passiveToolTarget)
public void setPassiveWrapperClassName(java.lang.String passiveWrapperClassName)
public void setPassThrough(boolean passThrough)
public void setPersistenceFileName(java.lang.String persistenceFileName)
persistenceFileName
- the gem persistence file namepublic void setPort(int port)
public static void setS1F3ReturnsValues(boolean returnsValues)
returnsValues
- the S1F3ReturnsValues parameterpublic void setSoftRevAndMDLN()
public void setT1(double newValue)
public void setT2(double newValue)
public void setT3(double newValue)
public void setT4(double newValue)
public void setT5(int newValue)
public void setT6(int newValue)
public void setT7(int newValue)
public void setT8(int newValue)
public void setupFileRecipeManager() throws BadParameterException, VIBUpdateFailedException
public void start() throws BadParameterException, VIBUpdateFailedException
public void stop() throws BadParameterException
BadParameterException
public java.lang.String toString()
toString
in class java.lang.Object
public static void unregisterInstance(VIBMessageBean messageBean)
public void valueInput(ValueChangedEvent event) throws VIBUpdateFailedException
VIBUpdateFailedException
Copyright © 1999-2025 ErgoTech Systems, Inc. All Rights Reserved.