Changeset d3ca363 in sasview
- Timestamp:
- Dec 19, 2016 8:05:25 AM (8 years ago)
- Branches:
- ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- 257bd57
- Parents:
- 9290b1a
- Location:
- src/sas/qtgui
- Files:
-
- 3 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/GUITests.py
- Property mode changed from 100755 to 100644
r9290b1a rd3ca363 19 19 from UnitTesting import DensityCalculatorTest 20 20 from UnitTesting import WindowTitleTest 21 from UnitTesting import SetGraphRangeTest 21 22 22 23 def suite(): … … 40 41 unittest.makeSuite(DensityCalculatorTest.DensityCalculatorTest, 'test'), 41 42 unittest.makeSuite(WindowTitleTest.WindowTitleTest, 'test'), 43 unittest.makeSuite(SetGraphRangeTest.SetGraphRangeTest, 'test'), 42 44 ) 43 45 return unittest.TestSuite(suites) -
src/sas/qtgui/Plotter.py
r9290b1a rd3ca363 9 9 from sas.qtgui.PlotterBase import PlotterBase 10 10 from sas.qtgui.AddText import AddText 11 from sas.qtgui.SetGraphRange import SetGraphRange 11 12 12 13 class PlotterWidget(PlotterBase): … … 206 207 Show a dialog allowing setting the chart ranges 207 208 """ 208 print("onSetGraphRange") 209 pass 209 # min and max of data 210 x_range = self.ax.get_xlim() 211 y_range = self.ax.get_ylim() 212 self.setRange = SetGraphRange(parent=self, 213 x_range=x_range, y_range=y_range) 214 if self.setRange.exec_() == QtGui.QDialog.Accepted: 215 x_range = self.setRange.xrange() 216 y_range = self.setRange.yrange() 217 if x_range is not None and y_range is not None: 218 self.ax.set_xlim(x_range) 219 self.ax.set_ylim(y_range) 220 self.canvas.draw_idle() 210 221 211 222 def onResetGraphRange(self): 212 223 """ 213 Resets the chart X and Y ranges to the original values 214 """ 215 print("onResetGraphRange") 216 pass 224 Resets the chart X and Y ranges to their original values 225 """ 226 x_range = (self.data.x.min(), self.data.x.max()) 227 y_range = (self.data.y.min(), self.data.y.max()) 228 if x_range is not None and y_range is not None: 229 self.ax.set_xlim(x_range) 230 self.ax.set_ylim(y_range) 231 self.canvas.draw_idle() 217 232 218 233 def xyTransform(self, xLabel="", yLabel=""): -
src/sas/qtgui/UnitTesting/PlotterTest.py
r9290b1a rd3ca363 162 162 pass 163 163 164 def testOnSetGraphRange(self): 165 """ Cheks if the graph can be resized for range """ 166 pass 167 168 def testOnResetGraphRange(self): 169 """ Cheks if the graph can be reset after resizing for range """ 170 pass 164 171 165 172 if __name__ == "__main__": -
src/sas/qtgui/run_tests.bat
r9290b1a rd3ca363 18 18 python -m UnitTesting.WindowTitleTest 19 19 python -m UnitTesting.AddTextTest 20 python -m UnitTesting.SetGraphRangeTest -
src/sas/qtgui/run_tests.sh
r9290b1a rd3ca363 17 17 python -m UnitTesting.WindowTitleTest 18 18 python -m UnitTesting.AddTextTest 19 python -m UnitTesting.SetGraphRangeTest
Note: See TracChangeset
for help on using the changeset viewer.