chiark / gitweb /
Merge branch 'SteamEngine' of github.com:daid/Cura into SteamEngine
[cura.git] / Cura / util / profile.py
index 5249237f8c1dd67d64ade35d76990a8df57e797d..9a3d20455f7a98b2dcfbdafb2cba5d52960c65c1 100644 (file)
@@ -13,9 +13,22 @@ from Cura.util import resources
 from Cura.util import version
 from Cura.util import validators
 
+#The settings dictionary contains a key/value reference to all possible settings. With the setting name as key.
 settingsDictionary = {}
+#The settings list is used to keep a full list of all the settings. This is needed to keep the settings in the proper order,
+# as the dictionary will not contain insertion order.
 settingsList = []
+
 class setting(object):
+       #A setting object contains a configuration setting. These are globally accessible trough the quick access functions
+       # and trough the settingsDictionary function.
+       # Settings can be:
+       # * profile settings (settings that effect the slicing process and the print result)
+       # * preferences (settings that effect how cura works and acts)
+       # * machine settings (settings that relate to the physical configuration of your machine)
+       # * alterations (bad name copied from Skeinforge. These are the start/end code pieces)
+       # Settings have validators that check if the value is valid, but do not prevent invalid values!
+       # Settings have conditions that enable/disable this setting depending on other settings. (Ex: Dual-extrusion)
        def __init__(self, name, default, type, category, subcategory):
                self._name = name
                self._label = name
@@ -43,7 +56,7 @@ class setting(object):
                self._tooltip = tooltip
                return self
 
-       def setRange(self, minValue = None, maxValue = None):
+       def setRange(self, minValue=None, maxValue=None):
                if len(self._validators) < 1:
                        return
                self._validators[0].minValue = minValue
@@ -307,6 +320,7 @@ setting('check_for_updates', 'True', bool, 'preference', 'hidden').setLabel('Che
 setting('submit_slice_information', 'False', bool, 'preference', 'hidden').setLabel('Send usage statistics', 'Submit anonymous usage information to improve next versions of Cura')
 setting('youmagine_token', '', str, 'preference', 'hidden')
 setting('filament_physical_density', '1240', float, 'preference', 'hidden').setRange(500.0, 3000.0).setLabel('Density (kg/m3)', 'Weight of the filament per m3. Around 1240 for PLA. And around 1040 for ABS. This value is used to estimate the weight if the filament used for the print.')
+setting('active_machine', '', str, 'preference', 'hidden')
 
 setting('model_colour', '#FFC924', str, 'preference', 'hidden').setLabel('Model colour')
 setting('model_colour2', '#CB3030', str, 'preference', 'hidden').setLabel('Model colour (2)')
@@ -320,10 +334,11 @@ setting('window_width', '-1', float, 'preference', 'hidden')
 setting('window_height', '-1', float, 'preference', 'hidden')
 setting('window_normal_sash', '320', float, 'preference', 'hidden')
 
+setting('machine_name', 'unknown', str, 'machine', 'hidden')
+setting('machine_type', 'unknown', str, 'machine', 'hidden') #Ultimaker, Ultimaker2, RepRap
 setting('machine_width', '205', float, 'machine', 'hidden').setLabel('Maximum width (mm)', 'Size of the machine in mm')
 setting('machine_depth', '205', float, 'machine', 'hidden').setLabel('Maximum depth (mm)', 'Size of the machine in mm')
 setting('machine_height', '200', float, 'machine', 'hidden').setLabel('Maximum height (mm)', 'Size of the machine in mm')
-setting('machine_type', 'unknown', str, 'machine', 'hidden')
 setting('machine_center_is_zero', 'False', bool, 'machine', 'hidden')
 setting('ultimaker_extruder_upgrade', 'False', bool, 'machine', 'hidden')
 setting('has_heated_bed', 'False', bool, 'machine', 'hidden').setLabel('Heated bed', 'If you have an heated bed, this enabled heated bed settings (requires restart)')