621 Commits

Author SHA1 Message Date
e1d5170a90 T controller tutorial and improve documentation
add tutorial for Berlin hands-on workshop

+ improve the documentation (hints for structure welcome)
+ remove 'optional' parameter property
  (is not yet used - should not appear in doc)
+ added test property in frappy_demo.cryo alters Parameter class
  ('test' property appears in Parameter doc)

Change-Id: I3ea08f955a92f72451fd23a5ff00d1185c7fb00e
2023-03-06 08:24:15 +01:00
Alexander Zaft
a39db9a35d Change Readme title
Change-Id: Id8b07e76cb5748aa595fb484d78ffcc43f9cdddf
2023-03-06 08:24:15 +01:00
Alexander Zaft
5c874483a9 Add initial README
Change-Id: I314b6bf527ba6bb7011804a3768e7785ed4046e3
2023-03-06 08:24:15 +01:00
65480cd773 HasStates: fix status code inheritance
use mro for status code inheritance
- as a consequence, the decorator class 'StatusCode' is now a
  decorator function 'status_code'. snake case is anyway more
  common for decorators.
- adapt tests
+ fix an error message

Change-Id: Ib409b963c51e0fe807397ff1d73d77d0147b8580
2023-03-06 08:24:15 +01:00
7d59345f43 HasControlledBy and HasOutputModule mixins
for supporting coupled modules (output - input case)

Change-Id: I58488faa0d52b3b984a3dc70ff44ee4a9a218d7a
2023-03-06 08:24:15 +01:00
Oksana Shliakhtun
bc553f889c Implement ramping qnw
Change-Id: I9d7fab73194a0a8be3a230cc7ca99066d2553fce
2023-03-02 17:01:43 +01:00
Oksana Shliakhtun
cae225df41 create qnw driver
Change-Id: I7b466caf91b7a2a177fa94ac84cdfc315475f959
2023-03-01 17:49:15 +01:00
Oksana Shliakhtun
3a52f9d31c fixes in lakeshore alarm
Change-Id: Ibbcbe94d9a64d1c074025183e1310506a2cb00f4
2023-03-01 17:49:15 +01:00
4ebb15ca6c add lakeshore demo for hands-on workshop
- a simple LakeShore model 336 driver

a tutorial follows

Change-Id: I291a615efa5bd58a0dd908949210086d2f82c2ca
2023-02-20 12:52:05 +01:00
240c4f027b interactive client: improve watch function
- watch is now a command, not a module method
- finish watching with ctrl-C
- watching an io module logs communication
- add bin/frappy-cli to start interactive client
+ remove sorted function from StructOf.format_value

Change-Id: I7dd707473e4534f2d39c5d6afc533c2d872380f8
2023-02-20 12:51:55 +01:00
f7e24f13bb raise ProtcolError when specifier is missing
- fixed this for 'read', 'change' and 'do' message
+ fix an error in frappy.client.SecopClient closing the connection
  when the identifier is None

fixes: #4672

Change-Id: Iaba0f9ed86b6eb6ef7588403ba640ded552dded6
2023-02-20 12:51:22 +01:00
c3d8068e02 adapt tutorial to new config file format
Change-Id: Iafd8a2dbed8cd1283ce97b6559138c7bc02714c7
2023-02-20 12:51:11 +01:00
084e890645 do not throw ZeroDivisonError when pollinterval is 0
fast_interval might be 0, indicating to poll as fast as possible
- this should not throw a zero division error

Change-Id: I26e18f5a656c943b906c6ffff65361e1fcf16d50
2023-02-20 12:50:38 +01:00
edd3437682 improve persistent parameters
A value given in config overrides values read from the persistent data file.
To let the loaded parameter have precedence, configure a default only.
The write_<param> method of a persistent parameter is now always called
on startup.

- add tests for persistent behaviour
+ simplify Modules.writeInitParams: remove started_callback argument

Change-Id: I08b49de52e9d9a2ed0918018eb2fe538141a4f5e
2023-02-20 12:50:19 +01:00
Alexander Zaft
c2728c8340 Add .desktop file
Fixes: #4632
Change-Id: Ie0f07049462ed6664cca4062bced09c15bdd5a56
2023-02-20 12:50:08 +01:00
725820fafd fix copy method of Attached
a copy of 'Attached' must also copy the basecls

