- Timestamp:
- Oct 25, 2017 5:19:41 AM (7 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:
- 9863343
- Parents:
- 0bb1397
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/GPUOptions.py
r0bb1397 r37be27f 27 27 class GPUOptions(QtGui.QDialog, Ui_GPUOptions): 28 28 """ 29 OpenCL Dialog to modify the OpenCL options29 OpenCL Dialog to select the desired OpenCL driver 30 30 """ 31 31 … … 48 48 i = 0 49 49 self.sas_open_cl = os.environ.get("SAS_OPENCL", "") 50 self.setWindowFlags(self.windowFlags() | QtCore.Qt.CustomizeWindowHint)51 self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowCloseButtonHint)52 50 for title, descr in cl_tuple: 53 checkBox = QtGui.QCheckBox(self.openCLCheckBoxGroup) 54 checkBox.setGeometry(20, 20 + i, 351, 30) 55 checkBox.setObjectName(_fromUtf8(descr)) 56 checkBox.setText(_translate("GPUOptions", descr, None)) 57 if (descr == self.sas_open_cl) or (title == "None" and not self.clicked): 58 checkBox.click() 51 # Create an list item for each openCL option 52 check_box = QtGui.QCheckBox(self.openCLCheckBoxGroup) 53 check_box.setGeometry(20, 20 + i, 351, 30) 54 check_box.setObjectName(_fromUtf8(descr)) 55 check_box.setText(_translate("GPUOptions", descr, None)) 56 if (descr == self.sas_open_cl) or ( 57 title == "None" and not self.clicked): 58 check_box.click() 59 59 self.clicked = True 60 60 61 # Expand group and shift items down as more are added 61 62 self.openCLCheckBoxGroup.resize(391, 60 + i) … … 70 71 def createLinks(self): 71 72 """ 72 Link actions to function calls73 Link user interactions to function calls 73 74 """ 74 75 self.testButton.clicked.connect(lambda: self.testButtonClicked()) … … 79 80 def checked(self): 80 81 """ 81 Action triggered when box is selected82 Only allow a single check box to be selected. Uncheck others. 82 83 """ 83 84 checked = None 84 85 for box in self.openCLCheckBoxGroup.findChildren(QtGui.QCheckBox): 85 86 if box.isChecked() and (str(box.text()) == self.sas_open_cl or ( 86 87 str(box.text()) == "No OpenCL" and self.sas_open_cl == "")): 87 88 box.setChecked(False) 88 elif not box.isChecked(): 89 pass 90 else: 89 elif box.isChecked(): 91 90 checked = box 92 91 if hasattr(checked, "text"): … … 97 96 def set_sas_open_cl(self): 98 97 """ 99 Set openCL value when tests run or OK button clicked98 Set SAS_OPENCL value when tests run or OK button clicked 100 99 """ 101 100 no_opencl_msg = False … … 221 220 def _get_clinfo(): 222 221 """ 223 Reading in information about available OpenCL infrastructure 224 :return: 222 Read in information about available OpenCL infrastructure 225 223 """ 226 224 clinfo = [] … … 243 241 else: 244 242 combined_index = str(d_index) 245 clinfo.append((combined_index, ":".join([platform.name, device.name]))) 243 clinfo.append((combined_index, ":".join([platform.name, 244 device.name]))) 246 245 d_index += 1 247 246 p_index += 1
Note: See TracChangeset
for help on using the changeset viewer.