public class CanOpenProxy
extends org.lsst.ccs.framework.Module
| Modifier and Type | Class and Description |
|---|---|
static class |
CanOpenProxy.PDOStorage
To store the values returned by the PDO.
|
protected static class |
FcsTcpProxy.ClientContext |
| Modifier and Type | Field and Description |
|---|---|
protected FcsTcpProxy.ClientContext |
clientContext |
PieceOfHardware[] |
hardwareList |
protected boolean |
stopping |
| Constructor and Description |
|---|
CanOpenProxy(String aName,
int aTickMillis,
int portNumber,
String aClientName,
int expectedNodesNB,
long hardwareBootTimeout) |
| Modifier and Type | Method and Description |
|---|---|
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 : so we compare the serial number found on the can open bus
for the piece of hardware node id with the serial number of the harwdare configuration.
|
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.
|
void |
disconnectHardware()
This methods stops the CWrapper client, and the TCP server.
|
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() |
long |
getHardwareBootTimeout() |
String |
getMyClientName() |
CanOpenProxy.PDOStorage |
getPdoStorage() |
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.
|
String |
initializeHardware() |
void |
initModule() |
boolean |
isBooted(PieceOfHardware piece) |
boolean |
isBooted(String aNodeID) |
boolean |
isHardwareIdentified() |
boolean |
isHardwareInitialized() |
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
and the hardware is initialized.
|
boolean |
isNodeIdBootedAndOK(PieceOfHardware piece)
Check if a piece of hardware is booted
and if its can open node ID is correct.
|
boolean |
isReady(String clientName) |
String |
listHardware() |
String |
listNodes()
List the can open nodes which are in the nodes table.
|
CanOpenProxy.PDOStorage |
readPDOs()
This method sends a sync command to the can open stack and returns the reply.
|
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 |
setHardwareBootTimeout(int hardwareBootTimeout) |
void |
setHardwareBootTimeout(long hardwareBootTimeout) |
void |
setPortNumber(int portNumber) |
void |
shutdownNow() |
void |
startThreadReader()
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.
|
alias, change, checkHardware, dropConfigurationContext, getCheckedValueFromConfiguration, getChildren, getContext, getModule, getName, getNObserverThreads, getObservables, getSubsystem, getTickMillis, init, listens, newConfigurationContext, notifyChange, notifyChangeWithoutPreliminaryChecks, processUpdate, publishData, publishData, publishData, publishData, publishData, publishData, publishData, register, removeLogPanicState, sendToReply, sendToStatus, setBeanName, setContext, setEnvironment, setHandlerLevel, setLogLevel, setName, setNObserverThreads, setObservables, setStateModularSubsystem, setStateModularSubsystem, setTickMillis, shutdownCommand, start, startTicking, updateaddObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChangedpublic PieceOfHardware[] hardwareList
protected volatile boolean stopping
protected FcsTcpProxy.ClientContext clientContext
public void disconnectHardware()
throws InterruptedException
InterruptedExceptionpublic int getExpectedNodesNB()
public void setExpectedNodesNB(int nodeNB)
expectedNodesNB - the expectedNodesNB to setpublic long getHardwareBootTimeout()
@ConfigChanger public void setHardwareBootTimeout(long hardwareBootTimeout)
@ConfigChanger public void setHardwareBootTimeout(int hardwareBootTimeout)
public int getBootedNodesNB()
public String getMyClientName()
public CanOpenProxy.PDOStorage getPdoStorage()
public boolean isHardwareIdentified()
public boolean isHardwareInitialized()
public void initModule()
public void tick()
tick in class org.lsst.ccs.framework.Modulepublic boolean isBooted(String aNodeID)
public boolean isBooted(PieceOfHardware piece)
public boolean isNodeIdBootedAndOK(PieceOfHardware piece)
public String listNodes()
public String sendCanOpen(String command) throws TimeoutException, org.lsst.ccs.bus.BadCommandException
command - A Can Open command that the Wrapper should understand.TimeoutExceptionorg.lsst.ccs.bus.BadCommandExceptionpublic String writeSDO(String nodeID, String index, String subindex, String size, String value) throws SDORequestException
nodeID - FORMAT=HEXAindex - FORMAT=HEXAsubindex - FORMAT=HEXAsize - FORMAT=HEXAvalue - FORMAT=HEXASDORequestExceptionpublic String writeSDO(int nodeID, String index, String subindex, int size, int value) throws SDORequestException, org.lsst.ccs.bus.BadCommandException
nodeID - FORMAT=decimalindex - FORMAT=HEXAsubindex - FORMAT=HEXAsize - FORMAT=decimalvalue - FORMAT=decimalSDORequestExceptionorg.lsst.ccs.bus.BadCommandExceptionpublic String readSDO(String nodeID, String index, String subindex) throws SDORequestException
SDORequestExceptionpublic String readSDO(int nodeID, String index, String subindex) throws SDORequestException, org.lsst.ccs.bus.BadCommandException
nodeID - FORMAT=decimalindex - FORMAT=hexasubindex - FORMAT=hexaSDORequestErrorSDORequestExceptionorg.lsst.ccs.bus.BadCommandExceptionpublic CanOpenProxy.PDOStorage readPDOs() throws HardwareException, org.lsst.ccs.bus.BadCommandException
HardwareExceptionorg.lsst.ccs.bus.BadCommandExceptionpublic void identifieHardware()
throws TimeoutException
TimeoutExceptionpublic boolean isHardwareReady()
public CanOpenNode getDetectedNodeForSerialNumber(String aSerialNB)
aSerialNB - public boolean checkCanOpenNodes()
throws org.lsst.ccs.bus.BadCommandException,
ErrorInBootingHardwareProcessException,
HardwareConfigurationException,
HardwareNotDetectedException
org.lsst.ccs.bus.BadCommandExceptionErrorInBootingHardwareProcessExceptionHardwareConfigurationExceptionHardwareNotDetectedExceptionpublic boolean checkCanOpenNodeConfiguration(PieceOfHardware pieceOfHardware) throws org.lsst.ccs.bus.BadCommandException, HardwareConfigurationException, HardwareNotDetectedException
org.lsst.ccs.bus.BadCommandExceptionHardwareConfigurationExceptionHardwareNotDetectedExceptionpublic String listHardware()
public String initializeHardware() throws org.lsst.ccs.bus.BadCommandException, Exception
org.lsst.ccs.bus.BadCommandExceptionExceptionpublic String configAsHeartbeatProducer(String nodeID, String heartbeat_time) throws SDORequestException, TimeoutException, org.lsst.ccs.bus.BadCommandException
nodeID - node ID in hexaheartbeat_time - FORMAT=hexa UNIT=millisecondsSDORequestExceptionTimeoutExceptionorg.lsst.ccs.bus.BadCommandExceptionpublic String configAsHeartbeatProducer(int nodeID, int heartbeat_time) throws SDORequestException, TimeoutException, org.lsst.ccs.bus.BadCommandException
nodeID - FORMAT=decimalheartbeat_time - FORMAT=decimal UNIT=millisecondsSDORequestExceptionTimeoutExceptionorg.lsst.ccs.bus.BadCommandExceptionpublic String configAsHeartbeatConsumer(int nodeID, int producerNodeID, int heartbeat_time) throws SDORequestException, TimeoutException, org.lsst.ccs.bus.BadCommandException
nodeID - node ID in decimalheartbeat_time - FORMAT=decimal UNIT=millisecondsSDORequestExceptionTimeoutExceptionorg.lsst.ccs.bus.BadCommandExceptionpublic int getPortNumber()
public void setPortNumber(int portNumber)
public void startThreadReader()
public void shutdownNow()
shutdownNow in class org.lsst.ccs.framework.Modulepublic void stop()
public boolean isReady(String clientName)
public Object call(String clientName, String command) throws TimeoutException, CWrapperNotConnected
clientName - command - TimeoutExceptionCWrapperNotConnectedCopyright © 2014 LSST. All Rights Reserved.