move getParameter method from ProxyClient to SecopClient
+ 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>
This commit is contained in:
parent
c840935588
commit
434ef4a423
@ -171,15 +171,6 @@ class ProxyClient:
|
||||
self.callback(module, 'updateEvent', module, param, value, timestamp, readerror)
|
||||
self.callback((module, param), 'updateEvent', module, param, value, timestamp, readerror)
|
||||
|
||||
def getParameter(self, module, parameter, trycache=False):
|
||||
if trycache:
|
||||
cached = self.cache.get((module, parameter), None)
|
||||
if cached:
|
||||
return cached
|
||||
if self.online:
|
||||
self.readParameter(module, parameter)
|
||||
return self.cache[module, parameter]
|
||||
|
||||
|
||||
class SecopClient(ProxyClient):
|
||||
"""a general SECoP client"""
|
||||
@ -509,6 +500,15 @@ class SecopClient(ProxyClient):
|
||||
pass
|
||||
return self.cache.get((module, parameter), None)
|
||||
|
||||
def getParameter(self, module, parameter, trycache=False):
|
||||
if trycache:
|
||||
cached = self.cache.get((module, parameter), None)
|
||||
if cached:
|
||||
return cached
|
||||
if self.online:
|
||||
self.readParameter(module, parameter)
|
||||
return self.cache[module, parameter]
|
||||
|
||||
def setParameter(self, module, parameter, value):
|
||||
self.connect() # make sure we are connected
|
||||
datatype = self.modules[module]['parameters'][parameter]['datatype']
|
||||
|
0
secop/lib/enum.py
Executable file → Normal file
0
secop/lib/enum.py
Executable file → Normal file
0
secop_psi/ah2700.py
Executable file → Normal file
0
secop_psi/ah2700.py
Executable file → Normal file
0
secop_psi/k2601b.py
Executable file → Normal file
0
secop_psi/k2601b.py
Executable file → Normal file
0
secop_psi/ppms.py
Executable file → Normal file
0
secop_psi/ppms.py
Executable file → Normal file
0
secop_psi/ppmssim.py
Executable file → Normal file
0
secop_psi/ppmssim.py
Executable file → Normal file
0
secop_psi/ppmswindows.py
Executable file → Normal file
0
secop_psi/ppmswindows.py
Executable file → Normal file
Loading…
x
Reference in New Issue
Block a user