mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-15 02:37:49 -06:00
CURA-4785 now actually checking for extruder position, improved logs
This commit is contained in:
parent
dc119d74bd
commit
92e99012d3
1 changed files with 8 additions and 3 deletions
|
@ -396,18 +396,23 @@ class MachineManager(QObject):
|
|||
return False
|
||||
|
||||
if self._global_container_stack.hasErrors():
|
||||
Logger.log("d", "Checking global stack for errors took %0.2f s and we found and error" % (time.time() - time_start))
|
||||
return True
|
||||
|
||||
# Not a very pretty solution, but the extruder manager doesn't really know how many extruders there are
|
||||
machine_extruder_count = self._global_container_stack.getProperty("machine_extruder_count", "value")
|
||||
extruder_stacks = ExtruderManager.getInstance().getMachineExtruders(self._global_container_stack.getId())
|
||||
if len(extruder_stacks) > machine_extruder_count:
|
||||
extruder_stacks = extruder_stacks[:machine_extruder_count] # we only have to check the used extruders
|
||||
count = 1 # we start with the global stack
|
||||
for stack in extruder_stacks:
|
||||
md = stack.getMetaData()
|
||||
if "position" in md and int(md["position"]) >= machine_extruder_count:
|
||||
continue
|
||||
count += 1
|
||||
if stack.hasErrors():
|
||||
Logger.log("d", "Checking %s stacks for errors took %.2f s and we found an error in stack [%s]" % (count, time.time() - time_start, str(stack)))
|
||||
return True
|
||||
|
||||
Logger.log("d", "Checking stacks for errors took %.2f s" % (time.time() - time_start))
|
||||
Logger.log("d", "Checking %s stacks for errors took %.2f s" % (count, time.time() - time_start))
|
||||
return False
|
||||
|
||||
## Remove all instances from the top instanceContainer (effectively removing all user-changed settings)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue