- repeated errors on poller are only once logged (per poll
function / read_* method)
- during exception handling, silent=True on a SECoP error indicates
that the error is already logged
+ fix the name of HardwareError
+ add test for consistency of SECoPErrors
+ catch socket.timeout in AsynTcp
Change-Id: I9df6c775cc19553b22a4d6e39591092adf7ff9a1
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/28139
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
in secop.proxy the callers modules method announceUpdate is
called from an other thread while the accessLock is locked,
creating a deadlock. solve this by creating an other lock
'updateLock' for the update.
+ add status parameter even to non-Readable proxy modules,
in order to indicate a failed connection
+ fix an error in secop_psi/softcal.py
Change-Id: Iae7c6d5a74001150a47aa9dc99209c15d972cd5e
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/28130
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>
This valve needs 8 turns to open. As the encoder forgets
the number if turns on power cycle, a home switch is
mounte, which engages during the last turn when closing.
The final close position is determined by closing the valve
with a defined motor current/torque.
+ fix an issue in StateMachine.start: the first cycle
must be called after the new state is assigned
Change-Id: I34cd05d10d97b043f9e3126310943b74ee727382
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/28030
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>
When several poller threads are using the same io, the resposivity
of client requests is reduced, as every thread first finishes
its pending communication requests, before it is the turn of the
request thread. This is solved by using one common poller thread
for all modules sharing the same communicator.
+ fix an issue with overriding a property with a parameter, as
this is the case for pollperiod (cfg was applied to property
instead of overriding parameter)
+ separate setFastPoll arguments into flag and fast interval
+ fix missing announceUpdate call when read function fails
+ fix mechanism for triggering polls after an io connection
reconnected again.
Change-Id: I1115a61fae3de80d18416e61f40b52a0eebb637c
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/28021
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
revert basically the former change
"init generalConfig.defaults only in secop-server"
The problem of import order when setting generalConfig.defaults
has to be solved by not overriding already existing keys when
setting the default.
Change-Id: I82121e346607dd74146279c4241e13ab63c14096
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/28011
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>
using one RLock per Module
+ init generalConfig for all tests
Change-Id: I88db6cacdb4aaac2ecd56644ccd6a3e5fd2d1cf2
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/28005
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
generalConfig.defaults must not be set on import, as this
depends on import order
Change-Id: I00395b40b4281ddc044c196713f6512068011380
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/27985
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>
- fix CommandType.__repr__
- secop/modules.py: command properties are allowed to be configured:
- section 2: remove comment and rename
- section 3: all accessible properties should be checked
- command description should be inherited also when taken from docstring
- move test for command inheritance to test_modules.py
- added tests to check for valid properties of commands
Change-Id: I5fd04e03be1faec5e54fed9735620bc5dc0f89c0
- asynconn: raise * from *
- asynconn: correct handling for timeout in AsynSerial
- add new py35compat
- target unit $
Change-Id: I052185ad3ebb3e3d1e3374f7ece9c7df06223951
- driving with a generator
- 3 phases
1) find active range (low current, far movement until force over hysteresis)
2) release force until well below target
3) adjusting using pid_p. (this is in fact an integral factor)
- a mixin should not inherit from module then it has Parameters
- Parameters in mixins must be complete, not just overrides
- check precedence of read_<param> or handler
Change-Id: I72d9355a1982770d1a99d9552a20330103c97edb
Config errors are collected first, and raised after processing
all modules. This is more user friendly.
+ remove redundant check for predefined accessibles in modules.py
+ fixed error handling for exporting parameters in params.py
+ fixed handling of bare attributes overwriting properties
Change-Id: I894bda291ab85ccec3d771c4903393c808af0a2a
- a new wrapper for a read function is not only to be created when
the a new read method is in the class dict, but also when
it is inherited, but not yet wrapped
- a handler must not be ignored, when a write method is inherited
- a proxy class must not call checkProperties
+ remove trailing spaces in tutorial_helevel.rst
Change-Id: I16024c14232ea200db91a1bc07ec23326219ab68
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/25093
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
- a new wrapper for a read function is not only to be created when
the a new read function is in the class dict, but also when
it inherited, but not yet wrapped
- a proxy class must not call checkProperties
- fixed most important code after checking with flake8
- ignored code which has to be reworked or removed
+ mark unused code with 'TODO: remove ...'
Change-Id: Ic45e541049e391e2853d29cd64bb0963bd9a2125
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/25053
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
- removed secop/metaclass.py
- moved code from ModuleMeta to modules.HasAccessibles.__init_subclass__
- reworked properties:
assignment obj.property = value now always allowed
- reworked Parameters and Command to be true descriptors
- Command must now be solely used as decorator
- renamed 'usercommand' to 'Command'
- command methods no longer start with 'do_'
- reworked mechanism to determine accessible order:
the attribute paramOrder, if given, determines order of accessibles
+ fixed some issues makeing the IDE more happy
+ simplified code for StatusType and added a test for it
Change-Id: I8045cf38ee6f4d4862428272df0b12a7c8abaca7
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/25049
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>
- flatten hierarchy (some links do not work when using folders)
- add a tutorial for programming a simple driver
- clean description using inspect.cleandoc
+ fix a bug with 'unit' pseudo property in a Parameter used as override
Change-Id: I31ddba5d516d1ee5e785e28fbd79fca44ed23f5e
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/25000
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
New Syntax:
- define properties and parameters as class attributes directly
instead of items in class attribute dicts
- define commands with decorator @usercommand(...)
- old syntax is still supported for now
still to do (with decreasing priority):
- turn parameters into descriptors (vs. creating getters/setters)
- migrate all existing code to new syntax
- get rid of or reduce code in metaclasses using __set_name__ and
__init_subclass__ instead, including a fix for allowing py < 3.6
Change-Id: Id47e0f89c506f50c40fa518b01822c6e5bbf4e98
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/24991
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>
with handlers, a parameter from the cfg file which is not the
first of parameters with the same handler were not written.
fix: write_<param> method is called for all parameters in
<module>.writeDict even if there is no poll entry.
with this fix, when a parameter has the property initwrite=True,
the write_<param> method is called even when <param>
is not polled and even when <module>.pollerClass is None
Change-Id: I9b397deb5b20709fc4fa7c860c85b251a204c7f6
with handlers, a parameter from the cfg file which is not the
first of parameters with the same handler were not written.
fix: write_<param> method is called for all parameters in
<module>.writeDict even if there is no poll entry.
with this fix, when a parameter has the property initwrite=True,
the write_<param> method is called even when <param>
is not polled and even when <module>.pollerClass is None
Change-Id: I9b397deb5b20709fc4fa7c860c85b251a204c7f6
includes a use case:
- a software calibration, to be applied to any Readable.
- calibration could be changed on the fly
+ refactored a little bit update events mechanism
Change-Id: Ifa340770caa9eb2185fe7e912c51bd9ddb411ece
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/23093
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
moved adjusting of the name of enum types from the parameter name to
secop.datatypes.get_datatype
+ ignore additional items in datainfo (must-ignore policy)
Change-Id: Id1bb089c33729f15f06ad51e5c03bb333ef3c307
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/22513
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
A proxy module is a module with a known structure, but
accessed over a SECoP connection.
For the configuration, a Frappy module class has to be given.
The proxy class is created from this, but does not inherit from it.
However, the class of the returned object will be subclass of the
SECoP base classes (Readable, Drivable etc.).
A possible extension might be, that instead of the Frappy class,
the JSON module description can be given, as a separate file
or directly in the config file.
Or we might offer a tool to convert the JSON description to
a python class.
Change-Id: I9212d9f3fe82ec56dfc08611d0e1efc0b0112271
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/22386
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
as module properties and parameters anyway share the same namespace,
there is no need to distinguish in config files.
+ a parameter default value may be overriden just with a class
attribute.
Both improvements help to switch between parameters and properties
more easily.
Change-Id: Ieb5cf3121f37c7c04e63345d3e95dfaf42726455
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/22054
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
- analyze_<group> returns now a dict
- change_<group> has no more values arguments.
values may be read with change.readValues(), which leaves more
freedom to the programmer, especially if the values do not need
to be read before a change
Change-Id: I67b70302eaf9bbdac107df61123062fa133d501d
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/22047
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
this is a simplicifcation for the ppms driver
- the derivation of a changecmd from a querycmd is moved to
CmdHandler.__init__
- the special treatment of handlers when writing configured
parameters has moved to CmdHandler.write
- introduced Drivable.isDriving, changed Module.isBusy
Change-Id: I8862ecda9c8cc998bb018bd960f31c9488146707
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/22033
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>