Changeset 30e0be0 in sasview for src/sas/qtgui
- Timestamp:
- Sep 25, 2018 6:35:13 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- 4e85147
- Parents:
- 6923863
- Location:
- src/sas/qtgui/Calculators
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Calculators/GenericScatteringCalculator.py
raed0532 r30e0be0 32 32 33 33 trigger_plot_3d = QtCore.pyqtSignal() 34 calculationFinishedSignal = QtCore.pyqtSignal() 34 35 35 36 def __init__(self, parent=None): … … 100 101 # plots - 3D in real space 101 102 self.trigger_plot_3d.connect(lambda: self.plot3d(has_arrow=False)) 103 104 # plots - 3D in real space 105 self.calculationFinishedSignal.connect(self.plot_1_2d) 102 106 103 107 # TODO the option Ellipsoid has not been implemented … … 545 549 d = threads.deferToThread(self.complete, inputs, self._update) 546 550 # Add deferred callback for call return 547 d.addCallback(self.plot_1_2d) 551 #d.addCallback(self.plot_1_2d) 552 d.addCallback(self.calculateComplete) 548 553 d.addErrback(self.calculateFailed) 549 554 except: … … 563 568 print("Calculate Failed with:\n", reason) 564 569 pass 570 571 def calculateComplete(self, d): 572 """ 573 Notify the main thread 574 """ 575 self.calculationFinishedSignal.emit() 565 576 566 577 def complete(self, input, update=None): … … 629 640 self.graph_num += 1 630 641 631 def plot_1_2d(self , d):642 def plot_1_2d(self): 632 643 """ Generate 1D or 2D plot, called in Compute""" 633 644 if self.is_avg or self.is_avg is None: … … 637 648 data.xaxis('\\rm{Q_{x}}', '\AA^{-1}') 638 649 data.yaxis('\\rm{Intensity}', 'cm^{-1}') 639 plot1D = Plotter(self )650 plot1D = Plotter(self, quickplot=True) 640 651 plot1D.plot(data) 641 652 plot1D.show() … … 655 666 data.title = "GenSAS {} #{} 2D".format(self.file_name, 656 667 int(self.graph_num)) 657 plot2D = Plotter2D(self )668 plot2D = Plotter2D(self, quickplot=True) 658 669 plot2D.plot(data) 659 670 plot2D.show() … … 825 836 self.figure.canvas.draw() 826 837 838 def createContextMenu(self): 839 """ 840 Define common context menu and associated actions for the MPL widget 841 """ 842 return 843 844 def createContextMenuQuick(self): 845 """ 846 Define context menu and associated actions for the quickplot MPL widget 847 """ 848 return 849 827 850 828 851 class Plotter3D(QtWidgets.QDialog, Plotter3DWidget): -
src/sas/qtgui/Calculators/ResolutionCalculatorPanel.py
r144fe21 r30e0be0 517 517 cal_res.addErrback(self.calculateFailed) 518 518 519 # logging.info("Computation is in progress...")520 519 self.cmdCompute.setText('Wait...') 521 520 self.cmdCompute.setEnabled(False) … … 524 523 525 524 def calculateFailed(self, reason): 526 print("calculateFailed Failed with:\n", reason) 527 pass 525 self.cmdCompute.setText('Compute') 526 self.cmdCompute.setEnabled(True) 527 logging.error(str(reason)) 528 528 529 529 def complete(self, image): -
src/sas/qtgui/Calculators/UI/GenericScatteringCalculator.ui
r457d961 r30e0be0 164 164 </property> 165 165 </item> 166 <item>167 <property name="text">168 <string>Ellipsoid</string>169 </property>170 </item>171 166 </widget> 172 167 </item> -
src/sas/qtgui/Calculators/UnitTesting/GenericScatteringCalculatorTest.py
re90988c r30e0be0 91 91 ['Fixed orientation', 'Debye full avg.']) 92 92 93 self.assertEqual(self.widget.cbShape.count(), 2)93 self.assertEqual(self.widget.cbShape.count(), 1) 94 94 self.assertEqual(self.widget.cbShape.currentIndex(), 0) 95 95 self.assertListEqual([self.widget.cbShape.itemText(i) for i in 96 96 range(self.widget.cbShape.count())], 97 ['Rectangular', 'Ellipsoid']) 97 ['Rectangular']) 98 #['Rectangular', 'Ellipsoid']) 98 99 self.assertFalse(self.widget.cbShape.isEditable()) 99 100 # disable buttons
Note: See TracChangeset
for help on using the changeset viewer.