Changeset 7b21c05 in sasview for src/sas


Ignore:
Timestamp:
Oct 24, 2017 12:15:21 PM (7 years ago)
Author:
Adam Washington <adam.washington@…>
Children:
cadd595a
Parents:
1bb879d
Message:

Move more data into the model

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Corfunc/CorfuncPerspective.py

    r1bb879d r7b21c05  
    151151        if item.row() == W.W_QMIN: 
    152152            value = float(self.model.item(W.W_QMIN).text()) 
    153             self._calculator.lowerq = value 
    154153            self._canvas.qmin = value 
    155         elif item.row() == W.W_QMAX: 
    156             value = float(self.model.item(W.W_QMAX).text()) 
    157             self._calculator.upperq = (value, self._calculator.upperq[1]) 
    158             self._canvas.qmax1 = value 
    159         elif item.row() == W.W_QCUTOFF: 
    160             value = float(self.model.item(W.W_QCUTOFF).text()) 
    161             self._calculator.upperq = (self._calculator.upperq[0], value) 
    162             self._canvas.qmax2 = value 
    163         elif item.row() == W.W_BACKGROUND: 
    164             value = float(self.model.item(W.W_BACKGROUND).text()) 
    165             self._calculator.background = value 
     154        elif item.row() == W.W_QMAX or item.row() == W.W_QCUTOFF: 
     155            a = float(self.model.item(W.W_QMAX).text()) 
     156            b = float(self.model.item(W.W_QCUTOFF).text()) 
     157            self._canvas.qmax1 = a 
     158            self._canvas.qmax2 = b 
    166159        else: 
    167160            print("{} Changed".format(item)) 
    168161 
     162        self._update_calculator() 
    169163        self.mapper.toFirst() 
    170164        self._canvas.drawQSpace() 
    171165 
     166    def _update_calculator(self): 
     167        self._calculator.lowerq = float(self.model.item(W.W_QMIN).text()) 
     168        qmax1 = float(self.model.item(W.W_QMAX).text()) 
     169        qmax2 = float(self.model.item(W.W_QCUTOFF).text()) 
     170        self._calculator.upperq = (qmax1, qmax2) 
     171        self._calculator.background = float(self.model.item(W.W_BACKGROUND).text()) 
    172172 
    173173    def extrapolate(self): 
     
    190190 
    191191        extrap = self._canvas.extrap 
    192         bg = self._calculator.background 
     192        bg = float(self.model.item(W.W_BACKGROUND).text()) 
    193193        def updatefn(*args, **kwargs): 
    194194            pass 
Note: See TracChangeset for help on using the changeset viewer.