|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Observable
org.lsst.ccs.framework.Module
org.lsst.ccs.subsystems.fcs.drivers.CanOpenProxy
public class CanOpenProxy
This Module starts a tcpip server, waits for the connection of a client whose name is the value of the field myClientName. This client is supposed to be a CanOpen C-wrapper. When the client starts it scans the can open network and send to the server some information on the can open nodes living on the network.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.lsst.ccs.framework.Module |
|---|
org.lsst.ccs.framework.Module.ValueUpdate |
| Field Summary | |
|---|---|
PieceOfHardware[] |
hardwareList
|
| Fields inherited from class org.lsst.ccs.framework.Module |
|---|
configMethods, log, name, nObserverThreads, registry, tickMillis |
| Constructor Summary | |
|---|---|
CanOpenProxy()
|
|
| Method Summary | |
|---|---|
Object |
call(String clientName,
String command)
This methods send a command to the tcp client. |
boolean |
checkCanOpenNodeConfiguration(PieceOfHardware pieceOfHardware)
When the hardware is booted and we have retrieve the information, we want to check for each piece of hardware that the node ID stored in the Configuration data base is the same than the node ID which is stored on the hardware with a switch. |
boolean |
checkCanOpenNodes()
|
String |
configAsHeartbeatConsumer(int nodeID,
int producerNodeID,
int heartbeat_time)
Configure a node as a hearbeat consumer. |
String |
configAsHeartbeatProducer(int nodeID,
int heartbeat_time)
Command to be used by the end users. |
String |
configAsHeartbeatProducer(String nodeID,
String heartbeat_time)
Configure a node as a hearbeat producer. |
int |
getBootedNodesNB()
|
CanOpenNode |
getDetectedNodeForSerialNumber(String aSerialNB)
This method returns the can open detected on the can open network for a piece of hardware identified by its serial number. |
int |
getExpectedNodesNB()
|
String |
getMyClientName()
|
int |
getPortNumber()
|
void |
identifieHardware()
Identification of the hardware : we want to retrieve the information stored in the hardware of the booted nodes and update the array of nodes with this information. |
void |
initializeHardware()
|
void |
initModule()
|
boolean |
isBooted(PieceOfHardware piece)
|
boolean |
isBooted(String aNodeID)
|
boolean |
isConfigOK(PieceOfHardware piece)
Check if a piece of hardware is booted and if its can open node ID is correct. |
boolean |
isHardwareIdentified()
|
boolean |
isHardwareReady()
This method returns true if : all the hardware items are booted and identified and the hardware have the node ID expected within the configuration. |
boolean |
isReady(String clientName)
|
String |
listHardware()
|
String |
listNodes()
List the can open nodes which are in the nodes table. |
String |
readSDO(int nodeID,
String index,
String subindex)
Command to be used by the end user at the console in engineering mode. |
String |
readSDO(String nodeID,
String index,
String subindex)
Read a SDO with the given index and subindex RETURNS the value read in hexa (String) if no error occured or returns the error code if a error was detected. |
String |
sendCanOpen(String command)
For engineering mode, this method can be used to send Can Open commands to the Wrapper. |
void |
setExpectedNodesNB(int nodeNB)
|
void |
setMyClientName(String myClientName)
|
void |
setPortNumber(int portNumber)
|
protected void |
startTheadReader()
Starts a thread which read on the tcp socket, waiting for messages coming from tcp proxy. |
void |
stop()
|
void |
tick()
|
String |
writeSDO(int nodeID,
String index,
String subindex,
int size,
int value)
Command to be used by the end user at the console. |
String |
writeSDO(String nodeID,
String index,
String subindex,
String size,
String value)
Write a SDO request and send it to the can open stack, then analyses the response or throws an exception if the request failed. |
| Methods inherited from class org.lsst.ccs.framework.Module |
|---|
change, checkHardware, dropConfigurationContext, getCheckedValueFromConfiguration, getContext, getModule, getName, getNObserverThreads, getObservables, getSubsystem, getTickMillis, init, listens, newConfigurationContext, notifyChange, notifyChangeWithoutPreliminaryChecks, processUpdate, publishData, publishData, publishData, publishData, register, register, sendToReply, sendToStatus, setBeanName, setContext, setName, setNObserverThreads, setObservables, setStateModularSubsystem, setStateModularSubsystem, setTickMillis, shutdownCommand, shutdownNow, start, startTicking, update |
| Methods inherited from class java.util.Observable |
|---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public PieceOfHardware[] hardwareList
| Constructor Detail |
|---|
public CanOpenProxy()
| Method Detail |
|---|
public int getExpectedNodesNB()
public void setExpectedNodesNB(int nodeNB)
expectedNodesNB - the expectedNodesNB to setpublic int getBootedNodesNB()
public String getMyClientName()
public void setMyClientName(String myClientName)
myClientName - the myClientName to setpublic void initModule()
public boolean isHardwareIdentified()
public void tick()
tick in class org.lsst.ccs.framework.Modulepublic boolean isBooted(String aNodeID)
public boolean isBooted(PieceOfHardware piece)
public boolean isConfigOK(PieceOfHardware piece)
public String listNodes()
public String sendCanOpen(String command)
throws TimeoutException
command - A Can Open command that the Wrapper should understand.
TimeoutException
public String writeSDO(String nodeID,
String index,
String subindex,
String size,
String value)
throws SDORequestError
nodeID - FORMAT=HEXAindex - FORMAT=HEXAsubindex - FORMAT=HEXAsize - FORMAT=HEXAvalue - FORMAT=HEXA
SDORequestError
public String writeSDO(int nodeID,
String index,
String subindex,
int size,
int value)
throws SDORequestError
nodeID - FORMAT=decimalindex - FORMAT=HEXAsubindex - FORMAT=HEXAsize - FORMAT=decimalvalue - FORMAT=decimal
SDORequestError
public String readSDO(String nodeID,
String index,
String subindex)
throws SDORequestError
SDORequestError
public String readSDO(int nodeID,
String index,
String subindex)
throws SDORequestError
nodeID - FORMAT=decimalindex - FORMAT=hexasubindex - FORMAT=hexa
SDORequestError
public void identifieHardware()
throws TimeoutException
TimeoutExceptionpublic boolean isHardwareReady()
public CanOpenNode getDetectedNodeForSerialNumber(String aSerialNB)
serialNB -
public boolean checkCanOpenNodes()
throws org.lsst.ccs.bus.BadCommandException,
ErrorInBootingHardwareProcess,
ConfigNodeIDMismatchException,
HardwareNotDetectedException
org.lsst.ccs.bus.BadCommandException
ErrorInBootingHardwareProcess
ConfigNodeIDMismatchException
HardwareNotDetectedException
public boolean checkCanOpenNodeConfiguration(PieceOfHardware pieceOfHardware)
throws org.lsst.ccs.bus.BadCommandException,
ConfigNodeIDMismatchException,
HardwareNotDetectedException
org.lsst.ccs.bus.BadCommandException
ConfigNodeIDMismatchException
HardwareNotDetectedExceptionpublic String listHardware()
public void initializeHardware()
public String configAsHeartbeatProducer(String nodeID,
String heartbeat_time)
throws SDORequestError,
TimeoutException
nodeID - node ID in hexaheartbeat_time - FORMAT=hexa UNIT=milliseconds
SDORequestError
TimeoutException
public String configAsHeartbeatProducer(int nodeID,
int heartbeat_time)
throws SDORequestError,
TimeoutException
nodeID - FORMAT=decimalheartbeat_time - FORMAT=decimal UNIT=milliseconds
SDORequestError
TimeoutException
public String configAsHeartbeatConsumer(int nodeID,
int producerNodeID,
int heartbeat_time)
throws SDORequestError,
TimeoutException
nodeID - node ID in decimalheartbeat_time - FORMAT=decimal UNIT=milliseconds
SDORequestError
TimeoutExceptionpublic int getPortNumber()
public void setPortNumber(int portNumber)
protected void startTheadReader()
public void stop()
public boolean isReady(String clientName)
public Object call(String clientName,
String command)
throws TimeoutException
clientName - command -
TimeoutException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||