Browse Source

update status with every 2nd webcam image. don't allow setting 0 delay for webcam / status.

Thomas Buck 3 years ago
parent
commit
45c343da22
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      src/octotray.py

+ 3
- 3
src/octotray.py View File

226
 
226
 
227
 class CamWindow(QWidget):
227
 class CamWindow(QWidget):
228
     reloadDelayDefault = 1000 # in ms
228
     reloadDelayDefault = 1000 # in ms
229
-    statusDelay = 5 * 1000 # in ms
229
+    statusDelayFactor = 2
230
     reloadOn = True
230
     reloadOn = True
231
     sliderFactor = 100
231
     sliderFactor = 100
232
 
232
 
258
         box.addLayout(slide, 0)
258
         box.addLayout(slide, 0)
259
 
259
 
260
         self.slider = QSlider(Qt.Horizontal)
260
         self.slider = QSlider(Qt.Horizontal)
261
-        self.slider.setMinimum(int(0 / self.sliderFactor))
261
+        self.slider.setMinimum(int(100 / self.sliderFactor))
262
         self.slider.setMaximum(int(2000 / self.sliderFactor))
262
         self.slider.setMaximum(int(2000 / self.sliderFactor))
263
         self.slider.setTickInterval(int(100 / self.sliderFactor))
263
         self.slider.setTickInterval(int(100 / self.sliderFactor))
264
         self.slider.setPageStep(int(100 / self.sliderFactor))
264
         self.slider.setPageStep(int(100 / self.sliderFactor))
295
 
295
 
296
     def scheduleLoadStatus(self):
296
     def scheduleLoadStatus(self):
297
         if self.reloadOn:
297
         if self.reloadOn:
298
-            QTimer.singleShot(self.statusDelay, self.loadStatus)
298
+            QTimer.singleShot(self.slider.value() * self.sliderFactor * self.statusDelayFactor, self.loadStatus)
299
 
299
 
300
     def loadImage(self):
300
     def loadImage(self):
301
         url = QUrl(self.url)
301
         url = QUrl(self.url)

Loading…
Cancel
Save