def _do_remote_connect_lt1():
    global powermeter_lt1, SMB100_lt1, PMServo_lt1, ZPLServo_lt1, ivvi_lt1, AWG_lt1
    
    from lib.network import object_sharer as objsh
    if objsh.start_glibtcp_client('192.168.0.20',port=12002, nretry=3, timeout=5):
        remote_ins_server_lt1=objsh.helper.find_object('qtlab_lt1:instrument_server')
        powermeter_lt1 = qt.instruments.create('powermeter_lt1', 'Remote_Instrument',
                remote_name='powermeter', inssrv=remote_ins_server_lt1)
        SMB100_lt1 = qt.instruments.create('SMB100_lt1', 'Remote_Instrument',
                remote_name='SMB100', inssrv=remote_ins_server_lt1)
        #AWG_lt1 = qt.instruments.create('AWG_lt1', 'Remote_Instrument',
        #        remote_name='AWG', inssrv=remote_ins_server_lt1)
        AWG_lt1 = qt.instruments.create('AWG_lt1', 'Tektronix_AWG5014',
                address='TCPIP0::192.168.0.22::inst0::INSTR',reset=False,numpoints=1e3)
        PMServo_lt1= qt.instruments.create('PMServo_lt1', 'Remote_Instrument',
                remote_name='PMServo', inssrv=remote_ins_server_lt1)
        ZPLServo_lt1= qt.instruments.create('ZPLServo_lt1', 'Remote_Instrument',
                remote_name='ZPLServo', inssrv=remote_ins_server_lt1)
        ivvi_lt1 = qt.instruments.create('ivvi_lt1', 'Remote_Instrument',
                remote_name='ivvi', inssrv=remote_ins_server_lt1)

        return True
    
    logging.warning('Failed to start remote instruments') 
    return False
Beispiel #2
0
def set_lt1_standalone():
    global adwin
    global AWG
    global counters
    global master_of_space
    global optimiz0r
    global GreenAOM
    global NewfocusAOM
    global MatisseAOM
    global ivvi

    AWG = qt.instruments.create('AWG', 'Tektronix_AWG5014', 
        address='TCPIP0::192.168.0.22::inst0::INSTR', 
        reset=False, numpoints=1e3)

    adwin = qt.instruments.create('adwin', 'adwin_lt1', 
            physical_adwin='physical_adwin')
    
    counters = qt.instruments.create('counters', 'counters_via_adwin',
            adwin='adwin')
    
    master_of_space = qt.instruments.create('master_of_space',
            'master_of_space_lt1', adwin='adwin')

    linescan_counts = qt.instruments.create('linescan_counts', 
            'linescan_counts',  adwin='adwin', mos='master_of_space',
            counters='counters')
    
    scan2d = qt.instruments.create('scan2d', 'scan2d_counts',
             linescan='linescan_counts', mos='master_of_space',
            xdim='x', ydim='y', counters='counters')
     
    opt1d_counts = qt.instruments.create('opt1d_counts', 
             'optimize1d_counts', linescan='linescan_counts', 
            mos='master_of_space', counters='counters')

    optimiz0r = qt.instruments.create('optimiz0r', 'optimiz0r',opt1d_ins=
            opt1d_counts,mos_ins=master_of_space,dimension_set='lt1')
  
    GreenAOM = qt.instruments.create('GreenAOM', 'AOM', 
            use_adwin='adwin', use_pm= 'powermeter')
    NewfocusAOM = qt.instruments.create('NewfocusAOM', 'AOM', 
            use_adwin='adwin', use_pm = 'powermeter')         
    MatisseAOM = qt.instruments.create('MatisseAOM', 'AOM', 
            use_adwin='adwin', use_pm = 'powermeter')
    YellowAOM = qt.instruments.create('YellowAOM', 'AOM', 
            use_adwin='adwin', use_pm ='powermeter')
    setup_controller = qt.instruments.create('setup_controller',
             'setup_controller',
            use = { 'master_of_space' : 'mos'} )
    
    from lib.network import object_sharer as objsh
    if objsh.start_glibtcp_client('192.168.0.80', port=12002, nretry=3):
        remote_ins_server = objsh.helper.find_object('qtlab_lasermeister:instrument_server')
        labjack = qt.instruments.create('labjack', 'Remote_Instrument',
        remote_name='labjack', inssrv=remote_ins_server)
from lib.network import object_sharer as objsh

if objsh.start_glibtcp_client('192.168.0.80', port=12002, nretry=3, timeout=5):
    remote_ins_server_lasers = objsh.helper.find_object(
        'qtlab_lasermeister:instrument_server')
    pidvelocity1 = qt.instruments.create('pidvelocity1',
                                         'Remote_Instrument',
                                         remote_name='pid_lt1_newfocus1',
                                         inssrv=remote_ins_server_lasers)
    pidvelocity2 = qt.instruments.create('pidvelocity2',
                                         'Remote_Instrument',
                                         remote_name='pid_lt1_newfocus2',
                                         inssrv=remote_ins_server_lasers)
else:
    logging.warning('Failed to start remote instruments for pids lt1')

if objsh.start_glibtcp_client('192.168.0.20', port=12002, nretry=3, timeout=5):
    remote_ins_server_lt1 = objsh.helper.find_object(
        'qtlab_lt1:instrument_server')
    ivvi_lt1 = qt.instruments.create('ivvi_lt1',
                                     'Remote_Instrument',
                                     remote_name='ivvi',
                                     inssrv=remote_ins_server_lt1)
else:
    logging.warning('Failed to start remote instruments for ivvi lt1')
        pass
    sys.exit()

if __name__ == "__main__":
    parser = optparse.OptionParser()
    parser.add_option('-d', '--disable-io', default=False, action='store_true')
    parser.add_option('-p', '--port', type=int, default=objsh.PORT,
        help='Port to connect to')
    parser.add_option('--name', default='',
        help='QTlab instance name to connect to')

    args, pargs = parser.parse_args()
    if args.name:
        config['instance_name'] = args.name

    objsh.start_glibtcp_client('localhost', port=args.port, nretry=60)
    objsh.helper.register_event_callback('disconnected', _close_gui_cb)
    import qtclient as qt
    qt.flow.connect('close-gui', _close_gui_cb)
    setup_windows()

    if args.disable_io:
        os.close(sys.stdin.fileno())
        os.close(sys.stdout.fileno())
        os.close(sys.stderr.fileno())

    # Ignore CTRL-C
    import signal
    signal.signal(signal.SIGINT, signal.SIG_IGN)

    import gtk
Beispiel #5
0
    parser = optparse.OptionParser()
    parser.add_option('-d', '--disable-io', default=False, action='store_true')
    parser.add_option('-p',
                      '--port',
                      type=int,
                      default=objsh.PORT,
                      help='Port to connect to')
    parser.add_option('--name',
                      default='',
                      help='QTlab instance name to connect to')

    args, pargs = parser.parse_args()
    if args.name:
        config['instance_name'] = args.name

    objsh.start_glibtcp_client('localhost', port=args.port, nretry=60)
    objsh.helper.register_event_callback('disconnected', _close_gui_cb)
    import qtclient as qt
    qt.flow.connect('close-gui', _close_gui_cb)
    setup_windows()

    if args.disable_io:
        os.close(sys.stdin.fileno())
        os.close(sys.stdout.fileno())
        os.close(sys.stderr.fileno())

    # Ignore CTRL-C
    import signal
    signal.signal(signal.SIGINT, signal.SIG_IGN)

    import gtk
Beispiel #6
0
        delta = time.time() - start
        logging.info('   Time = %.03s', delta)


def _close_gui_cb(*args):
    import gtk
    logging.info('Closing GUI')
    qt.config.save(delay=0)
    try:
        gtk.main_quit()
    except:
        pass
    sys.exit()


objsh.start_glibtcp_client('localhost', nretry=60)
objsh.helper.register_event_callback('disconnected', _close_gui_cb)
import qtclient as qt
qt.flow.connect('close-gui', _close_gui_cb)
setup_windows()

if __name__ == "__main__":
    parser = optparse.OptionParser()
    parser.add_option('-d', '--disable-io', default=False, action='store_true')
    args, pargs = parser.parse_args()
    if args.disable_io:
        os.close(sys.stdin.fileno())
        os.close(sys.stdout.fileno())
        os.close(sys.stderr.fileno())

    # Ignore CTRL-C
from lib.network import object_sharer as objsh
    
if objsh.start_glibtcp_client('192.168.0.80',port=12002, nretry=3, timeout=5):
    remote_ins_server_lasers=objsh.helper.find_object('qtlab_lasermeister:instrument_server')
    pidvelocity1 = qt.instruments.create('pidvelocity1', 'Remote_Instrument',
                 remote_name='pid_lt1_newfocus1', inssrv=remote_ins_server_lasers)    
    pidvelocity2 = qt.instruments.create('pidvelocity2', 'Remote_Instrument',
                 remote_name='pid_lt1_newfocus2', inssrv=remote_ins_server_lasers)
else:
    logging.warning('Failed to start remote instruments for pids lt1') 


if objsh.start_glibtcp_client('192.168.0.20',port=12002, nretry=3, timeout=5):
    remote_ins_server_lt1=objsh.helper.find_object('qtlab_lt1:instrument_server')
    ivvi_lt1 = qt.instruments.create('ivvi_lt1', 'Remote_Instrument',
            remote_name='ivvi', inssrv=remote_ins_server_lt1)
else:
    logging.warning('Failed to start remote instruments for ivvi lt1')