Changeset 37be27f in sasview


Ignore:
Timestamp:
Oct 25, 2017 3:19:41 AM (6 years ago)
Author:
krzywon
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
Message:

Code cleanup on OpenCL Qt dialog.

File:
1 edited

Legend:

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

    r0bb1397 r37be27f  
    2727class GPUOptions(QtGui.QDialog, Ui_GPUOptions): 
    2828    """ 
    29     OpenCL Dialog to modify the OpenCL options 
     29    OpenCL Dialog to select the desired OpenCL driver 
    3030    """ 
    3131 
     
    4848        i = 0 
    4949        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) 
    5250        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() 
    5959                self.clicked = True 
     60 
    6061            # Expand group and shift items down as more are added 
    6162            self.openCLCheckBoxGroup.resize(391, 60 + i) 
     
    7071    def createLinks(self): 
    7172        """ 
    72         Link actions to function calls 
     73        Link user interactions to function calls 
    7374        """ 
    7475        self.testButton.clicked.connect(lambda: self.testButtonClicked()) 
     
    7980    def checked(self): 
    8081        """ 
    81         Action triggered when box is selected 
     82        Only allow a single check box to be selected. Uncheck others. 
    8283        """ 
    8384        checked = None 
    8485        for box in self.openCLCheckBoxGroup.findChildren(QtGui.QCheckBox): 
    8586            if box.isChecked() and (str(box.text()) == self.sas_open_cl or ( 
    86                             str(box.text()) == "No OpenCL" and self.sas_open_cl == "")): 
     87                    str(box.text()) == "No OpenCL" and self.sas_open_cl == "")): 
    8788                box.setChecked(False) 
    88             elif not box.isChecked(): 
    89                 pass 
    90             else: 
     89            elif box.isChecked(): 
    9190                checked = box 
    9291        if hasattr(checked, "text"): 
     
    9796    def set_sas_open_cl(self): 
    9897        """ 
    99         Set openCL value when tests run or OK button clicked 
     98        Set SAS_OPENCL value when tests run or OK button clicked 
    10099        """ 
    101100        no_opencl_msg = False 
     
    221220def _get_clinfo(): 
    222221    """ 
    223     Reading in information about available OpenCL infrastructure 
    224     :return: 
     222    Read in information about available OpenCL infrastructure 
    225223    """ 
    226224    clinfo = [] 
     
    243241            else: 
    244242                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]))) 
    246245            d_index += 1 
    247246        p_index += 1 
Note: See TracChangeset for help on using the changeset viewer.