Browse Source

Merge branch '15.10'

* 15.10: (37 commits)
  Tweak the initial camera position
  Never disable the view button
  Use selection status to disable/enable tools rather than platform activity
  JSON: bugfix: skirt_speed was the only child of speed_layer_0, which meant you couldnt tweak them separately
  Fix Windows build
  Move all contributed profiles to an "Other" manufacturer
  Bump version
  Make the Infill buttons and support checkboxes in Simple mode functional
  Fix the variants menu so the variants actually get added
  Try to add a page when the name of a wizard page is unknown
  Catch any exception that happens while trying to eject
  Set High Quality to 0.08 layer height
  Capture stdout and stderr on Windows to prevent py2exe messages
  Add missing Ulti and Low quality profiles
  JSON: bugfix/feat: wall_line_width defaults to nozzle size and wall_line_count computed properly
  When you click [Manage Printers..] it brings you to the right page
  Delay showing the Add Machine dialog until after the main window is properly shown
  Adds a smaller cross icon
  Use the job name for saving files
  Update RemovableDrive and USB output devices to use the new file_name parameter
  ...
Arjen Hiemstra 9 years ago
parent
commit
7982e79940

+ 19 - 9
cura/CuraApplication.py

@@ -68,7 +68,7 @@ class CuraApplication(QtApplication):
         if not hasattr(sys, "frozen"):
             Resources.addSearchPath(os.path.join(os.path.abspath(os.path.dirname(__file__)), ".."))
 
-        super().__init__(name = "cura", version = "15.09.82")
+        super().__init__(name = "cura", version = "15.09.85")
 
         self.setWindowIcon(QIcon(Resources.getPath(Resources.Images, "cura-icon.png")))
 
@@ -90,6 +90,7 @@ class CuraApplication(QtApplication):
         self._i18n_catalog = None
         self._previous_active_tool = None
         self._platform_activity = False
+        self._job_name = None
 
         self.getMachineManager().activeMachineInstanceChanged.connect(self._onActiveMachineChanged)
         self.getMachineManager().addMachineRequested.connect(self._onAddMachineRequested)
@@ -165,25 +166,21 @@ class CuraApplication(QtApplication):
         self._physics = PlatformPhysics.PlatformPhysics(controller, self._volume)
 
         camera = Camera("3d", root)
-        camera.setPosition(Vector(-150, 150, 300))
+        camera.setPosition(Vector(0, 250, 900))
         camera.setPerspective(True)
         camera.lookAt(Vector(0, 0, 0))
+        controller.getScene().setActiveCamera("3d")
+
+        self.getController().getTool("CameraTool").setOrigin(Vector(0, 100, 0))
 
         self._camera_animation = CameraAnimation.CameraAnimation()
         self._camera_animation.setCameraTool(self.getController().getTool("CameraTool"))
 
-        controller.getScene().setActiveCamera("3d")
-
         self.showSplashMessage(self._i18n_catalog.i18nc("@info:progress", "Loading interface..."))
 
         self.setMainQml(Resources.getPath(self.ResourceTypes.QmlFiles, "Cura.qml"))
         self.initializeEngine()
 
-        manager = self.getMachineManager()
-        if not self.getMachineManager().getMachineInstances():
-            self.requestAddPrinter.emit()
-
-
         if self._engine.rootObjects:
             self.closeSplash()
 
@@ -248,6 +245,17 @@ class CuraApplication(QtApplication):
         self._platform_activity = True if count > 0 else False
         self.activityChanged.emit()
 
+    @pyqtSlot(str)
+    def setJobName(self, name):
+        if self._job_name != name:
+            self._job_name = name
+            self.jobNameChanged.emit()
+
+    jobNameChanged = pyqtSignal()
+    @pyqtProperty(str, notify = jobNameChanged)
+    def jobName(self):
+        return self._job_name
+
     ##  Remove an object from the scene
     @pyqtSlot("quint64")
     def deleteObject(self, object_id):
