Changes in / [4acca8c:f7e6b30] in sasview
- Location:
- src/sas/qtgui
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/ConstraintWidget.py
r14e1ff0 r33c0561 128 128 self.is_chain_fitting = False 129 129 130 # Is the fit job running?131 self.is_running = False132 self.calc_fit = None133 134 130 # Remember previous content of modified cell 135 131 self.current_cell = "" … … 261 257 Perform the constrained/simultaneous fit 262 258 """ 263 # Stop if we're running264 if self.is_running:265 self.is_running = False266 #re-enable the Fit button267 self.cmdFit.setStyleSheet('QPushButton {color: black;}')268 self.cmdFit.setText("Fit")269 # stop the fitpages270 self.calc_fit.stop()271 return272 273 259 # Find out all tabs to fit 274 260 tabs_to_fit = self.getTabsForFit() … … 324 310 325 311 # new fit thread object 326 self.calc_fit = FitThread(handler=handler,312 calc_fit = FitThread(handler=handler, 327 313 fn=sim_fitter_list, 328 314 batch_inputs=batch_inputs, … … 335 321 if LocalConfig.USING_TWISTED: 336 322 # 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) 340 326 else: 341 327 # 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 346 333 self.cmdFit.setStyleSheet('QPushButton {color: red;}') 347 self.cmdFit.setText(' Stop fit')334 self.cmdFit.setText('Running...') 348 335 self.parent.communicate.statusBarUpdateSignal.emit('Fitting started...') 349 self. is_running = True336 self.cmdFit.setEnabled(False) 350 337 351 338 def onHelp(self): … … 470 457 self.cmdFit.setStyleSheet('QPushButton {color: black;}') 471 458 self.cmdFit.setText("Fit") 459 self.cmdFit.setEnabled(True) 472 460 473 461 # Notify the parent about completed fitting … … 515 503 self.cmdFit.setStyleSheet('QPushButton {color: black;}') 516 504 self.cmdFit.setText("Fit") 505 self.cmdFit.setEnabled(True) 517 506 518 507 # Notify the parent about completed fitting … … 549 538 self.cmdFit.setStyleSheet('QPushButton {color: black;}') 550 539 self.cmdFit.setText("Fit") 540 self.cmdFit.setEnabled(True) 551 541 552 542 # Notify the parent about completed fitting … … 968 958 if isBatch: 969 959 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 tool975 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 406 406 tab_object.enableInteractiveElements() 407 407 408 pass 409 408 410 def getCurrentStateAsXml(self): 409 411 """ -
src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py
rb38c8c8 rcf9f39e 729 729 output_string = "sasview_parameter_values:" 730 730 for parameter in parameters: 731 # recast tuples into strings732 parameter = [str(p) for p in parameter]733 731 output_string += ",".join([p for p in parameter if p is not None]) 734 732 output_string += ":" -
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
rd4c9242 r1d6899f 522 522 self.cmdFit.setEnabled(False) 523 523 self.cmdPlot.setEnabled(False) 524 self.options_widget.cmdComputePoints.setVisible(False) # probably redundant 524 525 self.chkPolydispersity.setEnabled(True) 525 526 self.chkPolydispersity.setCheckState(False) … … 2862 2863 self.createNewIndex(weighted_data) 2863 2864 2864 # Plot residuals if actual data2865 if not self.data_is_loaded:2866 return2867 2868 2865 # Calculate difference between return_data and logic.data 2869 2866 self.chi2 = FittingUtilities.calculateChi2(weighted_data, self.data) … … 2871 2868 chi2_repr = "---" if self.chi2 is None else GuiUtils.formatNumber(self.chi2, high=True) 2872 2869 self.lblChi2Value.setText(chi2_repr) 2870 2871 # Plot residuals if actual data 2872 if not self.data_is_loaded: 2873 return 2873 2874 2874 2875 residuals_plot = FittingUtilities.plotResiduals(self.data, weighted_data) -
src/sas/qtgui/Perspectives/Fitting/OptionsWidget.py
r17e6a2b rb764ae5 88 88 self.model.blockSignals(True) 89 89 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)) 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 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)) 187 185 self.model.item(MODEL.index('NPTS')).setText(str(npts)) 188 186 self.qmin, self.qmax, self.npts = q_range_min, q_range_max, npts -
src/sas/qtgui/Perspectives/Fitting/UI/OptionsWidgetUI.ui
r17e6a2b r309fa1b 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> 124 186 <item row="1" column="2"> 125 187 <spacer name="horizontalSpacer_9"> … … 135 197 </spacer> 136 198 </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>178 199 </layout> 179 200 </item> -
src/sas/qtgui/Plotting/Plotter.py
r4c11b2a rd9e7792 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 plot424 selected_plot = self.plot_dict[id]425 new_plot.xtransform = selected_plot.xtransform426 new_plot.ytransform = selected_plot.ytransform427 428 422 self.removePlot(id) 429 423 self.plot(data=new_plot)
Note: See TracChangeset
for help on using the changeset viewer.