Browse Source

Merge remote-tracking branch 'upstream/master'

Simon Lundell 7 years ago
parent
commit
c393167878

+ 12 - 2
cura/CrashHandler.py

@@ -14,8 +14,9 @@ import urllib.request
 import urllib.error
 import shutil
 
-from PyQt5.QtCore import QT_VERSION_STR, PYQT_VERSION_STR, QFile
+from PyQt5.QtCore import QT_VERSION_STR, PYQT_VERSION_STR, QUrl
 from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QVBoxLayout, QLabel, QTextEdit, QGroupBox, QCheckBox, QPushButton
+from PyQt5.QtGui import QDesktopServices
 
 from UM.Application import Application
 from UM.Logger import Logger
@@ -91,7 +92,7 @@ class CrashHandler:
         label = QLabel()
         label.setText(catalog.i18nc("@label crash message", """<p><b>A fatal error has occurred.</p></b>
                     <p>Unfortunately, Cura encountered an unrecoverable error during start up. It was possibly caused by some incorrect configuration files. We suggest to backup and reset your configuration.</p>
-                    <p>Your backup can be found in your Configuration folder.</p>
+                    <p>Backups can be found in the configuration folder.</p>
                     <p>Please send us this Crash Report to fix the problem.</p>
                 """))
         label.setWordWrap(True)
@@ -105,8 +106,13 @@ class CrashHandler:
         show_details_button.setMaximumWidth(200)
         show_details_button.clicked.connect(self._showDetailedReport)
 
+        show_configuration_folder_button = QPushButton(catalog.i18nc("@action:button", "Show configuration folder"), dialog)
+        show_configuration_folder_button.setMaximumWidth(200)
+        show_configuration_folder_button.clicked.connect(self._showConfigurationFolder)
+
         layout.addWidget(self._send_report_checkbox)
         layout.addWidget(show_details_button)
+        layout.addWidget(show_configuration_folder_button)
 
         # "backup and start clean" and "close" buttons
         buttons = QDialogButtonBox()
@@ -182,6 +188,10 @@ class CrashHandler:
 
         self.early_crash_dialog.close()
 
+    def _showConfigurationFolder(self):
+        path = Resources.getConfigStoragePath();
+        QDesktopServices.openUrl(QUrl.fromLocalFile( path ))
+
     def _showDetailedReport(self):
         self.dialog.exec_()
 

+ 10 - 2
cura/CuraApplication.py

@@ -1547,8 +1547,16 @@ class CuraApplication(QtApplication):
         for original_node in nodes:
 
             # Create a CuraSceneNode just if the original node is not that type
-            node = original_node if isinstance(original_node, CuraSceneNode) else CuraSceneNode()
-            node.setMeshData(original_node.getMeshData())
+            if isinstance(original_node, CuraSceneNode):
+                node = original_node
+            else:
+                node = CuraSceneNode()
+                node.setMeshData(original_node.getMeshData())
+
+                #Setting meshdata does not apply scaling.
+                if(original_node.getScale() != Vector(1.0, 1.0, 1.0)):
+                    node.scale(original_node.getScale())
+
 
             node.setSelectable(True)
             node.setName(os.path.basename(filename))

+ 4 - 11
cura/Settings/CuraContainerRegistry.py

@@ -228,19 +228,12 @@ class CuraContainerRegistry(ContainerRegistry):
                     Logger.log("e", "Incorrect profile [%s]. Could not find global profile", file_name)
                     return { "status": "error",
                              "message": catalog.i18nc("@info:status Don't translate the XML tags <filename> or <message>!", "This profile <filename>{0}</filename> contains incorrect data, could not import it.", file_name)}
-
-                # In a profile we can have the quality_definition metadata, but if not, we get the definition
-                profile_definition = global_profile.getMetaDataEntry("quality_definition")
-                if not profile_definition:
-                    profile_definition = global_profile.getMetaDataEntry("definition")
-
-                # The expected machine definition may be the quality_definition if defined or the current definition id
-                expected_machine_definition = None
+                profile_definition = global_profile.getMetaDataEntry("definition")
+                expected_machine_definition = "fdmprinter"
                 if parseBool(global_container_stack.getMetaDataEntry("has_machine_quality", "False")):
                     expected_machine_definition = global_container_stack.getMetaDataEntry("quality_definition")
