mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-01 08:14:22 +08:00
Use ConnectionType enum
Move import statement CURA-9277
This commit is contained in:
parent
61ce8dff7d
commit
d83673a972
@ -1,6 +1,8 @@
|
|||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from UM.Settings.ContainerStack import ContainerStack
|
from UM.Settings.ContainerStack import ContainerStack
|
||||||
|
from cura.CuraApplication import CuraApplication
|
||||||
|
from cura.PrinterOutput.PrinterOutputDevice import ConnectionType
|
||||||
from cura.Settings.GlobalStack import GlobalStack
|
from cura.Settings.GlobalStack import GlobalStack
|
||||||
from UM.MimeTypeDatabase import MimeType, MimeTypeDatabase
|
from UM.MimeTypeDatabase import MimeType, MimeTypeDatabase
|
||||||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||||
@ -14,13 +16,11 @@ class AbstractMachine(GlobalStack):
|
|||||||
self.setMetaDataEntry("type", "abstract_machine")
|
self.setMetaDataEntry("type", "abstract_machine")
|
||||||
|
|
||||||
def getMachines(self) -> List[ContainerStack]:
|
def getMachines(self) -> List[ContainerStack]:
|
||||||
from cura.CuraApplication import CuraApplication
|
|
||||||
application = CuraApplication.getInstance()
|
application = CuraApplication.getInstance()
|
||||||
registry = application.getContainerRegistry()
|
registry = application.getContainerRegistry()
|
||||||
|
|
||||||
printer_type = self.definition.getId()
|
printer_type = self.definition.getId()
|
||||||
cloud_printer_type = 3
|
return [machine for machine in registry.findContainerStacks(type="machine") if machine.definition.id == printer_type and ConnectionType.CloudConnection in machine.configuredConnectionTypes]
|
||||||
return [machine for machine in registry.findContainerStacks(type="machine") if machine.definition.id == printer_type and cloud_printer_type in machine.configuredConnectionTypes]
|
|
||||||
|
|
||||||
|
|
||||||
## private:
|
## private:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user