Change-Id: Ia80cc458b241cb1f224f4c24f0241ed1d4ec1060
2023-02-20 12:49:53 +01:00
9f653b4e6f update interactive client
Change-Id: Iacc521807969b23779f1172d09bfc164a0a66a3b
2023-02-02 17:35:39 +01:00
ae7d3514a1 update interactive frappy client
Change-Id: Icf0ce4c7e2f99ac65e2b47e8fa1efb497322922a
2023-02-02 17:33:53 +01:00
Oksana Shliakhtun
6b9d4a8140 .
Change-Id: I45df6909814299a26eefdb25c63b827741872d82
2023-02-02 17:31:24 +01:00
Oksana Shliakhtun
af295b12b0 fixed write_alarm
Change-Id: I1c155a63c7340aa1292bc1e530cedfcc72d5ffed
2023-02-02 17:25:34 +01:00
Oksana Shliakhtun
69dd011260 Added alarms
Change-Id: Idd06278e44e01522ddf904b56a452ce8c704b5a6
2023-02-02 17:22:08 +01:00
Oksana Shliakhtun
d62076128a add comma between command and arguments
Change-Id: Ibc3a9072140842d521ebb4840eecb180e69b134e
2023-01-31 09:42:45 +01:00
38ae301cda add frappy-cli
Change-Id: I2622212e178ceede7cc7285564a7a09929fafc5c
2023-01-30 17:16:08 +01:00
Oksana Shliakhtun
2ee9ea65da fix SETP?
Change-Id: I337adece10204ca67dcf720e4de36085b80601ba
2023-01-30 17:13:52 +01:00
Oksana Shliakhtun
0dfaa79f77 fix set_par/get_par calls
Change-Id: Iff6b244ca381849333646853b4c0bb8a347bbb3b
2023-01-30 17:09:46 +01:00
Oksana Shliakhtun
866fe73f2e fix CDISP
Change-Id: I09010a1997799bed04f25a7a3eb0157f7af5ad8b
2023-01-30 17:04:28 +01:00
l_samenv
f5c96214b0 Merge branch 'develop' of gitlab.psi.ch:samenv/frappy into develop 2023-01-30 16:57:29 +01:00
l_samenv
4d28abe141 fix issue with old reading
- old reading shoould be ignored
- fix channels for CTI7
2023-01-30 16:56:31 +01:00
Oksana Shliakhtun
c75d7f17f7 The PID parameters were added.
Change-Id: I67a7db66ca13b60d35cb4041bbd35c6c4729416c
2023-01-30 16:52:06 +01:00
Oksana Shliakhtun
a384664639 first version of lakeshore 340 driver
Change-Id: Ie9a68be61e142802b2e71420b87623b7a4b4f645
2023-01-24 18:13:34 +01:00
Oksana Shliakhtun
ee708f7b02 fix typo in frappy_psi.mixins
Change-Id: Ifccb6278bbfc221882067a2ae8c72d0163e5f351
2023-01-24 18:12:25 +01:00
edc942cb24 introduce frappy_psi.mixins
containing for now: HasControlledBy, HasOutputModule

Change-Id: I27e3a81d6e985c74440eb9ea6d224272bac4fb7d
2023-01-24 15:33:27 +01:00
dcd79506a9 Merge "improve parameter initialisation" 2023-01-23 08:25:36 +01:00
f4e974f46c improve parameter initialisation
- make 'value' a Parameter property instead of an attribute
- use 'value' instead of 'default' property for setting
  the initial value in the config file
- removal of initwrite parameter property

this change is the basis of a better implementation
for change 30041 (PersistentParam property 'override_cfg')

Change-Id: I2b82bdd54c2dacb87dcd2b3472004d2f0a730cf0
2023-01-20 16:55:06 +01:00
Alexander Zaft
d889401697 Revert limit change in demo
After 29724, the change in frappy_demo/modules.py from 30183 which was
made to run 'make demo' without errors can be reverted.