@@ -536,6 +544,8 @@ class CuraApplication(QtApplication):
             op = AddSceneNodeOperation(node, self.getController().getScene().getRoot())
             op.push()
 
+            self.getController().getScene().sceneChanged.emit(node) #Force scene change.
+
     def _onJobFinished(self, job):
         if type(job) is not ReadMeshJob or not job.getResult():
             return

+ 5 - 0
cura_app.py

@@ -13,5 +13,10 @@ sys.excepthook = exceptHook
 
 import cura.CuraApplication
 
+if sys.platform == "win32" and hasattr(sys, "frozen"):
+    from UM.Resources import Resources
+    sys.stdout = open(Resources.getStoragePath(Resources.Resources, "stdout.log"), "w")
+    sys.stderr = open(Resources.getStoragePath(Resources.Resources, "stderr.log"), "w")
+
 app = cura.CuraApplication.CuraApplication.getInstance()
 app.run()

+ 10 - 2
plugins/CuraEngineBackend/CuraEngineBackend.py

@@ -77,6 +77,8 @@ class CuraEngineBackend(Backend):
         self._message = None
 
         self.backendConnected.connect(self._onBackendConnected)
+        Application.getInstance().getController().toolOperationStarted.connect(self._onToolOperationStarted)
+        Application.getInstance().getController().toolOperationStopped.connect(self._onToolOperationStopped)
 
     ##  Get the command that is used to call the engine.
     #   This is usefull for debugging and used to actually start the engine
@@ -221,10 +223,16 @@ class CuraEngineBackend(Backend):
         self._socket.sendMessage(slice_message)
 
     def _onSceneChanged(self, source):
-        if (type(source) is not SceneNode) or (source is self._scene.getRoot()) or (source.getMeshData() is None):
+        if type(source) is not SceneNode:
             return
 
-        if(source.getMeshData().getVertices() is None):
+        if source is self._scene.getRoot():
+            return
+
+        if source.getMeshData() is None:
+            return
+
+        if source.getMeshData().getVertices() is None:
             return
 
         self._onChanged()

+ 6 - 5
plugins/LayerView/LayerView.py

@@ -102,15 +102,16 @@ class LayerView(View):
                                     continue
                             except:
                                 continue
-
-                            self._current_layer_mesh.addVertices(layer_mesh.getVertices())
+                            if self._current_layer_mesh: #Threading thing; Switching between views can cause the current layer mesh to be deleted.
+                                self._current_layer_mesh.addVertices(layer_mesh.getVertices())
 
                             # Scale layer color by a brightness factor based on the current layer number
                             # This will result in a range of 0.5 - 1.0 to multiply colors by.
                             brightness = (2.0 - (i / self._solid_layers)) / 2.0
-                            self._current_layer_mesh.addColors(layer_mesh.getColors() * brightness)
-
-                    renderer.queueNode(node, mesh = self._current_layer_mesh, material = self._material)
+                            if self._current_layer_mesh:
+                                self._current_layer_mesh.addColors(layer_mesh.getColors() * brightness)
+                    if self._current_layer_mesh:
+                        renderer.queueNode(node, mesh = self._current_layer_mesh, material = self._material)
 
                     if not self._current_layer_jumps:
                         self._current_layer_jumps = MeshData()

+ 7 - 7
plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py

@@ -22,18 +22,18 @@ class RemovableDriveOutputDevice(OutputDevice):
         self.setIconName("save_sd")
         self.setPriority(1)
 
-    def requestWrite(self, node):
+    def requestWrite(self, node, file_name = None):
         gcode_writer = Application.getInstance().getMeshFileHandler().getWriterByMimeType("text/x-gcode")
         if not gcode_writer:
             Logger.log("e", "Could not find GCode writer, not writing to removable drive %s", self.getName())
             raise OutputDeviceError.WriteRequestFailedError()
 
