Use working profile instead of "active" profile

This commit is contained in:
fieldOfView 2016-01-28 12:23:24 +01:00
parent 828752af30
commit 6e11c2409b
12 changed files with 17 additions and 17 deletions

View file

@ -146,7 +146,7 @@ class BuildVolume(SceneNode):
skirt_size = 0.0 skirt_size = 0.0
profile = Application.getInstance().getMachineManager().getActiveProfile() profile = Application.getInstance().getMachineManager().getWorkingProfile()
if profile: if profile:
skirt_size = self._getSkirtSize(profile) skirt_size = self._getSkirtSize(profile)
@ -176,7 +176,7 @@ class BuildVolume(SceneNode):
if self._active_profile: if self._active_profile:
self._active_profile.settingValueChanged.disconnect(self._onSettingValueChanged) 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: if self._active_profile:
self._active_profile.settingValueChanged.connect(self._onSettingValueChanged) self._active_profile.settingValueChanged.connect(self._onSettingValueChanged)
self._updateDisallowedAreas() self._updateDisallowedAreas()

View file

@ -63,7 +63,7 @@ class ConvexHullDecorator(SceneNodeDecorator):
if self._profile: if self._profile:
self._profile.settingValueChanged.disconnect(self._onSettingValueChanged) self._profile.settingValueChanged.disconnect(self._onSettingValueChanged)
self._profile = Application.getInstance().getMachineManager().getActiveProfile() self._profile = Application.getInstance().getMachineManager().getWorkingProfile()
if self._profile: if self._profile:
self._profile.settingValueChanged.connect(self._onSettingValueChanged) self._profile.settingValueChanged.connect(self._onSettingValueChanged)

View file

@ -49,7 +49,7 @@ class ConvexHullJob(Job):
# This is done because of rounding errors. # This is done because of rounding errors.
hull = hull.getMinkowskiHull(Polygon(numpy.array([[-1, -1], [-1, 1], [1, 1], [1, -1]], numpy.float32))) 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:
if profile.getSettingValue("print_sequence") == "one_at_a_time" and not self._node.getParent().callDecoration("isGroup"): 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 # Printing one at a time and it's not an object in a group

View file

@ -502,18 +502,18 @@ class CuraApplication(QtApplication):
@pyqtSlot(str, result = "QVariant") @pyqtSlot(str, result = "QVariant")
def getSettingValue(self, key): def getSettingValue(self, key):
if not self.getMachineManager().getActiveProfile(): if not self.getMachineManager().getWorkingProfile():
return None return None
return self.getMachineManager().getActiveProfile().getSettingValue(key) return self.getMachineManager().getWorkingProfile().getSettingValue(key)
#return self.getActiveMachine().getSettingValueByKey(key) #return self.getActiveMachine().getSettingValueByKey(key)
## Change setting by key value pair ## Change setting by key value pair
@pyqtSlot(str, "QVariant") @pyqtSlot(str, "QVariant")
def setSettingValue(self, key, value): def setSettingValue(self, key, value):
if not self.getMachineManager().getActiveProfile(): if not self.getMachineManager().getWorkingProfile():
return return
self.getMachineManager().getActiveProfile().setSettingValue(key, value) self.getMachineManager().getWorkingProfile().setSettingValue(key, value)
@pyqtSlot() @pyqtSlot()
def mergeSelected(self): def mergeSelected(self):

View file

@ -21,7 +21,7 @@ class OneAtATimeIterator(Iterator.Iterator):
if not type(node) is SceneNode: if not type(node) is SceneNode:
continue continue
if node.getBoundingBox().height > Application.getInstance().getMachineManager().getActiveProfile().getSettingValue("gantry_height"): if node.getBoundingBox().height > Application.getInstance().getMachineManager().getWorkingProfile().getSettingValue("gantry_height"):
return return
if node.callDecoration("getConvexHull"): if node.callDecoration("getConvexHull"):
node_list.append(node) node_list.append(node)

