def main(): url = DELAY_GENERATOR_SERVER if not LOCAL else TEST_DELAY_GENERATOR_SERVER dgOptions = DG_CONFIG if not DEBUG else DEBUG_DG_CONFIG print '\n\n\n' printDict(dgOptions) configList = dgOptions.keys() if type(configList) is not list: configList = [configList] #if it is only 1 element, convert to list configList += ["Run All"] configList += ["Done"] while True: print '\n\n\n' if AUTORUN: dgToAdd = "Run All" else: dgToAdd = yield selectFromList(configList, "Which delay generator to add?") if dgToAdd == "Done" or len(configList) <= 0: break if dgToAdd == "Run All": configList.remove("Done") configList.remove("Run All") for thisDG in configList: try: if dgOptions[thisDG]['run_by_default']: dgDict.update( createDelayGenerator(thisDG, dgOptions[thisDG], dgDict)) except: print 'failed to create ' + thisDG break elif dgToAdd in configList: print dgToAdd print dgOptions[dgToAdd] dgDict.update( createDelayGenerator(dgToAdd, dgOptions[dgToAdd], dgDict)) configList.remove(dgToAdd) #confirm config doesn't have a conflict in the partnered delays. safety concern for lasers! for dg in dgDict.keys(): partnerName = dgOptions[dg]['partner'] if partnerName is None: continue partnerDefault = dgOptions[partnerName]['delay'] partnerRelative = dgOptions[dg]['delay'] + dgOptions[dg][ 'rel_part_delay'] if partnerDefault != partnerRelative: print 'your config file has a conflict in the default delay and relative delay for ' + str( dg) + ' and ' + str(partnerName) print str(partnerDefault) + ' ' + str(partnerRelative) print 'get yo shit together \n\n\n' sys.exit() runServer(WAMP=DelayGeneratorWAMP, URL=url, debug=True, outputToConsole=True)
def main(): url = DELAY_GENERATOR_SERVER if not LOCAL else TEST_DELAY_GENERATOR_SERVER dgOptions = DG_CONFIG if not DEBUG else DEBUG_DG_CONFIG print '\n\n\n' printDict(dgOptions) configList = dgOptions.keys() if type(configList) is not list: configList = [configList] #if it is only 1 element, convert to list configList += ["Run All"] configList += ["Done"] while True: print '\n\n\n' if AUTORUN: dgToAdd = "Run All" else: dgToAdd = yield selectFromList(configList,"Which delay generator to add?") if dgToAdd == "Done" or len(configList) <= 0: break if dgToAdd == "Run All": configList.remove("Done") configList.remove("Run All") for thisDG in configList: try: if dgOptions[thisDG]['run_by_default']: dgDict.update(createDelayGenerator(thisDG,dgOptions[thisDG],dgDict)) except: print 'failed to create ' + thisDG break elif dgToAdd in configList: print dgToAdd print dgOptions[dgToAdd] dgDict.update(createDelayGenerator(dgToAdd,dgOptions[dgToAdd],dgDict)) configList.remove(dgToAdd) #confirm config doesn't have a conflict in the partnered delays. safety concern for lasers! for dg in dgDict.keys(): partnerName = dgOptions[dg]['partner'] if partnerName is None: continue partnerDefault = dgOptions[partnerName]['delay'] partnerRelative = dgOptions[dg]['delay'] + dgOptions[dg]['rel_part_delay'] if partnerDefault != partnerRelative: print 'your config file has a conflict in the default delay and relative delay for ' +str(dg)+' and '+str(partnerName) print str(partnerDefault) + ' ' + str(partnerRelative) print 'get yo shit together \n\n\n' sys.exit() runServer( WAMP = DelayGeneratorWAMP, URL = url, debug = True, outputToConsole=True )
def main(): runServer(WAMP = PolarizerWAMP, URL = URL, debug = True)
def main(): runServer(WAMP=PolarizerWAMP, URL=URL, debug=True)
VM_SERVER_CONFIG['trigChannel'], VM_SERVER_CONFIG['trigEdge'] ) ) @inlineCallbacks def getVoltMeter(): if os.path.isfile(CONFIG_FILEPATH): with open(CONFIG_FILEPATH,'r') as config_file: config_dict = pickle.loads(config_file.read()) returnValue( VoltMeter( config_dict.values() ) ) else: device = yield selectFromList(daqmx.getDevices(),'select a device') returnValue( VoltMeter( ( {VoltMeter.PHYSICAL_CHANNEL:channel,VoltMeter.VOLTAGE_RANGE:VoltMeter.V0_05} for channel in daqmx.getPhysicalChannels(device)[daqmx.AI] ) ) ) if __name__ == '__main__': runServer(WAMP=VoltMeterWAMP,debug=False,URL=URL,outputToConsole=True) reactor.run()
def main(): runServer(WAMP=WavelengthWAMP, URL=URL, debug=True)
def main(): runServer( WAMP = SpectrometerWAMP, URL = SPECTROMETER_SERVER if not DEBUG else TEST_SPECTROMETER_SERVER, debug = True, outputToConsole = False)
def main(): runServer( WAMP=StepperMotorWAMP, URL=STEPPER_MOTOR_SERVER if not DEBUG else TEST_STEPPER_MOTOR_SERVER, debug=False, outputToConsole=True)
def main(): runServer(WAMP = StepperMotorWAMP, URL = STEPPER_MOTOR_SERVER if not DEBUG else TEST_STEPPER_MOTOR_SERVER,debug = False,outputToConsole=True)