chiark / gitweb /
Move nozzle_size back to machine config. Rename machine config tab to advanced config...
authordaid <daid303@gmail.com>
Mon, 26 Mar 2012 11:45:31 +0000 (13:45 +0200)
committerdaid <daid303@gmail.com>
Mon, 26 Mar 2012 11:45:31 +0000 (13:45 +0200)
Cura/fabmetheus_utilities/settings.py
Cura/newui/advancedConfig.py
Cura/newui/configWizard.py
Cura/newui/mainWindow.py
Cura/newui/preferencesDialog.py
Cura/newui/preview3d.py
Cura/newui/profile.py
Cura/newui/validators.py

index 351c3cce8548aa5ec56e1e977ce6c2cd78e42654..75556f9636a970130e1e1dc27b703665600d5362 100644 (file)
@@ -37,7 +37,7 @@ def storedPercentSetting(name):
 
 def calculateEdgeWidth(setting):
        wallThickness = float(profile.getProfileSetting('wall_thickness'))
-       nozzleSize = float(profile.getPreference('nozzle_size'))
+       nozzleSize = float(profile.getProfileSetting('nozzle_size'))
        
        if wallThickness < nozzleSize:
                return wallThickness
@@ -56,7 +56,7 @@ def calculateShellsBase(setting):
        return calculateShellsImp(float(profile.getProfileSetting('wall_thickness')) + float(profile.getProfileSetting('extra_base_wall_thickness')))
 
 def calculateShellsImp(wallThickness):
-       nozzleSize = float(profile.getPreference('nozzle_size'))
+       nozzleSize = float(profile.getProfileSetting('nozzle_size'))
        
        if wallThickness < nozzleSize:
                return 0
