Created
January 10, 2019 22:51
-
-
Save andrisgauracs/ad38248f6e3f68849b915c6db39b90d1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def valuechange(self): | |
| # We access our global variables within the function | |
| global framesTaken | |
| global framesSpecified | |
| # We set the framesSpecified value to | |
| # whatever is specified on the spinbox | |
| framesSpecified = self.sp.value() | |
| # We modify our label to give us info, how many | |
| # frames have been captured so far | |
| self.l2.setText( | |
| "Frames taken: "+str(framesTaken)+" from "+str(framesSpecified)) | |
| # Once the snapshot taking process has begun, | |
| # we need to disable the spinbox | |
| self.sp.setEnabled(0) if (framesTaken > 0) else self.sp.setEnabled(1) | |
| # We enable our snapshot trigger button, if frames have been specified | |
| # and the process is ongoing. | |
| # If the process ends, we disable the button again | |
| if (self.sp.value() > 0 | |
| and framesTaken < 10 | |
| and framesTaken < framesSpecified): | |
| self.snapbutton.setEnabled(1) | |
| else: | |
| self.snapbutton.setEnabled(0) | |
| if (self.sp.value() > 0): | |
| self.l2.setVisible(1) | |
| else: | |
| self.l2.setVisible(0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment