Esempio n. 1
0
 def get_item(self):
     item = self.get_active_iter()
     if item is None:
         return None
     name = self._items.get(item, 0)[0]
     objname = '%s_%s' % (self._namedlist.get_base_name(), name)
     return helper.find_object(objname)
Esempio n. 2
0
    def set_instrument(self, ins):
        if type(ins) == types.StringType:
            # This should perhaps go through qt.get_instrument_proxy()
            ins = helper.find_object('instruments_%s' % ins)

        if self._instrument == ins:
            return True

        if ins is not None:
            self._insname = ins.get_name()
        else:
            self._insname = ''

        self._instrument = ins
        self._param_list.clear()
        if ins is not None:
            self._param_list.append([TEXT_NONE])

            self._instrument.connect('parameter-added', self._parameter_added_cb)

            for (name, options) in misc.dict_to_ordered_tuples(ins.get_shared_parameters()):
                if len(self._types) > 0 and options['type'] not in self._types:
                    continue

                if options['flags'] & self._flags:
                    self._param_list.append([name])
        else:
            self._param_list.clear()
Esempio n. 3
0
 def add_instruments(self):
     inslist = qt.instruments.get_instrument_names()
     inslist.sort()
     for insname in inslist:
         # This should perhaps go through qt.get_instrument_proxy()
         ins = helper.find_object('instrument_%s' % insname)
         self.add_instrument(ins)
Esempio n. 4
0
    def __init__(self, types=[]):
        self._ins_list = gtk.ListStore(gobject.TYPE_STRING)
        QTComboBox.__init__(self, model=self._ins_list)

        self._types = types
        self._ins_list.append(['<None>'])
        self._instruments = qt.instruments
        for insname in self._instruments.get_instrument_names():
            ins = helper.find_object('instrument_%s' % insname)
            if len(types) == 0 or ins.has_tag(types):
                self._ins_list.append([insname])

        self._instruments.connect('instrument-added', self._instrument_added_cb)
        self._instruments.connect('instrument-removed', self._instrument_removed_cb)
        self._instruments.connect('instrument-changed', self._instrument_changed_cb)
Esempio n. 5
0
    def __init__(self, types=[]):
        self._ins_list = gtk.ListStore(gobject.TYPE_STRING)
        QTComboBox.__init__(self, model=self._ins_list)

        self._types = types
        self._ins_list.append([TEXT_NONE])
        self._instruments = qt.instruments
        for insname in self._instruments.get_instrument_names():
            # This should perhaps go through qt.get_instrument_proxy()
            ins = helper.find_object('instrument_%s' % insname)
            if len(types) == 0 or ins.has_tag(types):
                self._ins_list.append([insname])

        self._instruments.connect('instrument-added', self._instrument_added_cb)
        self._instruments.connect('instrument-removed', self._instrument_removed_cb)
        self._instruments.connect('instrument-changed', self._instrument_changed_cb)
Esempio n. 6
0
    def __init__(self, parent, *arg, **kw):
        QtGui.QWidget.__init__(self, parent)

        # default params
        self._ins = None
        self._ins_supported = {}

        # process arguments
        # the panel can have a 'main' instrument
        for k in kw:
            if k == 'ins':
                self._ins = helper.find_object('instrument_%s' % kw[k])

        # get supported features
        # but only for available (duh), cyclopean instruments
        if self._ins != None:
            try:
                self._ins_supported = self._ins.supported()
            except AttributeError:
                # not cyclopean
                pass
Esempio n. 7
0
    def __init__(self, parent, *arg, **kw):
        QtGui.QWidget.__init__(self, parent)

        # default params
        self._ins = None
        self._ins_supported = {}

        # process arguments
        # the panel can have a 'main' instrument
        for k in kw:
            if k == 'ins':
                self._ins = helper.find_object('instrument_%s' % kw[k])

        # get supported features
        # but only for available (duh), cyclopean instruments
        if self._ins != None:
            try:
                self._ins_supported = self._ins.supported()
            except AttributeError:
                # not cyclopean
                pass
 def _add_instruments(self):
     for name in self._instruments.get_instrument_names():
         ins = helper.find_object('instrument_%s' % name)
         self._add_instrument(ins)
Esempio n. 9
0
def get_plot_proxy(name):
    return helper.find_object('%s:plot_%s' % (config['instance_name'], name))
Esempio n. 10
0
import types

from lib import config
config = config.get_config()


class constants():
    FLAG_GET = 0x01
    FLAG_SET = 0x02
    FLAG_GETSET = 0x03
    FLAG_GET_AFTER_SET = 0x04
    FLAG_SOFTGET = 0x08
    FLAG_PERSIST = 0x10


flow = helper.find_object('%s:flow' % config['instance_name'])
for i in range(100):
    status = flow.get_status()
    if not (status is None or status == "starting"):
        break
    print 'Status: %r, waiting...' % status
    time.sleep(2)

instruments = helper.find_object('%s:instruments1' % config['instance_name'])
plots = helper.find_object('%s:namedlist_plot' % config['instance_name'])
data = helper.find_object('%s:namedlist_data' % config['instance_name'])
interpreter = helper.find_object('%s:python_server' % config['instance_name'])
frontpanels = {}
sliders = {}

from lib.gui.qtwindow import QTWindow
Esempio n. 11
0
def get_plot_proxy(name):
    return helper.find_object('plot_%s' % name)
Esempio n. 12
0
def get_data_proxy(name):
    return helper.find_object('data_%s' % name)
Esempio n. 13
0
flow = helper.find_remote_object('%s:flow' % config['instance_name'])
if flow is None:
    flow = helper.find_remote_object('flow')
    if flow is None:
        raise ValueError('Unable to locate qt.flow object (%s), client failed to start' % config['instance_name'])
    else:
        print 'Connected to undefined qtlab instance'

for i in range(100):
    status = flow.get_status()
    if not (status is None or status == "starting"):
        break
    print 'Status: %r, waiting...' % status
    time.sleep(2)

instruments = helper.find_object('%s:instruments1' % config['instance_name'])
plots = helper.find_object('%s:namedlist_plot' % config['instance_name'])
data = helper.find_object('%s:namedlist_data' % config['instance_name'])
interpreter = helper.find_object('%s:python_server' % config['instance_name'])
frontpanels = {}
sliders = {}

from lib.gui.qtwindow import QTWindow
windows = QTWindow.get_named_list()

def get_instrument_proxy(name):
    return helper.find_object('%s:instrument_%s' % (config['instance_name'], name))

def get_data_proxy(name):
    return helper.find_object('%s:data_%s' % (config['instance_name'], name))
Esempio n. 14
0
from lib.network.object_sharer import helper
import time

from lib import config
config = config.get_config()

class constants():
    FLAG_GET = 0x01
    FLAG_SET = 0x02
    FLAG_GETSET = 0x03
    FLAG_GET_AFTER_SET = 0x04
    FLAG_SOFTGET = 0x08
    FLAG_PERSIST = 0x10

flow = helper.find_object('flow')
for i in range(100):
    status = flow.get_status()
    if not (status is None or status == "starting"):
        break
    print 'Status: %r, waiting...' % status
    time.sleep(2)

instruments = helper.find_object('instruments1')
plots = helper.find_object('namedlist_plot')
interpreter = helper.find_object('python_server')
frontpanels = {}
sliders = {}

# from lib.gui.qtwindow import QTWindow
# windows = QTWindow.get_named_list()
Esempio n. 15
0
def get_plot_proxy(name):
    return helper.find_object('plot_%s' % name)
Esempio n. 16
0
def get_data_proxy(name):
    return helper.find_object('data_%s' % name)
Esempio n. 17
0
def get_instrument_proxy(name):
    return helper.find_object('instrument_%s' % name)
Esempio n. 18
0
import time

from lib import config
config = config.get_config()


class constants():
    FLAG_GET = 0x01
    FLAG_SET = 0x02
    FLAG_GETSET = 0x03
    FLAG_GET_AFTER_SET = 0x04
    FLAG_SOFTGET = 0x08
    FLAG_PERSIST = 0x10


flow = helper.find_object('flow')
for i in range(100):
    status = flow.get_status()
    if not (status is None or status == "starting"):
        break
    print 'Status: %r, waiting...' % status
    time.sleep(2)

instruments = helper.find_object('instruments1')
plots = helper.find_object('namedlist_plot')
data = helper.find_object('namedlist_data')
interpreter = helper.find_object('python_server')
frontpanels = {}
sliders = {}

from lib.gui.qtwindow import QTWindow
Esempio n. 19
0
def get_instrument_proxy(name):
    return helper.find_object('instrument_%s' % name)
Esempio n. 20
0
def get_plot_proxy(name):
    return helper.find_object('%s:plot_%s' % (config['instance_name'], name))
Esempio n. 21
0
 def add_instruments(self):
     inslist = qt.instruments.get_instrument_names()
     inslist.sort()
     for insname in inslist:
         ins = helper.find_object('instrument_%s' % insname)
         self.add_instrument(ins)