chiark / gitweb /
Moved "nozzle size" to preferences, as it is not something that really belongs are...
authordaid <daid303@gmail.com>
Tue, 20 Mar 2012 15:09:25 +0000 (16:09 +0100)
committerdaid <daid303@gmail.com>
Tue, 20 Mar 2012 15:09:25 +0000 (16:09 +0100)
SkeinPyPy/fabmetheus_utilities/settings.py
SkeinPyPy/newui/configWizard.py
SkeinPyPy/newui/mainWindow.py
SkeinPyPy/newui/preferencesDialog.py
SkeinPyPy/newui/preview3d.py
SkeinPyPy/newui/profile.py
SkeinPyPy/newui/validators.py

index 7678b599c42d5274f0db1af88769d5b72f0a1691..ce6f48be23865b6e8df9de836423361eca73e4a4 100644 (file)
@@ -18,6 +18,8 @@ def DEFSET(setting):
 
 def storedSetting(name):
        return lambda setting: profile.getProfileSetting(name)
+def storedPreference(name):
+       return lambda setting: profile.getPreference(name)
 
 def ifSettingAboveZero(name):
        return lambda setting: float(profile.getProfileSetting(name)) > 0
@@ -35,7 +37,7 @@ def storedPercentSetting(name):
 
 def calculateEdgeWidth(setting):
        wallThickness = float(profile.getProfileSetting('wall_thickness'))
-       nozzleSize = float(profile.getProfileSetting('nozzle_size'))
+       nozzleSize = float(profile.getPreference('nozzle_size'))
        
        if wallThickness < nozzleSize:
                return wallThickness
@@ -54,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.getProfileSetting('nozzle_size'))
+       nozzleSize = float(profile.getPreference('nozzle_size'))
        
        if wallThickness < nozzleSize:
                return 0
@@ -150,7 +152,7 @@ def getSkeinPyPyProfileInformation():
                        'Line': ifSettingIs('infill_type', 'Line'),
                        'Infill_Perimeter_Overlap_ratio': storedPercentSetting('fill_overlap'),
                        'Infill_Solidity_ratio': storedPercentSetting('fill_density'),
-                       'Infill_Width': storedSetting("nozzle_size"),
+                       'Infill_Width': storedPreference("nozzle_size"),
                        'Solid_Surface_Thickness_layers': calculateSolidLayerCount,
                        'Start_From_Choice': DEFSET,
                        'Surrounding_Angle_degrees': DEFSET,
index 1b6f2f60422bee71a0d57be2eebd3a5a770c1133..70701586cfe0e16ffd21251a0e023de762e29b03 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.putProfileSetting('nozzle_size', '0.4')\r
+                       profile.putPreference('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.putProfileSetting('nozzle_size', '0.5')\r
+                       profile.putPreference('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.getProfileSetting('nozzle_size')) * 2)\r
+               profile.putProfileSetting('wall_thickness', float(profile.getPreference('nozzle_size')) * 2)\r
 \r
 class FirmwareUpgradePage(InfoPage):\r
        def __init__(self, parent):\r
index 65ca69ba5c94388d9d6f1c8f58fc7d2d2555b282..fc7e4c881a14da28c2d2f6917abc70aaadd67cba 100644 (file)
@@ -84,7 +84,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.getProfileSetting('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.getPreference('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)
@@ -133,10 +133,6 @@ class mainWindow(configBase.configWindowBase):
                validators.validInt(c, 10)
                configBase.settingNotify(c, self.preview3d.updateCenterY)
 
-               configBase.TitleRow(left, "Machine nozzle")
-               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)
-
                configBase.TitleRow(left, "Retraction")
                c = configBase.SettingRow(left, "Minimal travel (mm)", 'retraction_min_travel', '5.0', 'Minimal amount of travel needed for a retraction to happen at all. To make sure you do not get a lot of retractions in a small area')
                validators.validFloat(c, 0.0)
index 11369d31b974277629844e6bc4a5580267f4f6a6..539a69a7a9bd924206e2c0b54061e605535c6a27 100644 (file)
@@ -16,13 +16,15 @@ 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', 'machine_width', '205', 'Size of the machine in mm', type = 'preference')\r
+               c = configBase.SettingRow(left, 'Machine width (mm)', 'machine_width', '205', 'Size of the machine in mm', type = 'preference')\r
                validators.validFloat(c, 10.0)\r
-               c = configBase.SettingRow(left, 'Machine depth', 'machine_depth', '205', 'Size of the machine in mm', type = 'preference')\r
+               c = configBase.SettingRow(left, 'Machine depth (mm)', 'machine_depth', '205', 'Size of the machine in mm', type = 'preference')\r
                validators.validFloat(c, 10.0)\r
-               c = configBase.SettingRow(left, 'Machine height', 'machine_height', '200', 'Size of the machine in mm', type = 'preference')\r
+               c = configBase.SettingRow(left, 'Machine height (mm)', 'machine_height', '200', 'Size of the machine in mm', type = 'preference')\r
                validators.validFloat(c, 10.0)\r
 \r
                configBase.TitleRow(left, 'Communication settings')\r
index 040579a72e2a1b4126bf436fd3ba380fa355ca3b..483af4dd87af67b1fb8e871ceb74940c34edd107 100644 (file)
@@ -331,7 +331,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.getProfileSetting('nozzle_size')) / 2\r
+                               lineWidth = float(profile.getPreference('nozzle_size')) / 2\r
                                \r
                                curLayerNum = 0\r
                                for path in self.parent.gcode.pathList:\r
index ec415b761b62aa26340ea7aa373600e1b1c125fe..3c1ec2acdcce7986188e697f1c8dfd202ab30217 100644 (file)
@@ -21,7 +21,6 @@ profileDefaultSettings = {
        'filament_density': '1.00',\r
        'machine_center_x': '100',\r
        'machine_center_y': '100',\r
-       'nozzle_size': '0.4',\r
        'retraction_min_travel': '5.0',\r
        'retraction_speed': '13.5',\r
        'retraction_amount': '0.0',\r
@@ -60,6 +59,7 @@ 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 6352debd94ff7d88289523dcbb7908fe0b65c8f9..79a3d318aec573d6b9a010e57353bf77a8f4cd37 100644 (file)
@@ -75,7 +75,7 @@ class wallThicknessValidator():
        def validate(self):
                try:
                        wallThickness = float(self.setting.GetValue())
-                       nozzleSize = float(profile.getProfileSetting('nozzle_size'))
+                       nozzleSize = float(profile.getPreference('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.getProfileSetting('nozzle_size'))
+                       nozzleSize = float(profile.getPreference('nozzle_size'))
                        layerHeight = float(profile.getProfileSetting('layer_height'))
                        printSpeed = float(profile.getProfileSetting('print_speed'))