Changeset 60bf0db in sasview
- Timestamp:
- Oct 26, 2017 2:47:33 AM (7 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:
- 6060a86
- Parents:
- 6fd89d4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/PrInversion/dmax.py
r6fd89d4 r60bf0db 26 26 # from InvariantUtils import WIDGETS 27 27 28 def enum(*sequential, **named): 29 enums = dict(zip(sequential, range(len(sequential))), **named) 30 return type('Enum', (), enums) 31 32 W = enum( 'NPTS', #0 33 'DMIN', #1 34 'DMAX', #2 35 'VARIABLE', #3 36 ) 28 37 29 38 class DmaxWindow(QtGui.QDialog, Ui_DmaxExplorer): … … 32 41 name = "Dmax Explorer" # For displaying in the combo box 33 42 34 def __init__(self, pr_state, parent=None):43 def __init__(self, pr_state, nfunc, parent=None): 35 44 super(DmaxWindow, self).__init__() 36 45 self.setupUi(self) … … 39 48 40 49 self.pr_state = pr_state 50 self.nfunc = nfunc 41 51 self.communicator = GuiUtils.Communicate() 42 52 … … 49 59 # # Connect buttons to slots. 50 60 # # Needs to be done early so default values propagate properly. 51 #self.setupSlots()61 self.setupSlots() 52 62 53 # #Set up the model.54 #self.setupModel()63 # Set up the model. 64 self.setupModel() 55 65 56 66 # # Set up the mapper 57 # self.setupMapper() 67 self.setupMapper() 68 69 def setupSlots(self): 70 self.closeButton.clicked.connect(self.close) 71 72 self.model.itemChanged.connect(self.modelChanged) 73 74 def setupModel(self): 75 self.model.setItem(W.NPTS, QtGui.QStandardItem(str(self.nfunc))) 76 self.model.setItem(W.DMIN, 77 QtGui.QStandardItem( 78 str(0.9*self.pr_state.d_max))) 79 self.model.setItem(W.DMAX, 80 QtGui.QStandardItem( 81 str(1.1*self.pr_state.d_max))) 82 83 def setupMapper(self): 84 self.mapper = QtGui.QDataWidgetMapper(self) 85 self.mapper.setOrientation(QtCore.Qt.Vertical) 86 self.mapper.setModel(self.model) 87 88 self.mapper.addMapping(self.Npts, W.NPTS) 89 self.mapper.addMapping(self.minDist, W.DMIN) 90 self.mapper.addMapping(self.maxDist, W.DMAX) 91 self.mapper.addMapping(self.dependentVariable, W.VARIABLE) 92 93 self.mapper.toFirst() 94 95 def modelChanged(self, item): 96 pass 58 97 59 98 … … 65 104 # (unless you know what you're doing) 66 105 from twisted.internet import reactor 67 DLG = DmaxWindow(reactor) 106 from sas.sascalc.pr.invertor import Invertor 107 pr_state = Invertor() 108 DLG = DmaxWindow(pr_state, 10, reactor) 68 109 DLG.show() 69 110 reactor.run()
Note: See TracChangeset
for help on using the changeset viewer.