Skip to content

Commit

Permalink
Include inline documentation for the new GPUOptions class variable
Browse files Browse the repository at this point in the history
  • Loading branch information
krzywon committed Oct 22, 2024
1 parent 1069fbe commit a7236a3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/sas/qtgui/Perspectives/Fitting/GPUOptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ def __init__(self):
self.add_options()
self.progressBar.setVisible(False)
self.progressBar.setFormat(" Test %v / %m")

# A local flag to know if opencl options have been staged or not. This is to prevent an OpenCL context refresh
# when no refresh is required.
self._staged_open_cl = None

self.testButton.clicked.connect(self.testButtonClicked)
Expand All @@ -77,6 +80,8 @@ def _addAllWidgets(self):

def applyNonConfigValues(self):
"""Applies values that aren't stored in config. Only widgets that require this need to override this method."""
# This is called anytime *any* preference change is made, not only from this widget, but any other preferences
# widget. Track if openCL is changed locally to be sure the setter should be invoked.
if self._staged_open_cl:
self.set_sas_open_cl()
self._staged_open_cl = None
Expand Down Expand Up @@ -112,6 +117,7 @@ def add_options(self):
self.openCLCheckBoxGroup.setMinimumWidth(self.optionsLayout.sizeHint().width()+10)

def _unStageChange(self, key: str):
# The only staged change in this panel is the OpenCL selection. If any change is being unstaged, reset the flag.
self._staged_open_cl = None
super()._unStageChange(key)

Expand Down

0 comments on commit a7236a3

Please sign in to comment.