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:
zolliker 2020-03-02 17:10:47 +01:00
parent c840935588
commit 434ef4a423
7 changed files with 9 additions and 9 deletions

View File

@ -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
View File

0
secop_psi/ah2700.py Executable file → Normal file
View File

0
secop_psi/k2601b.py Executable file → Normal file
View File

0
secop_psi/ppms.py Executable file → Normal file
View File

0
secop_psi/ppmssim.py Executable file → Normal file
View File

0
secop_psi/ppmswindows.py Executable file → Normal file
View File