@@ -129,7 +129,7 @@ def getProfileInformation():
                },'inset': {
                        'Add_Custom_Code_for_Temperature_Reading': DEFSET,
                        'Infill_in_Direction_of_Bridge': "True",
-                       'Infill_Width': storedPreference("nozzle_size"),
+                       'Infill_Width': getProfileSetting("nozzle_size"),
                        'Loop_Order_Choice': DEFSET,
                        'Overlap_Removal_Width_over_Perimeter_Width_ratio': DEFSET,
                        'Turn_Extruder_Heater_Off_at_Shut_Down': DEFSET,
@@ -157,7 +157,7 @@ def getProfileInformation():
                        'Line': ifSettingIs('infill_type', 'Line'),
                        'Infill_Perimeter_Overlap_ratio': storedPercentSetting('fill_overlap'),
                        'Infill_Solidity_ratio': storedPercentSetting('fill_density'),
-                       'Infill_Width': storedPreference("nozzle_size"),
+                       'Infill_Width': getProfileSetting("nozzle_size"),
                        'Sharpest_Angle_degrees': DEFSET,
                        'Solid_Surface_Thickness_layers': calculateSolidLayerCount,
                        'Start_From_Choice': DEFSET,
index 2febe8bc7bb92f9103248c97fda07540a94d28ce..97852fe1bf1da92864a83e30728dfdc1b37a0111 100644 (file)
@@ -13,7 +13,7 @@ from newui import validators
 class advancedConfigWindow(configBase.configWindowBase):
        "Advanced configuration window"
        def __init__(self):
-               super(advancedConfigWindow, self).__init__(title='Advanced config')
+               super(advancedConfigWindow, self).__init__(title='Expert config')
 
                wx.EVT_CLOSE(self, self.OnClose)
 
@@ -22,6 +22,7 @@ class advancedConfigWindow(configBase.configWindowBase):
                configBase.TitleRow(left, "Accuracy")
                c = configBase.SettingRow(left, "Extra Wall thickness for bottom/top (mm)", 'extra_base_wall_thickness', '0.0', 'Additional wall thickness of the bottom and top layers.')
                validators.validFloat(c, 0.0)
+               
                configBase.TitleRow(left, "Sequence")
                c = configBase.SettingRow(left, "Print order sequence", 'sequence', ['Loops > Perimeter > Infill', 'Loops > Infill > Perimeter', 'Infill > Loops > Perimeter', 'Infill > Perimeter > Loops', 'Perimeter > Infill > Loops', 'Perimeter > Loops > Infill'], 'Sequence of printing. The perimeter is the outer print edge, the loops are the insides of the walls, and the infill is the insides.');
                c = configBase.SettingRow(left, "Force first layer sequence", 'force_first_layer_sequence', True, 'This setting forces the order of the first layer to be \'Perimeter > Loops > Infill\'')
index 4450195bb2325bf1be51931e82827352741ba49c..97b3f5b09f52c59ae13c7f8639e792d529420a67 100644 (file)
@@ -97,17 +97,17 @@ class MachineSelectPage(InfoPage):
                        profile.putPreference('machine_width', '205')\r
                        profile.putPreference('machine_depth', '205')\r
                        profile.putPreference('machine_height', '200')\r
-                       profile.putPreference('nozzle_size', '0.4')\r
+                       profile.putProfileSetting('nozzle_size', '0.4')\r
                        profile.putProfileSetting('machine_center_x', '100')\r
                        profile.putProfileSetting('machine_center_y', '100')\r
                else:\r
                        profile.putPreference('machine_width', '80')\r
                        profile.putPreference('machine_depth', '80')\r
                        profile.putPreference('machine_height', '60')\r
-                       profile.putPreference('nozzle_size', '0.5')\r
+                       profile.putProfileSetting('nozzle_size', '0.5')\r
                        profile.putProfileSetting('machine_center_x', '40')\r
                        profile.putProfileSetting('machine_center_y', '40')\r
-               profile.putProfileSetting('wall_thickness', float(profile.getPreference('nozzle_size')) * 2)\r
+               profile.putProfileSetting('wall_thickness', float(profile.getProfileSetting('nozzle_size')) * 2)\r
 \r
 class FirmwareUpgradePage(InfoPage):\r
        def __init__(self, parent):\r
index e1b1f8c1e86bf466f98da4e1f5918c63ca0f3e20..aecb1c5af7c585a3f25aaaef42079891b64f5553 100644 (file)
@@ -85,7 +85,7 @@ class mainWindow(configBase.configWindowBase):
                configBase.TitleRow(left, "Accuracy")
                c = configBase.SettingRow(left, "Layer height (mm)", 'layer_height', '0.2', 'Layer height in millimeters.\n0.2 is a good value for quick prints.\n0.1 gives high quality prints.')
                validators.validFloat(c, 0.0)
-               validators.warningAbove(c, lambda : (float(profile.getPreference('nozzle_size')) * 80 / 100), "Thicker layers then %.2fmm (80%% nozzle size) usually give bad results and are not recommended.")
+               validators.warningAbove(c, lambda : (float(profile.getProfileSetting('nozzle_size')) * 80 / 100), "Thicker layers then %.2fmm (80%% nozzle size) usually give bad results and are not recommended.")
                c = configBase.SettingRow(left, "Wall thickness (mm)", 'wall_thickness', '0.8', 'Thickness of the walls.\nThis is used in combination with the nozzle size to define the number\nof perimeter lines and the thickness of those perimeter lines.')
                validators.validFloat(c, 0.0)
                validators.wallThicknessValidator(c)
@@ -124,9 +124,11 @@ class mainWindow(configBase.configWindowBase):
                c = configBase.SettingRow(right, "Packing Density", 'filament_density', '1.00', 'Packing density of your filament. This should be 1.00 for PLA and 0.85 for ABS')
                validators.validFloat(c, 0.5, 1.5)
                
-               (left, right) = self.CreateConfigTab(nb, 'Machine config')
+               (left, right) = self.CreateConfigTab(nb, 'Advanced config')
                
                configBase.TitleRow(left, "Machine size")
+               c = configBase.SettingRow(left, "Nozzle size (mm)", 'nozzle_size', '0.4', 'The nozzle size is very important, this is used to calculate the line width of the infill, and used to calculate the amount of outside wall lines and thickness for the wall thickness you entered in the print settings.')
+               validators.validFloat(c, 0.1, 1.0)
                c = configBase.SettingRow(left, "Machine center X (mm)", 'machine_center_x', '100', 'The center of your machine, your print will be placed at this location')
                validators.validInt(c, 10)
                configBase.settingNotify(c, self.preview3d.updateCenterX)
index 539a69a7a9bd924206e2c0b54061e605535c6a27..493807be14ec78545e04fc78bb8607156df686f4 100644 (file)
@@ -16,8 +16,6 @@ class preferencesDialog(configBase.configWindowBase):
                \r
                left, right, main = self.CreateConfigPanel(self)\r
                configBase.TitleRow(left, 'Machine settings')\r
-               c = configBase.SettingRow(left, "Nozzle size (mm)", 'nozzle_size', '0.4', 'The nozzle size is very important, this is used to calculate the line width of the infill, and used to calculate the amount of outside wall lines and thickness for the wall thickness you entered in the print settings.', type = 'preference')\r
-               validators.validFloat(c, 0.1, 1.0)\r
                c = configBase.SettingRow(left, 'Steps per E', 'steps_per_e', '0', 'Amount of steps per mm filament extrusion', type = 'preference')\r
                validators.validFloat(c, 0.1)\r
                c = configBase.SettingRow(left, 'Machine width (mm)', 'machine_width', '205', 'Size of the machine in mm', type = 'preference')\r
index 722c2821d1587bf300bdd29b29f5a5b7c59f20da..679f05b4a5f814f03de2c23e1921484c6a0ff7eb 100644 (file)
@@ -440,7 +440,7 @@ class PreviewGLCanvas(glcanvas.GLCanvas):
                                layerThickness = 0.0\r
                                filamentRadius = float(profile.getProfileSetting('filament_diameter')) / 2\r
                                filamentArea = math.pi * filamentRadius * filamentRadius\r
-                               lineWidth = float(profile.getPreference('nozzle_size')) / 2\r
+                               lineWidth = float(profile.getProfileSetting('nozzle_size')) / 2\r
                                \r
                                curLayerNum = 0\r
                                for path in self.parent.gcode.pathList:\r
index 5a3e40363e3fc04d987cba780da2773c2d7522e8..481932db62dfb18b6438a8cb8087e529efb0848a 100644 (file)
@@ -8,6 +8,7 @@ import traceback
 \r
 #Single place to store the defaults, so we have a consistent set of default settings.\r
 profileDefaultSettings = {\r
+       'nozzle_size': '0.4',\r
        'layer_height': '0.2',\r
        'wall_thickness': '0.8',\r
        'solid_layer_thickness': '0.6',\r
@@ -59,7 +60,6 @@ preferencesDefaultSettings = {
        'machine_width': '205',\r
        'machine_depth': '205',\r
        'machine_height': '200',\r
-       'nozzle_size': '0.4',\r
        'steps_per_e': '0',\r
        'serial_port': 'AUTO',\r
        'serial_baud': '250000',\r
index 79a3d318aec573d6b9a010e57353bf77a8f4cd37..6352debd94ff7d88289523dcbb7908fe0b65c8f9 100644 (file)
@@ -75,7 +75,7 @@ class wallThicknessValidator():
        def validate(self):
                try:
                        wallThickness = float(self.setting.GetValue())
-                       nozzleSize = float(profile.getPreference('nozzle_size'))
+                       nozzleSize = float(profile.getProfileSetting('nozzle_size'))
                        if wallThickness <= nozzleSize * 0.5:
                                return ERROR, 'Trying to print walls thinner then the half of your nozzle size, this will not produce anything usable'
                        if wallThickness <= nozzleSize * 0.85:
@@ -100,7 +100,7 @@ class printSpeedValidator():
 
        def validate(self):
                try:
-                       nozzleSize = float(profile.getPreference('nozzle_size'))
+                       nozzleSize = float(profile.getProfileSetting('nozzle_size'))
                        layerHeight = float(profile.getProfileSetting('layer_height'))
                        printSpeed = float(profile.getProfileSetting('print_speed'))