previously, the signal handler would ignore SIGINTs and SIGTERMs during
server startup, so if there would be e.g. non-respoinding hardware, the
program could not be exited until a timeout occured.
For now, the default signal handler will be called. Later, we should
consider cleaning up the partial started modules.
Change-Id: I5bb802b5d996bb03dfa2679c1497e298fde1dd17
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/32247
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Alexander Zaft <a.zaft@fz-juelich.de>
An attached property may be defined with mandatory=False.
In this case, when no value or an empty string is given,
<modobj>.<attached_mod> must return None after initialisation.
+ remove 'dispatcher' level from the logger hierarchy on modules
Change-Id: Icee3ae3f9142cd7a910c579ae1ffaa35f93cee03
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/32187
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
For the case when the readback of a parameter does not reflect the
change immediately.
May also be used on Writable.target or Drivable.target with a short
BUSY period.
+ bug fix in an error message in frappy.datatypes.IntRange
Change-Id: I5e1c871629f9e3940ae80f35cb6307f404202b4a
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/31981
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
in SecopClient.disconnect joinng the reconnect thread may take
up to 10 s, because of the time.sleep(10) call in the reconnect
thread.
change the _shutdown attribute from bool to an Event, and
use Event.wait instead of time.sleep
Change-Id: Icea6a14ad73df0b3d26ef45806f4c05e6bf18492
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/32137
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
in the previous version FloatRange(max=100) was neither working
properly nor complaining, because the maxval=None default was
overriding the value for max.
possible fixes:
- raise an error when min/max used as argument (confusing for
the programmer, as it is a property)
- allow both versions minval/maxval and min/max (more code)
- use min/max and a pylint directive here (the only thing to
take care is not to use the min/max builtin in __init__)
this change uses the last option for the fix
Change-Id: Iff0e0c4d0d7b165003bdeffa67a93a1cd7f29eea
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/31982
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
reading back the target does not work properly, because
a) the readback value might be delayed
b) there is no command to read back the target, SETP?1
is returning the working setpoint, which might be distinct
in case of a ramp
Change-Id: I0da2dbfc1a8ddbecbae6d0456ff64e008bc56336
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/31983
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
- when driving a module with <module>(<target>),
keyboard interrupt should send stop()
- make sure keyboard interrupt does not only stop
the current driving, but also skips other code
on the same command line
Change-Id: Ib4d2c4111dc0f23bf07385065766fb9b4a611454
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/31926
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
restarting the phytron motor without prior stop leads
to funny behaviour.
- send stop before restart
- stop motor when moving but status not busy
- restart when motor drives the wrong way
+ better status text when stopping
Change-Id: I82cd59297b3c79a354a4eeb5ba03fc65bedf755f
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/31929
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
for host name without port, None was used for the port
leading to a confusing error message
- do not call parse_host_port with None as defaultport argument
- improve error message when connection fails
+ fix an error in last line of parse_ipv6_host_and_port
+ fix some issues breaking PEP 8 rules
Change-Id: I437360be96449c164f0080e3c60f1685825d4780
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/31911
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
- in SEA, it is not guaranteed that the is_running state is set
before the run command returns. as a consequence, we have to
wait in SeaDrivable.write_target for is_running being set
- syncio has always to be reconnected after asynio
Change-Id: Ia46cff11de86868ce0627faaf6f776282bd7a8f4
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/31631
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
adds a generic solution for creating parameters with struct datatype
with their members linked to individual parameters.
main use case: ctrlpars
read_*/write_* methods are either created for the main (structed)
parameter based on the corresponding methods of the individual
parameters or the methods for the individual parameters are created
based on the methods of the main parameter
+ disable pylint use-dict-literal
Change-Id: I7f1d9fb3d3b2226b548c2999bbfebe2ba5ac285e
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/31405
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
add module which scans a connection and registers new devices depending
on the answer.
* change module initialization to demand-based
* move code from server to dispatcher
- remove intermediate step in Attached __get__
TODO:
factor out dispatcher (regards to playground)
discuss factoring out of module creation code from server AND
dispatcher
Change-Id: I7af959b99a84c291c526aac067a4e2bf3cd741d4
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/31470
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Reviewed-by: Georg Brandl <g.brandl@fz-juelich.de>
Reviewed-by: Alexander Zaft <a.zaft@fz-juelich.de>
previously, no cleanup would be performed, SIGINTs being catched above
the server.run() function
+ signal handler for SIGINT, SIGTERM
* put serve_forever in its own thread, to be able to call shutdown() on
the server
Change-Id: Ia5c021f3d6fd60ff2b9012c10e30715f93104977
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/31340
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Alexander Zaft <a.zaft@fz-juelich.de>
Add and call shutdownModule function, in order to allow modules to clean
up.
use shutdownModule instead of shutdown to avoid confusion with
severs/dispatchers shutdown and to make it consistent with initModule
etc.
Try to resolve module dependencies
Change-Id: I2a091bf74ecadc2395fcdf92c599f1c49eb120f5
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/31339
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Reviewed-by: Alexander Zaft <a.zaft@fz-juelich.de>
Change 31280 introduced an error where an import was overridden, which
leads python to consider it a local variable, preventing access to the
systemd import. (TODO: a better way to handle the systemd import?)
Fixes: #4732
Change-Id: I5188a8737392bd8befcdfa9af044a21be9af908a
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/31386
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Alexander Zaft <a.zaft@fz-juelich.de>