Commit Graph

217 Commits

Author SHA1 Message Date
aa753b8e7e followup fix to 38071: class missing 'frappy.' prefix
in 38071 get_class was modified not to prefix 'frappy.'
when path does not start with 'frappy'.

Change-Id: I528ed552a2af693794ce7f92c2e7dc43f4118f27
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/38435
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Georg Brandl <g.brandl@fz-juelich.de>
2026-02-12 17:20:10 +01:00
18f6fa239b frappy-edit: fix class completion
when the suggestion ends with a dot, all possibilities have
to be on the popup menu

Change-Id: Ic6f759d1e9d4028695d8949be5d4e3e81bbbe044
2026-02-12 09:00:22 +01:00
00318cc7a1 frappy-edit: add default cfg path given typically at psi
Change-Id: I91032c912d76f555ae88e3e7ae313fa3c03948bd
2026-02-11 14:30:01 +01:00
e1e642fb2f beta version of frappy-edit
Change-Id: I82b35505207429cddac44d28222e20627b3a90b3
2026-02-11 13:40:32 +01:00
53256d1583 [WIP] work on curses cfg editor
state as of 2026-01-28

Change-Id: I73d2fa4e6fda8820a95fe4e7256c7a23bf565f67
2026-02-11 13:40:32 +01:00
e741404d0b simplify configuration of IO modules
As the communicator class needed for a module can be specified,
in the configuration we do not need to specifiy it explicitly.

A new configurator function IO() is introduced for this, defining
names and uri only.

- update also configuration reference and a tutorial example
- update get_class function to accept attributes of classes like
  'frappy_demo.lakshore.TemperatureSensor.ioClass' and import from
  modules other than frappy... like 'test.test_iocfg.Mod'.
- add ioClass to the example class for the temperature controller
  tutorial

Change-Id: I3115371d612f14024e43bc6d38b642e1d27b314d
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/38071
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
2026-02-11 13:40:32 +01:00
d0b56ae918 followup fix for 37776: remove Secnode.raise_config_errors
use raise_config_errors from generalConfig

Change-Id: I5c05edee452540ddc0401f47b375335690d29e54
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/37935
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Georg Brandl <g.brandl@fz-juelich.de>
2026-02-11 13:40:32 +01:00
40934e45bc frappy.lib.mathparser: add relational operators 2026-01-21 17:15:52 +01:00
f00d37b7a6 frappy.client.interactive: cosmetic fixes 2025-11-17 16:33:24 +01:00
f832e40898 add shortcut for acquisition modules
acq(<goal>) sets goal, starts and waits for completion
2025-11-17 16:06:07 +01:00
151627b4f4 frappy.io: add readline method
For devices sending messages asynchronously, a simple
readline method is added. Waiting for characters is not
blocking writeline - only the actual reading is using
a lock.
This needs also some rework of frappy.lib.asynconn.
2025-11-17 15:48:45 +01:00
ee26c72ed4 add missing property check
check also values of properties with mandatory=False

Change-Id: I346691a7260a4d85b89c9620c097180da4e9d657
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/37777
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
2025-11-13 17:30:08 +01:00
9fe040e9d3 improve error handling during polls
improve the mechanism which avoids duplicated error messages
in the log file:

- extend to errors in doPoll
- trigger error messages every day, so that they appear in every
  logfile

+ add missing space in some error message

Change-Id: Icfaa06b43ee53f477483bab1f84def832fd0b977
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/37432
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
2025-11-13 17:29:58 +01:00
943995b1d7 improve error handling on startup
- configuration errors on startup are no longer collected in the
  'errors' attribute, but logged immediately and counted in a new
  'logError' method.
- generalConfig may be configured to raise the errors immediately
  instead
- Raise immediately on unhandled errors. Some of them were catched
  before which may lead to strange follow up errors.
- do not start poller thread, when the error count is non-zero
- as before, simple connection failures are not preventing startup,
  but now more severe errors (bad uri) will stop the server