-                if not expected_machine_definition:
-                    expected_machine_definition = global_container_stack.definition.getId()
-
+                    if not expected_machine_definition:
+                        expected_machine_definition = global_container_stack.definition.getId()
                 if expected_machine_definition is not None and profile_definition is not None and profile_definition != expected_machine_definition:
                     Logger.log("e", "Profile [%s] is for machine [%s] but the current active machine is [%s]. Will not import the profile", file_name, profile_definition, expected_machine_definition)
                     return { "status": "error",

+ 1 - 1
cura/Settings/MaterialSettingsVisibilityHandler.py

@@ -9,7 +9,7 @@ class MaterialSettingsVisibilityHandler(UM.Settings.Models.SettingVisibilityHand
 
         material_settings = {
             "default_material_print_temperature",
-            "material_bed_temperature",
+            "default_material_bed_temperature",
             "material_standby_temperature",
             #"material_flow_temp_graph",
             "cool_fan_speed",

+ 2 - 2
plugins/CuraEngineBackend/CuraEngineBackend.py

@@ -192,7 +192,7 @@ class CuraEngineBackend(QObject, Backend):
 
     ##  Perform a slice of the scene.
     def slice(self):
-        Logger.log("d", "starting to slice!")
+        Logger.log("d", "Starting to slice...")
         self._slice_start_time = time()
         if not self._build_plates_to_be_sliced:
             self.processingProgress.emit(1.0)
@@ -200,7 +200,7 @@ class CuraEngineBackend(QObject, Backend):
             return
 
         if self._process_layers_job:
-            Logger.log("d", "  ## Process layers job still busy, trying later")
+            Logger.log("d", "Process layers job still busy, trying later.")
             return
 
         if not hasattr(self._scene, "gcode_dict"):

+ 10 - 2
plugins/GCodeWriter/GCodeWriter.py

@@ -121,9 +121,13 @@ class GCodeWriter(MeshWriter):
         if flat_global_container.getMetaDataEntry("quality_type", None) is None:
             flat_global_container.addMetaDataEntry("quality_type", stack.quality.getMetaDataEntry("quality_type", "normal"))
 
-        # Ensure that quality_definition is set. (Can happen if we have empty quality changes).
+        # Change the default defintion
+        default_machine_definition = "fdmprinter"
         if parseBool(stack.getMetaDataEntry("has_machine_quality", "False")):
-            flat_global_container.addMetaDataEntry("quality_definition", stack.getMetaDataEntry("quality_definition"))
+            default_machine_definition = stack.getMetaDataEntry("quality_definition")
+            if not default_machine_definition:
+                default_machine_definition = stack.definition.getId()
+        flat_global_container.setMetaDataEntry("definition", default_machine_definition)
 
         serialized = flat_global_container.serialize()
         data = {"global_quality": serialized}
@@ -145,6 +149,10 @@ class GCodeWriter(MeshWriter):
             # Ensure that quality_type is set. (Can happen if we have empty quality changes).
             if flat_extruder_quality.getMetaDataEntry("quality_type", None) is None:
                 flat_extruder_quality.addMetaDataEntry("quality_type", extruder.quality.getMetaDataEntry("quality_type", "normal"))
+
+            # Change the default defintion
+            flat_extruder_quality.setMetaDataEntry("definition", default_machine_definition)
+
             extruder_serialized = flat_extruder_quality.serialize()
             data.setdefault("extruder_quality", []).append(extruder_serialized)
 

+ 4 - 2
plugins/MonitorStage/MonitorStage.py

@@ -69,9 +69,11 @@ class MonitorStage(CuraStage):
                 self._printer_output_device.connectionStateChanged.connect(self._updateIconSource)
                 self._setActivePrinter(self._printer_output_device.activePrinter)
 
-                # Force an update of the icon source
-                self._updateIconSource()
+            # Force an update of the icon source
+            self._updateIconSource()
         except IndexError:
+            #If index error occurs, then the icon on monitor button also should be updated
+            self._updateIconSource()
             pass
 
     def _onEngineCreated(self):

+ 0 - 2
plugins/UM3NetworkPrinting/LegacyUM3OutputDevice.py

@@ -419,8 +419,6 @@ class LegacyUM3OutputDevice(NetworkedPrinterOutputDevice):
             self._authentication_failed_message.show()
         elif status_code == 200:
             self.setAuthenticationState(AuthState.Authenticated)
-            # Now we know for sure that we are authenticated, send the material profiles to the machine.
-            self._sendMaterialProfiles()
 
     def _checkAuthentication(self):
         Logger.log("d", "Checking if authentication is correct for id %s and key %s", self._authentication_id, self._getSafeAuthKey())

+ 14 - 3
resources/definitions/dagoma_discoeasy200.def.json

@@ -7,7 +7,6 @@
         "author": "Dagoma",
         "manufacturer": "Dagoma",
         "file_formats": "text/x-gcode",
-        "icon": "icon_discoeasy200.png",
         "platform": "discoeasy200.stl",
         "platform_offset": [ 105, -59, 280]
     },
@@ -39,13 +38,25 @@
             "default_value": 10
         },
         "machine_start_gcode": {
-            "default_value": ";Gcode by Cura\nG90   ;absolute positioning\nM106 S250 ;fan on for the palpeur\nG28 X Y\nG1 X50\nM109 S180\nG28\nM104 S{material_print_temperature_layer_0}\n;Activation palpeur\n;bloc palpeur\nG29 ;Auto level\nM107 ;start with the fan off\nG1 X100 Y20 F3000\nG1 Z0.5\nM109 S{material_print_temperature_layer_0}\nM82 ;set extruder to absolute mode\nG92 E0 ;zero the extruded length\nG1 F200 E10 ;extrude 10mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 Z3\nG1 F6000"
+            "default_value": ";Gcode by Cura\nG90\nM106 S250\nG28 X Y\nG1 X50\nM109 S180\nG28\nM104 S{material_print_temperature_layer_0}\nG29\nM107\nG1 X100 Y20 F3000\nG1 Z0.5\nM109 S{material_print_temperature_layer_0}\nM82\nG92 E0\nG1 F200 E10\nG92 E0\nG1 Z3\nG1 F6000\n"
         },
         "machine_end_gcode": {
-            "default_value": "M104 S0\nM106 S255   ;start fan full power\nM140 S0   ;heated bed heater off (if you have it)\n;Home machine\nG91   ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+3 F3000  ;move Z up a bit and retract filament even more\nG90\nG28 X Y\n;Ventilation forcee\nM107    ;stop fan\n;Shut down motor\nM84   ;shut down motors"
+            "default_value": "\nM104 S0\nM106 S255\nM140 S0\nG91\nG1 E-1 F300\nG1 Z+3 F3000\nG90\nG28 X Y\nM107\nM84\n"
         },
         "material_diameter": {
             "default_value": 1.75
+        },
+        "speed_print": {
+            "default_value": 60
+        },
+        "speed_travel": {
+            "default_value": 100
+        },
+        "retraction_amount": {
+            "default_value": 3.5
+        },
+        "retraction_speed": {
+            "default_value": 50
         }
     }
 }

