Changeset e1e3e09 in sasview
- Timestamp:
- Apr 21, 2017 8:40:01 AM (8 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:
- 98b13f72
- Parents:
- 9d266d2
- Location:
- src/sas/qtgui/Perspectives/Fitting
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r9d266d2 re1e3e09 30 30 from sas.qtgui.Perspectives.Fitting.FittingLogic import FittingLogic 31 31 from sas.qtgui.Perspectives.Fitting import FittingUtilities 32 from SmearingWidget import SmearingWidget 32 33 33 34 TAB_MAGNETISM = 4 … … 91 92 self.communicate = self.parent.communicate 92 93 94 # Smearing widget 95 layout = QtGui.QGridLayout() 96 self.smearing_widget = SmearingWidget(self) 97 layout.addWidget(self.smearing_widget) 98 #self.tabFitting.removeTab(2) 99 self.tabFitting.insertTab(2, self.smearing_widget, "Resolution") 100 93 101 # Define bold font for use in various controls 94 102 self.boldFont=QtGui.QFont() … … 161 169 self.logic.data = GuiUtils.dataFromItem(value) 162 170 171 # Overwrite data type descriptor 172 self.is2D = True if isinstance(self.logic.data, Data2D) else False 173 163 174 self.data_is_loaded = True 175 176 # Enable/disable UI components 177 self.setEnablementOnDataLoad() 178 179 def setEnablementOnDataLoad(self): 180 """ 181 Enable/disable various UI elements based on data loaded 182 """ 164 183 # Tag along functionality 165 184 self.label.setText("Data loaded from: ") … … 173 192 self.txtNptsFit.setEnabled(False) 174 193 self.chkLogData.setEnabled(False) 194 # Switch off Data2D control 195 self.chk2DView.setEnabled(False) 196 self.chk2DView.setVisible(False) 197 self.chkMagnetism.setEnabled(True) 198 199 # Weighting and smearing controls 200 if self.is2D: 201 #self.slit_smearer.Disable() 202 #self.pinhole_smearer.Enable(True) 203 #self.default_mask = copy.deepcopy(self.data.mask) 204 if self.logic.data.err_data is None or\ 205 numpy.all(err == 1 for err in self.logic.data.err_data) or \ 206 not numpy.any(self.logic.data.err_data): 207 self.rbWeighting2.setEnabled(False) 208 self.rbWeighting1.setChecked(True) 209 else: 210 self.rbWeighting2.setEnabled(True) 211 self.rbWeighting2.setChecked(True) 212 else: 213 #self.slit_smearer.Enable(True) 214 #self.pinhole_smearer.Enable(True) 215 if self.logic.data.dy is None or\ 216 numpy.all(self.logic.data.dy == 1) or\ 217 not numpy.any(self.logic.data.dy): 218 self.rbWeighting2.setEnabled(False) 219 self.rbWeighting1.setChecked(True) 220 else: 221 self.rbWeighting2.setEnabled(True) 222 self.rbWeighting2.setChecked(True) 223 224 # Smearing tab 225 self.smearing_widget.updateSmearing(self.data) 175 226 176 227 def acceptsData(self): … … 211 262 self.is2D = isChecked 212 263 # Reload the current model 213 self.onSelectModel() 264 if self.kernel_module: 265 self.onSelectModel() 214 266 215 267 def toggleLogData(self, isChecked): … … 242 294 self.weightingGroup.addButton(self.rbWeighting3) 243 295 self.weightingGroup.addButton(self.rbWeighting4) 296 # Smearing tab 297 self.smearing_widget.updateSmearing(self.data) 244 298 245 299 def initializeSignals(self): … … 251 305 self.cbCategory.currentIndexChanged.connect(self.onSelectCategory) 252 306 self.cbModel.currentIndexChanged.connect(self.onSelectModel) 253 self.cbSmearing.currentIndexChanged.connect(self.onSelectSmearing)307 #self.cbSmearing.currentIndexChanged.connect(self.onSelectSmearing) 254 308 # Checkboxes 255 309 self.chk2DView.toggled.connect(self.toggle2D) … … 266 320 self.txtMinRange.editingFinished.connect(self.onMinRange) 267 321 self.txtMaxRange.editingFinished.connect(self.onMaxRange) 268 self.txtSmearUp.editingFinished.connect(self.onSmearUp)269 self.txtSmearDown.editingFinished.connect(self.onSmearDown)322 #self.txtSmearUp.editingFinished.connect(self.onSmearUp) 323 #self.txtSmearDown.editingFinished.connect(self.onSmearDown) 270 324 # Button groups 271 325 self.weightingGroup.buttonClicked.connect(self.onWeightingChoice) … … 717 771 # Check the state of the Weighting radio buttons 718 772 button_id = self.weightingGroup.checkedId() 773 # Cast the id to a valid index 719 774 button_id = abs(button_id + 2) 720 775 if button_id == 0: 776 # No weight added 721 777 return 722 778 # Send original data for weighting -
src/sas/qtgui/Perspectives/Fitting/UI/FittingWidgetUI.ui
r9d266d2 re1e3e09 561 561 </layout> 562 562 </widget> 563 <widget class="QWidget" name="tab_5">564 <attribute name="title">565 <string>Resolution</string>566 </attribute>567 <layout class="QGridLayout" name="gridLayout_14">568 <item row="0" column="0">569 <widget class="QGroupBox" name="groupBox_4">570 <property name="title">571 <string>Instrumental Smearing</string>572 </property>573 <layout class="QGridLayout" name="gridLayout_13">574 <item row="0" column="0">575 <widget class="QComboBox" name="cbSmearing">576 <property name="currentIndex">577 <number>0</number>578 </property>579 <item>580 <property name="text">581 <string>None</string>582 </property>583 </item>584 <item>585 <property name="text">586 <string>Use dQ Data</string>587 </property>588 </item>589 <item>590 <property name="text">591 <string>Custom Pinhole Smear</string>592 </property>593 </item>594 <item>595 <property name="text">596 <string>Custom Slit Smear</string>597 </property>598 </item>599 </widget>600 </item>601 <item row="0" column="1">602 <layout class="QGridLayout" name="gridLayout_11">603 <item row="0" column="0">604 <widget class="QLabel" name="lblSmearUp">605 <property name="text">606 <string><html><head/><body><p>dQ<span style=" vertical-align:sub;">low</span></p></body></html></string>607 </property>608 </widget>609 </item>610 <item row="0" column="1">611 <widget class="QLineEdit" name="txtSmearUp"/>612 </item>613 <item row="0" column="2">614 <widget class="QLabel" name="label_14">615 <property name="text">616 <string><html><head/><body><p>Ã617 <span style=" vertical-align:super;">-1</span></p></body></html></string>618 </property>619 </widget>620 </item>621 <item row="1" column="0">622 <widget class="QLabel" name="lblSmearDown">623 <property name="text">624 <string><html><head/><body><p>dQ<span style=" vertical-align:sub;">high</span></p></body></html></string>625 </property>626 </widget>627 </item>628 <item row="1" column="1">629 <widget class="QLineEdit" name="txtSmearDown"/>630 </item>631 <item row="1" column="2">632 <widget class="QLabel" name="label_15">633 <property name="text">634 <string><html><head/><body><p>Ã635 <span style=" vertical-align:super;">-1</span></p></body></html></string>636 </property>637 </widget>638 </item>639 </layout>640 </item>641 <item row="0" column="2">642 <spacer name="horizontalSpacer_2">643 <property name="orientation">644 <enum>Qt::Horizontal</enum>645 </property>646 <property name="sizeHint" stdset="0">647 <size>648 <width>71</width>649 <height>20</height>650 </size>651 </property>652 </spacer>653 </item>654 </layout>655 <zorder>cbSmearing</zorder>656 <zorder>horizontalSpacer_2</zorder>657 </widget>658 </item>659 <item row="1" column="0">660 <spacer name="verticalSpacer_2">661 <property name="orientation">662 <enum>Qt::Vertical</enum>663 </property>664 <property name="sizeHint" stdset="0">665 <size>666 <width>20</width>667 <height>340</height>668 </size>669 </property>670 </spacer>671 </item>672 </layout>673 </widget>674 563 <widget class="QWidget" name="tab_4"> 675 564 <attribute name="title">
Note: See TracChangeset
for help on using the changeset viewer.