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])
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])
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)
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)
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)
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"
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)
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
def set_field(param,val): var_list[param] = val beamline_support.pvPut(var_channel_list[param],val)
def broadcast_output(s): time.sleep(0.01) if (s.find('|') == -1): logger.info(s) beamline_support.pvPut(message_string_pv, s)
def set_field(param, val): var_list[param] = val beamline_support.pvPut(var_channel_list[param], val)
def destroy_gui_message(): beamline_support.pvPut(gui_popup_message_string_pv, "killMessage")
def gui_message(message_string): beamline_support.pvPut(gui_popup_message_string_pv, message_string)
def gui_message(message_string): beamline_support.pvPut(gui_popup_message_string_pv,message_string)
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])
def broadcast_output(s): time.sleep(0.01) if (string.find(s,'|') == -1): print s beamline_support.pvPut(message_string_pv,s)
def destroy_gui_message(): beamline_support.pvPut(gui_popup_message_string_pv,"killMessage")