View file

@ -66,6 +66,6 @@ class PrintInformation(QObject):
self.currentPrintTimeChanged.emit() self.currentPrintTimeChanged.emit()
# Material amount is sent as an amount of mm^3, so calculate length from that # 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._material_amount = round((amount / (math.pi * r ** 2)) / 1000, 2)
self.materialAmountChanged.emit() self.materialAmountChanged.emit()

View file

@ -47,7 +47,7 @@ class AutoSave(Extension):
if self._profile: if self._profile:
self._profile.settingValueChanged.disconnect(self._onSettingValueChanged) self._profile.settingValueChanged.disconnect(self._onSettingValueChanged)
self._profile = Application.getInstance().getMachineManager().getActiveProfile() self._profile = Application.getInstance().getMachineManager().getWorkingProfile()
if self._profile: if self._profile:
self._profile.settingValueChanged.connect(self._onSettingValueChanged) self._profile.settingValueChanged.connect(self._onSettingValueChanged)

View file

@ -180,7 +180,7 @@ class CuraEngineBackend(Backend):
if self._profile: if self._profile:
self._profile.settingValueChanged.disconnect(self._onSettingChanged) self._profile.settingValueChanged.disconnect(self._onSettingChanged)
self._profile = Application.getInstance().getMachineManager().getActiveProfile() self._profile = Application.getInstance().getMachineManager().getWorkingProfile()
if self._profile: if self._profile:
self._profile.settingValueChanged.connect(self._onSettingChanged) self._profile.settingValueChanged.connect(self._onSettingChanged)
self._onChanged() self._onChanged()

View file

@ -44,7 +44,7 @@ class ProcessSlicedObjectListJob(Job):
object_id_map[id(node)] = node object_id_map[id(node)] = node
Job.yieldThread() Job.yieldThread()
settings = Application.getInstance().getMachineManager().getActiveProfile() settings = Application.getInstance().getMachineManager().getWorkingProfile()
center = None center = None
if not settings.getSettingValue("machine_center_is_zero"): if not settings.getSettingValue("machine_center_is_zero"):

View file

@ -40,7 +40,7 @@ class GCodeWriter(MeshWriter):
if gcode_list: if gcode_list:
for gcode in gcode_list: for gcode in gcode_list:
stream.write(gcode) 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) stream.write(profile)
return True return True

View file

@ -44,7 +44,7 @@ class SliceInfo(Extension):
def _onWriteStarted(self, output_device): def _onWriteStarted(self, output_device):
if not Preferences.getInstance().getValue("info/send_slice_info"): if not Preferences.getInstance().getValue("info/send_slice_info"):
return # Do nothing, user does not want to send data 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 # Load all machine definitions and put them in machine_settings dict
#setting_file_name = Application.getInstance().getActiveMachineInstance().getMachineSettings()._json_file #setting_file_name = Application.getInstance().getActiveMachineInstance().getMachineSettings()._json_file

View file

@ -34,8 +34,8 @@ class SolidView(View):
self._disabled_shader = OpenGL.getInstance().createShaderProgram(Resources.getPath(Resources.Shaders, "overhang.shader")) 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]) self._disabled_shader.setUniformValue("u_diffuseColor", [0.68, 0.68, 0.68, 1.0])
if Application.getInstance().getMachineManager().getActiveProfile(): if Application.getInstance().getMachineManager().getWorkingProfile():
profile = Application.getInstance().getMachineManager().getActiveProfile() profile = Application.getInstance().getMachineManager().getWorkingProfile()
if profile.getSettingValue("support_enable") or not Preferences.getInstance().getValue("view/show_overhang"): if profile.getSettingValue("support_enable") or not Preferences.getInstance().getValue("view/show_overhang"):
angle = profile.getSettingValue("support_angle") angle = profile.getSettingValue("support_angle")