Changeset 86d3207 in sasview for src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
- Timestamp:
- Sep 14, 2018 6:58:21 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- 9d23e4c, 305114c
- Parents:
- 768387e0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r557fc498 r86d3207 28 28 from sas.qtgui.Plotting.PlotterData import Data1D 29 29 from sas.qtgui.Plotting.PlotterData import Data2D 30 from sas.qtgui.Plotting.Plotter import PlotterWidget 30 31 31 32 from sas.qtgui.Perspectives.Fitting.UI.FittingWidgetUI import Ui_FittingWidgetUI … … 2825 2826 item4 = QtGui.QStandardItem() 2826 2827 2827 self._model_model.appendRow([item1, item2, item3, item4]) 2828 # cell 4: SLD button 2829 item5 = QtGui.QStandardItem() 2830 button = QtWidgets.QPushButton() 2831 button.setText("Show SLD Profile") 2832 2833 self._model_model.appendRow([item1, item2, item3, item4, item5]) 2828 2834 2829 2835 # Beautify the row: span columns 2-4 2830 2836 shell_row = self._model_model.rowCount() 2831 2837 shell_index = self._model_model.index(shell_row-1, 1) 2838 button_index = self._model_model.index(shell_row-1, 4) 2832 2839 2833 2840 self.lstParams.setIndexWidget(shell_index, func) 2841 self.lstParams.setIndexWidget(button_index, button) 2834 2842 self._n_shells_row = shell_row - 1 2835 2843 … … 2858 2866 func.currentTextChanged.connect(self.modifyShellsInList) 2859 2867 2868 # Respond to button press 2869 button.clicked.connect(self.onShowSLDProfile) 2870 2860 2871 # Available range of shells displayed in the combobox 2861 2872 func.addItems([str(i) for i in range(shell_min, shell_max+1)]) … … 2877 2888 index = 0 2878 2889 logger.error("Multiplicity incorrect! Setting to 0") 2879 2890 self.kernel_module.multiplicity = index 2880 2891 if remove_rows > 1: 2881 2892 self._model_model.removeRows(first_row, remove_rows) … … 2903 2914 self.setPolyModel() 2904 2915 self.setMagneticModel() 2916 2917 def onShowSLDProfile(self): 2918 """ 2919 Show a quick plot of SLD profile 2920 """ 2921 # get profile data 2922 x, y = self.kernel_module.getProfile() 2923 y *= 1.0e6 2924 profile_data = Data1D(x=x, y=y) 2925 profile_data.name = "SLD" 2926 profile_data.scale = 'linear' 2927 profile_data.symbol = 'Line' 2928 profile_data.hide_error = True 2929 profile_data._xaxis = "R(\AA)" 2930 profile_data._yaxis = "SLD(10^{-6}\AA^{-2})" 2931 2932 plotter = PlotterWidget(self, quickplot=True) 2933 plotter.data = profile_data 2934 plotter.showLegend = True 2935 plotter.plot(hide_error=True, marker='-') 2936 2937 self.plot_widget = QtWidgets.QWidget() 2938 self.plot_widget.setWindowTitle("Scattering Length Density Profile") 2939 layout = QtWidgets.QVBoxLayout() 2940 layout.addWidget(plotter) 2941 self.plot_widget.setLayout(layout) 2942 self.plot_widget.show() 2905 2943 2906 2944 def setInteractiveElements(self, enabled=True):
Note: See TracChangeset
for help on using the changeset viewer.