Changeset 9ce69ec in sasview
- Timestamp:
- Sep 18, 2018 1:51:44 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:
- fc5d2d7f
- Parents:
- 1738173
- git-author:
- Piotr Rozyczko <rozyczko@…> (09/18/18 01:42:03)
- git-committer:
- Piotr Rozyczko <rozyczko@…> (09/18/18 01:51:44)
- Location:
- src/sas/qtgui
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Calculators/UnitTesting/SLDCalculatorTest.py
r144fe21 r9ce69ec 81 81 self.assertEqual(self.widget.ui.editMolecularFormula.styleSheet(), '') 82 82 self.assertEqual(self.widget.model.columnCount(), 1) 83 self.assertEqual(self.widget.model.rowCount(), 1 2)83 self.assertEqual(self.widget.model.rowCount(), 11) 84 84 self.assertEqual(self.widget.sizePolicy().Policy(), QtWidgets.QSizePolicy.Fixed) 85 85 86 86 def testSimpleEntry(self): 87 87 ''' Default compound calculations ''' 88 89 self.widget.show()90 88 91 89 self.widget.ui.editMassDensity.clear() … … 102 100 103 101 # Change mass density 104 self.widget.ui.edit Wavelength.clear()105 self.widget.ui.edit Wavelength.setText("666.0")102 self.widget.ui.editNeutronWavelength.clear() 103 self.widget.ui.editNeutronWavelength.setText("666.0") 106 104 107 105 # Send shift-tab to update the molar volume field … … 130 128 131 129 # Assure the mass density field is set 132 self.assertEqual(self.widget.ui.editNeutronIncXs.text(), '43.4') 130 #self.assertEqual(self.widget.ui.editNeutronIncXs.text(), '43.4') 131 self.assertEqual(self.widget.ui.editNeutronIncXs.text(), '2.89') 133 132 134 133 # Reset the widget 135 134 self.widget.modelReset() 136 135 137 136 self.assertEqual(self.widget.ui.editMolecularFormula.text(), "H2O") 138 137 self.assertEqual(self.widget.ui.editMassDensity.text(), "1") -
src/sas/qtgui/MainWindow/DataExplorer.py
r9f4eaeb r9ce69ec 598 598 Forces display of charts for the given data set 599 599 """ 600 plot_to_show = data_list[0] 601 # passed plot is used ONLY to figure out its title, 602 # so all the charts related by it can be pulled from 603 # the data explorer indices. 604 filename = plot_to_show.filename 605 self.displayFile(filename=filename, is_data=plot_to_show.is_data, id=id) 600 # data_list = [QStandardItem, Data1D/Data2D] 601 plot_to_show = data_list[1] 602 plot_item = data_list[0] 603 604 # plots to show 605 new_plots = [] 606 607 # Check if this is merely a plot update 608 if self.updatePlot(plot_to_show): 609 return 610 611 # Residuals get their own plot 612 if plot_to_show.plot_role == Data1D.ROLE_RESIDUAL: 613 plot_to_show.yscale='linear' 614 self.plotData([(plot_item, plot_to_show)]) 615 elif plot_to_show.plot_role == Data1D.ROLE_DELETABLE: 616 # No plot 617 return 618 else: 619 # Plots with main data points on the same chart 620 # Get the main data plot 621 main_data = GuiUtils.dataFromItem(plot_item.parent()) 622 if main_data is None: 623 # Try the current item 624 main_data = GuiUtils.dataFromItem(plot_item) 625 if main_data is not None: 626 new_plots.append((plot_item, main_data)) 627 new_plots.append((plot_item, plot_to_show)) 628 629 if new_plots: 630 self.plotData(new_plots) 606 631 607 632 def addDataPlot2D(self, plot_set, item): -
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r305114c r9ce69ec 1849 1849 # Show the chart if ready 1850 1850 data_to_show = self.data if self.data_is_loaded else self.model_data 1851 if data_to_show is not None: 1852 self.communicate.plotRequestedSignal.emit([data_to_show], self.tab_id) 1851 # Any models for this page 1852 current_index = self.all_data[self.data_index] 1853 plots = GuiUtils.plotsFromFilename(self.data.filename, current_index.model()) 1854 fitpage_name = "" if id is None else "M"+str(self.tab_id) 1855 # Has the fitted data been shown? 1856 data_shown = False 1857 #for plot in plots: 1858 for item, plot in plots.items(): 1859 if fitpage_name in plot.name: 1860 data_shown = True 1861 self.communicate.plotRequestedSignal.emit([item, plot], self.tab_id) 1862 if not data_shown: 1863 # fit+data has not been shown - show just data 1864 self.communicate.plotRequestedSignal.emit([item, data_to_show], self.tab_id) 1853 1865 1854 1866 def onOptionsUpdate(self): … … 2080 2092 self.kernel_module = self.models[model_name]() 2081 2093 2094 # Change the model name to a monicker 2095 self.kernel_module.name = self.modelName() 2096 2082 2097 # Explicitly add scale and background with default values 2083 2098 temp_undo_state = self.undo_supported … … 2112 2127 # Structure factor is the only selected model; build it and show all its params 2113 2128 self.kernel_module = self.models[structure_factor]() 2129 self.kernel_module.name = self.modelName() 2114 2130 s_params = self.kernel_module._model_info.parameters 2115 2131 s_params_orig = s_params … … 2122 2138 2123 2139 self.kernel_module = MultiplicationModel(p_kernel, s_kernel) 2140 # Modify the name to correspond to shown items 2141 self.kernel_module.name = self.modelName() 2124 2142 all_params = self.kernel_module._model_info.parameters.kernel_parameters 2125 2143 all_param_names = [param.name for param in all_params] … … 2427 2445 # Bring the GUI to normal state 2428 2446 self.enableInteractiveElements() 2429 2447 if return_data is None: 2448 self.calculateDataFailed("Results not available.") 2449 return 2430 2450 fitted_data = self.logic.new1DPlot(return_data, self.tab_id) 2431 2451 residuals = self.calculateResiduals(fitted_data) -
src/sas/qtgui/Perspectives/Invariant/InvariantPerspective.py
raed0532 r9ce69ec 233 233 234 234 plot_data = GuiUtils.plotsFromCheckedItems(self._manager.filesWidget.model) 235 #self.communicate.plotRequestedSignal.emit([item, plot], self.tab_id) 235 236 236 237 self._manager.filesWidget.plotData(plot_data) … … 347 348 extrapolated_data.name = title 348 349 extrapolated_data.title = title 350 extrapolated_data.style = "Line" 351 extrapolated_data.has_errors = False 352 extrapolated_data.plot_role = Data1D.ROLE_DEFAULT 349 353 350 354 # copy labels and units of axes for plotting … … 378 382 high_out_data.name = title 379 383 high_out_data.title = title 384 high_out_data.style = "Line" 385 high_out_data.has_errors = False 386 high_out_data.plot_role = Data1D.ROLE_DEFAULT 380 387 381 388 # copy labels and units of axes for plotting -
src/sas/qtgui/Perspectives/Inversion/InversionPerspective.py
r855e7ad r9ce69ec 547 547 self.prPlot.plot_role = Data1D.ROLE_RESIDUAL 548 548 GuiUtils.updateModelItemWithPlot(self._data, self.prPlot, title) 549 self.communicate.plotRequestedSignal.emit([self._data,self.prPlot], None) 549 550 if self.dataPlot is not None: 550 551 title = self.dataPlot.name 551 552 self.dataPlot.plot_role = Data1D.ROLE_DEFAULT 553 self.dataPlot.symbol = "Line" 554 self.dataPlot.show_errors = False 552 555 GuiUtils.updateModelItemWithPlot(self._data, self.dataPlot, title) 553 if self.dataPlot is not None or self.prPlot is not None: 554 self.communicate.plotRequestedSignal.emit([self.logic.data], None) 556 self.communicate.plotRequestedSignal.emit([self._data,self.dataPlot], None) 555 557 self.enableButtons() 556 558 -
src/sas/qtgui/Utilities/GuiUtils.py
ra54bbf2b r9ce69ec 567 567 The assumption - data stored in SasView standard, in child 0 568 568 """ 569 return item.child(0).data() 569 try: 570 data = item.child(0).data() 571 except AttributeError: 572 data = None 573 return data 570 574 571 575 def openLink(url):
Note: See TracChangeset
for help on using the changeset viewer.