Changes in / [f7e6b30:4acca8c] in sasview
- Location:
- src/sas/qtgui
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/ConstraintWidget.py
r33c0561 r14e1ff0 128 128 self.is_chain_fitting = False 129 129 130 # Is the fit job running? 131 self.is_running = False 132 self.calc_fit = None 133 130 134 # Remember previous content of modified cell 131 135 self.current_cell = "" … … 257 261 Perform the constrained/simultaneous fit 258 262 """ 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 259 273 # Find out all tabs to fit 260 274 tabs_to_fit = self.getTabsForFit() … … 310 324 311 325 # new fit thread object 312 calc_fit = FitThread(handler=handler,326 self.calc_fit = FitThread(handler=handler, 313 327 fn=sim_fitter_list, 314 328 batch_inputs=batch_inputs, … … 321 335 if LocalConfig.USING_TWISTED: 322 336 # start the trhrhread with twisted 323 calc_thread = threads.deferToThread(calc_fit.compute)324 calc_thread.addCallback(completefn)325 calc_thread.addErrback(self.onFitFailed)337 self.calc_fit = threads.deferToThread(self.calc_fit.compute) 338 self.calc_fit.addCallback(completefn) 339 self.calc_fit.addErrback(self.onFitFailed) 326 340 else: 327 341 # Use the old python threads + Queue 328 calc_fit.queue() 329 calc_fit.ready(2.5) 330 331 332 #disable the Fit button 342 self.calc_fit.queue() 343 self.calc_fit.ready(2.5) 344 345 # modify the Fit button 333 346 self.cmdFit.setStyleSheet('QPushButton {color: red;}') 334 self.cmdFit.setText(' Running...')347 self.cmdFit.setText('Stop fit') 335 348 self.parent.communicate.statusBarUpdateSignal.emit('Fitting started...') 336 self. cmdFit.setEnabled(False)349 self.is_running = True 337 350 338 351 def onHelp(self): … … 457 470 self.cmdFit.setStyleSheet('QPushButton {color: black;}') 458 471 self.cmdFit.setText("Fit") 459 self.cmdFit.setEnabled(True)460 472 461 473 # Notify the parent about completed fitting … … 503 515 self.cmdFit.setStyleSheet('QPushButton {color: black;}') 504 516 self.cmdFit.setText("Fit") 505 self.cmdFit.setEnabled(True)506 517 507 518 # Notify the parent about completed fitting … … 538 549 self.cmdFit.setStyleSheet('QPushButton {color: black;}') 539 550 self.cmdFit.setText("Fit") 540 self.cmdFit.setEnabled(True)541 551 542 552 # Notify the parent about completed fitting … … 958 968 if isBatch: 959 969 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
rfb39f28 r14e1ff0 406 406 tab_object.enableInteractiveElements() 407 407 408 pass409 410 408 def getCurrentStateAsXml(self): 411 409 """ -
src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py
rcf9f39e rb38c8c8 729 729 output_string = "sasview_parameter_values:" 730 730 for parameter in parameters: 731 # recast tuples into strings 732 parameter = [str(p) for p in parameter] 731 733 output_string += ",".join([p for p in parameter if p is not None]) 732 734 output_string += ":" -
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r1d6899f rd4c9242 522 522 self.cmdFit.setEnabled(False) 523 523 self.cmdPlot.setEnabled(False) 524 self.options_widget.cmdComputePoints.setVisible(False) # probably redundant525 524 self.chkPolydispersity.setEnabled(True) 526 525 self.chkPolydispersity.setCheckState(False) … … 2863 2862 self.createNewIndex(weighted_data) 2864 2863 2864 # Plot residuals if actual data 2865 if not self.data_is_loaded: 2866 return 2867 2865 2868 # Calculate difference between return_data and logic.data 2866 2869 self.chi2 = FittingUtilities.calculateChi2(weighted_data, self.data) … … 2868 2871 chi2_repr = "---" if self.chi2 is None else GuiUtils.formatNumber(self.chi2, high=True) 2869 2872 self.lblChi2Value.setText(chi2_repr) 2870 2871 # Plot residuals if actual data2872 if not self.data_is_loaded:2873 return2874 2873 2875 2874 residuals_plot = FittingUtilities.plotResiduals(self.data, weighted_data) -
src/sas/qtgui/Perspectives/Fitting/OptionsWidget.py
rb764ae5 r17e6a2b 88 88 self.model.blockSignals(True) 89 89 self.updateQRange(self.qmin, self.qmax, self.npts) 90 self.txtMaxRange.setText( str(self.qmax))91 self.txtMinRange.setText( str(self.qmin))90 self.txtMaxRange.setText(GuiUtils.formatNumber(self.qmax, high=True)) 91 self.txtMinRange.setText(GuiUtils.formatNumber(self.qmin, high=True)) 92 92 self.txtNpts.setText(str(self.npts)) 93 93 self.txtNptsFit.setText(str(self.npts)) … … 181 181 Update the local model based on calculated values 182 182 """ 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)) 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) 185 187 self.model.item(MODEL.index('NPTS')).setText(str(npts)) 186 188 self.qmin, self.qmax, self.npts = q_range_min, q_range_max, npts -
src/sas/qtgui/Perspectives/Fitting/UI/OptionsWidgetUI.ui
r309fa1b r17e6a2b 122 122 <item row="0" column="0"> 123 123 <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><html><head/><body><p>Total number of data points.</p></body></html></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><html><head/><body><p>Check to use log spaced points.</p></body></html></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><html><head/><body><p>Number of points selected for fitting.</p></body></html></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><html><head/><body><p>Ï<span style=" vertical-align:super;">2</span>/Npts</p></body></html></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>186 124 <item row="1" column="2"> 187 125 <spacer name="horizontalSpacer_9"> … … 197 135 </spacer> 198 136 </item> 137 <item row="0" column="1"> 138 <widget class="QLineEdit" name="txtNpts"> 139 <property name="toolTip"> 140 <string><html><head/><body><p>Total number of data points.</p></body></html></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><html><head/><body><p>Number of points selected for fitting.</p></body></html></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><html><head/><body><p>Check to use log spaced points.</p></body></html></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> 199 178 </layout> 200 179 </item> -
src/sas/qtgui/Plotting/Plotter.py
rd9e7792 r4c11b2a 420 420 This effectlvely refreshes the chart with changes to one of its plots 421 421 """ 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 422 428 self.removePlot(id) 423 429 self.plot(data=new_plot)
Note: See TracChangeset
for help on using the changeset viewer.