core: formatting and update server docstring

Change-Id: Ic0dd4c5239f27679c89f6b3742b9c5f8b71f33f6
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/32514
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Alexander Zaft <a.zaft@fz-juelich.de>
This commit is contained in:
Alexander Zaft 2023-11-10 08:43:53 +01:00 committed by Markus Zolliker
parent 34793f8bd0
commit 5b6a9de96e

View File

@ -71,19 +71,18 @@ class Server:
multiple cfg files, the interface is taken from the first cfg file
- testonly: test mode. tries to build all modules, but the server is not started
Format of cfg file (for now, both forms are accepted):
old form: new form:
[node <equipment id>] [NODE]
description=<descr> id=<equipment id>
description=<descr>
[interface tcp] [INTERFACE]
bindport=10769 uri=tcp://10769
bindto=0.0.0.0
[module temp] [temp]
ramp=12 ramp=12
Config file:
Format: Example:
Node('<equipment_id>', Node('ex.frappy.demo',
<description>, 'short description\n\nlong descr.',
<main interface>, 'tcp://10769',
secondary=[ secondary=['ws://10770'], # optional
<interfaces>
],
) )
Mod('<module name>', Mod('temp',
<param config> value = Param(unit='K'),
) )
...
"""
self._testonly = testonly
@ -156,7 +155,10 @@ class Server:
iface_threads = []
interfaces_started = MultiEvent(default_timeout=1)#default_timeout=15)
lock = threading.Lock()
for interface in [self.node_cfg['interface']] + self.node_cfg.get('interfaces', []):
# TODO: check if only one interface of each type is open?
for interface in [self.node_cfg['interface']] + self.node_cfg.get(
'secondary', []
):
opts = {'uri': interface}
t = mkthread(
self._interfaceThread,