Changes in / [4acca8c:f7e6b30] in sasview


Ignore:
Location:
src/sas/qtgui
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/ConstraintWidget.py

    r14e1ff0 r33c0561  
    128128        self.is_chain_fitting = False 
    129129 
    130         # Is the fit job running? 
    131         self.is_running = False 
    132         self.calc_fit = None 
    133  
    134130        # Remember previous content of modified cell 
    135131        self.current_cell = "" 
     
    261257        Perform the constrained/simultaneous fit 
    262258        """ 
    263         # Stop if we're running 
    264         if self.is_running: 
    265             self.is_running = False 
    266             #re-enable the Fit button 
    267             self.cmdFit.setStyleSheet('QPushButton {color: black;}') 
    268             self.cmdFit.setText("Fit") 
    269             # stop the fitpages 
    270             self.calc_fit.stop() 
    271             return 
    272  
    273259        # Find out all tabs to fit 
    274260        tabs_to_fit = self.getTabsForFit() 
     
    324310 
    325311        # new fit thread object 
    326         self.calc_fit = FitThread(handler=handler, 
     312        calc_fit = FitThread(handler=handler, 
    327313                             fn=sim_fitter_list, 
    328314                             batch_inputs=batch_inputs, 
     
    335321        if LocalConfig.USING_TWISTED: 
    336322            # start the trhrhread with twisted 
    337             self.calc_fit = threads.deferToThread(self.calc_fit.compute) 
    338             self.calc_fit.addCallback(completefn) 
    339             self.calc_fit.addErrback(self.onFitFailed) 
     323            calc_thread = threads.deferToThread(calc_fit.compute) 
     324            calc_thread.addCallback(completefn) 
     325            calc_thread.addErrback(self.onFitFailed) 
    340326        else: 
    341327            # Use the old python threads + Queue 
    342             self.calc_fit.queue() 
    343             self.calc_fit.ready(2.5) 
    344  
    345         # modify the Fit button 
     328            calc_fit.queue() 
     329            calc_fit.ready(2.5) 
     330 
     331 
     332        #disable the Fit button 
    346333        self.cmdFit.setStyleSheet('QPushButton {color: red;}') 
    347         self.cmdFit.setText('Stop fit') 
     334        self.cmdFit.setText('Running...') 
    348335        self.parent.communicate.statusBarUpdateSignal.emit('Fitting started...') 
    349         self.is_running = True 
     336        self.cmdFit.setEnabled(False) 
    350337 
    351338    def onHelp(self): 
     
    470457        self.cmdFit.setStyleSheet('QPushButton {color: black;}') 
    471458        self.cmdFit.setText("Fit") 
     459        self.cmdFit.setEnabled(True) 
    472460 
    473461        # Notify the parent about completed fitting 
     
    515503        self.cmdFit.setStyleSheet('QPushButton {color: black;}') 
    516504        self.cmdFit.setText("Fit") 
     505        self.cmdFit.setEnabled(True) 
    517506 
    518507        # Notify the parent about completed fitting 
     
    549538        self.cmdFit.setStyleSheet('QPushButton {color: black;}') 
    550539        self.cmdFit.setText("Fit") 
     540        self.cmdFit.setEnabled(True) 
    551541 
    552542        # Notify the parent about completed fitting 
     
    968958        if isBatch: 
    969959            self.chkChain.setChecked(is_chain) 
    970  
    971     def getReport(self): 
    972         """ 
    973         Wrapper for non-existent functionality. 
    974         Tell the user to use the reporting tool 
    975         on separate fit pages. 
    976         """ 
    977         msg = "Please use Report Results directly on fit pages" 
    978         msg += " involved in the Constrained and Simultaneous fitting process." 
    979         msgbox = QtWidgets.QMessageBox(self) 
    980         msgbox.setIcon(QtWidgets.QMessageBox.Warning) 
    981         msgbox.setText(msg) 
    982         msgbox.setWindowTitle("Fit Report") 
    983         _ = msgbox.exec_() 
    984         return 
  • src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py

    r14e1ff0 rfb39f28  
    406406                tab_object.enableInteractiveElements() 
    407407 
     408        pass 
     409 
    408410    def getCurrentStateAsXml(self): 
    409411        """ 
  • src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py

    rb38c8c8 rcf9f39e  
    729729    output_string = "sasview_parameter_values:" 
    730730    for parameter in parameters: 
    731         # recast tuples into strings 
    732         parameter = [str(p) for p in parameter] 
    733731        output_string += ",".join([p for p in parameter if p is not None]) 
    734732        output_string += ":" 
  • src/sas/qtgui/Perspectives/Fitting/FittingWidget.py

    rd4c9242 r1d6899f  
    522522        self.cmdFit.setEnabled(False) 
    523523        self.cmdPlot.setEnabled(False) 
     524        self.options_widget.cmdComputePoints.setVisible(False) # probably redundant 
    524525        self.chkPolydispersity.setEnabled(True) 
    525526        self.chkPolydispersity.setCheckState(False) 
     
    28622863        self.createNewIndex(weighted_data) 
    28632864 
    2864         # Plot residuals if actual data 
    2865         if not self.data_is_loaded: 
    2866             return 
    2867  
    28682865        # Calculate difference between return_data and logic.data 
    28692866        self.chi2 = FittingUtilities.calculateChi2(weighted_data, self.data) 
     
    28712868        chi2_repr = "---" if self.chi2 is None else GuiUtils.formatNumber(self.chi2, high=True) 
    28722869        self.lblChi2Value.setText(chi2_repr) 
     2870 
     2871        # Plot residuals if actual data 
     2872        if not self.data_is_loaded: 
     2873            return 
    28732874 
    28742875        residuals_plot = FittingUtilities.plotResiduals(self.data, weighted_data) 
  • src/sas/qtgui/Perspectives/Fitting/OptionsWidget.py

    r17e6a2b rb764ae5  
    8888        self.model.blockSignals(True) 
    8989        self.updateQRange(self.qmin, self.qmax, self.npts) 
    90         self.txtMaxRange.setText(GuiUtils.formatNumber(self.qmax, high=True)) 
    91         self.txtMinRange.setText(GuiUtils.formatNumber(self.qmin, high=True)) 
     90        self.txtMaxRange.setText(str(self.qmax)) 
     91        self.txtMinRange.setText(str(self.qmin)) 
    9292        self.txtNpts.setText(str(self.npts)) 
    9393        self.txtNptsFit.setText(str(self.npts)) 
     
    181181        Update the local model based on calculated values 
    182182        """ 
    183         qmax = GuiUtils.formatNumber(self.qmax, high=True) 
    184         qmin = GuiUtils.formatNumber(self.qmin, high=True) 
    185         self.model.item(MODEL.index('MIN_RANGE')).setText(qmin) 
    186         self.model.item(MODEL.index('MAX_RANGE')).setText(qmax) 
     183        self.model.item(MODEL.index('MIN_RANGE')).setText(str(q_range_min)) 
     184        self.model.item(MODEL.index('MAX_RANGE')).setText(str(q_range_max)) 
    187185        self.model.item(MODEL.index('NPTS')).setText(str(npts)) 
    188186        self.qmin, self.qmax, self.npts = q_range_min, q_range_max, npts 
  • src/sas/qtgui/Perspectives/Fitting/UI/OptionsWidgetUI.ui

    r17e6a2b r309fa1b  
    122122      <item row="0" column="0"> 
    123123       <layout class="QGridLayout" name="gridLayout_15"> 
     124        <item row="0" column="0"> 
     125         <widget class="QLabel" name="label_21"> 
     126          <property name="text"> 
     127           <string>Npts</string> 
     128          </property> 
     129         </widget> 
     130        </item> 
     131        <item row="0" column="1"> 
     132         <widget class="QLineEdit" name="txtNpts"> 
     133          <property name="toolTip"> 
     134           <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Total number of data points.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> 
     135          </property> 
     136         </widget> 
     137        </item> 
     138        <item row="0" column="2"> 
     139         <widget class="QCheckBox" name="chkLogData"> 
     140          <property name="toolTip"> 
     141           <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Check to use log spaced points.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> 
     142          </property> 
     143          <property name="text"> 
     144           <string>Log spaced points</string> 
     145          </property> 
     146         </widget> 
     147        </item> 
     148        <item row="1" column="0"> 
     149         <widget class="QLabel" name="label_22"> 
     150          <property name="text"> 
     151           <string>Npts(Fit)</string> 
     152          </property> 
     153         </widget> 
     154        </item> 
     155        <item row="1" column="1"> 
     156         <widget class="QLineEdit" name="txtNptsFit"> 
     157          <property name="toolTip"> 
     158           <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Number of points selected for fitting.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> 
     159          </property> 
     160          <property name="readOnly"> 
     161           <bool>true</bool> 
     162          </property> 
     163         </widget> 
     164        </item> 
     165        <item row="2" column="0"> 
     166         <widget class="QLabel" name="label_24"> 
     167          <property name="text"> 
     168           <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;χ&lt;span style=&quot; vertical-align:super;&quot;&gt;2&lt;/span&gt;/Npts&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> 
     169          </property> 
     170         </widget> 
     171        </item> 
     172        <item row="2" column="1"> 
     173         <widget class="QLineEdit" name="txtChi2"> 
     174          <property name="readOnly"> 
     175           <bool>true</bool> 
     176          </property> 
     177         </widget> 
     178        </item> 
     179        <item row="2" column="3"> 
     180         <widget class="QPushButton" name="cmdComputePoints"> 
     181          <property name="text"> 
     182           <string>Compute</string> 
     183          </property> 
     184         </widget> 
     185        </item> 
    124186        <item row="1" column="2"> 
    125187         <spacer name="horizontalSpacer_9"> 
     
    135197         </spacer> 
    136198        </item> 
    137         <item row="0" column="1"> 
    138          <widget class="QLineEdit" name="txtNpts"> 
    139           <property name="toolTip"> 
    140            <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Total number of data points.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> 
    141           </property> 
    142          </widget> 
    143         </item> 
    144         <item row="1" column="0"> 
    145          <widget class="QLabel" name="label_22"> 
    146           <property name="text"> 
    147            <string>Npts(Fit)</string> 
    148           </property> 
    149          </widget> 
    150         </item> 
    151         <item row="1" column="1"> 
    152          <widget class="QLineEdit" name="txtNptsFit"> 
    153           <property name="toolTip"> 
    154            <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Number of points selected for fitting.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> 
    155           </property> 
    156           <property name="readOnly"> 
    157            <bool>true</bool> 
    158           </property> 
    159          </widget> 
    160         </item> 
    161         <item row="0" column="2"> 
    162          <widget class="QCheckBox" name="chkLogData"> 
    163           <property name="toolTip"> 
    164            <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Check to use log spaced points.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> 
    165           </property> 
    166           <property name="text"> 
    167            <string>Log spaced points</string> 
    168           </property> 
    169          </widget> 
    170         </item> 
    171         <item row="0" column="0"> 
    172          <widget class="QLabel" name="label_21"> 
    173           <property name="text"> 
    174            <string>Npts</string> 
    175           </property> 
    176          </widget> 
    177         </item> 
    178199       </layout> 
    179200      </item> 
  • src/sas/qtgui/Plotting/Plotter.py

    r4c11b2a rd9e7792  
    420420        This effectlvely refreshes the chart with changes to one of its plots 
    421421        """ 
    422  
    423         # Pull the current transform settings from the old plot 
    424         selected_plot = self.plot_dict[id] 
    425         new_plot.xtransform = selected_plot.xtransform 
    426         new_plot.ytransform = selected_plot.ytransform 
    427  
    428422        self.removePlot(id) 
    429423        self.plot(data=new_plot) 
Note: See TracChangeset for help on using the changeset viewer.