+ 69 - 0
resources/definitions/dagoma_neva.def.json

@@ -0,0 +1,69 @@
+{
+    "id": "Dagoma_neva",
+    "name": "Dagoma NEVA",
+    "version": 2,
+    "inherits": "fdmprinter",
+    "metadata": {
+        "visible": true,
+        "author": "Dagoma",
+        "manufacturer": "Dagoma",
+        "file_formats": "text/x-gcode",
+        "platform": "neva.stl",
+        "platform_offset": [ 0, 0, 0]
+    },
+    "overrides": {
+        "machine_width": {
+            "default_value": 195.55
+        },
+        "machine_height": {
+            "default_value": 205
+        },
+        "machine_depth": {
+            "default_value": 195.55
+        },
+        "machine_center_is_zero": {
+            "default_value": true
+        },
+        "machine_nozzle_size": {
+            "default_value": 0.4
+        },
+        "machine_head_with_fans_polygon": {
+            "default_value": [
+                [17, 40],
+                [17, -70],
+                [-17, -70],
+                [17, 40]
+            ]
+        },
+        "gantry_height": {
+          "default_value": 0
+        },
+        "machine_shape": {
+            "default_value": "elliptic"
+        },
+        "machine_gcode_flavor": {
+            "default_value": "RepRap"
+        },
+        "machine_start_gcode": {
+            "default_value": ";Gcode by Cura\nG90\nG28\nM109 S100\nG29\nM104 S{material_print_temperature_layer_0}\nG0 X0 Y-85\nG0 Z0.26\nM109 S{material_print_temperature_layer_0}\nM82\nG92 E0\nG1 F200 E6\nG92 E0\nG1 F200 E-3.5\nG0 Z0.15\nG0 X10\nG0 Z3\nG1 F6000\n"
+        },
+        "machine_end_gcode": {
+            "default_value": "\nM104 S0\nM106 S255\nM140 S0\nG91\nG1 E-1 F300\nG1 Z+3 E-2 F9000\nG90\nG28\n"
+        },
+        "material_diameter": {
+            "default_value": 1.75
+        },
+        "speed_print": {
+            "default_value": 40
+        },
+        "speed_travel": {
+            "default_value": 120
+        },
+        "retraction_amount": {
+            "default_value": 3.8
+        },
+        "retraction_speed": {
+            "default_value": 60
+        }
+    }
+}

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