コード例 #1
0
ファイル: instruments.py プロジェクト: Chrede88/qtlab
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

import code
import inspect
import gobject
import types
import os
import logging
import sys
import instrument
from lib.config import get_config
from insproxy import Proxy
from lib.network.object_sharer import SharedGObject

from lib.misc import get_traceback
TB = get_traceback()()


def _set_insdir():
    dir = os.path.join(_config['execdir'], 'instrument_plugins')
    sys.path.append(dir)
    return dir


def _set_user_insdir():
    '''
    Setting directory for user-specific instruments.
    For this config['user_insdir'] needs to be defined.
    '''

    dir = _config['user_insdir']
コード例 #2
0
ファイル: qtflow.py プロジェクト: dchristle/qtlab
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

import gobject
import gtk
import logging
import time
from gettext import gettext as _L
from lib.misc import exact_time, get_traceback
from lib.network.object_sharer import SharedGObject
import os

AutoFormattedTB = get_traceback()


class FlowControl(SharedGObject):
    '''
    Class for flow control of the QT measurement environment.
    '''

    __gsignals__ = {
        'measurement-start': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ()),
        'measurement-end': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ()),
        'measurement-idle': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ()),
        'stop-request': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ()),
        'close-gui': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ()),
    }
コード例 #3
0
l.setLevel(logging.WARNING)

import os
import sys
import time
import optparse
adddir = os.path.join(os.getcwd(), 'source')
sys.path.insert(0,adddir)

from lib import config
config = config.create_config('qtlabgui.cfg')

from lib.network import object_sharer as objsh

from lib.misc import get_traceback
TB = get_traceback()()

def setup_windows():
    from windows import main_window
    main_window.Window()

    winpath = os.path.join(config['execdir'], 'source/gui/windows')
    for fn in os.listdir(winpath):
        if not fn.endswith('_window.py') or fn == 'main_window.py':
            continue

        dir, fn = os.path.split(fn)
        classname = os.path.splitext(fn)[0]

        if config.get('exclude_%s' % classname, False):
            logging.info('Skipping class %s', classname)
コード例 #4
0
ファイル: qtflow.py プロジェクト: dchristle/qtlab
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

import gobject
import gtk
import logging
import time
from gettext import gettext as _L
from lib.misc import exact_time, get_traceback
from lib.network.object_sharer import SharedGObject
import os

AutoFormattedTB = get_traceback()

class FlowControl(SharedGObject):
    '''
    Class for flow control of the QT measurement environment.
    '''

    __gsignals__ = {
            'measurement-start': (gobject.SIGNAL_RUN_FIRST,
                gobject.TYPE_NONE,()),
            'measurement-end': (gobject.SIGNAL_RUN_FIRST,
                gobject.TYPE_NONE,()),
            'measurement-idle': (gobject.SIGNAL_RUN_FIRST,
                gobject.TYPE_NONE,()),
            'stop-request': (gobject.SIGNAL_RUN_FIRST,
                gobject.TYPE_NONE,()),