labrad / pylabrad

python interface for labrad
51 stars 31 forks source link

Setting not found: select_device on pylabrad==0.97.2 #357

Closed zibrov-zlobin closed 5 years ago

zibrov-zlobin commented 5 years ago

I was writing a new server for a Zurich Instruments subclassing from a DeviceServer and got stuck on select_device() setting for some reason not registering. All other servers seem to work fine, downgrading the version of pylabrad fixed the problem. Given that all other servers (serial/ gpib) seem to be working fine, is there something I am missing in initializing and defining the class?

pylabrad==0.97.2

>>>cxn.servername.list_devices()
[]
>>>cxn.servername.select_device()
C:\ProgramData\Anaconda2\lib\site-packages\concurrent\futures\_base.pyc in __get_result(self)
    412             else:
    413                 exception_type = type(self._exception)
--> 414             raise exception_type, self._exception, self._traceback
    415         else:
    416             return self._result

Error: (0) Setting not found: select_device [payload=None]
>>> cxn.servername
Settings:
    debug
    deselect_device
    echo
    list_devices
    lock_device
    refresh_devices
    release_device
    select_device
    signal__log

on pylabrad==0.95.1

>>>cxn.servername.list_devices()
[]
>>>cxn.servername.select_device()
labrad.errors.NoDevicesAvailableError: (0) No devices are available. [payload=None]

minimal code:

class NewDeviceWrapper(DeviceWrapper):
    @inlineCallbacks
    def connect(self, server, port):
        pass

class NewServer(DeviceServer):
    deviceName = ['DevName']
    name = "ServerName"   
    deviceWrapper = NewDeviceWrapper

    @inlineCallbacks
    def initServer(self):
        yield DeviceServer.initServer(self)
DanielSank commented 5 years ago

Can you make the code even more minimal:

class NewDeviceWrapper(DeviceWrapper):
    @inlineCallbacks
    def connect(self, server, port):
        pass

class NewServer(DeviceServer):
    name = "ServerName"   
    deviceWrapper = NewDeviceWrapper
zibrov-zlobin commented 5 years ago

@DanielSank somehow the problem got resolved and i can no longer reproduce the error. thanks!