autogeneration of iodevs

allow a shortcut for generating iodevs:
If 'uri' is given in the config file for a module with HasIodev, it
will autogenerate its communicator.
The iodevClass attribute on the module class determines the class
for the iodev to be generated.

Change-Id: I4e82a57a33218fd159cec9f4c95171365c55d94a
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/22068
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
This commit is contained in:
2019-12-20 10:43:45 +01:00
parent f06fa9faa2
commit e2cc9f74b5
3 changed files with 27 additions and 18 deletions

View File

@ -57,6 +57,7 @@ for bit, text in enumerate('CS_OVL VCM_OVL VMIX_OVL R_OVER R_UNDER T_OVER T_UNDE
class StringIO(secop.stringio.StringIO):
identification = [('*IDN?', 'LSCI,MODEL370,.*')]
wait_before = 0.05
class Main(HasIodev, Module):
@ -72,6 +73,7 @@ class Main(HasIodev, Module):
}
pollerClass = Poller
iodevClass = StringIO
def analyze_scan(self, channel, autoscan):
return dict(channel=channel, autoscan=autoscan)
@ -96,6 +98,7 @@ class ResChannel(HasIodev, Readable):
for val in [2, 6.32, 20, 63.2, 200, 632]))}
pollerClass = Poller
iodevClass = StringIO
properties = {
'channel':