public class SimuCanOpenProxy extends CanOpenProxy
| Modifier and Type | Class and Description |
|---|---|
protected static class |
FcsTcpProxy.ClientContext
A class to handle the tcpip connexion.
|
org.lsst.ccs.framework.Module.ValueUpdate| Modifier and Type | Field and Description |
|---|---|
protected FcsTcpProxy.ClientContext |
clientContext |
static org.lsst.ccs.utilities.logging.Logger |
COMMAND_LOG
A Logger for CommandDispenser.
|
protected int |
fieldBusTimeout |
protected Condition |
hardwareBooted |
protected Lock |
lock |
protected int |
portNumber |
protected boolean |
stopped |
protected boolean |
stopping |
protected boolean |
tcpServerStarted |
bootedNodes, bootingCompleted, hardwareBootProcessEnded, hardwareMapByNodeID| Constructor and Description |
|---|
SimuCanOpenProxy(int portNumber,
int fieldBusTimeout,
String clientName,
long hardwareBootTimeout) |
| Modifier and Type | Method and Description |
|---|---|
Object |
call(String clientName,
String command)
In simulation, call method only logs the command to be called.
|
org.lsst.ccs.framework.TreeWalkerDiag |
checkHardware()
check that all pieces of hardware is booted.
|
void |
initModule() |
boolean |
isCANDevicesReady()
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 |
isCWrapperConnected()
This method returns true if the C-Wrapper is connected to the tcp proxy.
|
boolean |
isReady(String clientName) |
boolean |
isRealHardware() |
protected void |
processUnknownCommand(String message)
Process a message received from the CAN bus when this message is an unknown message.
|
PDOStorage |
readPDOs()
This method sends a sync command to the can open stack and returns the
reply.
|
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 throws an Exception if an error occured.
|
void |
start() |
void |
startServer()
Starts the server tcp on the port portNumber.
|
void |
startThreadReader()
Starts a thread which read on the tcp socket, waiting for messages coming
from tcp proxy.
|
void |
stopServer()
Stops the tcp server.
|
String |
writeSDO(String nodeID,
String index,
String subindex,
String size,
String newValue)
Write a SDO request and send it to the can open stack, then analyses the
response or throws an exception if the request failed.
|
canClearAlert, checkBootedCanOpenNodes, checkCanOpenCommand, checkHardwareID, checkNodeID, checkNumberOfBootedNodes, checkStarted, checkStopped, connectHardware, disconnectHardware, getBootedNodeBySerialNumber, getBootedSerialNumberForNode, getMyClientName, getNodeName, getPdoStorage, initialize, isBooted, listBootedNodes, listHardwareNames, printBootedNodeBySerialNumber, printHardwareList, printHardwareState, printPDOStorage, processEmcyMessage, processResponseToReadSDO, processSDORequestError, publishData, publishHardwareData, publishHardwareData, readDevicesInfo, readSDOCommand, retrieveHardwareInfo, sendCanOpenCommand, shutdownNow, toString, updateDeviceInfo, writeSDOgetNObserverThreads, getObservables, getTickMillis, init, listens, processUpdate, sendSignal, sendSignalWithTimeLimit, setNObserverThreads, setObservables, setTickMillis, signal, startTicking, tick, updateaddObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChangedclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitraiseAlarm, raiseAlarm, raiseAlarm, raiseAlarm, raiseWarning, raiseWarning, raiseWarning, raiseWarninggetComponentConfigurationEnvironment, getComponentLookup, getName, getSubsystemchange, dropSubmittedChanges, getChildren, getComponentByName, getEnvironment, getParent, getParentObject, getSubmittedChanges, isParameterConfigurable, postStart, printConfigurableParameters, setBulkParameter, submitChange, submitChanges, validateBulkChangepublic static final org.lsst.ccs.utilities.logging.Logger COMMAND_LOG
@ConfigurationParameter(isFinal=true,
range="1024..99000",
description="tcpip port number on which this tcpip server starts on.")
protected int portNumber
@ConfigurationParameter(description="Timeout in Millisecond. If a command sent to the CANbus doesn\'t respond during this amount of time, we considere that they could be an issue on the hardware.") protected int fieldBusTimeout
protected volatile boolean stopped
protected volatile boolean stopping
protected volatile boolean tcpServerStarted
protected FcsTcpProxy.ClientContext clientContext
protected final Lock lock
protected final Condition hardwareBooted
public SimuCanOpenProxy(int portNumber,
int fieldBusTimeout,
String clientName,
long hardwareBootTimeout)
public void initModule()
initModule in class CanOpenProxypublic void startServer()
startServer in interface BridgeToHardwarepublic void startThreadReader()
startThreadReader in interface BridgeToHardwarepublic void stopServer()
public org.lsst.ccs.framework.TreeWalkerDiag checkHardware()
throws org.lsst.ccs.HardwareException
CanOpenProxycheckHardware in interface org.lsst.ccs.framework.HardwareControllercheckHardware in interface BridgeToHardwarecheckHardware in class CanOpenProxyorg.lsst.ccs.HardwareExceptionpublic Object call(String clientName, String command)
clientName - command - public PDOStorage readPDOs()
CanOpenProxyreadPDOs in interface BridgeToHardwarereadPDOs in class CanOpenProxypublic String readSDO(String nodeID, String index, String subindex)
CanOpenProxyreadSDO in class CanOpenProxynodeID - index - subindex - public String writeSDO(String nodeID, String index, String subindex, String size, String newValue)
CanOpenProxywriteSDO in class CanOpenProxynodeID - FORMAT=HEXAindex - FORMAT=HEXAsubindex - FORMAT=HEXAsize - FORMAT=HEXAnewValue - FORMAT=HEXApublic boolean isCANDevicesReady()
CanOpenProxyisCANDevicesReady in interface BridgeToHardwareisCANDevicesReady in class CanOpenProxypublic boolean isCWrapperConnected()
BridgeToHardwareisCWrapperConnected in interface BridgeToHardwareisCWrapperConnected in class CanOpenProxypublic boolean isRealHardware()
isRealHardware in interface BridgeToHardwareisRealHardware in class CanOpenProxypublic void start()
start in interface org.lsst.ccs.framework.Configurablestart in interface org.lsst.ccs.framework.HasLifecyclepublic boolean isReady(String clientName)
protected void processUnknownCommand(String message)
nodeID - Copyright © 2017 LSST. All rights reserved.