Change-Id: I4f84ee8e86cf2925108c0fe92eaab796bb731091
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/37776
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
2025-11-13 17:29:41 +01:00
Georg Brandl
2ec2954159 datatypes: make length checks more consistent
Change-Id: If5a5422675571506085c73ff2051ba06f4fb37b2
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/37844
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
Reviewed-by: Georg Brandl <g.brandl@fz-juelich.de>
2025-11-13 15:35:39 +01:00
Georg Brandl
7769a5daa6 do not put entire blob value into error message, it might be megabytes
Change-Id: Ib94701022ea864b4d77d2ac632a8b6d74e8b2e16
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/37842
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
Reviewed-by: Georg Brandl <g.brandl@fz-juelich.de>
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
2025-11-13 15:30:35 +01:00
Georg Brandl
a31e5a5009 remove passive aggressiveness from error messages
Change-Id: I6a25703c65c11c1b57e2cad409b0da0bba724b5e
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/37841
Reviewed-by: Georg Brandl <g.brandl@fz-juelich.de>
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
2025-11-13 15:30:17 +01:00
Georg Brandl
cf220382b9 datatypes: do not arbitrarily restrict maxlen of arrays/blobs to 2**16
Change-Id: Ic03ff05240c7caa22ae5adf555f871d09612eecd
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/37837
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Georg Brandl <g.brandl@fz-juelich.de>
2025-11-13 15:30:17 +01:00
Georg Brandl
66f0e64b2e client: increase read buffer size
Receiving large replies with 8kb buffer size is painfully slow.

Change-Id: Ife4a439d01153c60e8fd96d2c7f2874918fb4012
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/37838
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
Reviewed-by: Georg Brandl <g.brandl@fz-juelich.de>
2025-11-13 15:30:17 +01:00
6e10382d98 io: add reconnect command
sometimes reconnecting helps to heal a broken connection

Change-Id: I368ecb549ca346d7db3484f6a8be0a3a9a86aff1
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/37433
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Georg Brandl <g.brandl@fz-juelich.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
2025-11-13 15:29:17 +01:00
Alexander Zaft
6600ec63fd module: apply datatype first
if the default value is given before the datatype, the module cannot be
created. Also fixes the remaining errors in issue 4913.

Fixes: 4913
Change-Id: I613576388bc3b9e7a5cdc7aa4d5ea73e549ae167
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/37182
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Alexander Zaft <a.zaft@fz-juelich.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
2025-11-13 15:29:11 +01:00
17511b8bf2 frappy/lib: add math parser to evaluate a string function 2025-11-12 17:22:38 +01:00
ebfb8a005d simplify errors on startup
Change-Id: I2b12abf15487000992e019e12002303036766d52
2025-11-05 16:23:46 +01:00
b45635e4f8 make controlled_by configuration work properly
- secnode.py: initialize all modules before creating description
- fixes in ctrlby.py
2025-10-30 13:43:20 +01:00
Alexander Zaft
07377c8bf5 core: Add Acquisition Interface
+ Adds first implementation for the Acquisition interface, split into
  Controller and Channel Modules
+ frappy_demo: adds an example simulation
+ new property AttachedDict for a collection of attached modules
+ move Attach and AttachDict to a new file frappy/attached.py
+ interface_classes creation changed. includes now also Acquisition

Change-Id: I198a96065a65bb28f73e468ce0465fca2d8734d7
2025-10-30 10:21:19 +01:00
84ee2dd508 specify interface_classes property explicitly on SECoP base classes
The mechanism to calculate the interface_classes automatically
gets more complicated whith the introduction if acquisition
classes. Instead of making the mechanism more complex its simpler
to give them explictly on the classes which correspond to the
predefined SECoP interface classes.

Change-Id: I9be7d9e54e3603b979ca2a823ec47b2075937ece
2025-10-30 10:21:05 +01:00
174da915d2 allow to remove a property defined in a base class
the same mechanism works already for parameters

Change-Id: I19da668ded9697b0f51069af9ddd752091abd0fc
2025-10-30 10:20:21 +01:00
24153d2584 datatypes: split base classes for internal and SECoP datatypes
Simple datatypes used only in properties like ValueType of NoneOr
do not need a couple of methods. Splitting the base class avoids
warnings about unimlemented abstract methods.

Change-Id: Ie7d5754c44a5fb5c3ed8569df544495450347082
2025-10-30 10:19:49 +01:00
8575a2f785 improve error messages when attached modules fail on startup
fix to align local frappy branch wip with gerrit repo

Change-Id: Iafbd8c5e4b67209046c252f2cafa69dcb6e2bbcb
2025-10-30 08:01:26 +01:00
51725d6d0d fix bug introduced in commit 7adb4d6f
Change-Id: I00f0101a437ec070a8a3f07b3c0766acde23cad4
2025-10-29 16:58:58 +01:00
7adb4d6f04 improve error messages when attached modules fail on startup
Change-Id: Ic1d2d77de2574043749ddbc00def48a6fe77b2bd
2025-10-27 13:14:26 +01:00
431f4d1198 fi furnace: version for first tests
Change-Id: I841bc9dab210bfc907d2ae56c42198c30df9a3a4
2025-08-07 15:57:12 +02:00
bea6ea38ae interactive client: change command history location
- place file in ~/.local/state/
- create the directory if needed
- use pathlib

