Information
We are currently investigating an issue with the editor of some pages. Please save your work and avoid to create new pages until this banner is gone.
The CDB Simulated Components are a quick way to make a component available for development and testing. They could be used to prototype basic functionality and to mock-up components in order to prepare module tests which need to interact with other components.
Create a module for the tests that are going to be performed:
...
Code Block | ||
---|---|---|
| ||
> cd test > make all |
The simulation code needs to be put in the CDB:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<SimulatedComponent xmlns="urn:schemas-cosylab-com:SimulatedComponent:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <pythonImports> from acstime import Duration </pythonImports> <initialize> logger=parameters[0].getLogger() logger.logInfo("Component initialized!") </initialize> <cleanUp> print('Simulated component cleaning up') </cleanUp> <_corbaMethod Name="objfix" Timeout="0"> print("\nobjfix called with params ", parameters, "\n") </_corbaMethod> </SimulatedComponent> |
A simple client could be prepared:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
from Acspy.Clients.SimpleClient import PySimpleClient client = PySimpleClient() m = client.getComponent("MOUNT") m.objfix(3,6) |
Start ACS:
Code Block | ||||
---|---|---|---|---|
| ||||
> cd sim_comp > export ACS_CDB=$PWD/test > export IDL_PATH="-I$PWD/idl $IDLPATH" > acsStart |
...