mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-12 01:07:52 -06:00
STAR-322: Creating a subclass for connect devices
This commit is contained in:
parent
8ea4edf67e
commit
01e443049f
4 changed files with 22 additions and 13 deletions
8
plugins/UM3NetworkPrinting/src/BaseCuraConnectDevice.py
Normal file
8
plugins/UM3NetworkPrinting/src/BaseCuraConnectDevice.py
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
# Copyright (c) 2018 Ultimaker B.V.
|
||||||
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
from cura.PrinterOutput.NetworkedPrinterOutputDevice import NetworkedPrinterOutputDevice
|
||||||
|
|
||||||
|
|
||||||
|
## this is the base class for the UM3 output devices (via connect or cloud)
|
||||||
|
class BaseCuraConnectDevice(NetworkedPrinterOutputDevice):
|
||||||
|
pass
|
|
@ -2,6 +2,7 @@
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
import io
|
import io
|
||||||
import os
|
import os
|
||||||
|
from datetime import datetime, timedelta
|
||||||
from time import time
|
from time import time
|
||||||
from typing import List, Optional, Dict, cast, Union, Set
|
from typing import List, Optional, Dict, cast, Union, Set
|
||||||
|
|
||||||
|
@ -18,8 +19,9 @@ from UM.Version import Version
|
||||||
from cura.CuraApplication import CuraApplication
|
from cura.CuraApplication import CuraApplication
|
||||||
from cura.PrinterOutput.PrinterOutputController import PrinterOutputController
|
from cura.PrinterOutput.PrinterOutputController import PrinterOutputController
|
||||||
from cura.PrinterOutput.MaterialOutputModel import MaterialOutputModel
|
from cura.PrinterOutput.MaterialOutputModel import MaterialOutputModel
|
||||||
from cura.PrinterOutput.NetworkedPrinterOutputDevice import NetworkedPrinterOutputDevice, AuthState
|
from cura.PrinterOutput.NetworkedPrinterOutputDevice import AuthState
|
||||||
from cura.PrinterOutput.PrinterOutputModel import PrinterOutputModel
|
from cura.PrinterOutput.PrinterOutputModel import PrinterOutputModel
|
||||||
|
from plugins.UM3NetworkPrinting.src.BaseCuraConnectDevice import BaseCuraConnectDevice
|
||||||
from plugins.UM3NetworkPrinting.src.Cloud.CloudApiClient import CloudApiClient
|
from plugins.UM3NetworkPrinting.src.Cloud.CloudApiClient import CloudApiClient
|
||||||
from plugins.UM3NetworkPrinting.src.UM3PrintJobOutputModel import UM3PrintJobOutputModel
|
from plugins.UM3NetworkPrinting.src.UM3PrintJobOutputModel import UM3PrintJobOutputModel
|
||||||
from .Models import (
|
from .Models import (
|
||||||
|
@ -61,7 +63,7 @@ class T:
|
||||||
# Note that this device represents a single remote cluster, not a list of multiple clusters.
|
# Note that this device represents a single remote cluster, not a list of multiple clusters.
|
||||||
#
|
#
|
||||||
# TODO: figure our how the QML interface for the cluster networking should operate with this limited functionality.
|
# TODO: figure our how the QML interface for the cluster networking should operate with this limited functionality.
|
||||||
class CloudOutputDevice(NetworkedPrinterOutputDevice):
|
class CloudOutputDevice(BaseCuraConnectDevice):
|
||||||
|
|
||||||
# The interval with which the remote clusters are checked
|
# The interval with which the remote clusters are checked
|
||||||
CHECK_CLUSTER_INTERVAL = 2.0 # seconds
|
CHECK_CLUSTER_INTERVAL = 2.0 # seconds
|
||||||
|
|
|
@ -1,7 +1,13 @@
|
||||||
# Copyright (c) 2018 Ultimaker B.V.
|
# Copyright (c) 2018 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
from typing import Any, cast, Optional, Set, Tuple, Union
|
from typing import Any, cast, Tuple, Union, Optional, Dict, List
|
||||||
|
from time import time
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
|
import io # To create the correct buffers for sending data to the printer.
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
|
||||||
from UM.FileHandler.FileHandler import FileHandler
|
from UM.FileHandler.FileHandler import FileHandler
|
||||||
from UM.FileHandler.FileWriter import FileWriter # To choose based on the output file mode (text vs. binary).
|
from UM.FileHandler.FileWriter import FileWriter # To choose based on the output file mode (text vs. binary).
|
||||||
|
@ -22,6 +28,7 @@ from cura.PrinterOutput.ExtruderConfigurationModel import ExtruderConfigurationM
|
||||||
from cura.PrinterOutput.NetworkedPrinterOutputDevice import NetworkedPrinterOutputDevice, AuthState
|
from cura.PrinterOutput.NetworkedPrinterOutputDevice import NetworkedPrinterOutputDevice, AuthState
|
||||||
from cura.PrinterOutput.PrinterOutputModel import PrinterOutputModel
|
from cura.PrinterOutput.PrinterOutputModel import PrinterOutputModel
|
||||||
from cura.PrinterOutput.MaterialOutputModel import MaterialOutputModel
|
from cura.PrinterOutput.MaterialOutputModel import MaterialOutputModel
|
||||||
|
from plugins.UM3NetworkPrinting.src.BaseCuraConnectDevice import BaseCuraConnectDevice
|
||||||
|
|
||||||
from .ClusterUM3PrinterOutputController import ClusterUM3PrinterOutputController
|
from .ClusterUM3PrinterOutputController import ClusterUM3PrinterOutputController
|
||||||
from .SendMaterialJob import SendMaterialJob
|
from .SendMaterialJob import SendMaterialJob
|
||||||
|
@ -32,18 +39,10 @@ from PyQt5.QtNetwork import QNetworkRequest, QNetworkReply
|
||||||
from PyQt5.QtGui import QDesktopServices, QImage
|
from PyQt5.QtGui import QDesktopServices, QImage
|
||||||
from PyQt5.QtCore import pyqtSlot, QUrl, pyqtSignal, pyqtProperty, QObject
|
from PyQt5.QtCore import pyqtSlot, QUrl, pyqtSignal, pyqtProperty, QObject
|
||||||
|
|
||||||
from time import time
|
|
||||||
from datetime import datetime
|
|
||||||
from typing import Optional, Dict, List
|
|
||||||
|
|
||||||
import io # To create the correct buffers for sending data to the printer.
|
|
||||||
import json
|
|
||||||
import os
|
|
||||||
|
|
||||||
i18n_catalog = i18nCatalog("cura")
|
i18n_catalog = i18nCatalog("cura")
|
||||||
|
|
||||||
|
|
||||||
class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice):
|
class ClusterUM3OutputDevice(BaseCuraConnectDevice):
|
||||||
printJobsChanged = pyqtSignal()
|
printJobsChanged = pyqtSignal()
|
||||||
activePrinterChanged = pyqtSignal()
|
activePrinterChanged = pyqtSignal()
|
||||||
activeCameraUrlChanged = pyqtSignal()
|
activeCameraUrlChanged = pyqtSignal()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue