mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Use working profile instead of "active" profile
This commit is contained in:
parent
828752af30
commit
6e11c2409b
12 changed files with 17 additions and 17 deletions
|
@ -146,7 +146,7 @@ class BuildVolume(SceneNode):
|
|||
|
||||
skirt_size = 0.0
|
||||
|
||||
profile = Application.getInstance().getMachineManager().getActiveProfile()
|
||||
profile = Application.getInstance().getMachineManager().getWorkingProfile()
|
||||
if profile:
|
||||
skirt_size = self._getSkirtSize(profile)
|
||||
|
||||
|
@ -176,7 +176,7 @@ class BuildVolume(SceneNode):
|
|||
if self._active_profile:
|
||||
self._active_profile.settingValueChanged.disconnect(self._onSettingValueChanged)
|
||||
|
||||
self._active_profile = Application.getInstance().getMachineManager().getActiveProfile()
|
||||
self._active_profile = Application.getInstance().getMachineManager().getWorkingProfile()
|
||||
if self._active_profile:
|
||||
self._active_profile.settingValueChanged.connect(self._onSettingValueChanged)
|
||||
self._updateDisallowedAreas()
|
||||
|
|
|
@ -63,7 +63,7 @@ class ConvexHullDecorator(SceneNodeDecorator):
|
|||
if self._profile:
|
||||
self._profile.settingValueChanged.disconnect(self._onSettingValueChanged)
|
||||
|
||||
self._profile = Application.getInstance().getMachineManager().getActiveProfile()
|
||||
self._profile = Application.getInstance().getMachineManager().getWorkingProfile()
|
||||
|
||||
if self._profile:
|
||||
self._profile.settingValueChanged.connect(self._onSettingValueChanged)
|
||||
|
|
|
@ -49,7 +49,7 @@ class ConvexHullJob(Job):
|
|||
# This is done because of rounding errors.
|
||||
hull = hull.getMinkowskiHull(Polygon(numpy.array([[-1, -1], [-1, 1], [1, 1], [1, -1]], numpy.float32)))
|
||||
|
||||
profile = Application.getInstance().getMachineManager().getActiveProfile()
|
||||
profile = Application.getInstance().getMachineManager().getWorkingProfile()
|
||||
if profile:
|
||||
if profile.getSettingValue("print_sequence") == "one_at_a_time" and not self._node.getParent().callDecoration("isGroup"):
|
||||
# Printing one at a time and it's not an object in a group
|
||||
|
|
|
@ -502,18 +502,18 @@ class CuraApplication(QtApplication):
|
|||
|
||||
@pyqtSlot(str, result = "QVariant")
|
||||
def getSettingValue(self, key):
|
||||
if not self.getMachineManager().getActiveProfile():
|
||||
if not self.getMachineManager().getWorkingProfile():
|
||||
return None
|
||||
return self.getMachineManager().getActiveProfile().getSettingValue(key)
|
||||
return self.getMachineManager().getWorkingProfile().getSettingValue(key)
|
||||
#return self.getActiveMachine().getSettingValueByKey(key)
|
||||
|
||||
## Change setting by key value pair
|
||||
@pyqtSlot(str, "QVariant")
|
||||
def setSettingValue(self, key, value):
|
||||
if not self.getMachineManager().getActiveProfile():
|
||||
if not self.getMachineManager().getWorkingProfile():
|
||||
return
|
||||
|
||||
self.getMachineManager().getActiveProfile().setSettingValue(key, value)
|
||||
self.getMachineManager().getWorkingProfile().setSettingValue(key, value)
|
||||
|
||||
@pyqtSlot()
|
||||
def mergeSelected(self):
|
||||
|
|
|
@ -21,7 +21,7 @@ class OneAtATimeIterator(Iterator.Iterator):
|
|||
if not type(node) is SceneNode:
|
||||
continue
|
||||
|
||||
if node.getBoundingBox().height > Application.getInstance().getMachineManager().getActiveProfile().getSettingValue("gantry_height"):
|
||||
if node.getBoundingBox().height > Application.getInstance().getMachineManager().getWorkingProfile().getSettingValue("gantry_height"):
|
||||
return
|
||||
if node.callDecoration("getConvexHull"):
|
||||
node_list.append(node)
|
||||
|
|
|
@ -66,6 +66,6 @@ class PrintInformation(QObject):
|
|||
self.currentPrintTimeChanged.emit()
|
||||
|
||||
# Material amount is sent as an amount of mm^3, so calculate length from that
|
||||
r = Application.getInstance().getMachineManager().getActiveProfile().getSettingValue("material_diameter") / 2
|
||||
r = Application.getInstance().getMachineManager().getWorkingProfile().getSettingValue("material_diameter") / 2
|
||||
self._material_amount = round((amount / (math.pi * r ** 2)) / 1000, 2)
|
||||
self.materialAmountChanged.emit()
|
||||
|
|
|
@ -47,7 +47,7 @@ class AutoSave(Extension):
|
|||
if self._profile:
|
||||
self._profile.settingValueChanged.disconnect(self._onSettingValueChanged)
|
||||
|
||||
self._profile = Application.getInstance().getMachineManager().getActiveProfile()
|
||||
self._profile = Application.getInstance().getMachineManager().getWorkingProfile()
|
||||
|
||||
if self._profile:
|
||||
self._profile.settingValueChanged.connect(self._onSettingValueChanged)
|
||||
|
|
|
@ -180,7 +180,7 @@ class CuraEngineBackend(Backend):
|
|||
if self._profile:
|
||||
self._profile.settingValueChanged.disconnect(self._onSettingChanged)
|
||||
|
||||
self._profile = Application.getInstance().getMachineManager().getActiveProfile()
|
||||
self._profile = Application.getInstance().getMachineManager().getWorkingProfile()
|
||||
if self._profile:
|
||||
self._profile.settingValueChanged.connect(self._onSettingChanged)
|
||||
self._onChanged()
|
||||
|
|
|
@ -44,7 +44,7 @@ class ProcessSlicedObjectListJob(Job):
|
|||
object_id_map[id(node)] = node
|
||||
Job.yieldThread()
|
||||
|
||||
settings = Application.getInstance().getMachineManager().getActiveProfile()
|
||||
settings = Application.getInstance().getMachineManager().getWorkingProfile()
|
||||
|
||||
center = None
|
||||
if not settings.getSettingValue("machine_center_is_zero"):
|
||||
|
|
|
@ -40,7 +40,7 @@ class GCodeWriter(MeshWriter):
|
|||
if gcode_list:
|
||||
for gcode in gcode_list:
|
||||
stream.write(gcode)
|
||||
profile = self._serialiseProfile(Application.getInstance().getMachineManager().getActiveProfile()) #Serialise the profile and put them at the end of the file.
|
||||
profile = self._serialiseProfile(Application.getInstance().getMachineManager().getWorkingProfile()) #Serialise the profile and put them at the end of the file.
|
||||
stream.write(profile)
|
||||
return True
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ class SliceInfo(Extension):
|
|||
def _onWriteStarted(self, output_device):
|
||||
if not Preferences.getInstance().getValue("info/send_slice_info"):
|
||||
return # Do nothing, user does not want to send data
|
||||
settings = Application.getInstance().getMachineManager().getActiveProfile()
|
||||
settings = Application.getInstance().getMachineManager().getWorkingProfile()
|
||||
|
||||
# Load all machine definitions and put them in machine_settings dict
|
||||
#setting_file_name = Application.getInstance().getActiveMachineInstance().getMachineSettings()._json_file
|
||||
|
|
|
@ -34,8 +34,8 @@ class SolidView(View):
|
|||
self._disabled_shader = OpenGL.getInstance().createShaderProgram(Resources.getPath(Resources.Shaders, "overhang.shader"))
|
||||
self._disabled_shader.setUniformValue("u_diffuseColor", [0.68, 0.68, 0.68, 1.0])
|
||||
|
||||
if Application.getInstance().getMachineManager().getActiveProfile():
|
||||
profile = Application.getInstance().getMachineManager().getActiveProfile()
|
||||
if Application.getInstance().getMachineManager().getWorkingProfile():
|
||||
profile = Application.getInstance().getMachineManager().getWorkingProfile()
|
||||
|
||||
if profile.getSettingValue("support_enable") or not Preferences.getInstance().getValue("view/show_overhang"):
|
||||
angle = profile.getSettingValue("support_angle")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue