def main(): import sys import json import taurus.core.util.argparse as argparse parser = argparse.get_taurus_parser() parser.set_usage("%prog [options] <devName>") parser.set_description("This is a test script for the Iocaste of Hazemeyer Power supplies.") parser.add_option("--pollingPeriod") parser.add_option("--waitTime") parser.add_option("--transitions") parser.add_option("--realExecution") parser, options, args = argparse.init_taurus_args(parser=parser) if not len(args) == 1: sys.stderr.write("Need to supply one (and only one) device Name\n") sys.exit(1) print("args = %s"%(args)) optionsstr = "%s"%options optionsdict = eval(optionsstr) print("optionsdict = %s"%(optionsdict)) if optionsdict['pollingPeriod'] == None: pollinglist = 250 else: pollinglist = json.loads(optionsdict['pollingPeriod']) if optionsdict['transitions'] == None: transitions = 1000 else: transitions = int(optionsdict['transitions']) if optionsdict['realExecution'] == None: realExecution = True else: realExecution = eval(optionsdict['realExecution']) for pollperiod in pollinglist: for Wsingle in [True,False]: if optionsdict['waitTime'] == None: waitTime = (10*1000)/pollperiod #mean 10s else: waitTime = (int(optionsdict['waitTime'])*1000)/pollperiod print("HazemeyerIocaster_Tester(devName=%s,"\ "pollingPeriod=%s,ntimes=%s,transitions=%s,"\ "useWsingle=%s"\ %(args[0],pollperiod,waitTime,transitions,Wsingle)) if realExecution: tester = HazemeyerIocaster_Tester(args[0],pollperiod,waitTime,transitions,Wsingle)
def run(period=PERIOD): """Run LLRF expert GUI.""" import taurus.core.util.argparse as argparse parser = argparse.get_taurus_parser() parser.set_usage("%prog [-e, --expert]") description_message = "Graphical User Interface to control a LLRF system." parser.set_description(description_message) parser.add_option('-e', '--expert', action='store_true', help="Launch the GUI in expert mode") parser.add_option('-r', '--rf_room', type=str, help="""RF Room to be controlled. \nAvailable options: \n RF-ROOM-1,RF-ROOM-2,RF-ROOM-3, R1, RF-LAB """) parser, options, args = argparse.init_taurus_args(parser=parser) # set_polling_period(period) import taurus taurus.Manager().changeDefaultPollingPeriod(period) configure_pythonpath() if options.expert: models = get_model(options.expert, options.rf_room) section, loops, diags, rftrans1, rftrans2 = models llrf = None llrfdiags = None else: models = get_model(options.expert, options.rf_room) section, loops, diags, llrf, llrfdiags, rftrans1, rftrans2 = models app_name = create_app_name(section, options.expert) app, gui = create_application(app_name, parser=parser) splashLogo = os.path.join(os.path.dirname(__file__), 'images/maxivlogo.png') splashscreen = Qt.QSplashScreen(Qt.QPixmap(splashLogo)) splashscreen.show() app.processEvents() hide_toolbars(gui) splashscreen.showMessage('Creating panels') create_panels( splashscreen=splashscreen, gui=gui, section=section, loops_device=loops, diags_device=diags, is_expert=options.expert, transmitter1=rftrans1, transmitter2=rftrans2, llrf_device=llrf, llrfdiags_device=llrfdiags) splashscreen.showMessage('Loading settings') load_settings(gui, options.expert) gui.show() splashscreen.finish(gui) sys.exit(app.exec_())
self.ui.qLedEncX3.ledStatus = (flags & (1<<14) ) != 0 self.ui.qLedEncX4.ledStatus = (flags & (1<<15) ) != 0 self.ui.qLedDrvZ1.ledStatus = (flags & (1<<16) ) != 0 self.ui.qLedDrvZ2.ledStatus = (flags & (1<<17) ) != 0 self.ui.qLedDrvZ3.ledStatus = (flags & (1<<18) ) != 0 self.ui.qLedDrvZ4.ledStatus = (flags & (1<<19) ) != 0 self.ui.qLedDrvX1.ledStatus = (flags & (1<<20) ) != 0 self.ui.qLedDrvX2.ledStatus = (flags & (1<<21) ) != 0 self.ui.qLedDrvX3.ledStatus = (flags & (1<<22) ) != 0 self.ui.qLedDrvX4.ledStatus = (flags & (1<<23) ) != 0 if __name__ == "__main__": import sys import undulatorDesigner from array import * import taurus.core.util.argparse as argparse parser, options, args = argparse.init_taurus_args() app = QtGui.QApplication(sys.argv) ui = undulatorDesigner.Ui_Main() Main = UndulatorWindow(ui) connections(ui) # Show GUI Main.show() sys.exit(app.exec_())
self.ui.qLedEncX2.ledStatus = (flags & (1 << 13)) != 0 self.ui.qLedEncX3.ledStatus = (flags & (1 << 14)) != 0 self.ui.qLedEncX4.ledStatus = (flags & (1 << 15)) != 0 self.ui.qLedDrvZ1.ledStatus = (flags & (1 << 16)) != 0 self.ui.qLedDrvZ2.ledStatus = (flags & (1 << 17)) != 0 self.ui.qLedDrvZ3.ledStatus = (flags & (1 << 18)) != 0 self.ui.qLedDrvZ4.ledStatus = (flags & (1 << 19)) != 0 self.ui.qLedDrvX1.ledStatus = (flags & (1 << 20)) != 0 self.ui.qLedDrvX2.ledStatus = (flags & (1 << 21)) != 0 self.ui.qLedDrvX3.ledStatus = (flags & (1 << 22)) != 0 self.ui.qLedDrvX4.ledStatus = (flags & (1 << 23)) != 0 if __name__ == "__main__": import sys import undulatorDesigner from array import * import taurus.core.util.argparse as argparse parser, options, args = argparse.init_taurus_args() app = QtGui.QApplication(sys.argv) ui = undulatorDesigner.Ui_Main() Main = UndulatorWindow(ui) connections(ui) # Show GUI Main.show() sys.exit(app.exec_())