Change-Id: I9381c65fd63cea44013f2cfd16e14b8dc26c465c
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/37111
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
2025-08-07 14:01:33 +02:00
cf151dd324 fs (and other furnaces): fixes on interlock
- try to make interlock right
- merge status where ever possbile
2025-07-07 16:05:27 +02:00
73c620797c frappy.ctrlby: improvements
Change-Id: I7ea2d0398fa3b32002dbaa066e3923fef72535fa
2025-07-02 15:41:41 +02:00
a3d0549199 fs: improve and fix implementation
+ introduce WrapControlledBy and fix HasControlledBy

this in a new module before mercury/triton have been fixed
2025-06-27 14:48:02 +02:00
2b7ee0a72c addressed parameters
- generic method to access parameters with just an address
  changed to avoid boilerplate code
- it would really be nice to include the generic methods
  into Module

Change-Id: I898e5eeb282f03d3177a324fa88813976fb15f3c
2025-06-05 17:48:15 +02:00
97140aa3b4 SEA: do not override write_target method
else it will not wait for is_running

+ fix in playground
2025-06-05 11:52:50 +02:00
404b38d91a frappy.params: fix typo
Change-Id: I724615de8d8d6b44bc5aceded85bf40d2a5e96f7
2025-06-05 10:22:07 +02:00
c0f6569f1b frappy-cli: connect to servers on localhost by default
--scan option: specify where to scan if not on localhost

Change-Id: I51a694eb3cb045e7d18c19a332db8e6ba063009b
2025-06-02 15:24:04 +02:00
6fed5a3651 increase omit_unchanged_within to 60 s
+ fix a bug reading this from general config file
2025-05-22 08:38:51 +02:00
d3280474c3 frappy.client.interactive: no pathlib needed here
allow the argument of the run function to be a simple string

Change-Id: I1d5de3802b6adc22a01a262d4cb017bf7dd084c5
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/36343
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
2025-05-16 15:43:00 +02:00
7cf32c4e7c config: add 'include' and 'override'
including a config file and overriding some properties is
helpful when we do not want to modify the original config
but run it with sligthly different properties.

this involves some redesign a.o.:
- modules are collected in a dict instead of a list in
  order for 'override' to find the related module
- checking for duplicates happens in the Collector

Do not warn when included file does not end with '_cfg.py',
as this may be intentional, in case a file is only used
via 'include' and not as cfg file alone.

+ remove unused method Collector.append
+ complain with specific error message when Node is not given

Change-Id: Id568f04d6d84622ef2547412eb6f288fcebf986f
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/36357
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
2025-05-16 15:43:00 +02:00
b1c920819e frappy.client.interactive: improve updates while driving
- instead to show first current 'value' and 'status', and then
  the changes, show changes only - this way updates appear
  in the expected order
- for this SecopClient.register_callback needs a 'callimmediately'
  argument

Change-Id: I3e91c2c15bca7fee2eba3b1bf1dd27313da3ae29
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/36291
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
2025-05-12 10:48:14 +02:00
8f2973c39d client: add SecopClient.execCommandFromString
analogous to setParameterFromString
to be used in simple clients where values of structured datatypes
are just python literals

Change-Id: I4936a3c5c0cac45bd7e875c938ce2700b4f4a979
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/36262
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
2025-05-12 10:46:39 +02:00
58549065fb more demo test cases
- added them to cfg/dummy_cfg.py
+ treat enum correctly in SecopClient.setParameterFromString

Change-Id: Ia5b2d8d3a21c3215cb93d90975086eb9995b1543
2025-04-25 15:38:16 +02:00
b264455ad3 follow-up change to 35931: make Proxy a Module
Proxy must be a class, because of the new check for configured
'cls' inheriting from Module. Use Proxy.__new__ to implement
this.

Change-Id: I4bb036afc2ce92187a9049dff0a6f22b20c3a260
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/36104
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
2025-04-24 11:14:35 +02:00
07c5b32c5f revert 'change to new visibility spec'
nicos is not yet ready for this

Change-Id: Ibfbb7e32e06a6e0616ded8342bc5844fd531944f
2025-04-24 11:09:26 +02:00
e0bd84cc3b change to new visibility spec
+ visibiliy is no longer an EnumType, as this would break
  the specs

Change-Id: I1197c82f31c33c210fdcda0b49a0c38027880d77
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/36088
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
2025-04-23 08:20:54 +02:00
9545cb4188 make sure unexported modules are initialized
take the opportunity for a small redesign:

- create a new method build_descriptive_data which
  calls secnode.get_modules also on unexported modules.

+ cache descriptive data

Change-Id: I4a0b8ac96108463dc0c800bb11a404206c26b092
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/36089
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>
2025-04-23 08:20:54 +02:00