Proof of concept: using Sardana tools for MARTe configuration files creation - mrosanes/sardana-test GitHub Wiki

Proof of concept: using Sardana macroexecutor for MARTe configuration files creation

Given that Marte configuration files have some similarities between them, it could be interesting to have tools for automating the process of creating MARTe configuration files. The macroexecutor GUI from Sardana is an available tool that can simplify the process MARTE configuration files creation.

As a proof of concept I created a marteconfig Sardana macro that could be used for this purpose (it could also be improved and/or more macros could be created if desired to deal with more complex configurations).

How to install the necessary tools and set the environment to use Sardana MacroExecutor with the MARTe configuration file creation macro:

From a Linux machine with docker installed:

  1. At the beginning maybe you'll need to activate the docker service:
sudo systemctl start docker
  1. Clone the Sardana test repository, checkout marte branch and create a sardana-test docker container, which will allow us to play with Sardana.
git clone https://github.com/mrosanes/sardana-test
cd sardana-test
git checkout marte
xhost +local:
docker build -t marte:marte1 .
docker run -d --name=martecfg-test -h sardana-test -e DISPLAY=$DISPLAY -e QT_X11_NO_MITSHM=1 -v /tmp/.X11-unix:/tmp/.X11-unix marte:marte1
docker exec -it martecfg-test bash
  1. Now, from inside the created martecfg-test docker container, instantiate a new Sardana MacroServer, without entering any arguments to the terminal. After entering the following command, press enter twice and the macroserver will be created (do not connect the MacroServer to any Pool).
MacroServer marte
  1. Open a new terminal window, enter the docker also in this new window and launch the Sardana spock CLI. When instantiating spock for the first time, tap enter once, and then choose the Door: Door/marte/1).
xhost +local:
docker exec -it martecfg-test bash
spock --profile=marte
  1. From inside spock set the environment variable MacroPath:
ms=tango.DeviceProxy('MacroServer/marte/1')
ms.put_property({'MacroPath':'/marte_macros/macros'})
  1. Restart the MacroServer from the first terminal window that we opened, by pressing twice on Ctrl+C, and then launching again the MacroServer in order for the MacroServer to load the MacroPath variable.
MacroServer marte
  1. From another docker terminal window, launch now the macroexecutor GUI:
xhost+local:
docker exec -it martecfg-test bash
macroexecutor
  1. Connect from the macroexecutor GUI to your sardana marte MacroServer from the GUI Menu: Taurus -> Change configuration -> MacroServer/marte/1->ok.

  2. The Sardana configuration is now all done. Now from inside the macroexecutor (see attached image), navigate to the marteconfig macro and create a configuration by duplicating nodes, adding new nodes, etc. Once you're done press the play button from the GUI and the MARTe configuration file will be created. You can then refine the Marte configuration created file manually if needed.

 marte_create_cfg_file

The martecfg.txt file has been created with the macroexecutor marteconfig sardana macro.

For this concrete macro (marteconfig), the JSON format has been used.