-        file_name = None
-        for n in BreadthFirstIterator(node):
-            if n.getMeshData():
-                file_name = n.getName()
-                if file_name:
-                    break
+        if file_name == None:
+            for n in BreadthFirstIterator(node):
+                if n.getMeshData():
+                    file_name = n.getName()
+                    if file_name:
+                        break
 
         if not file_name:
             Logger.log("e", "Could not determine a proper file name when trying to write to %s, aborting", self.getName())

+ 5 - 1
plugins/RemovableDriveOutputDevice/RemovableDrivePlugin.py

@@ -37,7 +37,11 @@ class RemovableDrivePlugin(OutputDevicePlugin):
         raise NotImplementedError()
 
     def ejectDevice(self, device):
-        result = self.performEjectDevice(device)
+        try:
+            result = self.performEjectDevice(device)
+        except Exception as e:
+            result = False
+
         if result:
             message = Message(catalog.i18nc("@info:status", "Ejected {0}. You can now safely remove the drive.").format(device.getName()))
             message.show()

+ 3 - 6
plugins/RemovableDriveOutputDevice/WindowsRemovableDrivePlugin.py

@@ -88,13 +88,10 @@ class WindowsRemovableDrivePlugin(RemovableDrivePlugin.RemovableDrivePlugin):
 
         result = None
         # Then, try and tell it to eject
-        try:
-            if not windll.kernel32.DeviceIoControl(handle, IOCTL_STORAGE_EJECT_MEDIA, None, None, None, None, None, None):
-                result = False
-            else:
-                result = True
-        except Exception as e:
+        if not windll.kernel32.DeviceIoControl(handle, IOCTL_STORAGE_EJECT_MEDIA, None, None, None, None, None, None):
             result = False
+        else:
+            result = True
 
         # Finally, close the handle
         windll.kernel32.CloseHandle(handle)

+ 3 - 1
plugins/USBPrinting/PrinterConnection.py

@@ -323,6 +323,7 @@ class PrinterConnection(OutputDevice, QObject, SignalEmitter):
 
     ##  Close the printer connection
     def close(self):
+        Logger.log("d", "Closing the printer connection.")
         if self._connect_thread.isAlive():
             try:
                 self._connect_thread.join()
@@ -411,6 +412,7 @@ class PrinterConnection(OutputDevice, QObject, SignalEmitter):
 
     def createControlInterface(self):
         if self._control_view is None:
+            Logger.log("d", "Creating control interface for printer connection")
             path = QUrl.fromLocalFile(os.path.join(PluginRegistry.getInstance().getPluginPath("USBPrinting"), "ControlWindow.qml"))
             component = QQmlComponent(Application.getInstance()._engine, path)
             self._control_context = QQmlContext(Application.getInstance()._engine.rootContext())
@@ -455,7 +457,7 @@ class PrinterConnection(OutputDevice, QObject, SignalEmitter):
         self._bed_temperature = temperature
         self.bedTemperatureChanged.emit()
 
-    def requestWrite(self, node):
+    def requestWrite(self, node, file_name = None):
         self.showControlInterface()
 
     def _setEndstopState(self, endstop_key, value):

+ 1 - 1
resources/machines/RigidBot.json

@@ -2,7 +2,7 @@
     "id": "rigidbotbig",
     "version": 1, 
     "name": "RigidBot",
-    "manufacturer": "Invent-A-Part",
+    "manufacturer": "Other",
     "author": "RBC",
     "platform": "rigidbot_platform.stl",
 

+ 1 - 1
resources/machines/RigidBotBig.json

@@ -2,7 +2,7 @@
     "id": "rigidbotbig",
     "version": 1, 
     "name": "RigidBotBig",
-    "manufacturer": "Invent-A-Part",
+    "manufacturer": "Other",
     "author": "RBC",
     "platform": "rigidbotbig_platform.stl",
 	

Some files were not shown because too many files changed in this diff