Bladeren bron

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

Thomas Buck 3 jaren geleden
bovenliggende
commit
45c343da22
1 gewijzigde bestanden met toevoegingen van 3 en 3 verwijderingen
  1. 3
    3
      src/octotray.py

+ 3
- 3
src/octotray.py Bestand weergeven

@@ -226,7 +226,7 @@ class AspectRatioPixmapLabel(QLabel):
226 226
 
227 227
 class CamWindow(QWidget):
228 228
     reloadDelayDefault = 1000 # in ms
229
-    statusDelay = 5 * 1000 # in ms
229
+    statusDelayFactor = 2
230 230
     reloadOn = True
231 231
     sliderFactor = 100
232 232
 
@@ -258,7 +258,7 @@ class CamWindow(QWidget):
258 258
         box.addLayout(slide, 0)
259 259
 
260 260
         self.slider = QSlider(Qt.Horizontal)
261
-        self.slider.setMinimum(int(0 / self.sliderFactor))
261
+        self.slider.setMinimum(int(100 / self.sliderFactor))
262 262
         self.slider.setMaximum(int(2000 / self.sliderFactor))
263 263
         self.slider.setTickInterval(int(100 / self.sliderFactor))
264 264
         self.slider.setPageStep(int(100 / self.sliderFactor))
@@ -295,7 +295,7 @@ class CamWindow(QWidget):
295 295
 
296 296
     def scheduleLoadStatus(self):
297 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 300
     def loadImage(self):
301 301
         url = QUrl(self.url)

Laden…
Annuleren
Opslaan