def __setup_layout( self ): self.connect( self.button, QtCore.SIGNAL( 'clicked()' ), self.button_Click ) self.connect( self.button2, QtCore.SIGNAL( 'clicked()' ), self.button_Click2 ) self.connect( self.button3, QtCore.SIGNAL( 'clicked()' ), self.button_Click3 ) self.connect( self.button4, QtCore.SIGNAL( 'clicked()' ), self.button_Click4 ) self.connect( self.button5, QtCore.SIGNAL( 'clicked()' ), self.button_Click5 ) self.connect( self.button6, QtCore.SIGNAL( 'clicked()' ), self.button_Click6 ) # Vertical cursor self.cursorposition = 0.8 self.cursorposition2 = 1.2 self.vcursor1 = make.vcursor(self.cursorposition, label='x = %.2f') self.plot.add_item( self.vcursor1 ) self.vcursor2 = make.vcursor(self.cursorposition2, label='x = %.2f') self.plot.add_item( self.vcursor2 ) # Define the y label, x might change depending on user definition CurvePlot.set_axis_title(self.plot,CurvePlot.Y_LEFT,"Intensity (counts)") # Crate the PlotManager self.manager = PlotManager( self ) self.manager.add_plot( self.plot ) self.manager.add_plot( self.plot2 ) # Create Toolbar toolbar = self.addToolBar( 'tools' ) self.manager.add_toolbar( toolbar, id( toolbar ) ) # Register the ToolBar's type self.manager.register_all_curve_tools( ) # self.manager.register_other_tools() # Register a custom tool self.manager.add_tool( SelectPointTool, title = 'Position', on_active_item = True, mode = 'create' )
class GuiQwtPlot( QtGui.QWidget ): def __init__( self ): QtGui.QWidget.__init__( self ) self.__create_layout() self.__setup_layout() def __create_layout( self ): self.setWindowTitle( "LambdaFunction - guiqwt" ) self.plot = CurvePlot( self ) #self.plot.set_antialiasing( True ) self.button = QtGui.QPushButton( "Load" ) ly = QtGui.QVBoxLayout() ly.addWidget( self.plot ) ly.addWidget( self.button ) self.setLayout( ly ) def __setup_layout( self ): self.connect( self.button, QtCore.SIGNAL( "clicked()" ), self.button_Click ) self.curve = make.curve( [ ], [ ], "curve1", QtGui.QColor( 255, 0, 0) ) self.plot.add_item( self.curve ) def button_Click( self ): self.curve.set_data( range( 0, 20, 2), map( lambda _: random(), range( 0, 10 ) ) ) self.plot.replot( )
class BaseCurveWidget2(QSplitter): """ Construct a BaseCurveWidget object, which includes: * A plot (:py:class:`guiqwt.curve.CurvePlot`) * An `item list` panel (:py:class:`guiqwt.curve.PlotItemList`) This object does nothing in itself because plot and panels are not connected to each other. See children class :py:class:`guiqwt.plot.CurveWidget` """ def __init__(self, parent=None, title=None, xlabel=None, ylabel=None, xunit=None, yunit=None, section="plot", show_itemlist=False, gridparam=None, rtitle=None, rxlabel=None, rylabel=None, rxunit=None, ryunit=None, rsection="rplot", rgridparam=None, curve_antialiasing=None): QSplitter.__init__(self, Qt.Vertical, parent) self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self.plot = CurvePlot(parent=self, title=title, xlabel=xlabel, ylabel=ylabel, xunit=xunit, yunit=yunit, section=section, gridparam=gridparam) self.rplot = CurvePlot(parent=self, title=rtitle, xlabel=rxlabel, ylabel=rylabel, xunit=rxunit, yunit=ryunit, section=section, gridparam=rgridparam) if curve_antialiasing is not None: self.plot.set_antialiasing(curve_antialiasing) self.rplot.set_antialiasing(curve_antialiasing) self.addWidget(self.plot) self.addWidget(self.rplot) self.itemlist = PlotItemList(self) self.itemlist.setVisible(show_itemlist) self.addWidget(self.itemlist) configure_plot_splitter(self)
def __init__(self): super(RealtimeDemo, self).__init__() self.setWindowTitle(u"Realtime Demo") self.data = {u"t":array("d")} for name in sum(PLOT_DEFINE, []): self.data[name] = array("d") self.curves = {} self.t = 0 vbox = QVBoxLayout() vbox.addWidget(self.setup_toolbar()) self.manager = PlotManager(self) self.plots = [] for i, define in enumerate(PLOT_DEFINE): plot = CurvePlot() plot.axisScaleDraw(CurvePlot.Y_LEFT).setMinimumExtent(60) self.manager.add_plot(plot) self.plots.append(plot) plot.plot_id = id(plot) for j, curve_name in enumerate(define): curve = self.curves[curve_name] = make.curve([0], [0], color=COLORS[j], title=curve_name) plot.add_item(curve) plot.add_item(make.legend("BL")) vbox.addWidget(plot) self.manager.register_standard_tools() self.manager.get_default_tool().activate() self.manager.synchronize_axis(CurvePlot.X_BOTTOM, self.manager.plots.keys()) self.setLayout(vbox) self.startTimer(100)
def __init__(self): super(RealtimeDemo, self).__init__() self.setWindowTitle(u"Realtime Demo") self.data = {u"t": array("d")} for name in sum(PLOT_DEFINE, []): self.data[name] = array("d") self.curves = {} self.t = 0 vbox = QVBoxLayout() vbox.addWidget(self.setup_toolbar()) self.manager = PlotManager(self) self.plots = [] for i, define in enumerate(PLOT_DEFINE): plot = CurvePlot() plot.axisScaleDraw(CurvePlot.Y_LEFT).setMinimumExtent(60) self.manager.add_plot(plot) self.plots.append(plot) plot.plot_id = id(plot) for j, curve_name in enumerate(define): curve = self.curves[curve_name] = make.curve([0], [0], color=COLORS[j], title=curve_name) plot.add_item(curve) plot.add_item(make.legend("BL")) vbox.addWidget(plot) self.manager.register_standard_tools() self.manager.get_default_tool().activate() self.manager.synchronize_axis(CurvePlot.X_BOTTOM, self.manager.plots.keys()) self.setLayout(vbox) self.startTimer(100)
def __init__(self, parent=None, title=None, xlabel=None, ylabel=None, xunit=None, yunit=None, section="plot", show_itemlist=False, gridparam=None, rtitle=None, rxlabel=None, rylabel=None, rxunit=None, ryunit=None, rsection="rplot", rgridparam=None, curve_antialiasing=None): QSplitter.__init__(self, Qt.Vertical, parent) self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self.plot = CurvePlot(parent=self, title=title, xlabel=xlabel, ylabel=ylabel, xunit=xunit, yunit=yunit, section=section, gridparam=gridparam) self.rplot = CurvePlot(parent=self, title=rtitle, xlabel=rxlabel, ylabel=rylabel, xunit=rxunit, yunit=ryunit, section=section, gridparam=rgridparam) if curve_antialiasing is not None: self.plot.set_antialiasing(curve_antialiasing) self.rplot.set_antialiasing(curve_antialiasing) self.addWidget(self.plot) self.addWidget(self.rplot) self.itemlist = PlotItemList(self) self.itemlist.setVisible(show_itemlist) self.addWidget(self.itemlist) configure_plot_splitter(self)
def __init__(self): super(SyncXAxis, self).__init__() self.data = {u"t":array("d")} for name in sum(PLOT_DEFINE, []): self.data[name] = array("d") self.i = 0 self.x = [] self.curves = {} self.t = 0 self.sint = [] self.get_Roll = [] self.get_Pitch = [] self.get_Yaw = [] self.get_Angle1 = [] self.get_Angle2 =[] self.get_Angle3 = [] vbox = QtGui.QGridLayout() #工具栏 vbox.addLayout(self.setup_toolbar(),0,0) self.manager = PlotManager(self) self.plots = [] #生成竖直排列图形窗口 for i, define in enumerate(PLOT_DEFINE): plot = CurvePlot() plot.axisScaleDraw(CurvePlot.Y_LEFT).setMinimumExtent(60) self.manager.add_plot(plot) self.plots.append(plot) plot.plot_id = id(plot) for j, curve_name in enumerate(define): curve = self.curves[curve_name] = make.curve([0], [0], color=COLORS[j], title=curve_name) plot.add_item(curve) plot.add_item(make.legend("BL")) #vbox.addWidget(plot) vbox.addWidget(self.plots[0],1,0) vbox.addWidget(self.plots[1],1,1) vbox.addWidget(self.plots[2],2,0) vbox.addWidget(self.plots[3],2,1) self.manager.register_standard_tools() self.manager.get_default_tool().activate() self.manager.synchronize_axis(CurvePlot.X_BOTTOM, self.manager.plots.keys()) self.setLayout(vbox) self.startTimer(20)
def __create_layout( self ): self.setWindowTitle( "LambdaFunction - guiqwt" ) self.plot = CurvePlot( self ) #self.plot.set_antialiasing( True ) self.button = QtGui.QPushButton( "Load" ) ly = QtGui.QVBoxLayout() ly.addWidget( self.plot ) ly.addWidget( self.button ) self.setLayout( ly )
def __init__(self, parent, signal_names, sample_rate): '''Do the initialization work. A PlottingHelper object helps plotting a group of signals all of which has the same number of points to plot at one time. signal_names: a dictionary {'list_name':['list of signal names']} sample_rate: the sample_rate of the signals ''' self.sample_rate = sample_rate self.signal_names = signal_names self.curve_items = {} self.curve_plots = {} self.plot_manager = PlotManager(parent) for list_name, sig_name_list in self.signal_names.items(): # One CurvePlot object for every sig_name_list curve_plot = CurvePlot() curve_plot.axisScaleDraw(CurvePlot.Y_LEFT).setMinimumExtent(10) self.curve_plots[list_name] = curve_plot curve_plot.plot_id = id(curve_plot) for i, sig_name in enumerate(sig_name_list): # One CurveItem object for every signal_name print sig_name, colors[i] self.curve_items[sig_name] = make.curve([0], [0], \ color=colors[i], title=sig_name) curve_plot.add_item(self.curve_items[sig_name]) # add the curve_plot object to plot_manager self.plot_manager.add_plot(curve_plot) # register and activate the tools self.plot_manager.register_standard_tools() self.plot_manager.get_default_tool().activate() self.plot_manager.synchronize_axis(CurvePlot.X_BOTTOM, \ self.plot_manager.plots.keys())
def __create_layout( self ): self.setWindowTitle( "Live *.Chi plotter, v. 2.1.0 (April 2013)" ) self.plot = CurvePlot( self ) self.plot.set_antialiasing( True ) self.plot2 = CurvePlot( self ) self.plot2.set_antialiasing( True ) self.button = QtGui.QPushButton( "Search for files" ) self.button2 = QtGui.QPushButton( "Plot selected files" ) self.button3 = QtGui.QPushButton( "Select all" ) self.button4 = QtGui.QPushButton( "Select none" ) self.button5 = QtGui.QPushButton( "Integrate" ) self.button6 = QtGui.QPushButton( "Integral over ROI (defined by the two vertical cursors)" ) left_hbox0 = QtGui.QVBoxLayout() right_hbox0 = QtGui.QVBoxLayout() # Main graph left_vbox = QtGui.QVBoxLayout() left_vbox.addWidget( self.plot, 3) # Smaller graph left_vbox.addWidget( self.plot2, 1 ) self.tick_axis_reset = QtGui.QCheckBox("Reset axis when replotting data") self.tick_axis_reset.setCheckState(Qt.Checked) left_hbox0.addWidget( self.tick_axis_reset ) # Static text field right_hbox0.addWidget( QtGui.QLabel('Directory'), 0, QtCore.Qt.AlignRight ) hbox0 = QtGui.QHBoxLayout() hbox0.addLayout( left_hbox0 ) hbox0.addLayout( right_hbox0 ) left_vbox.addLayout( hbox0 ) # Add buttons to the left side left_vbox.addWidget( self.button ) left_vbox.addWidget( self.button2 ) left_vbox.addWidget( self.button6 ) # Data series list view log_label = QtGui.QLabel("Data series:") self.series_list_model = QtGui.QStandardItemModel() self.series_list_view = QtGui.QListView() self.series_list_view.setModel(self.series_list_model) right_vbox = QtGui.QVBoxLayout() right_vbox.addWidget( log_label ) right_vbox.addWidget( self.series_list_view ) # Create editable text box for inputting directory self.text1 = QtGui.QTextEdit() self.text1.setFixedHeight(22) # Put current directory to the text box self.text1.setText(os.getcwd()) right_vbox.addWidget( self.text1 ) # Add buttons right_vbox.addWidget( self.button3 ) right_vbox.addWidget( self.button4 ) right_vbox.addWidget( self.button5 ) # Combine left and right box hbox = QtGui.QHBoxLayout() hbox.addLayout( left_vbox, 2 ) # Second parameter is the stretch factor hbox.addLayout( right_vbox, 1 ) # of the widget, letting the figure to stretch more w = QtGui.QWidget() w.setLayout( hbox ) self.setCentralWidget( w )
def button_Click6( self ): # Clear the plot first self.plot2.del_all_items() # Seed for random generator of colors, so that they are always in the same order random.seed(654321) colorlistred = [220, 255, 155, 24, 0, 0, 48, 205, 255, 255, 0, 142] colorlistgreen = [20, 105, 48, 116, 229, 238, 128, 205, 193, 97, 0, 142] colorlistblue = [60, 180, 255, 205, 238, 118, 20, 0, 37, 3, 0, 142] markerlist = ['Rect','Diamond', 'UTriangle', 'DTriangle', 'RTriangle','Cross', 'Ellipse', 'Star1', 'XCross', 'LTriangle', 'Star2'] # Get cursor positions to define ROI x1 = guiqwt.shapes.Marker.xValue(self.vcursor1) x2 = guiqwt.shapes.Marker.xValue(self.vcursor2) if x2 < x1: x3 = copy.deepcopy(x1) x1 = copy.deepcopy(x2) x2 = x3 indices = [] self.sumy = {} self.sumx = {} # Use first predefined colours, then random colorcounter = 0 maxsumx = 0 minsumx = 10000 maxsumy = 0 minsumy = 10000000 self.sumxall = {} self.sumyall = {} seriesnames = [] for row in range(self.series_list_model.rowCount()): model_index = self.series_list_model.index(row, 0) checked = self.series_list_model.data(model_index, Qt.CheckStateRole) == QVariant(Qt.Checked) name = str(self.series_list_model.data(model_index).toString()) if checked: # Find x values over which to sum indices = [] for index,value in enumerate(self.x[name]): if value > x1 and value < x2: indices.append(index) xx = np.array(self.x[name]) yy = np.array(self.y[name]) sumy1 = np.trapz(yy[indices],xx[indices]) self.sumy[name] = [float(sumy1)] number1 = re.findall("(?<=_|-)[\d]*(?=.chi)",name) sumx1 = int(number1[0]) self.sumx[name] = [float(sumx1)] if max(self.sumx[name])>maxsumx: maxsumx = max(self.sumx[name]) if max(self.sumy[name])>maxsumy: maxsumy = max(self.sumy[name]) if min(self.sumx[name])<minsumx: minsumx = min(self.sumx[name]) if min(self.sumy[name])<minsumy and min(self.sumy[name]) > 0: minsumy = min(self.sumy[name]) # Check which series names we have name1 = re.findall("[\W\S\d]*(?=-[\d]{5}.chi)",name) # Try different versions of writing the names if first one does not succeed if name1 == []: name1 = re.findall("[\W\S\d]*(?=_[\d]{4}.chi)",name) if name1 == []: name1 = re.findall("[\W\S\d]*(?=_[\d]{5}.chi)",name) seriesname1 = str(name1[0]) if seriesname1 not in seriesnames: seriesnames.append(seriesname1) self.sumxall[seriesname1] = [] self.sumyall[seriesname1] = [] self.sumxall[seriesname1].append(sumx1) self.sumyall[seriesname1].append(sumy1) # Make lines and legends to separate different sample series colorcounter = 0 random.seed(654321) markercounter = 0 for seriesname1 in seriesnames: if len(colorlistred) > colorcounter: self.curveB = make.curve( [ ], [ ], seriesname1, QtGui.QColor( colorlistred[colorcounter], colorlistgreen[colorcounter], colorlistblue[colorcounter] ), linewidth=3.0, marker=markerlist[markercounter], markerfacecolor = QtGui.QColor( colorlistred[colorcounter], colorlistgreen[colorcounter], colorlistblue[colorcounter] ), markeredgecolor= QtGui.QColor( colorlistred[colorcounter], colorlistgreen[colorcounter], colorlistblue[colorcounter] )) colorcounter = colorcounter + 1 markercounter = markercounter + 1 else: newcolor = QtGui.QColor( random.randint(0,255), random.randint(0,255), random.randint(0,255)) self.curveB = make.curve( [ ], [ ], seriesname1, newcolor, linewidth=3.0, marker=markerlist[markercounter], markerfacecolor = newcolor, markeredgecolor = newcolor ) markercounter = markercounter + 1 if markercounter > len(markerlist): markercounter = 0 self.plot2.add_item( self.curveB ) self.curveB.set_data( self.sumxall[seriesname1],self.sumyall[seriesname1] ) CurvePlot.set_axis_title(self.plot2,CurvePlot.X_BOTTOM,"File number") CurvePlot.set_axis_title(self.plot2,CurvePlot.Y_LEFT,"ROI sum") self.legend2 = make.legend( 'TR' ) # Top Right self.plot2.add_item( self.legend2 ) # Reset axis if ticked if self.tick_axis_reset.isChecked()==True: CurvePlot.set_axis_limits(self.plot2,CurvePlot.X_BOTTOM,minsumx*0.9,maxsumx*1.1) CurvePlot.set_axis_limits(self.plot2,CurvePlot.Y_LEFT,minsumy*0.9,maxsumy*1.1) # Plot everything self.plot2.replot( )
class GuiQwtPlot( QtGui.QMainWindow ): def __init__( self ): QtGui.QMainWindow.__init__( self ) self.__create_layout() self.__setup_layout() def __create_layout( self ): self.setWindowTitle( "Live *.Chi plotter, v. 2.1.0 (April 2013)" ) self.plot = CurvePlot( self ) self.plot.set_antialiasing( True ) self.plot2 = CurvePlot( self ) self.plot2.set_antialiasing( True ) self.button = QtGui.QPushButton( "Search for files" ) self.button2 = QtGui.QPushButton( "Plot selected files" ) self.button3 = QtGui.QPushButton( "Select all" ) self.button4 = QtGui.QPushButton( "Select none" ) self.button5 = QtGui.QPushButton( "Integrate" ) self.button6 = QtGui.QPushButton( "Integral over ROI (defined by the two vertical cursors)" ) left_hbox0 = QtGui.QVBoxLayout() right_hbox0 = QtGui.QVBoxLayout() # Main graph left_vbox = QtGui.QVBoxLayout() left_vbox.addWidget( self.plot, 3) # Smaller graph left_vbox.addWidget( self.plot2, 1 ) self.tick_axis_reset = QtGui.QCheckBox("Reset axis when replotting data") self.tick_axis_reset.setCheckState(Qt.Checked) left_hbox0.addWidget( self.tick_axis_reset ) # Static text field right_hbox0.addWidget( QtGui.QLabel('Directory'), 0, QtCore.Qt.AlignRight ) hbox0 = QtGui.QHBoxLayout() hbox0.addLayout( left_hbox0 ) hbox0.addLayout( right_hbox0 ) left_vbox.addLayout( hbox0 ) # Add buttons to the left side left_vbox.addWidget( self.button ) left_vbox.addWidget( self.button2 ) left_vbox.addWidget( self.button6 ) # Data series list view log_label = QtGui.QLabel("Data series:") self.series_list_model = QtGui.QStandardItemModel() self.series_list_view = QtGui.QListView() self.series_list_view.setModel(self.series_list_model) right_vbox = QtGui.QVBoxLayout() right_vbox.addWidget( log_label ) right_vbox.addWidget( self.series_list_view ) # Create editable text box for inputting directory self.text1 = QtGui.QTextEdit() self.text1.setFixedHeight(22) # Put current directory to the text box self.text1.setText(os.getcwd()) right_vbox.addWidget( self.text1 ) # Add buttons right_vbox.addWidget( self.button3 ) right_vbox.addWidget( self.button4 ) right_vbox.addWidget( self.button5 ) # Combine left and right box hbox = QtGui.QHBoxLayout() hbox.addLayout( left_vbox, 2 ) # Second parameter is the stretch factor hbox.addLayout( right_vbox, 1 ) # of the widget, letting the figure to stretch more w = QtGui.QWidget() w.setLayout( hbox ) self.setCentralWidget( w ) def __setup_layout( self ): self.connect( self.button, QtCore.SIGNAL( 'clicked()' ), self.button_Click ) self.connect( self.button2, QtCore.SIGNAL( 'clicked()' ), self.button_Click2 ) self.connect( self.button3, QtCore.SIGNAL( 'clicked()' ), self.button_Click3 ) self.connect( self.button4, QtCore.SIGNAL( 'clicked()' ), self.button_Click4 ) self.connect( self.button5, QtCore.SIGNAL( 'clicked()' ), self.button_Click5 ) self.connect( self.button6, QtCore.SIGNAL( 'clicked()' ), self.button_Click6 ) # Vertical cursor self.cursorposition = 0.8 self.cursorposition2 = 1.2 self.vcursor1 = make.vcursor(self.cursorposition, label='x = %.2f') self.plot.add_item( self.vcursor1 ) self.vcursor2 = make.vcursor(self.cursorposition2, label='x = %.2f') self.plot.add_item( self.vcursor2 ) # Define the y label, x might change depending on user definition CurvePlot.set_axis_title(self.plot,CurvePlot.Y_LEFT,"Intensity (counts)") # Crate the PlotManager self.manager = PlotManager( self ) self.manager.add_plot( self.plot ) self.manager.add_plot( self.plot2 ) # Create Toolbar toolbar = self.addToolBar( 'tools' ) self.manager.add_toolbar( toolbar, id( toolbar ) ) # Register the ToolBar's type self.manager.register_all_curve_tools( ) # self.manager.register_other_tools() # Register a custom tool self.manager.add_tool( SelectPointTool, title = 'Position', on_active_item = True, mode = 'create' ) def fill_series_list(self, names): self.series_list_model.clear() counterlist = 0 for name in reversed(names): item = QtGui.QStandardItem(name) # if counterlist == 0: # Check only the first one # item.setCheckState(Qt.Checked) # else: item.setCheckState(Qt.Unchecked) item.setCheckable(True) self.series_list_model.appendRow(item) counterlist = counterlist + 1 # Load data to the list def button_Click( self ): # Find the newest files in the directory and subdirectories # and populate the list of files self.y = {} self.x = {} self.timestamp = {} self.names = [] self.fullfilename = {} # Clear the list in case used another directory before self.series_list_model.clear() # Go to the directory specified in the field or if none, give error message curdir = str(self.text1.toPlainText()) if os.path.isdir(curdir): os.chdir(curdir) else: print curdir+" is not a valid directory!" # Find the files in the directory counterfiles = 0 for dirpath, dirnames, filenames in os.walk(os.getcwd()): filenames.sort(key=lambda x: os.path.getmtime(dirpath+'/'+x)) for file1 in filenames: prefix,postfix = os.path.splitext(file1) # Only *.chi files ending with a number are accepted if len(re.findall("[\d]"+".chi",file1))>0: fullfilename1 = dirpath+'/'+file1 time1 = os.path.getmtime(fullfilename1) tmp,subpath = os.path.split(dirpath) tmp,subpath2 = os.path.split(tmp) seriesname1 = os.path.basename(str(subpath2+'_'+subpath+'_'+file1)) self.names.append(seriesname1) # Load data tmp = np.genfromtxt(str(fullfilename1),dtype=None,skip_header=4) self.y[seriesname1] = map(float, np.transpose(tmp[:,1])) self.x[seriesname1] = map(float, np.transpose(tmp[:,0])) self.datalen = len(self.x[seriesname1]) self.timestamp[seriesname1] = time1 self.fullfilename[seriesname1] = fullfilename1 counterfiles = counterfiles + 1 # Populate the checkbox list self.fill_series_list(self.names) #Refresh the figure def button_Click2( self ): # has_series = False # Seed for random generator of colors, so that they are always in the same order random.seed(654321) colorlistred = [220, 255, 155, 24, 0, 0, 48, 205, 255, 255, 0, 142] colorlistgreen = [20, 105, 48, 116, 229, 238, 128, 205, 193, 97, 0, 142] colorlistblue = [60, 180, 255, 205, 238, 118, 20, 0, 37, 3, 0, 142] # Clear the plot first self.plot.del_all_items() # Add back the vertical cursor to the plot in the same position as before self.plot.add_item( self.vcursor1 ) self.plot.add_item( self.vcursor2 ) # For axes take max of 2theta and max of intensity maxtth = 0 maxintensity = 0 mintth = 100 minintensity = 100 # Use first predefined colours, then random colorcounter = 0 # Two simple markers to test if mixed x ranges exist foundq = 0 foundtth = 0 for row in range(self.series_list_model.rowCount()): model_index = self.series_list_model.index(row, 0) checked = self.series_list_model.data(model_index, Qt.CheckStateRole) == QVariant(Qt.Checked) name = str(self.series_list_model.data(model_index).toString()) if checked: # has_series = True self.curveAlabel = name if len(colorlistred) > colorcounter: self.curveA = make.curve( [ ], [ ], self.curveAlabel, QtGui.QColor( colorlistred[colorcounter], colorlistgreen[colorcounter], colorlistblue[colorcounter] ), linewidth=3.0) colorcounter = colorcounter + 1 else: self.curveA = make.curve( [ ], [ ], self.curveAlabel, QtGui.QColor( random.randint(0,255), random.randint(0,255), random.randint(0,255) ), linewidth=3.0) self.plot.add_item( self.curveA ) self.curveA.set_data( self.x[name], self.y[name]) if max(self.x[name])>maxtth: maxtth = max(self.x[name]) if max(self.y[name])>maxintensity: maxintensity = max(self.y[name]) if min(self.x[name])<mintth: mintth = min(self.x[name]) if min(self.y[name])<minintensity and min(self.y[name]) > 0: minintensity = min(self.y[name]) # Check if TTH or Q range, redefine x label if Q f = open(str(self.fullfilename[name])) text1 = f.read() f.close() if 'Azimuth (Degrees)' in text1: foundtth = 1 CurvePlot.set_axis_title(self.plot,CurvePlot.X_BOTTOM,"Azimuth angle (degrees)") elif 'Q' in text1: foundq = 1 CurvePlot.set_axis_title(self.plot,CurvePlot.X_BOTTOM,"q (1/nm)") elif '2-Theta Angle (Degrees)' in text1: foundtth = 1 CurvePlot.set_axis_title(self.plot,CurvePlot.X_BOTTOM,"2-theta (degrees)") if foundq == 1 and foundtth == 1: CurvePlot.set_axis_title(self.plot,CurvePlot.X_BOTTOM,"Mixed! q (1/nm) and 2-theta (degrees)") self.legend = make.legend( 'TR' ) # Top Right self.plot.add_item( self.legend ) # Reset axis if checkbox is checked, otherwise ignore if self.tick_axis_reset.isChecked()==True: CurvePlot.set_axis_limits(self.plot,CurvePlot.X_BOTTOM,mintth*0.9,maxtth*1.1) CurvePlot.set_axis_limits(self.plot,CurvePlot.Y_LEFT,minintensity*0.9,maxintensity*1.1) # Plot everything self.plot.replot( ) # Refresh also the integral plot self.button_Click6( ) # Select all def button_Click3( self ): for k in range(0,len(self.names)): self.series_list_model.item(k).setCheckState( Qt.Checked ) # Select none def button_Click4( self ): for k in range(0,len(self.names)): self.series_list_model.item(k).setCheckState( Qt.Unchecked ) # Download and integrate button def button_Click5( self ): curdir = str(self.text1.toPlainText()) execfile(curdir+"/setup/pipeline.py") # Update file list after integrating self.button_Click( ) # Sum over ROI and update the lower graph def button_Click6( self ): # Clear the plot first self.plot2.del_all_items() # Seed for random generator of colors, so that they are always in the same order random.seed(654321) colorlistred = [220, 255, 155, 24, 0, 0, 48, 205, 255, 255, 0, 142] colorlistgreen = [20, 105, 48, 116, 229, 238, 128, 205, 193, 97, 0, 142] colorlistblue = [60, 180, 255, 205, 238, 118, 20, 0, 37, 3, 0, 142] markerlist = ['Rect','Diamond', 'UTriangle', 'DTriangle', 'RTriangle','Cross', 'Ellipse', 'Star1', 'XCross', 'LTriangle', 'Star2'] # Get cursor positions to define ROI x1 = guiqwt.shapes.Marker.xValue(self.vcursor1) x2 = guiqwt.shapes.Marker.xValue(self.vcursor2) if x2 < x1: x3 = copy.deepcopy(x1) x1 = copy.deepcopy(x2) x2 = x3 indices = [] self.sumy = {} self.sumx = {} # Use first predefined colours, then random colorcounter = 0 maxsumx = 0 minsumx = 10000 maxsumy = 0 minsumy = 10000000 self.sumxall = {} self.sumyall = {} seriesnames = [] for row in range(self.series_list_model.rowCount()): model_index = self.series_list_model.index(row, 0) checked = self.series_list_model.data(model_index, Qt.CheckStateRole) == QVariant(Qt.Checked) name = str(self.series_list_model.data(model_index).toString()) if checked: # Find x values over which to sum indices = [] for index,value in enumerate(self.x[name]): if value > x1 and value < x2: indices.append(index) xx = np.array(self.x[name]) yy = np.array(self.y[name]) sumy1 = np.trapz(yy[indices],xx[indices]) self.sumy[name] = [float(sumy1)] number1 = re.findall("(?<=_|-)[\d]*(?=.chi)",name) sumx1 = int(number1[0]) self.sumx[name] = [float(sumx1)] if max(self.sumx[name])>maxsumx: maxsumx = max(self.sumx[name]) if max(self.sumy[name])>maxsumy: maxsumy = max(self.sumy[name]) if min(self.sumx[name])<minsumx: minsumx = min(self.sumx[name]) if min(self.sumy[name])<minsumy and min(self.sumy[name]) > 0: minsumy = min(self.sumy[name]) # Check which series names we have name1 = re.findall("[\W\S\d]*(?=-[\d]{5}.chi)",name) # Try different versions of writing the names if first one does not succeed if name1 == []: name1 = re.findall("[\W\S\d]*(?=_[\d]{4}.chi)",name) if name1 == []: name1 = re.findall("[\W\S\d]*(?=_[\d]{5}.chi)",name) seriesname1 = str(name1[0]) if seriesname1 not in seriesnames: seriesnames.append(seriesname1) self.sumxall[seriesname1] = [] self.sumyall[seriesname1] = [] self.sumxall[seriesname1].append(sumx1) self.sumyall[seriesname1].append(sumy1) # Make lines and legends to separate different sample series colorcounter = 0 random.seed(654321) markercounter = 0 for seriesname1 in seriesnames: if len(colorlistred) > colorcounter: self.curveB = make.curve( [ ], [ ], seriesname1, QtGui.QColor( colorlistred[colorcounter], colorlistgreen[colorcounter], colorlistblue[colorcounter] ), linewidth=3.0, marker=markerlist[markercounter], markerfacecolor = QtGui.QColor( colorlistred[colorcounter], colorlistgreen[colorcounter], colorlistblue[colorcounter] ), markeredgecolor= QtGui.QColor( colorlistred[colorcounter], colorlistgreen[colorcounter], colorlistblue[colorcounter] )) colorcounter = colorcounter + 1 markercounter = markercounter + 1 else: newcolor = QtGui.QColor( random.randint(0,255), random.randint(0,255), random.randint(0,255)) self.curveB = make.curve( [ ], [ ], seriesname1, newcolor, linewidth=3.0, marker=markerlist[markercounter], markerfacecolor = newcolor, markeredgecolor = newcolor ) markercounter = markercounter + 1 if markercounter > len(markerlist): markercounter = 0 self.plot2.add_item( self.curveB ) self.curveB.set_data( self.sumxall[seriesname1],self.sumyall[seriesname1] ) CurvePlot.set_axis_title(self.plot2,CurvePlot.X_BOTTOM,"File number") CurvePlot.set_axis_title(self.plot2,CurvePlot.Y_LEFT,"ROI sum") self.legend2 = make.legend( 'TR' ) # Top Right self.plot2.add_item( self.legend2 ) # Reset axis if ticked if self.tick_axis_reset.isChecked()==True: CurvePlot.set_axis_limits(self.plot2,CurvePlot.X_BOTTOM,minsumx*0.9,maxsumx*1.1) CurvePlot.set_axis_limits(self.plot2,CurvePlot.Y_LEFT,minsumy*0.9,maxsumy*1.1) # Plot everything self.plot2.replot( )
def button_Click2( self ): # has_series = False # Seed for random generator of colors, so that they are always in the same order random.seed(654321) colorlistred = [220, 255, 155, 24, 0, 0, 48, 205, 255, 255, 0, 142] colorlistgreen = [20, 105, 48, 116, 229, 238, 128, 205, 193, 97, 0, 142] colorlistblue = [60, 180, 255, 205, 238, 118, 20, 0, 37, 3, 0, 142] # Clear the plot first self.plot.del_all_items() # Add back the vertical cursor to the plot in the same position as before self.plot.add_item( self.vcursor1 ) self.plot.add_item( self.vcursor2 ) # For axes take max of 2theta and max of intensity maxtth = 0 maxintensity = 0 mintth = 100 minintensity = 100 # Use first predefined colours, then random colorcounter = 0 # Two simple markers to test if mixed x ranges exist foundq = 0 foundtth = 0 for row in range(self.series_list_model.rowCount()): model_index = self.series_list_model.index(row, 0) checked = self.series_list_model.data(model_index, Qt.CheckStateRole) == QVariant(Qt.Checked) name = str(self.series_list_model.data(model_index).toString()) if checked: # has_series = True self.curveAlabel = name if len(colorlistred) > colorcounter: self.curveA = make.curve( [ ], [ ], self.curveAlabel, QtGui.QColor( colorlistred[colorcounter], colorlistgreen[colorcounter], colorlistblue[colorcounter] ), linewidth=3.0) colorcounter = colorcounter + 1 else: self.curveA = make.curve( [ ], [ ], self.curveAlabel, QtGui.QColor( random.randint(0,255), random.randint(0,255), random.randint(0,255) ), linewidth=3.0) self.plot.add_item( self.curveA ) self.curveA.set_data( self.x[name], self.y[name]) if max(self.x[name])>maxtth: maxtth = max(self.x[name]) if max(self.y[name])>maxintensity: maxintensity = max(self.y[name]) if min(self.x[name])<mintth: mintth = min(self.x[name]) if min(self.y[name])<minintensity and min(self.y[name]) > 0: minintensity = min(self.y[name]) # Check if TTH or Q range, redefine x label if Q f = open(str(self.fullfilename[name])) text1 = f.read() f.close() if 'Azimuth (Degrees)' in text1: foundtth = 1 CurvePlot.set_axis_title(self.plot,CurvePlot.X_BOTTOM,"Azimuth angle (degrees)") elif 'Q' in text1: foundq = 1 CurvePlot.set_axis_title(self.plot,CurvePlot.X_BOTTOM,"q (1/nm)") elif '2-Theta Angle (Degrees)' in text1: foundtth = 1 CurvePlot.set_axis_title(self.plot,CurvePlot.X_BOTTOM,"2-theta (degrees)") if foundq == 1 and foundtth == 1: CurvePlot.set_axis_title(self.plot,CurvePlot.X_BOTTOM,"Mixed! q (1/nm) and 2-theta (degrees)") self.legend = make.legend( 'TR' ) # Top Right self.plot.add_item( self.legend ) # Reset axis if checkbox is checked, otherwise ignore if self.tick_axis_reset.isChecked()==True: CurvePlot.set_axis_limits(self.plot,CurvePlot.X_BOTTOM,mintth*0.9,maxtth*1.1) CurvePlot.set_axis_limits(self.plot,CurvePlot.Y_LEFT,minintensity*0.9,maxintensity*1.1) # Plot everything self.plot.replot( ) # Refresh also the integral plot self.button_Click6( )
def Plot_Start_New(widget,PLOT_DEFINE,COLORS,x1,x2,y1,y2): newmanager = PlotManager(widget) newplots = [] newcurves = {} for name in PLOT_DEFINE: plot = CurvePlot() #设置图表颜色 plot.setStyleSheet('''QWidget{ border: 1px solid #32435E; border-radius: 3px; font-size:11pt; color:white; font-family:"Microsoft YaHei UI"; /* padding: 0 8px; */ background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #080B10, stop: 1.0 #212C3F); selection-background-color: #0A246A; } ''' ) plot.axisScaleDraw(CurvePlot.Y_LEFT).setMinimumExtent(20) newplots.append(plot) newmanager.add_plot(plot) plot.plot_id = id(plot) for curve_color, curve_name in map(None,COLORS,name): if u"状态" in curve_name or u"打角/100" in curve_name : newcurves[curve_name] = guiqwt_make.curve([0], [0],markerfacecolor = 'black', markeredgecolor=curve_color, title=curve_name,marker = 'Diamond',linestyle = 'NoPen',markersize = 6) else: newcurves[curve_name] = guiqwt_make.curve([0], [0], color=curve_color, title=curve_name) plot.add_item(newcurves[curve_name]) #设置X轴y轴 plot.set_axis_limits(newcurves[curve_name].yAxis(),y1,y2) plot.set_axis_limits(newcurves[curve_name].xAxis(),x1,x2) plot.add_item(guiqwt_make.legend("BL")) newmanager.register_standard_tools() newmanager.get_default_tool().activate() return (newmanager,newplots,newcurves)
def __init__(self): super(RealtimeDemo, self).__init__() self.setWindowTitle(u"Realtime Demo") self.data = {u"t":array("d")} # for name in sum(PLOT_DEFINE, []): # self.data[name] = array("d") for name in PLOT_DEFINE: self.data[name] = array("d") self.curves = {} self.t = 0 vbox = QVBoxLayout() vbox.addWidget(self.setup_toolbar()) grid = QGridLayout() vbox.addLayout(grid) self.manager = PlotManager(self) self.plots = [] # for i, define in enumerate(PLOT_DEFINE): # plot = CurvePlot() # plot.axisScaleDraw(CurvePlot.Y_LEFT).setMinimumExtent(60) # self.manager.add_plot(plot) # self.plots.append(plot) # plot.plot_id = id(plot) # for j, curve_name in enumerate(define): # curve = self.curves[curve_name] = make.curve([0], [0], color=COLORS[j], title=curve_name) # plot.add_item(curve) # plot.add_item(make.legend("BL")) # vbox.addWidget(plot) # self.manager.register_standard_tools() # self.manager.get_default_tool().activate() # self.manager.synchronize_axis(CurvePlot.X_BOTTOM, self.manager.plots.keys()) # self.setLayout(vbox) # self.startTimer(100) # buttton_names = ['Cls', 'Bck', '', 'Close', # '7', '8', '9', '/', # '4', '5', '6', '*', # '1', '2', '3', '-', # '0', '.', '=', '+'] # main_ground = QtWidgets.QWidget() # self.setCentralWidget(main_ground) # grid = QtWidgets.QGridLayout() # for [n, (x, y)] in enumerate([(i, j) for i in range(4) for j in range(4)]): plot = CurvePlot() plot.axisScaleDraw(CurvePlot.Y_LEFT).setMinimumExtent(60) self.manager.add_plot(plot) self.plots.append(plot) plot.plot_id = id(plot) curve = self.curves[PLOT_DEFINE[n]] = make.curve([0], [0], color=COLORS[0], title=PLOT_DEFINE[n]) plot.add_item(curve) plot.add_item(make.legend("BL")) grid.addWidget(plot, x, y) self.manager.register_standard_tools() self.manager.get_default_tool().activate() self.manager.synchronize_axis(CurvePlot.X_BOTTOM, self.manager.plots.keys()) self.setLayout(vbox) self.startTimer(100)
def setupUi(self, Form): #----------------------------------------------- Form.setObjectName(_fromUtf8("Form")) Form.resize(1329, 856) self.realtimecurve = CurvePlot(Form) self.realtimecurve.setGeometry(QtCore.QRect(10, 10, 1251, 261)) self.realtimecurve.setObjectName(_fromUtf8("realtimecurve")) curve_name = 'Lspeed' curve = self.curve_item[curve_name] = make.curve([0], [0], color='b', title=curve_name) self.realtimecurve.add_item(curve) curve_name = 'Rspeed' curve = self.curve_item[curve_name] = make.curve([0], [0], color='r', title=curve_name) self.realtimecurve.add_item(curve) curve_name = 'DeltaSpeed' curve = self.curve_item[curve_name] = make.curve([0], [0], color='g', title=curve_name) self.realtimecurve.add_item(curve) self.realtimecurve.add_item(make.legend("TR")) #curve self.realtimecurve2 = CurvePlot(Form) self.realtimecurve2.setGeometry(QtCore.QRect(10, 280, 1251, 261)) self.realtimecurve2.setObjectName(_fromUtf8("realtimecurve2")) curve_name = 'Lcurrent' curve = self.curve_item[curve_name] = make.curve([0], [0], color='b', title=curve_name) self.realtimecurve2.add_item(curve) curve_name = 'Rcurrent' curve = self.curve_item[curve_name] = make.curve([0], [0], color='r', title=curve_name) self.realtimecurve2.add_item(curve) self.realtimecurve2.add_item(make.legend("TR")) #------------------------------------------------ self.Controller = QtGui.QGroupBox(Form) self.Controller.setGeometry(QtCore.QRect(20, 580, 311, 271)) self.Controller.setObjectName(_fromUtf8("Controller")) self.Lspeed = QtGui.QLineEdit(self.Controller) self.Lspeed.setGeometry(QtCore.QRect(150, 40, 121, 22)) self.Lspeed.setObjectName(_fromUtf8("Lspeed")) self.Rspeed = QtGui.QLineEdit(self.Controller) self.Rspeed.setGeometry(QtCore.QRect(150, 70, 121, 22)) self.Rspeed.setObjectName(_fromUtf8("Rspeed")) self.label = QtGui.QLabel(self.Controller) self.label.setGeometry(QtCore.QRect(20, 40, 111, 20)) self.label.setObjectName(_fromUtf8("label")) self.label_2 = QtGui.QLabel(self.Controller) self.label_2.setGeometry(QtCore.QRect(20, 70, 111, 20)) self.label_2.setObjectName(_fromUtf8("label_2")) self.checkBox = QtGui.QCheckBox(self.Controller) self.checkBox.setGeometry(QtCore.QRect(20, 100, 91, 16)) self.checkBox.setObjectName(_fromUtf8("checkBox")) self.speed = QtGui.QSlider(self.Controller) self.speed.setGeometry(QtCore.QRect(130, 140, 160, 22)) self.speed.setOrientation(QtCore.Qt.Horizontal) self.speed.setObjectName(_fromUtf8("speed")) self.lcdSpeed = QtGui.QLCDNumber(self.Controller) self.lcdSpeed.setGeometry(QtCore.QRect(20, 140, 91, 23)) self.lcdSpeed.setStyleSheet( _fromUtf8("background-color: rgb(0, 0, 0);\n" "border-color: rgb(255, 0, 0);\n" "selection-color: rgb(255, 0, 0);")) self.lcdSpeed.setSmallDecimalPoint(False) self.lcdSpeed.setObjectName(_fromUtf8("lcdSpeed")) self.pushButton = QtGui.QPushButton(self.Controller) self.pushButton.setGeometry(QtCore.QRect(200, 230, 75, 23)) self.pushButton.setObjectName(_fromUtf8("pushButton")) self.pushButton_2 = QtGui.QPushButton(self.Controller) self.pushButton_2.setGeometry(QtCore.QRect(20, 230, 75, 23)) self.pushButton_2.setObjectName(_fromUtf8("pushButton_2")) self.pushButton_3 = QtGui.QPushButton(self.Controller) self.pushButton_3.setGeometry(QtCore.QRect(110, 230, 75, 23)) self.pushButton_3.setObjectName(_fromUtf8("pushButton_3")) self.LineStrategy = QtGui.QGroupBox(Form) self.LineStrategy.setGeometry(QtCore.QRect(330, 580, 241, 271)) self.LineStrategy.setObjectName(_fromUtf8("LineStrategy")) self.LineKp = QtGui.QLineEdit(self.LineStrategy) self.LineKp.setGeometry(QtCore.QRect(100, 30, 121, 22)) self.LineKp.setObjectName(_fromUtf8("LineKp")) self.LineKi = QtGui.QLineEdit(self.LineStrategy) self.LineKi.setGeometry(QtCore.QRect(100, 60, 121, 22)) self.LineKi.setObjectName(_fromUtf8("LineKi")) self.LineKd = QtGui.QLineEdit(self.LineStrategy) self.LineKd.setGeometry(QtCore.QRect(100, 90, 121, 22)) self.LineKd.setObjectName(_fromUtf8("LineKd")) self.label_4 = QtGui.QLabel(self.LineStrategy) self.label_4.setGeometry(QtCore.QRect(20, 30, 61, 21)) self.label_4.setObjectName(_fromUtf8("label_4")) self.label_5 = QtGui.QLabel(self.LineStrategy) self.label_5.setGeometry(QtCore.QRect(20, 60, 61, 21)) self.label_5.setObjectName(_fromUtf8("label_5")) self.label_6 = QtGui.QLabel(self.LineStrategy) self.label_6.setGeometry(QtCore.QRect(20, 90, 61, 21)) self.label_6.setObjectName(_fromUtf8("label_6")) self.lineUpdate = QtGui.QPushButton(self.LineStrategy) self.lineUpdate.setGeometry(QtCore.QRect(80, 230, 75, 23)) self.lineUpdate.setObjectName(_fromUtf8("lineUpdate")) self.lineStragery = QtGui.QRadioButton(self.LineStrategy) self.lineStragery.setGeometry(QtCore.QRect(20, 130, 89, 16)) self.lineStragery.setObjectName(_fromUtf8("lineStragery")) self.lineStragery_2 = QtGui.QRadioButton(self.LineStrategy) self.lineStragery_2.setGeometry(QtCore.QRect(90, 130, 89, 16)) self.lineStragery_2.setObjectName(_fromUtf8("lineStragery_2")) self.lineStragery_3 = QtGui.QRadioButton(self.LineStrategy) self.lineStragery_3.setGeometry(QtCore.QRect(160, 130, 71, 16)) self.lineStragery_3.setObjectName(_fromUtf8("lineStragery_3")) self.ObstacleCrossing = QtGui.QGroupBox(Form) self.ObstacleCrossing.setGeometry(QtCore.QRect(570, 580, 241, 271)) self.ObstacleCrossing.setObjectName(_fromUtf8("ObstacleCrossing")) self.obCrossKd = QtGui.QLineEdit(self.ObstacleCrossing) self.obCrossKd.setGeometry(QtCore.QRect(100, 90, 121, 22)) self.obCrossKd.setObjectName(_fromUtf8("obCrossKd")) self.obCrossKi = QtGui.QLineEdit(self.ObstacleCrossing) self.obCrossKi.setGeometry(QtCore.QRect(100, 60, 121, 22)) self.obCrossKi.setObjectName(_fromUtf8("obCrossKi")) self.label_7 = QtGui.QLabel(self.ObstacleCrossing) self.label_7.setGeometry(QtCore.QRect(20, 60, 61, 21)) self.label_7.setObjectName(_fromUtf8("label_7")) self.label_8 = QtGui.QLabel(self.ObstacleCrossing) self.label_8.setGeometry(QtCore.QRect(20, 90, 61, 21)) self.label_8.setObjectName(_fromUtf8("label_8")) self.label_9 = QtGui.QLabel(self.ObstacleCrossing) self.label_9.setGeometry(QtCore.QRect(20, 30, 61, 21)) self.label_9.setObjectName(_fromUtf8("label_9")) self.obCrossKp = QtGui.QLineEdit(self.ObstacleCrossing) self.obCrossKp.setGeometry(QtCore.QRect(100, 30, 121, 22)) self.obCrossKp.setObjectName(_fromUtf8("obCrossKp")) self.label_10 = QtGui.QLabel(self.ObstacleCrossing) self.label_10.setGeometry(QtCore.QRect(20, 120, 54, 21)) self.label_10.setObjectName(_fromUtf8("label_10")) self.obTriggerCurrent = QtGui.QLineEdit(self.ObstacleCrossing) self.obTriggerCurrent.setGeometry(QtCore.QRect(100, 120, 121, 22)) self.obTriggerCurrent.setObjectName(_fromUtf8("obTriggerCurrent")) self.label_11 = QtGui.QLabel(self.ObstacleCrossing) self.label_11.setGeometry(QtCore.QRect(20, 150, 61, 21)) self.label_11.setObjectName(_fromUtf8("label_11")) self.obCurrent = QtGui.QLineEdit(self.ObstacleCrossing) self.obCurrent.setGeometry(QtCore.QRect(100, 150, 121, 22)) self.obCurrent.setObjectName(_fromUtf8("obCurrent")) self.obStragery = QtGui.QRadioButton(self.ObstacleCrossing) self.obStragery.setGeometry(QtCore.QRect(30, 190, 89, 16)) self.obStragery.setObjectName(_fromUtf8("obStragery")) self.obStragery_2 = QtGui.QRadioButton(self.ObstacleCrossing) self.obStragery_2.setGeometry(QtCore.QRect(120, 190, 89, 16)) self.obStragery_2.setObjectName(_fromUtf8("obStragery_2")) self.obUpdate = QtGui.QPushButton(self.ObstacleCrossing) self.obUpdate.setGeometry(QtCore.QRect(70, 230, 75, 23)) self.obUpdate.setObjectName(_fromUtf8("obUpdate")) self.retranslateUi(Form) QtCore.QMetaObject.connectSlotsByName(Form)