示例#1
0
def init_var_channels():
  global var_channel_list

  for varname in list(var_list.keys()):
#    print(varname)
    var_channel_list[varname] = beamline_support.pvCreate(daq_utils.beamlineComm + varname)
    beamline_support.pvPut(var_channel_list[varname],var_list[varname])
示例#2
0
def init_var_channels():
  global var_channel_list

  for varname in list(var_list.keys()):
    logger.debug('initing %s' % varname)
    var_channel_list[varname] = beamline_support.pvCreate(daq_utils.beamlineComm + varname)
    if (varname != 'size_mode'):
      beamline_support.pvPut(var_channel_list[varname],var_list[varname])
示例#3
0
def run_server():
  _thread.start_new_thread(process_immediate_commands,(.25,))  
  comm_pv = beamline_support.pvCreate(daq_utils.beamlineComm + "command_s")
  beamline_support.pvPut(comm_pv,"\n")
  immediate_comm_pv = beamline_support.pvCreate(daq_utils.beamlineComm + "immediate_command_s")
  beamline_support.pvPut(immediate_comm_pv,"\n")  
  comm_pv.add_callback(comm_cb)
  immediate_comm_pv.add_callback(comm2_cb)
  process_commands(0.5)
示例#4
0
def init_var_channels():
  global var_channel_list,beamlineStateChannel

  beamlineStateChannel = beamline_support.pvCreate(beamline + "_comm:beamlineState")
  beamline_support.pvPut(beamlineStateChannel,0)
  for varname in stateVars.keys():
    var_channel_list[varname] = beamline_support.pvCreate(beamline + "_comm:" + varname)
#    beamline_support.pvPut(var_channel_list[varname],stateVars[varname])
    add_callback(var_channel_list[varname],var_list_item_changeCb,varname)    
示例#5
0
def run_server():
#  _thread.start_new_thread(process_commands,(.05,))  
  _thread.start_new_thread(process_immediate_commands,(.25,))  
  comm_pv = beamline_support.pvCreate(daq_utils.beamlineComm + "command_s")
  beamline_support.pvPut(comm_pv,"\n")
  immediate_comm_pv = beamline_support.pvCreate(daq_utils.beamlineComm + "immediate_command_s")
  beamline_support.pvPut(immediate_comm_pv,"\n")  
  comm_pv.add_callback(comm_cb)
  immediate_comm_pv.add_callback(comm2_cb)
  process_commands(0.5)  
示例#6
0
def set_epics_pv(motcode,field_name,value): #sets a pv and makes sure motors are done moving.
  
  mcode = "%s%s.%s" % (beamline_support.beamline_designation,motcode,field_name)
  try:
    motor_val_channel = beamline_support.pvCreate(mcode)
    beamline_support.pvPut(motor_val_channel,value)
    wait_for_motors()
  except CaChannelException, status:
    print ca.message(status)
    print "\n\nHandled Epics Error in set pv " + mcode + "\n\n"
示例#7
0
文件: daq_main.py 项目: ericdill/lsdc
def run_server():
    #  thread.start_new_thread(print_status_thread,(.25,)) #really used to calculate percentage done of current collection
    thread.start_new_thread(process_commands, (0.05,))
    thread.start_new_thread(process_immediate_commands, (0.25,))
    comm_pv = beamline_support.pvCreate(daq_utils.beamline + "_comm:command_s")
    beamline_support.pvPut(comm_pv, "\n")
    immediate_comm_pv = beamline_support.pvCreate(daq_utils.beamline + "_comm:immediate_command_s")
    beamline_support.pvPut(immediate_comm_pv, "\n")
    beamline_support.add_callback(comm_pv, comm_cb, 0)
    beamline_support.add_callback(immediate_comm_pv, comm2_cb, 0)
示例#8
0
def getCurrentState():
  global beamlineStateChannel

  for i in xrange(1,len(stateDefinitions)): #skipping maintenance for now
    stateTest = 1
    for key in stateDefinitions[i]["stateDef"].keys():
      high = stateDefinitions[i]["stateDef"][key]["low"]
      low = stateDefinitions[i]["stateDef"][key]["hi"]
      if (stateVars[key] <= high and stateVars[key] >= low):
        pass
      else:
        stateTest = 0
        break
    if (stateTest == 1):
      beamline_support.pvPut(beamlineStateChannel,i)
      return stateDefinitions[i]   # if I made it here, then I passed all of the tests for a state
  beamline_support.pvPut(beamlineStateChannel,0)
  return stateDefinitions[0] # if I made it here, then none of the states passed all tests, so it must be maintenance
示例#9
0
文件: daq_lib.py 项目: cowanml/lsdc
def set_field(param,val):
  var_list[param] = val
  beamline_support.pvPut(var_channel_list[param],val)
示例#10
0
def broadcast_output(s):
    time.sleep(0.01)
    if (s.find('|') == -1):
        logger.info(s)
    beamline_support.pvPut(message_string_pv, s)
示例#11
0
def set_field(param, val):
    var_list[param] = val
    beamline_support.pvPut(var_channel_list[param], val)
示例#12
0
def destroy_gui_message():
    beamline_support.pvPut(gui_popup_message_string_pv, "killMessage")
示例#13
0
def gui_message(message_string):
    beamline_support.pvPut(gui_popup_message_string_pv, message_string)
示例#14
0
def gui_message(message_string): 
  beamline_support.pvPut(gui_popup_message_string_pv,message_string)
示例#15
0
文件: daq_lib.py 项目: cowanml/lsdc
def init_var_channels():
  global var_channel_list

  for varname in var_list.keys():
    var_channel_list[varname] = beamline_support.pvCreate(daq_utils.beamline + "_comm:" + varname)
    beamline_support.pvPut(var_channel_list[varname],var_list[varname])
示例#16
0
文件: daq_lib.py 项目: cowanml/lsdc
def broadcast_output(s):
  time.sleep(0.01)
  if (string.find(s,'|') == -1):
    print s
  beamline_support.pvPut(message_string_pv,s)
示例#17
0
def destroy_gui_message():
  beamline_support.pvPut(gui_popup_message_string_pv,"killMessage")