org.lsst.ccs.subsystems.fcs.testbench
Class TestBenchMainModule
java.lang.Object
java.util.Observable
org.lsst.ccs.framework.Module
org.lsst.ccs.subsystems.fcs.testbench.TestBenchMainModule
- All Implemented Interfaces:
- java.io.Serializable, java.util.Observer
public class TestBenchMainModule
- extends org.lsst.ccs.framework.Module
This is the main module for the control software of the APC test bench.
When the TestBenchMainModule starts, it starts a a TCP-IP server.
the can open wrapper software will connect.
Then the TestBenchProxy and the Wrapper will communicate over this TCP connection
with a protocol to be define.
In a first version :
1- The TCP server is started and waits for a client connection,
2- When the client connects, it sends first a key word "APCTestBench".
3- When the server receives the key word "APCTestBench", it's ready to boot the hardware
and receive commands.
- Author:
- virieux
- See Also:
- Serialized Form
| Nested classes/interfaces inherited from class org.lsst.ccs.framework.Module |
org.lsst.ccs.framework.Module.ValueUpdate |
| Fields inherited from class org.lsst.ccs.framework.Module |
log, name, nObserverThreads, registry, tickMillis |
| Methods inherited from class org.lsst.ccs.framework.Module |
getContext, getModule, getName, getNObserverThreads, getObservables, getSubsystem, getTickMillis, init, listens, processUpdate, publishData, publishData, publishData, publishData, sendToReply, sendToStatus, setBeanName, setContext, setName, setNObserverThreads, setObservables, setStateModularSubsystem, setStateModularSubsystem, setTickMillis, shutdownNow, start, 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 |
TestBenchMainModule
public TestBenchMainModule()
getTcpProxy
public ApcTcpProxy getTcpProxy()
- Returns:
- the myTcpProxy
setTcpProxy
public void setTcpProxy(ApcTcpProxy myTcpProxy)
- Parameters:
myTcpProxy - the myTcpProxy to set
getMyClientName
public java.lang.String getMyClientName()
- Returns:
- the myClientName
setMyClientName
public void setMyClientName(java.lang.String myClientName)
- Parameters:
myClientName - the myClientName to set
initModule
public void initModule()
- Overrides:
initModule in class org.lsst.ccs.framework.Module
tick
public void tick()
- Overrides:
tick in class org.lsst.ccs.framework.Module
getReturnValue
public int getReturnValue(java.lang.String responseLine,
int inputNB)
throws ReadingADCError
- Returns the value read on the socket for the input of the ADC given as an argument.
- Parameters:
responseLine - A string read on the socket.inputNB - The numero if the input on the ADC. (1<=inputNB<=8)
- Returns:
- the value (int) given
- Throws:
ReadingADCError
readTemperature
public double readTemperature()
throws ReadingADCError
- Read the temperature : in the test bench, a thermometer is plugged on the input number 1
of the ADC.
- Returns:
-
- Throws:
ReadingADCError
readADC
public java.lang.String readADC()
throws ReadingADCError
- Read the values of the 8 channels of the ADC.
It just send the command "adc" to the Can Open Wrapper and the Can OPen Wrapper sends
a SYNC to the ADC node.
- Returns:
-
- Throws:
ReadingADCError
readFromSocket
public java.lang.String readFromSocket(java.lang.String clientName)
turnOnLED
public void turnOnLED()
turnOffLED
public void turnOffLED()
stopAutomaticMode
public void stopAutomaticMode()
stop
public void stop()
listNodes
public java.lang.String listNodes()
- List the can open nodes which are booted.
It means that we have received a "boot,nodeID" and a "info,nodeID" messages
for these nodes.
- Returns:
- the list of can open nodes and the information stored in this.nodes.
sendCanOpen
public java.lang.Object sendCanOpen(java.lang.String command)
- For engineering mode, this method can be used to send Can Open commands
to the Wrapper.
Not very useful as we can send the same command from the console with:
invoke apctestbench/tcpProxy call APCTestBench command
- Parameters:
command - A Can Open command that the Wrapper should understand.
- Returns:
- the response from the Wrapper
Copyright © 2012 LSST. All Rights Reserved.