improve tutorial_helevel

- fix indent of query method
- add remark about the CCU4 cid command

Change-Id: Iaee821cf7739536cc823494f646a1d2a4bbbfa44
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/25092
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
This commit is contained in:
l_samenv 2021-03-02 13:42:10 +01:00 committed by Markus Zolliker
parent d0f895ed44
commit e568c665a8

View File

@ -30,6 +30,7 @@ CCU4 luckily has a very simple and logical protocol:
# for completeness: (not needed, as it is the default)
end_of_line = '\n'
# on connect, we send 'cid' and expect a reply starting with 'CCU4'
# 'cid' is a CCU4 command returning the current version prefixed with CCU4
identification = [('cid', r'CCU4.*')]
@ -144,16 +145,16 @@ which means it might be worth to create a *query* method, and then the
...
def query(self, cmd):
"""send a query and get the response
def query(self, cmd):
"""send a query and get the response
:param cmd: the name of the parameter to query or '<parameter>=<value'
for changing a parameter
:returns: the (new) value of the parameter
"""
name, txtvalue = self._iodev.communicate(cmd).split('=')
assert name == cmd.split('=')[0] # check that we got a reply to our command
return txtvalue # Frappy will automatically convert the string to the needed data type
:param cmd: the name of the parameter to query or '<parameter>=<value'
for changing a parameter
:returns: the (new) value of the parameter
"""
name, txtvalue = self._iodev.communicate(cmd).split('=')
assert name == cmd.split('=')[0] # check that we got a reply to our command
return txtvalue # Frappy will automatically convert the string to the needed data type
def read_value(self):
return self.query('h')
@ -247,4 +248,4 @@ the parameters *empty_length* and *full_length* from the client by defining:
However, we do not put this here, as it is nice to try out changing parameters for a test!
*to be continued*
*to be continued*