Changeset e33fcd1 in sasview for src


Ignore:
Timestamp:
Dec 7, 2018 5:23:15 AM (5 years ago)
Author:
wojciech
Branches:
ESS_GUI, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_sync_sascalc
Children:
54398d5
Parents:
ccdee50 (diff), aea6bb7 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'ESS_GUI_Invariant' into ESS_GUI

Location:
src/sas/qtgui
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Invariant/InvariantPerspective.py

    r11a336f raea6bb7  
    329329            surface = None 
    330330 
     331        if self._low_extrapolate: 
     332            try: 
     333                qstar_low, qstar_low_err = inv.get_qstar_low() 
     334            except Exception as ex: 
     335                calculation_failed = True 
     336                msg += str(ex) 
     337        if self._high_extrapolate: 
     338            try: 
     339                qstar_high, qstar_high_err = inv.get_qstar_high() 
     340            except Exception as ex: 
     341                calculation_failed = True 
     342                msg += str(ex) 
     343 
    331344        if (calculation_failed): 
    332345            logging.warning('Calculation failed: {}'.format(msg)) 
    333346            return self.model 
    334         else: 
    335  
    336             if self._low_extrapolate: 
    337                 # for presentation in InvariantDetails 
    338                 qstar_low, qstar_low_err = inv.get_qstar_low() 
    339                 extrapolated_data = inv.get_extra_data_low(self._low_points) 
    340                 power_low = inv.get_extrapolation_power(range='low') 
    341  
    342                 # Plot the chart 
    343                 title = "Low-Q extrapolation" 
    344  
    345                 # Convert the data into plottable 
    346                 extrapolated_data = self._manager.createGuiData(extrapolated_data) 
    347  
    348                 extrapolated_data.name = title 
    349                 extrapolated_data.title = title 
    350                 extrapolated_data.symbol = "Line" 
    351                 extrapolated_data.has_errors = False 
    352  
    353                 # copy labels and units of axes for plotting 
    354                 extrapolated_data._xaxis = temp_data._xaxis 
    355                 extrapolated_data._xunit = temp_data._xunit 
    356                 extrapolated_data._yaxis = temp_data._yaxis 
    357                 extrapolated_data._yunit = temp_data._yunit 
    358  
    359                 # Add the plot to the model item 
    360                 # This needs to run in the main thread 
    361                 reactor.callFromThread(GuiUtils.updateModelItemWithPlot, 
     347 
     348        if self._low_extrapolate: 
     349            extrapolated_data = inv.get_extra_data_low(self._low_points) 
     350            power_low = inv.get_extrapolation_power(range='low') 
     351 
     352            # Plot the chart 
     353            title = "Low-Q extrapolation" 
     354 
     355            # Convert the data into plottable 
     356            extrapolated_data = self._manager.createGuiData(extrapolated_data) 
     357 
     358            extrapolated_data.name = title 
     359            extrapolated_data.title = title 
     360            extrapolated_data.symbol = "Line" 
     361            extrapolated_data.has_errors = False 
     362 
     363            # copy labels and units of axes for plotting 
     364            extrapolated_data._xaxis = temp_data._xaxis 
     365            extrapolated_data._xunit = temp_data._xunit 
     366            extrapolated_data._yaxis = temp_data._yaxis 
     367            extrapolated_data._yunit = temp_data._yunit 
     368 
     369            # Add the plot to the model item 
     370            # This needs to run in the main thread 
     371            reactor.callFromThread(GuiUtils.updateModelItemWithPlot, 
    362372                                       self._model_item, 
    363373                                       extrapolated_data, 
    364374                                       title) 
    365375 
    366             if self._high_extrapolate: 
    367                 # for presentation in InvariantDetails 
    368                 qmax_plot = Q_MAXIMUM_PLOT * max(temp_data.x) 
    369  
    370                 if qmax_plot > Q_MAXIMUM: 
    371                     qmax_plot = Q_MAXIMUM 
    372                 qstar_high, qstar_high_err = inv.get_qstar_high() 
    373                 power_high = inv.get_extrapolation_power(range='high') 
    374                 high_out_data = inv.get_extra_data_high(q_end=qmax_plot, npts=500) 
    375  
    376                 # Plot the chart 
    377                 title = "High-Q extrapolation" 
    378  
    379                 # Convert the data into plottable 
    380                 high_out_data = self._manager.createGuiData(high_out_data) 
    381                 high_out_data.name = title 
    382                 high_out_data.title = title 
    383                 high_out_data.symbol = "Line" 
    384                 high_out_data.has_errors = False 
    385  
    386                 # copy labels and units of axes for plotting 
    387                 high_out_data._xaxis = temp_data._xaxis 
    388                 high_out_data._xunit = temp_data._xunit 
    389                 high_out_data._yaxis = temp_data._yaxis 
    390                 high_out_data._yunit = temp_data._yunit 
    391  
    392                 # Add the plot to the model item 
    393                 # This needs to run in the main thread 
    394                 reactor.callFromThread(GuiUtils.updateModelItemWithPlot, 
     376        if self._high_extrapolate: 
     377            # for presentation in InvariantDetails 
     378            qmax_plot = Q_MAXIMUM_PLOT * max(temp_data.x) 
     379 
     380            if qmax_plot > Q_MAXIMUM: 
     381                qmax_plot = Q_MAXIMUM 
     382            power_high = inv.get_extrapolation_power(range='high') 
     383            high_out_data = inv.get_extra_data_high(q_end=qmax_plot, npts=500) 
     384 
     385            # Plot the chart 
     386            title = "High-Q extrapolation" 
     387 
     388            # Convert the data into plottable 
     389            high_out_data = self._manager.createGuiData(high_out_data) 
     390            high_out_data.name = title 
     391            high_out_data.title = title 
     392            high_out_data.symbol = "Line" 
     393            high_out_data.has_errors = False 
     394 
     395            # copy labels and units of axes for plotting 
     396            high_out_data._xaxis = temp_data._xaxis 
     397            high_out_data._xunit = temp_data._xunit 
     398            high_out_data._yaxis = temp_data._yaxis 
     399            high_out_data._yunit = temp_data._yunit 
     400 
     401            # Add the plot to the model item 
     402            # This needs to run in the main thread 
     403            reactor.callFromThread(GuiUtils.updateModelItemWithPlot, 
    395404                                       self._model_item, high_out_data, title) 
    396405 
    397             item = QtGui.QStandardItem(str(float('%.3g'% volume_fraction))) 
    398             self.model.setItem(WIDGETS.W_VOLUME_FRACTION, item) 
    399             item = QtGui.QStandardItem(str(float('%.3g'% volume_fraction_error))) 
    400             self.model.setItem(WIDGETS.W_VOLUME_FRACTION_ERR, item) 
    401             if surface: 
    402                 item = QtGui.QStandardItem(str(float('%.3g'% surface))) 
    403                 self.model.setItem(WIDGETS.W_SPECIFIC_SURFACE, item) 
    404                 item = QtGui.QStandardItem(str(float('%.3g'% surface_error))) 
    405                 self.model.setItem(WIDGETS.W_SPECIFIC_SURFACE_ERR, item) 
    406             item = QtGui.QStandardItem(str(float('%.3g'% qstar_total))) 
    407             self.model.setItem(WIDGETS.W_INVARIANT, item) 
    408             item = QtGui.QStandardItem(str(float('%.3g'% qstar_total_error))) 
    409             self.model.setItem(WIDGETS.W_INVARIANT_ERR, item) 
    410  
    411             item = QtGui.QStandardItem(str(float('%.3g'% qstar_low))) 
    412             self.model.setItem(WIDGETS.D_LOW_QSTAR, item) 
    413             item = QtGui.QStandardItem(str(float('%.3g'% qstar_low_err))) 
    414             self.model.setItem(WIDGETS.D_LOW_QSTAR_ERR, item) 
    415             item = QtGui.QStandardItem(str(float('%.3g'% qstar_high))) 
    416             self.model.setItem(WIDGETS.D_HIGH_QSTAR, item) 
    417             item = QtGui.QStandardItem(str(float('%.3g'% qstar_high_err))) 
    418             self.model.setItem(WIDGETS.D_HIGH_QSTAR_ERR, item) 
    419  
    420             return self.model 
     406        item = QtGui.QStandardItem(str(float('%.3g'% volume_fraction))) 
     407        self.model.setItem(WIDGETS.W_VOLUME_FRACTION, item) 
     408        item = QtGui.QStandardItem(str(float('%.3g'% volume_fraction_error))) 
     409        self.model.setItem(WIDGETS.W_VOLUME_FRACTION_ERR, item) 
     410        if surface: 
     411            item = QtGui.QStandardItem(str(float('%.3g'% surface))) 
     412            self.model.setItem(WIDGETS.W_SPECIFIC_SURFACE, item) 
     413            item = QtGui.QStandardItem(str(float('%.3g'% surface_error))) 
     414            self.model.setItem(WIDGETS.W_SPECIFIC_SURFACE_ERR, item) 
     415        item = QtGui.QStandardItem(str(float('%.3g'% qstar_total))) 
     416        self.model.setItem(WIDGETS.W_INVARIANT, item) 
     417        item = QtGui.QStandardItem(str(float('%.3g'% qstar_total_error))) 
     418        self.model.setItem(WIDGETS.W_INVARIANT_ERR, item) 
     419 
     420        item = QtGui.QStandardItem(str(float('%.3g'% qstar_low))) 
     421        self.model.setItem(WIDGETS.D_LOW_QSTAR, item) 
     422        item = QtGui.QStandardItem(str(float('%.3g'% qstar_low_err))) 
     423        self.model.setItem(WIDGETS.D_LOW_QSTAR_ERR, item) 
     424        item = QtGui.QStandardItem(str(float('%.3g'% qstar_high))) 
     425        self.model.setItem(WIDGETS.D_HIGH_QSTAR, item) 
     426        item = QtGui.QStandardItem(str(float('%.3g'% qstar_high_err))) 
     427        self.model.setItem(WIDGETS.D_HIGH_QSTAR_ERR, item) 
     428 
     429        return self.model 
    421430 
    422431    def title(self): 
  • src/sas/qtgui/Calculators/KiessigPanel.py

    r3e314e6 rccdee50  
    3030        self.deltaq_in.textChanged.connect(self.onCompute) 
    3131        self.deltaq_in.setText("0.05") 
     32 
     33        # Set focus away from Close 
     34        self.computeButton.setFocus() 
    3235 
    3336        # no reason to have this widget resizable 
  • src/sas/qtgui/Calculators/UI/KiessigPanel.ui

    r457d961 rccdee50  
    88    <y>0</y> 
    99    <width>365</width> 
    10     <height>193</height> 
     10    <height>197</height> 
    1111   </rect> 
     12  </property> 
     13  <property name="focusPolicy"> 
     14   <enum>Qt::TabFocus</enum> 
    1215  </property> 
    1316  <property name="windowTitle"> 
  • src/sas/qtgui/Utilities/GridPanel.py

    r2327399 re03d56f  
    187187        """ 
    188188        url = "/user/qtgui/Perspectives/Fitting/fitting_help.html#batch-fit-mode" 
    189         location = GuiUtils.HELP_DIRECTORY_LOCATION + url 
    190         if os.path.isdir(location) == False: 
    191             sas_path = os.path.abspath(os.path.dirname(sys.argv[0])) 
    192             location = sas_path + "/" + location 
    193         try: 
    194             webbrowser.open('file://' + os.path.realpath(location)) 
    195         except webbrowser.Error as ex: 
    196             logging.warning("Cannot display help. %s" % ex) 
     189        GuiUtils.showHelp(url) 
     190 
    197191 
    198192    def onPlot(self): 
Note: See TracChangeset for help on using the changeset viewer.