Browse Source

Merge pull request #869 from Ultimaker/cura-1787

CURA-1787 Added message when switching to one_at_a_time.
Aldo Hoeben 8 years ago
parent
commit
946aac5e32
1 changed files with 12 additions and 0 deletions
  1. 12 0
      cura/BuildVolume.py

+ 12 - 0
cura/BuildVolume.py

@@ -1,6 +1,7 @@
 # Copyright (c) 2015 Ultimaker B.V.
 # Copyright (c) 2015 Ultimaker B.V.
 # Cura is released under the terms of the AGPLv3 or higher.
 # Cura is released under the terms of the AGPLv3 or higher.
 
 
+from UM.i18n import i18nCatalog
 from UM.Scene.SceneNode import SceneNode
 from UM.Scene.SceneNode import SceneNode
 from UM.Application import Application
 from UM.Application import Application
 from UM.Resources import Resources
 from UM.Resources import Resources
@@ -9,9 +10,11 @@ from UM.Math.Vector import Vector
 from UM.Math.Color import Color
 from UM.Math.Color import Color
 from UM.Math.AxisAlignedBox import AxisAlignedBox
 from UM.Math.AxisAlignedBox import AxisAlignedBox
 from UM.Math.Polygon import Polygon
 from UM.Math.Polygon import Polygon
+from UM.Message import Message
 
 
 from UM.View.RenderBatch import RenderBatch
 from UM.View.RenderBatch import RenderBatch
 from UM.View.GL.OpenGL import OpenGL
 from UM.View.GL.OpenGL import OpenGL
+catalog = i18nCatalog("cura")
 
 
 import numpy
 import numpy
 
 
@@ -162,6 +165,13 @@ class BuildVolume(SceneNode):
     def getBoundingBox(self):
     def getBoundingBox(self):
         return self._volume_aabb
         return self._volume_aabb
 
 
+    def _buildVolumeMessage(self):
+        Message(catalog.i18nc(
+            "@info:status",
+            "The build volume height has been reduced due to the value of the"
+            " \"Print Sequence\" setting to prevent the gantry from colliding"
+            " with printed objects."), lifetime=10).show()
+
     def _onGlobalContainerStackChanged(self):
     def _onGlobalContainerStackChanged(self):
         if self._active_container_stack:
         if self._active_container_stack:
             self._active_container_stack.propertyChanged.disconnect(self._onSettingPropertyChanged)
             self._active_container_stack.propertyChanged.disconnect(self._onSettingPropertyChanged)
@@ -174,6 +184,7 @@ class BuildVolume(SceneNode):
             self._width = self._active_container_stack.getProperty("machine_width", "value")
             self._width = self._active_container_stack.getProperty("machine_width", "value")
             if self._active_container_stack.getProperty("print_sequence", "value") == "one_at_a_time":
             if self._active_container_stack.getProperty("print_sequence", "value") == "one_at_a_time":
                 self._height = self._active_container_stack.getProperty("gantry_height", "value")
                 self._height = self._active_container_stack.getProperty("gantry_height", "value")
+                self._buildVolumeMessage()
             else:
             else:
                 self._height = self._active_container_stack.getProperty("machine_height", "value")
                 self._height = self._active_container_stack.getProperty("machine_height", "value")
             self._depth = self._active_container_stack.getProperty("machine_depth", "value")
             self._depth = self._active_container_stack.getProperty("machine_depth", "value")
@@ -189,6 +200,7 @@ class BuildVolume(SceneNode):
         if setting_key == "print_sequence":
         if setting_key == "print_sequence":
             if Application.getInstance().getGlobalContainerStack().getProperty("print_sequence", "value") == "one_at_a_time":
             if Application.getInstance().getGlobalContainerStack().getProperty("print_sequence", "value") == "one_at_a_time":
                 self._height = self._active_container_stack.getProperty("gantry_height", "value")
                 self._height = self._active_container_stack.getProperty("gantry_height", "value")
+                self._buildVolumeMessage()
             else:
             else:
                 self._height = self._active_container_stack.getProperty("machine_height", "value")
                 self._height = self._active_container_stack.getProperty("machine_height", "value")
             self.rebuild()
             self.rebuild()