Changeset 9863343 in sasview for src


Ignore:
Timestamp:
Oct 25, 2017 5:58:46 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:
c31d41e7
Parents:
37be27f
Message:

Address issues outlined in SVCC-79.

Location:
src/sas/qtgui
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/MainWindow/GuiManager.py

    ra6cd8d1 r9863343  
    623623    def actionGPU_Options(self): 
    624624        """ 
    625         """ 
    626         if getattr(self._current_perspective, "gpu_options_widget"): 
     625        Load the OpenCL selection dialog if the fitting perspective is active 
     626        """ 
     627        if hasattr(self._current_perspective, "gpu_options_widget"): 
    627628            self._current_perspective.gpu_options_widget.show() 
    628629        pass 
  • src/sas/qtgui/Perspectives/Fitting/GPUOptions.py

    r37be27f r9863343  
    66import platform 
    77 
     8import sas.qtgui.Utilities.GuiUtils as GuiUtils 
    89from PyQt4 import QtGui, QtCore, QtWebKit 
    910from sas.qtgui.Perspectives.Fitting.UI.GPUOptionsUI import Ui_GPUOptions 
     
    3839        self.setupUi(self) 
    3940        self.addOpenCLOptions() 
     41        self.setFixedSize(self.size()) 
    4042        self.createLinks() 
    4143 
     
    6163            # Expand group and shift items down as more are added 
    6264            self.openCLCheckBoxGroup.resize(391, 60 + i) 
    63             self.label.setGeometry(QtCore.QRect(20, 90 + i, 391, 37)) 
     65            self.warningMessage.setGeometry(QtCore.QRect(20, 90 + i, 391, 37)) 
    6466            self.okButton.setGeometry(QtCore.QRect(20, 127 + i, 93, 28)) 
    6567            self.resetButton.setGeometry(QtCore.QRect(120, 127 + i, 93, 28)) 
     
    7375        Link user interactions to function calls 
    7476        """ 
    75         self.testButton.clicked.connect(lambda: self.testButtonClicked()) 
    76         self.helpButton.clicked.connect(lambda: self.helpButtonClicked()) 
     77        self.testButton.clicked.connect(self.testButtonClicked) 
     78        self.helpButton.clicked.connect(self.helpButtonClicked) 
    7779        for item in self.openCLCheckBoxGroup.findChildren(QtGui.QCheckBox): 
    78             item.clicked.connect(lambda: self.checked()) 
     80            item.clicked.connect(self.checked) 
    7981 
    8082    def checked(self): 
     
    151153        } 
    152154 
    153         msg_info = 'OpenCL tests results' 
    154  
    155155        msg = str(tests_completed) + ' tests completed.\n' 
    156156        if len(failures) > 0: 
     
    172172            msg += "\nOpenCL driver: " 
    173173            msg += json.dumps(info['opencl']) + "\n" 
    174         GPUTestResults(self, msg, msg_info) 
     174        GPUTestResults(self, msg) 
    175175 
    176176    def helpButtonClicked(self): 
     
    178178        Open the help menu when the help button is clicked 
    179179        """ 
    180         tree_location = "user/sasgui/perspectives/fitting/gpu_setup.html" 
    181         anchor = "#device-selection" 
     180        help_location = GuiUtils.HELP_DIRECTORY_LOCATION 
     181        help_location += "/user/sasgui/perspectives/fitting/gpu_setup.html" 
     182        help_location += "#device-selection" 
    182183        self.helpView = QtWebKit.QWebView() 
    183         help_location = tree_location + anchor 
    184184        self.helpView.load(QtCore.QUrl(help_location)) 
    185185        self.helpView.show() 
     
    211211    OpenCL Dialog to modify the OpenCL options 
    212212    """ 
    213     def __init__(self, parent, msg, title): 
     213    def __init__(self, parent, msg): 
    214214        super(GPUTestResults, self).__init__(parent) 
    215215        self.setupUi(self) 
    216216        self.resultsText.setText(_translate("GPUTestResults", msg, None)) 
     217        self.setFixedSize(self.size()) 
    217218        self.open() 
    218219 
     
    223224    """ 
    224225    clinfo = [] 
    225     platforms = [] 
     226    cl_platforms = [] 
    226227    try: 
    227228        import pyopencl as cl 
    228         platforms = cl.get_platforms() 
     229        cl_platforms = cl.get_platforms() 
    229230    except ImportError: 
    230231        print("pyopencl import failed. Using only CPU computations") 
    231232 
    232233    p_index = 0 
    233     for platform in platforms: 
     234    for cl_platform in cl_platforms: 
    234235        d_index = 0 
    235         devices = platform.get_devices() 
    236         for device in devices: 
    237             if len(devices) > 1 and len(platforms) > 1: 
     236        cl_platforms = cl_platform.get_devices() 
     237        for cl_platform in cl_platforms: 
     238            if len(cl_platforms) > 1 and len(cl_platforms) > 1: 
    238239                combined_index = ":".join([str(p_index), str(d_index)]) 
    239             elif len(platforms) > 1: 
     240            elif len(cl_platforms) > 1: 
    240241                combined_index = str(p_index) 
    241242            else: 
    242243                combined_index = str(d_index) 
    243             clinfo.append((combined_index, ":".join([platform.name, 
    244                                                      device.name]))) 
     244            clinfo.append((combined_index, ":".join([cl_platform.name, 
     245                                                     cl_platform.name]))) 
    245246            d_index += 1 
    246247        p_index += 1 
  • src/sas/qtgui/Perspectives/Fitting/UI/GPUOptionsUI.ui

    rced1bff r9863343  
    77    <x>0</x> 
    88    <y>0</y> 
    9     <width>440</width> 
    10     <height>211</height> 
     9    <width>438</width> 
     10    <height>206</height> 
    1111   </rect> 
    1212  </property> 
     13  <property name="sizePolicy"> 
     14   <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> 
     15    <horstretch>0</horstretch> 
     16    <verstretch>0</verstretch> 
     17   </sizepolicy> 
     18  </property> 
    1319  <property name="windowTitle"> 
    14    <string>Dialog</string> 
     20   <string>OpenCL Options</string> 
    1521  </property> 
    1622  <widget class="QPushButton" name="testButton"> 
     
    8288   </property> 
    8389  </widget> 
    84   <widget class="QLabel" name="label"> 
     90  <widget class="QLabel" name="warningMessage"> 
    8591   <property name="geometry"> 
    8692    <rect> 
     
    114120    <hint type="sourcelabel"> 
    115121     <x>66</x> 
    116      <y>153</y> 
     122     <y>183</y> 
    117123    </hint> 
    118124    <hint type="destinationlabel"> 
     
    129135   <hints> 
    130136    <hint type="sourcelabel"> 
    131      <x>166</x> 
    132      <y>153</y> 
     137     <x>266</x> 
     138     <y>183</y> 
    133139    </hint> 
    134140    <hint type="destinationlabel"> 
  • src/sas/qtgui/Perspectives/Fitting/UI/GPUTestResultsUI.ui

    rced1bff r9863343  
    1212  </property> 
    1313  <property name="windowTitle"> 
    14    <string>Dialog</string> 
     14   <string>OpenCL Test Results</string> 
    1515  </property> 
    16   <widget class="QDialogButtonBox" name="buttonBox"> 
     16  <widget class="QDialogButtonBox" name="okButton"> 
    1717   <property name="geometry"> 
    1818    <rect> 
     
    3333   </property> 
    3434  </widget> 
    35   <widget class="QLabel" name="label"> 
     35  <widget class="QLabel" name="falingTestsNoOpenCL"> 
    3636   <property name="geometry"> 
    3737    <rect> 
     
    4949   </property> 
    5050  </widget> 
    51   <widget class="QLabel" name="label_2"> 
     51  <widget class="QLabel" name="howToReportIssues"> 
    5252   <property name="geometry"> 
    5353    <rect> 
     
    7676     <height>321</height> 
    7777    </rect> 
     78   </property> 
     79   <property name="sizePolicy"> 
     80    <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> 
     81     <horstretch>0</horstretch> 
     82     <verstretch>0</verstretch> 
     83    </sizepolicy> 
    7884   </property> 
    7985   <property name="title"> 
     
    116122 <connections> 
    117123  <connection> 
    118    <sender>buttonBox</sender> 
     124   <sender>okButton</sender> 
    119125   <signal>accepted()</signal> 
    120126   <receiver>GPUTestResults</receiver> 
     
    132138  </connection> 
    133139  <connection> 
    134    <sender>buttonBox</sender> 
     140   <sender>okButton</sender> 
    135141   <signal>rejected()</signal> 
    136142   <receiver>GPUTestResults</receiver> 
Note: See TracChangeset for help on using the changeset viewer.