def offset_s2():
    ic = confirm('Please confirm the s2 and m2 offset')
    if ic :
        slog('setpos s2 ' + str(-two_theta_off.value) + ' 0')
        sics.setpos('s2', -two_theta_off.value, 0)
    else:
        raise Exception, 'S2 offset not accepted'
Example #2
0
def zero_offset():
    dev = device_name.value
    if dev != None and dev != '':
        slog('set zero offset for ' + dev)
        cur_value = sics.getValue(dev).getFloatData()
        sics.setpos(dev, cur_value, visual_value.value)
        slog('drive ' + dev + ' ' + str(cur_value))
        sics.drive(dev, cur_value)
def offset_m2m1():
    if offset_done.value :
        print 'You have already set the zero offset'
    else:
        slog('setpos m1 ' + str(m1_old.value) + ' ' + str(m1_new.value))
        sics.setpos('m1', m1_old.value, m1_new.value)
        sics.drive('m1', m1_old.value)
        slog('setpos m2 ' + str(m2_old.value) + ' ' + str(m2_new.value))
        sics.setpos('m2', m2_old.value, m2_new.value)
        sics.drive('m2', m2_old.value)
        offset_done.value = True
def offset_a2():
    aname = 'a2'
    try:
        if DEBUGGING :
            aname = 'dummy_motor'
    except:
        pass
    if offset_done.value :
        slog('You have already set the zero offset of ' + aname)
    else:
        slog('drive ' + aname + ' ' + str(peak_pos.value))
        sics.drive(aname, peak_pos.value)
        slog('set peak position to be ' + str(a2.value))
        sics.setpos(aname, peak_pos.value, a2.value)
        offset_done.value = True
Example #5
0
def offset_m1():
    aname = 'm1'
    try:
        if DEBUGGING :
            aname = 'dummy_motor'
    except:
        pass
    if offset_done.value :
        print 'You have already set the zero offset of ' + aname
    else:
        slog('drive ' + aname + ' ' + str(peak_pos.value))
        sics.drive(aname, peak_pos.value)
        slog('set peak position to ' + str(m1.value))
        sics.setpos(aname, peak_pos.value, m1.value)
        offset_done.value = True
Example #6
0
def offset_s2():
    aname = "s2"
    try:
        if DEBUGGING:
            aname = "dummy_motor"
    except:
        pass
    if offset_done.value:
        print "You have already set the zero offset of " + aname
    else:
        slog("drive " + aname + " " + str(peak_pos.value))
        sics.drive(aname, peak_pos.value)
        slog("set peak position to " + str(s2.value))
        sics.setpos(aname, peak_pos.value, s2.value)
        offset_done.value = True
        print "done"
def offset_a():
    aname = str(axis_name.value)
    try:
        if DEBUGGING :
            aname = 'dummy_motor'
    except:
        pass
    if offset_done.value:
        print 'You have already set zero offset of ' + aname
    else:
        tar_pos = eval(aname + '.value')
        slog('drive ' + aname + ' ' + str(peak_pos.value))
        sics.drive(aname, peak_pos.value)
        slog('set ' + aname + ' peak position to be ' + str(tar_pos))
        sics.setpos(aname, peak_pos.value, tar_pos)
        offset_done.value = True
Example #8
0
def offset_s2():
    aname = 's2'
    try:
        if DEBUGGING:
            aname = 'dummy_motor'
    except:
        pass
    if offset_done.value:
        print 'You have already set the zero offset of ' + aname
    else:
        slog('drive ' + aname + ' ' + str(peak_pos.value))
        sics.drive(aname, peak_pos.value)
        slog('set peak position to ' + str(s2.value))
        sics.setpos(aname, peak_pos.value, s2.value)
        offset_done.value = True
        print 'done'
def offset_s2():
    slog('setpos s2 ' + str(-s2_offset.value) + ' 0')
    sics.setpos('s2', -s2_offset.value, 0)