mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 22:46:09 +08:00
Merge branch '3.2' of https://github.com/Ultimaker/Cura into 3.2
This commit is contained in:
commit
53d097b138
@ -1,6 +1,7 @@
|
|||||||
# Copyright (c) 2017 Ultimaker B.V.
|
# Copyright (c) 2017 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.
|
||||||
|
|
||||||
|
import time
|
||||||
#Type hinting.
|
#Type hinting.
|
||||||
from typing import Union, List, Dict
|
from typing import Union, List, Dict
|
||||||
|
|
||||||
@ -390,21 +391,28 @@ class MachineManager(QObject):
|
|||||||
Logger.log("w", "Failed creating a new machine!")
|
Logger.log("w", "Failed creating a new machine!")
|
||||||
|
|
||||||
def _checkStacksHaveErrors(self) -> bool:
|
def _checkStacksHaveErrors(self) -> bool:
|
||||||
|
time_start = time.time()
|
||||||
if self._global_container_stack is None: #No active machine.
|
if self._global_container_stack is None: #No active machine.
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if self._global_container_stack.hasErrors():
|
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
|
return True
|
||||||
|
|
||||||
# Not a very pretty solution, but the extruder manager doesn't really know how many extruders there are
|
# 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")
|
machine_extruder_count = self._global_container_stack.getProperty("machine_extruder_count", "value")
|
||||||
extruder_stacks = ExtruderManager.getInstance().getMachineExtruders(self._global_container_stack.getId())
|
extruder_stacks = ExtruderManager.getInstance().getMachineExtruders(self._global_container_stack.getId())
|
||||||
if len(extruder_stacks) > machine_extruder_count:
|
count = 1 # we start with the global stack
|
||||||
extruder_stacks = extruder_stacks[:machine_extruder_count] # we only have to check the used extruders
|
|
||||||
for stack in extruder_stacks:
|
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():
|
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
|
return True
|
||||||
|
|
||||||
|
Logger.log("d", "Checking %s stacks for errors took %.2f s" % (count, time.time() - time_start))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
## Remove all instances from the top instanceContainer (effectively removing all user-changed settings)
|
## Remove all instances from the top instanceContainer (effectively removing all user-changed settings)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user