mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-09 14:55:03 -06:00
Merge remote-tracking branch 'origin/main' into CURA-9278_choose_printer_dialog
This commit is contained in:
commit
6baf14a516
100 changed files with 609 additions and 1383 deletions
|
@ -3,6 +3,8 @@
|
|||
import os
|
||||
from typing import Optional, Dict, List, Callable, Any
|
||||
|
||||
from time import time
|
||||
|
||||
from PyQt6.QtGui import QDesktopServices
|
||||
from PyQt6.QtCore import pyqtSlot, QUrl, pyqtSignal, pyqtProperty, QObject
|
||||
from PyQt6.QtNetwork import QNetworkReply
|
||||
|
@ -32,6 +34,8 @@ class LocalClusterOutputDevice(UltimakerNetworkedPrinterOutputDevice):
|
|||
|
||||
activeCameraUrlChanged = pyqtSignal()
|
||||
|
||||
CHECK_CLUSTER_INTERVAL = 10.0 # seconds
|
||||
|
||||
def __init__(self, device_id: str, address: str, properties: Dict[bytes, bytes], parent=None) -> None:
|
||||
|
||||
super().__init__(
|
||||
|
@ -107,6 +111,8 @@ class LocalClusterOutputDevice(UltimakerNetworkedPrinterOutputDevice):
|
|||
|
||||
def _update(self) -> None:
|
||||
super()._update()
|
||||
if time() - self._time_of_last_request < self.CHECK_CLUSTER_INTERVAL:
|
||||
return # avoid calling the cluster too often
|
||||
self._getApiClient().getPrinters(self._updatePrinters)
|
||||
self._getApiClient().getPrintJobs(self._updatePrintJobs)
|
||||
self._updatePrintJobPreviewImages()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue