Ejemplo n.º 1
0
cfg['qtlab'] = False

cfg['new_data_structure'] = False

# plot related config settings
cfg['plot_engine'] = 'qkit.gui.qviewkit.main'
# message handling related port setting defaults
cfg['info_port'] = 5600  # this is the port we can listen on messages (signals) told by qkit
cfg['info_host'] = 'localhost'  # this is the host we can listen on messages  
cfg['ask_port']  = 5700  # this is the port rpc could use
cfg['ask_host']  = 'localhost' # as above
# if qtlab is used (qt_cfg exists and qt_cfg['qtlab']): 
# qkit config entries are overridden by the qtlab ones
try:
    from qkit.core.lib.config import get_config
    qt_cfg = get_config()
    in_qt = qt_cfg.get('qtlab', False)
except ImportError:
    in_qt = False

if in_qt:
    for entry in qt_cfg.get_all():
        if entry in cfg.keys():
            cfg[entry] = qt_cfg[entry]

# there can also be a local config file for qkit (qkit/config/local.py) with variable cfg_local = {...}
try:
    from qkit.config.local import cfg_local
    for entry in cfg_local.iterkeys():
        cfg[entry] = cfg_local[entry]
except ImportError:
Ejemplo n.º 2
0
from gettext import gettext as _L
from qkit.core.lib import calltimer
#from lib.network.object_sharer import SharedGObject, cache_result  # YS: try to get rid of 32bit gobject from pygtk
# YS: networking interface is planned to be rewritten

import numpy as np
import logging
#import qkit.core.qt as qt # YS: import problems somehow related to an import loop between instrument -> qt -> instruments -> instrument
#import qt
# YS: this problem can be reproduced with test1.py and test2.py externally.
from qkit.core.qtflow import get_flowcontrol
flow = get_flowcontrol()
msleep = flow.measurement_idle # YS: instead of importing qt, import the required tools from qtflow directly

from qkit.core.lib.config import get_config
_config = get_config()

class Instrument(object):#(SharedGObject): # YS: try to get rid of 32bit gobject from pygtk
    """
    Base class for instruments.

    Usage:
    Instrument.get(<variable name or list>)
    Instrument.set(<variable name or list>)

    Implement an instrument:
    In __init__ call self.add_variable(<name>, <option dict>)
    Implement _do_get_<variable> and _do_set_<variable> functions
    """

    #__gsignals__ = {
Ejemplo n.º 3
0
cfg['qtlab'] = False

cfg['new_data_structure'] = False

# plot related config settings
cfg['plot_engine'] = 'qkit.gui.qviewkit.main'
# message handling related port setting defaults
cfg['info_port'] = 5600  # this is the port we can listen on messages (signals) told by qkit
cfg['info_host'] = 'localhost'  # this is the host we can listen on messages
cfg['ask_port'] = 5700  # this is the port rpc could use
cfg['ask_host'] = 'localhost'  # as above
# if qtlab is used (qt_cfg exists and qt_cfg['qtlab']):
# qkit config entries are overridden by the qtlab ones
try:
    from qkit.core.lib.config import get_config
    qt_cfg = get_config()
    in_qt = qt_cfg.get('qtlab', False)
except ImportError:
    in_qt = False

if in_qt:
    for entry in qt_cfg.get_all():
        if entry in cfg.keys():
            cfg[entry] = qt_cfg[entry]

# there can also be a local config file for qkit (qkit/config/local.py) with variable cfg_local = {...}
try:
    from qkit.config.local import cfg_local
    for entry in cfg_local.iterkeys():
        cfg[entry] = cfg_local[entry]
except ImportError: