mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -06:00
Ensure that extruder configurations are correctly sorted
CL-894
This commit is contained in:
parent
03a7833180
commit
6a08b63f21
4 changed files with 18 additions and 12 deletions
|
@ -11,9 +11,9 @@ class ExtruderConfigurationModel(QObject):
|
|||
|
||||
extruderConfigurationChanged = pyqtSignal()
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self, position: int = -1):
|
||||
super().__init__()
|
||||
self._position = -1 # type: int
|
||||
self._position = position # type: int
|
||||
self._material = None # type: Optional[MaterialOutputModel]
|
||||
self._hotend_id = None # type: Optional[str]
|
||||
|
||||
|
|
|
@ -183,7 +183,6 @@ class Toolbox(QObject, Extension):
|
|||
"materials_available": QUrl("{base_url}/packages?package_type=material".format(base_url=self._api_url)),
|
||||
"materials_generic": QUrl("{base_url}/packages?package_type=material&tags=generic".format(base_url=self._api_url))
|
||||
}
|
||||
print("*******", self._request_urls )
|
||||
|
||||
# Get the API root for the packages API depending on Cura version settings.
|
||||
def _getCloudAPIRoot(self) -> str:
|
||||
|
|
|
@ -520,18 +520,16 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice):
|
|||
key=data["uuid"], name= data["name"])
|
||||
|
||||
configuration = ConfigurationModel()
|
||||
extruders = []
|
||||
extruders = [ExtruderConfigurationModel(position = idx) for idx in range(0, self._number_of_extruders)]
|
||||
for index in range(0, self._number_of_extruders):
|
||||
extruder = ExtruderConfigurationModel()
|
||||
extruder.setPosition(index)
|
||||
try:
|
||||
extruder_data = data["configuration"][index]
|
||||
except IndexError:
|
||||
break
|
||||
|
||||
continue
|
||||
extruder = extruders[int(data["configuration"][index]["extruder_index"])]
|
||||
extruder.setHotendID(extruder_data.get("print_core_id", ""))
|
||||
extruder.setMaterial(self._createMaterialOutputModel(extruder_data.get("material", {})))
|
||||
extruders.append(extruder)
|
||||
|
||||
configuration.setExtruderConfigurations(extruders)
|
||||
print_job.updateConfiguration(configuration)
|
||||
|
||||
|
|
|
@ -18,6 +18,15 @@ Item
|
|||
id: extruderCircle
|
||||
width: 30
|
||||
height: 30
|
||||
opacity:
|
||||
{
|
||||
if(printCoreConfiguration == undefined || printCoreConfiguration.activeMaterial == undefined || printCoreConfiguration.hotendID == undefined)
|
||||
{
|
||||
return 0.5
|
||||
}
|
||||
return 1
|
||||
}
|
||||
|
||||
Rectangle
|
||||
{
|
||||
anchors.fill: parent
|
||||
|
@ -30,7 +39,7 @@ Item
|
|||
{
|
||||
anchors.centerIn: parent
|
||||
font: UM.Theme.getFont("default_bold")
|
||||
text: printCoreConfiguration != undefined ? printCoreConfiguration.position + 1 : ""
|
||||
text: printCoreConfiguration.position + 1
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -40,7 +49,7 @@ Item
|
|||
text:
|
||||
|
||||
{
|
||||
if(printCoreConfiguration != undefined && printCoreConfiguration.activeMaterial != undefined)
|
||||
if(printCoreConfiguration != undefined && printCoreConfiguration.activeMaterial != undefined)
|
||||
{
|
||||
return printCoreConfiguration.activeMaterial.name
|
||||
}
|
||||
|
@ -58,7 +67,7 @@ Item
|
|||
id: printCoreLabel
|
||||
text:
|
||||
{
|
||||
if(printCoreConfiguration != undefined && printCoreConfiguration.hotendID != undefined)
|
||||
if(printCoreConfiguration != undefined && printCoreConfiguration.hotendID != undefined)
|
||||
{
|
||||
return printCoreConfiguration.hotendID
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue