Browse Source

Merge branch 'master' of github.com:Ultimaker/cura

Aleksei S 7 years ago
parent
commit
92e48795c9

+ 16 - 0
cura/Settings/ContainerManager.py

@@ -816,6 +816,22 @@ class ContainerManager(QObject):
             ContainerRegistry.getInstance().addContainer(container_to_add)
         return self._getMaterialContainerIdForActiveMachine(clone_of_original)
 
+    ##  Create a duplicate of a material or it's original entry
+    #
+    #   \return \type{str} the id of the newly created container.
+    @pyqtSlot(str, result = str)
+    def duplicateOriginalMaterial(self, material_id):
+
+        # check if the given material has a base file (i.e. was shipped by default)
+        base_file = self.getContainerMetaDataEntry(material_id, "base_file")
+
+        if base_file == "":
+            # there is no base file, so duplicate by ID
+            return self.duplicateMaterial(material_id)
+        else:
+            # there is a base file, so duplicate the original material
+            return self.duplicateMaterial(base_file)
+
     ##  Create a new material by cloning Generic PLA for the current material diameter and setting the GUID to something unqiue
     #
     #   \return \type{str} the id of the newly created container.

+ 13 - 1
cura/Settings/CuraContainerRegistry.py

@@ -574,7 +574,19 @@ class CuraContainerRegistry(ContainerRegistry):
 
         # Also need to fix the other qualities that are suitable for this machine. Those quality changes may still have
         # per-extruder settings in the container for the machine instead of the extruder.
-        quality_changes_machine_definition_id = machine.qualityChanges.getDefinition().getId()
+        if machine.qualityChanges.getId() not in ("empty", "empty_quality_changes"):
+            quality_changes_machine_definition_id = machine.qualityChanges.getDefinition().getId()
+        else:
+            whole_machine_definition = machine.definition
+            machine_entry = machine.definition.getMetaDataEntry("machine")
+            if machine_entry is not None:
+                container_registry = ContainerRegistry.getInstance()
+                whole_machine_definition = container_registry.findDefinitionContainers(id = machine_entry)[0]
+
+            quality_changes_machine_definition_id = "fdmprinter"
+            if whole_machine_definition.getMetaDataEntry("has_machine_quality"):
+                quality_changes_machine_definition_id = machine.definition.getMetaDataEntry("quality_definition",
+                                                                                            whole_machine_definition.getId())
         qcs = self.findInstanceContainers(type = "quality_changes", definition = quality_changes_machine_definition_id)
         qc_groups = {}  # map of qc names -> qc containers
         for qc in qcs:

+ 3 - 2
plugins/MonitorStage/MonitorMainView.qml

@@ -8,8 +8,9 @@ import Cura 1.0 as Cura
 
 Item
 {
-    width: parent.width
-    height: parent.height
+    // parent could be undefined as this component is not visible at all times
+    width: parent ? parent.width : 0
+    height: parent ? parent.height : 0
 
     // We show a nice overlay on the 3D viewer when the current output device has no monitor view
     Rectangle

+ 6 - 4
plugins/PerObjectSettingsTool/PerObjectSettingVisibilityHandler.py

@@ -22,7 +22,9 @@ class PerObjectSettingVisibilityHandler(UM.Settings.Models.SettingVisibilityHand
         self._selected_object_id = None
         self._node = None
         self._stack = None
-        self._skip_setting = None
+
+        # this is a set of settings that will be skipped if the user chooses to reset.
+        self._skip_reset_setting_set = set()
 
     def setSelectedObjectId(self, id):
         if id != self._selected_object_id:
@@ -39,8 +41,8 @@ class PerObjectSettingVisibilityHandler(UM.Settings.Models.SettingVisibilityHand
         return self._selected_object_id
 
     @pyqtSlot(str)
-    def setSkipSetting(self, setting_name):
-        self._skip_setting = setting_name
+    def addSkipResetSetting(self, setting_name):
+        self._skip_reset_setting_set.add(setting_name)
 
     def setVisible(self, visible):
         if not self._node:
@@ -57,7 +59,7 @@ class PerObjectSettingVisibilityHandler(UM.Settings.Models.SettingVisibilityHand
         # Remove all instances that are not in visibility list
         for instance in all_instances:
             # exceptionally skip setting
-            if self._skip_setting is not None and self._skip_setting == instance.definition.key:
+            if instance.definition.key in self._skip_reset_setting_set:
                 continue
             if instance.definition.key not in visible:
                 settings.removeInstance(instance.definition.key)

+ 2 - 2
plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml

@@ -324,8 +324,8 @@ Item {
             // force updating the model to sync it with addedSettingsModel
             if(visible)
             {
-                // Set skip setting, it will prevent from restting selected mesh_type
-                contents.model.visibilityHandler.setSkipSetting(meshTypeSelection.model.get(meshTypeSelection.currentIndex).type)
+                // Set skip setting, it will prevent from resetting selected mesh_type
+                contents.model.visibilityHandler.addSkipResetSetting(meshTypeSelection.model.get(meshTypeSelection.currentIndex).type)
                 listview.model.forceUpdate()
             }
         }

+ 4 - 5
plugins/UM3NetworkPrinting/NetworkClusterPrinterOutputDevice.py

@@ -80,6 +80,8 @@ class NetworkClusterPrinterOutputDevice(NetworkPrinterOutputDevice.NetworkPrinte
         self._print_view = None
         self._request_job = []
 
+        self._job_list = []
+
         self._monitor_view_qml_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "ClusterMonitorItem.qml")
         self._control_view_qml_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "ClusterControlItem.qml")
 
@@ -281,14 +283,11 @@ class NetworkClusterPrinterOutputDevice(NetworkPrinterOutputDevice.NetworkPrinte
     def sendPrintJob(self):
         nodes, file_name, filter_by_machine, file_handler, kwargs = self._request_job
         output_build_plate_number = self._job_list.pop(0)
-        gcode_dict = getattr(Application.getInstance().getController().getScene(), "gcode_dict")[output_build_plate_number]
-        if not gcode_dict:  # Empty build plate
+        gcode_list = getattr(Application.getInstance().getController().getScene(), "gcode_dict")[output_build_plate_number]
+        if not gcode_list:  # Empty build plate
             Logger.log("d", "Skipping empty job (build plate number %d).", output_build_plate_number)
             return self.sendPrintJob()
 
-        active_build_plate_id = Application.getInstance().getBuildPlateModel().activeBuildPlate
-        gcode_list = gcode_dict[active_build_plate_id]
-
         self._send_gcode_start = time.time()
         Logger.log("d", "Sending print job [%s] to host, build plate [%s]..." % (file_name, output_build_plate_number))
 

+ 1 - 1
resources/definitions/fdmprinter.def.json

@@ -3633,7 +3633,7 @@
                     "minimum_value": "0",
                     "maximum_value_warning": "100",
                     "default_value": 15,
-                    "value": "15 if support_enable else 0",
+                    "value": "15 if support_enable else 0 if support_tree_enable else 15",
                     "enabled": "support_enable or support_tree_enable",
                     "limit_to_extruder": "support_infill_extruder_nr",
                     "settable_per_mesh": false,

+ 1 - 0
resources/definitions/m180.def.json → resources/definitions/malyan_m180.def.json

@@ -1,4 +1,5 @@
 {
+    "id": "malyan_m180",
     "version": 2,
     "name": "Malyan M180",
     "inherits": "fdmprinter",

+ 85 - 0
resources/definitions/malyan_m200.def.json

@@ -0,0 +1,85 @@
+{
+    "id": "malyan_m200",
+    "version": 2,
+    "name": "Malyan M200",
+    "inherits": "fdmprinter",
+    "metadata": {
+        "author": "Brian Corbino, Tyler Gibson",
+        "manufacturer": "Malyan",
+        "category": "Other",
+        "file_formats": "text/x-gcode",
+        "platform": "malyan_m200_platform.stl",
+        "has_machine_quality": true,
+        "has_materials": true,
+        "preferred_quality": "*normal*",
+        "supports_usb_connection": true,
+        "visible": true,
+        "first_start_actions": ["MachineSettingsAction"],
+        "supported_actions": ["MachineSettingsAction"]    
+   },
+
+    "overrides": {
+        "machine_name": { "default_value": "Malyan M200" },
+        "speed_print": { "default_value": 50 },
+        "speed_wall_0": { "value": "round(speed_print * 0.75, 2)" },
+        "speed_wall_x": { "value": "speed_print" },
+        "speed_support": { "value": "speed_wall_0" },
+        "speed_layer_0": { "value": "round(speed_print / 2.0, 2)" },
+        "speed_travel": { "default_value": 50 },
+        "speed_travel_layer_0": { "default_value": 40 },
+        "speed_infill": { "value": "speed_print" },
+        "speed_topbottom": {"value": "speed_print / 2"},
+
+        "layer_height": { "minimum_value": "0.04375", "maximum_value": "machine_nozzle_size * 0.875", "maximum_value_warning": "machine_nozzle_size * 0.48125 + 0.0875",  "default_value": 0.13125 },
+        "line_width": { "value": "round(machine_nozzle_size * 0.875, 2)" },
+
+        "material_print_temperature": { "minimum_value": "0" },
+        "material_print_temperature_layer_0": { "value": "min(material_print_temperature + 5, 245)" },
+        "material_bed_temperature": { "minimum_value": "0" },
+        "material_bed_temperature_layer_0": { "value": "min(material_bed_temperature + 5, 70)" },
+        "material_standby_temperature": { "minimum_value": "0" },
+        "machine_show_variants": { "default_value": true },
+        "machine_gcode_flavor": { "default_value": "RepRap (Marlin/Sprinter)" },
+        "machine_start_gcode" : {
+            "default_value": "G21;(metric values)\nG90;(absolute positioning)\nM82;(set extruder to absolute mode)\nM107;(start with the fan off)\nG28;(Home the printer)\nG92 E0;(Reset the extruder to 0)\nG0 Z5 E5 F500;(Move up and prime the nozzle)\nG0 X-1 Z0;(Move outside the printable area)\nG1 Y60 E8 F500;(Draw a priming/wiping line to the rear)\nG1 X-1;(Move a little closer to the print area)\nG1 Y10 E16 F500;(draw more priming/wiping)\nG1 E15 F250;(Small retract)\nG92 E0;(Zero the extruder)"
+        },
+        "machine_end_gcode" : {
+            "default_value": "G0 X0 Y127;(Stick out the part)\nM190 S0;(Turn off heat bed, don't wait.)\nG92 E10;(Set extruder to 10)\nG1 E7 F200;(retract 3mm)\nM104 S0;(Turn off nozzle, don't wait)\nG4 S300;(Delay 5 minutes)\nM107;(Turn off part fan)\nM84;(Turn off stepper motors.)"
+        },
+        "machine_width": { "default_value": 120 },
+        "machine_depth": { "default_value": 120 },
+        "machine_height": { "default_value": 120 },
+        "machine_heated_bed": { "default_value": true },
+        "machine_center_is_zero": { "default_value": false },
+        "material_diameter": { "value": 1.75 },
+        "machine_nozzle_size": {
+            "default_value": 0.4,
+            "minimum_value": 0.15
+        },
+        "machine_max_feedrate_x": { "default_value": 150 },
+        "machine_max_feedrate_y": { "default_value": 150 },
+        "machine_max_feedrate_z": { "default_value": 1.5 },
+        "machine_max_feedrate_e": { "default_value": 100 },
+        "machine_max_acceleration_x": { "default_value": 800 },
+        "machine_max_acceleration_y": { "default_value": 800 },
+        "machine_max_acceleration_z": { "default_value": 20 },
+        "machine_max_acceleration_e": { "default_value": 10000 },
+        "machine_max_jerk_xy": { "default_value": 20 },
+        "machine_max_jerk_z": { "default_value": 0.4 },
+        "machine_max_jerk_e": { "default_value": 5},
+        "adhesion_type": { "default_value": "raft" },
+        "raft_margin": { "default_value": 5 },
+        "raft_airgap": { "default_value": 0.2625 },
+        "raft_base_thickness": { "value": "0.30625" },
+        "raft_interface_thickness": { "value": "0.21875" },
+        "raft_surface_layers": { "default_value": 1 },
+        "skirt_line_count": { "default_value": 2},
+        "brim_width" : { "default_value": 5},
+        "start_layers_at_same_position": { "default_value": true},
+        "retraction_combing": { "default_value": "noskin" },
+        "retraction_amount" : { "default_value": 4.5},
+        "retraction_speed" : { "default_value": 40},
+        "coasting_enable": { "default_value": true },
+        "prime_tower_enable": { "default_value": false}
+    }
+}

+ 18 - 0
resources/definitions/monoprice_select_mini_v1.def.json

@@ -0,0 +1,18 @@
+{
+    "id": "monoprice_select_mini_v1",
+    "version": 2,
+    "name": "Monoprice Select Mini V1",
+    "inherits": "malyan_m200",
+    "metadata": {
+        "author": "Brian Corbino, Tyler Gibson",
+        "manufacturer": "Monoprice",
+        "category": "Other",
+        "file_formats": "text/x-gcode",
+        "quality_definition": "malyan_m200",
+        "visible": true
+   },
+
+    "overrides": {
+        "machine_name": { "default_value": "Monoprice Select Mini V1" }
+    }
+}

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