Change-Id: I00a6f512304a3159c10e44aef670ac0edd4703d7
2023-01-19 15:39:33 +01:00
85295a7d72 Merge "client: detect original frappy error class" 2023-01-19 12:29:37 +01:00
82957c287d Merge "rework datatypes (setter should not check limits)" 2023-01-19 08:28:30 +01:00
Alexander Zaft
05593d80f6 Bring demo up to date
* Add python config for test and demo server
* Remove old configs
* Fix issue with slow start of test server

Change-Id: If0e576f4e4dda8b03489fdbb79b209dfcdca29ff
2023-01-18 16:24:30 +01:00
7a870aa56c rework datatypes (setter should not check limits)
- use Datatype.validate for converting and checking limits
  (used also in properties)
- Datatype.__call__ converts and validates, but without checking
  limits (used in setter)
- Datatype.validate may be used to add missing optional struct elements
  from previous value (used in Dispatcher._setParameterValue)
- remove problematic range check
+ use shorter formula for converting float to int in ScaledInteger
  (leftover from python2 compatibility)
+ improve error messages (strip very long repr(value))

Change-Id: Ib85736fe558ec3370ebce4e1c43f957e3bb0497c
2023-01-16 10:18:15 +01:00
Alexander Zaft
09d48ea913 Merge "GUI: add logging infra, switch to argparse" 2023-01-12 13:12:09 +01:00
Alexander Zaft
8850edbc2d Merge "Change config to Python" 2023-01-12 13:10:37 +01:00
59cc981566 client: detect original frappy error class
The text part of the error report contains the original error
class - convert it to the frappy error class, if possible.
This makes the error messages on the client nicer, as the
error class would be duplicated in the error message on the
client side.

Change-Id: If2e0c3eb15ac2dd1b80a851ff42e4076557a325d
2022-12-22 13:44:08 +01:00
3cc9a75174 improve He level tutorial
values return from read_* methods should be converted
from string to float on float parameters

+ fix some wording

Change-Id: Ic80010c6fbe3eef23483ff69c8a43e25afb8bb6a
2022-12-22 13:39:47 +01:00
Alexander Zaft
52b77ba9e6 Change config to Python
- Change Configuration format to be python-based.
- move config logic to frappy/config.py
- Add first py-config: cryo_cfg.py
- Adapt test to new expected config format

Change-Id: Iaec484e0e1e21ebbb1e5c74b53be6231329ddf71
2022-12-20 09:48:14 +01:00
Bjoern Pedersen
db3b190c26 Improve jenkinsfile
Change-Id: I68efdd1a20135a0374fb9692e369a315824786ea
2022-12-19 14:34:48 +01:00
Alexander Zaft
c522c41654 GUI: add logging infra, switch to argparse
First part for #4662

Change-Id: I75877337e8ea35d4c4555471ee4518c942dac88a
2022-12-08 16:38:00 +01:00
Enrico Faulhaber
929e41ffff Merge "Fix identification response" 2022-12-06 18:00:10 +01:00
Alexander Zaft
8d99a8c536 Fix identification response
- fix header, but accept both responses
- warn when counterpart uses old behaviour

Fixes: #4659
Change-Id: Ib8869755898bf20edcbc7ae93157c943f816ebc1
2022-12-06 14:43:45 +01:00
a14c282993 redesign of the state machine
With the current implementation, we run into a deadlock with the lock
from the state machine interfering with the accessLock on the module.
We can not wait for the state machine to finish while having the
accessLock locked by write_target. As a consequence, when restarting
the state machine we should not wait, but remember the state function
to call and postpone the restart after the cleanup has finished.
For this, we want to know the status before calling the state function.

- create HasState mixin, using doPoll for driving the machine
- StatusCode decorator for assigning a status to a state function
- remove the state machines 'threaded' option
- 'Retry' is now a unique value instead of a class. The retry period
  is determined by the (fast) poll interval.
- return 'Finish' instead of None for finishing the machine. returning
  None for state function is now an error, as this might happen
  easily inadvertently.

Change-Id: Icb31367442f10e98be69af3e05a84f12ce5cc966
2022-12-06 10:18:50 +01:00
Alexander Zaft
d09634a55d Fix error Message for too large arrays
Change-Id: I69b6789ef9f463565918a395120b8f5ad3494b20
2022-11-28 09:28:37 +01:00