mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-14 18:27:51 -06:00
Implement getMachines
function
Cura-9277 Co-authored-by: joeydelarago <joeydelarago@gmail.com>
This commit is contained in:
parent
d7f119415f
commit
f22d446fa4
1 changed files with 9 additions and 4 deletions
|
@ -1,16 +1,21 @@
|
|||
from typing import List
|
||||
|
||||
from UM.Settings.ContainerStack import ContainerStack
|
||||
from cura.Settings.GlobalStack import GlobalStack
|
||||
|
||||
|
||||
class AbstractMachine(GlobalStack):
|
||||
""" Behaves as a type of machine, represents multiple machines of the same type """
|
||||
""" Represents a group of machines of the same type. This allows the user to select settings before selecting a printer. """
|
||||
|
||||
def __init__(self, container_id: str):
|
||||
super().__init__(container_id)
|
||||
self.setMetaDataEntry("type", "abstract_machine")
|
||||
|
||||
def getMachinesOfType(self) -> List[GlobalStack]:
|
||||
pass
|
||||
|
||||
def getMachines(self) -> List[ContainerStack]:
|
||||
from cura.CuraApplication import CuraApplication
|
||||
application = CuraApplication.getInstance()
|
||||
registry = application.getContainerRegistry()
|
||||
|
||||
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 cloud_printer_type in machine.configuredConnectionTypes]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue