- when applying overrides with reorder=True, take ctr from Override,
else copy from the cloned Accesible. This did not work properly
- reworked:
- replaced CountedObj class by object_counter
- accessibles created by a copy or by applying Overrides
do not need fresh counted values
- adjusted tests
Change-Id: Id2fcf1ab1295aa1ea80ea81ae8cd02d36f86e969
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/24926
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
- PPMS: improved machanism for 10 K waiting
- LS370: fixed an issue with auto range
+ LS370: show test for all status bits
Change-Id: Ia6454141917893f0e5c6c4351df3a864942bb629
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/23495
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
in the previous version, it was not possible to give a ASCII nul
character as end_of_line, because StringType refuses this
- end_of_line might be given as bytes, str or int
- end_of_line might be given as tuple (eol_read, eol_write)
Change-Id: I8b7942320ad3ffe162cdf3a673e113a66a84fb93
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/23496
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>
- change secop.client.SecopClient to use native types instead of
strings for its setParameter and execCommand methods.
- secop-gui: for now, setParameter accept strings for complex types.
this should be changed to use native type in an other change
- fix bugs in parser.py
+ SecopClient: make visible in an error message that the error
was generated on the SEC node
+ fix a bug when a command is called with 0 as argument
Change-Id: Id87d4678311ef8cf43a25153254d36127e16c6d9
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/23299
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>
- automatically reuse communicators (iodevs) with the same uri
- when uri and iodev is given, iodev gets the name of the
auto-created communicator
Change-Id: If30353c0b61104837e0f940968080c3c1e53c1c6
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/23122
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
make __repr__ more nice and include in __all__
Change-Id: Iecfe6326f2d35a2210c03f7bd8c84dc2830b19ea
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/23120
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
motivation: a thread creating a lot of messages like a polling loop
with very short polling frequency or a fast polling connection might
monopolize the output of message over receiving new messages.
In addition, the current design has a latency of 0.3 sec for the
output of asynchronous replies.
Anyway, the output queue is just extending the network output buffer,
which is usally big enough.
- change the name of 'queue_async_reply' to 'send_reply'.
This method anyway was not only used for async replies.
- send_reply is directly sending the reply instead of putting into the
queue. It will slow down the calling thread, if the output buffer
is full, which is desired behaviour.
Change-Id: I305669be2f7c027355b43421432f32be9c166ed4
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/23119
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
- send a heartbeat, if no events for 5 sec.
an interrupted connection (not closed by the other end) may
not be detected for a long time when nothing is sent
+ make the error reply on a non SECoPEror more verbose
e.g. "KeyError('foo')" instead of just "foo"
+ allow cfg file without nodeinterface
+ shorter logger name in HasIodev
Change-Id: I6b1ff23f9bf8c96feb25af44935596437b7d726f
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/23098
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
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>
- errors in cache are stored as Exception, not as tuple
Change-Id: I391c74a4bef1dc10a1783b98b1ad06fec90365df
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/23044
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
- fix ArrayOf maxlen instead of maxsize
- marked missing NoneOr widget as TODO
(Remark: there are quite a lot of other things in cfg-editor to fix)
Change-Id: I3a8b2f650cca45dae4f87ba63c70ae58ca49ce42
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/23037
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
config file format change:
The section names no longer contain a space, the are either
bare module names or 'NODE' or 'INTERFACE' (capitalized in order to
distingish from module names).
The present code still accepts the old form.
Moving to the 'toml' format was considered too, but this needs some
more investigations. The necessary code changes would be limited
to the method Server.loadCfgFile.
Change-Id: I6020058c9dcc4c1cbf38f5b9e8f67e9aad670183
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/23031
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
importing secop.asynconn should not fail when pyserial
is not available
Change-Id: I9d06e66cf4ab9e1ad200e8d176b4a3a0e50496c7
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/23035
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
- server port can be given as cmd line argument
- multiple cfg files may be merged on one server
needed for the way how frappy is planned to be used at PSI
+ add --test option in bin/secop-server
Change-Id: I1e77f65891b15a70b191cbac8168e69715ace3dc
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/22947
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
in order to prevent modifying parameters without automatically
trigger updates, all datatypes must be immutable.
TupleOf and ArrayOf: change from list to tuple
StructOf: use ImmutableDict
most existing code should work properly, the only thing to consider are
equality comparisons with lists, which will result to False all the time
the changes in secop_psi/ppms.py (using tuples instead of lists for status values)
are not really necessary, but lead to less confusing code
Change-Id: I181f412b5cd55af296b2e5120af82449beb03f54
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/22972
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
handling of mappings for NamedDigital*put needs to be improved!
Change-Id: I015cb1d26d049d3caecc0e03baa9f523951f004c
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/22932
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
- added also test for this
Change-Id: I1c3ad92bc10131d6cd096496230222c999f0097e
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/22737
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
+ remove unneccessary x mode for some py files
Change-Id: Iaca31fc35ef57805e68e0404c1c7d3240a15f11a
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/22571
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
if a write_<parameter> function is defined and <parameter> has an
iohandler, the handlers write function is not called automatically.
It has to be called explicitly in the write_<param> function, if
needed.
reasons:
- the previous logic when a wrapped write function is already present, and a
handler is defined on the specialized class, did not work, and is not
easy to solve properly
- it is probably anyway better to call the handlers write function explicitly
instead of automatically depending on the return value
Change-Id: I04f0849b6cc3fb9979c0f5ac8245a6ab4bf23072
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/22565
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
the code for calling register_callback is more readable and more
explicit now
Change-Id: I7a6a236d7f50b1ad391c1d49e3fb48f2580aa875
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/22564
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
- change self._state to self.state: may be read by calling code
- online and state attributes to be set after the nodStateChange
callback in order to detect state changes
- remove ProxyClient.readParameter (no need to be implemented)
- reconnect thread must be killed on an external call to disconnect
Change-Id: I08d75dc8e29aa6e65a33ce36a911da4eaf0b62ef
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/22551
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
the executable for python might also be called pythonw.exe,
-> adjust the guess
Change-Id: Ie2e7adc6d55f82ad4243761645da0e8e6ec8cc40
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/22549
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
also allow SECoP client connections via serial
Change-Id: I10c02532a9f8e9b8f16599b98c439742da6d8f5c
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/22525
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>
in case a remote is disconnected and can be reconnected quickly,
a seamless routing is possible. However, when after reconnection
the description has changed, the server is restarted.
+ more information in error messages from dispatcher
Change-Id: I0837e0254aee3d12a26481f6fd697081a53aabba
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/22506
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
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>
new client intended as base class for all clients
- based on Ennos secop client in nicos ([WIP] provide secop client)
- self healing connection singletons
- extension for other than TCP is foreseen (by extending new uri schemes)
- extensible name mangling
- seperate rx and tx threads supporting events
- internal cache
- extensible error handling
- callback for unhandled messages
- callback for descriptive data change
- callback for node stat change (connected, disconnected)
- a short close down and reconnect without change in descriptive data
does not disturb the client side
works with secop-gui (change follows), planned to be used for Frappy
internal secop proxy and as a replacement for secop.client.baseclient.Client
in the nicos secop device.
-> secop/client/baseclient.py to be removed after planned changes
moved secop/client/__init__.py to secop/client/console.py because secop.client
would be the natural place to put the new base class.
Change-Id: I1a7b1f1ded2221a8f9fcdd52f9cc7414e8fbe035
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/22218
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
Actually, only property values set in the configuration can
be exported, as values equal to the default are not exported.
For this, the mechanism of overwriting properties by class attributes
has to be modified.
Change-Id: I4388d1fbb36393e863556fbbc8df800dd4800c87
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/22161
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
This change allows compilation under python 3.4. In addition:
- spec file added for pyinstaller with required hidden imports
- changed default pathes for compiled exe file
- added requirements for ppms under windows compilation
Change-Id: I63d805a984d6a2c045df527303f46c8440994aad
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/22170
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
Reviewed-by: Petr Cermak <cermak@mag.mff.cuni.cz>
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Tested-by: Petr Cermak <cermak@mag.mff.cuni.cz>
- code for calling write_<param> before write function from handler
is moved to the metaclass
- moved some methods from IOBaseHandler to IOHandler
Change-Id: I733c7fe8d3d59d9013e7b5a33e170c4b3e386921
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/22098
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>