Skip to content

Commit

Permalink
Make setting dicts actual definition files
Browse files Browse the repository at this point in the history
Definition files need to encapsulate settings in a "settings" lemma
  • Loading branch information
fieldOfView committed Mar 5, 2023
1 parent 674aff1 commit bc9dcf7
Show file tree
Hide file tree
Showing 3 changed files with 321 additions and 315 deletions.
2 changes: 1 addition & 1 deletion LinearAdvanceSettingPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(self) -> None:
settings_definition_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "linear_advance47.def.json")
try:
with open(settings_definition_path, "r", encoding = "utf-8") as f:
self._settings_dict = json.load(f, object_pairs_hook = collections.OrderedDict)
self._settings_dict = json.load(f, object_pairs_hook = collections.OrderedDict)["settings"]
except:
Logger.logException("e", "Could not load linear advance settings definition")
return
Expand Down
317 changes: 160 additions & 157 deletions linear_advance35.def.json
Original file line number Diff line number Diff line change
@@ -1,164 +1,167 @@
{
"material_linear_advance_enable":
"settings":
{
"label": "Enable Linear Advance",
"description": "Enables adjusting the linear advance factors in the g-code.",
"type": "bool",
"default_value": false,
"settable_per_mesh": false,
"settable_per_extruder": false,
"settable_per_meshgroup": false
},
"material_linear_advance_factor": {
"label": "Linear Advance Factor",
"description": "Sets the advance extrusion factor for Linear Advance. A value of '0' means no linear advance compensation is applied.",
"type": "float",
"default_value": 0,
"minimum_value": "0",
"maximum_value_warning": "10.0",
"settable_per_mesh": false,
"settable_per_extruder": true,
"settable_per_meshgroup": false,
"enabled": "resolveOrValue('material_linear_advance_enable')",
"children": {
"material_linear_advance_factor_infill": {
"label": "Infill Linear Advance Factor",
"description": "The Linear Advance Factor used when printing infill. A value of '0' means no linear advance compensation is applied for this feature.",
"type": "float",
"default_value": 0,
"minimum_value": "0",
"maximum_value_warning": "10.0",
"settable_per_mesh": false,
"settable_per_extruder": true,
"settable_per_meshgroup": false,
"value": "material_linear_advance_factor",
"enabled": "resolveOrValue('material_linear_advance_enable') and infill_sparse_density > 0",
"limit_to_extruder": "infill_extruder_nr"
},
"material_linear_advance_factor_wall": {
"label": "Wall Linear Advance Factor",
"description": "The Linear Advance Factor used when printing walls. A value of '0' means no linear advance compensation is applied for this feature.",
"type": "float",
"default_value": 0,
"minimum_value": "0",
"maximum_value_warning": "10.0",
"settable_per_mesh": false,
"settable_per_extruder": true,
"settable_per_meshgroup": false,
"value": "material_linear_advance_factor",
"enabled": "resolveOrValue('material_linear_advance_enable')",
"children": {
"material_linear_advance_factor_wall_0": {
"label": "Outer Wall Linear Advance Factor",
"description": "The Linear Advance Factor used when printing the outermost wall. A value of '0' means no linear advance compensation is applied for this feature.",
"type": "float",
"default_value": 0,
"minimum_value": "0",
"maximum_value_warning": "10.0",
"settable_per_mesh": false,
"settable_per_extruder": true,
"settable_per_meshgroup": false,
"value": "material_linear_advance_factor_wall",
"enabled": "resolveOrValue('material_linear_advance_enable')",
"limit_to_extruder": "wall_0_extruder_nr"
},
"material_linear_advance_factor_wall_x": {
"label": "Inner Wall Linear Advance Factor",
"description": "The Linear Advance Factor used when printing all inner walls. A value of '0' means no linear advance compensation is applied for this feature.",
"type": "float",
"default_value": 0,
"minimum_value": "0",
"maximum_value_warning": "10.0",
"settable_per_mesh": false,
"settable_per_extruder": true,
"settable_per_meshgroup": false,
"value": "material_linear_advance_factor_wall",
"enabled": "resolveOrValue('material_linear_advance_enable')",
"limit_to_extruder": "wall_x_extruder_nr"
"material_linear_advance_enable":
{
"label": "Enable Linear Advance",
"description": "Enables adjusting the linear advance factors in the g-code.",
"type": "bool",
"default_value": false,
"settable_per_mesh": false,
"settable_per_extruder": false,
"settable_per_meshgroup": false
},
"material_linear_advance_factor": {
"label": "Linear Advance Factor",
"description": "Sets the advance extrusion factor for Linear Advance. A value of '0' means no linear advance compensation is applied.",
"type": "float",
"default_value": 0,
"minimum_value": "0",
"maximum_value_warning": "10.0",
"settable_per_mesh": false,
"settable_per_extruder": true,
"settable_per_meshgroup": false,
"enabled": "resolveOrValue('material_linear_advance_enable')",
"children": {
"material_linear_advance_factor_infill": {
"label": "Infill Linear Advance Factor",
"description": "The Linear Advance Factor used when printing infill. A value of '0' means no linear advance compensation is applied for this feature.",
"type": "float",
"default_value": 0,
"minimum_value": "0",
"maximum_value_warning": "10.0",
"settable_per_mesh": false,
"settable_per_extruder": true,
"settable_per_meshgroup": false,
"value": "material_linear_advance_factor",
"enabled": "resolveOrValue('material_linear_advance_enable') and infill_sparse_density > 0",
"limit_to_extruder": "infill_extruder_nr"
},
"material_linear_advance_factor_wall": {
"label": "Wall Linear Advance Factor",
"description": "The Linear Advance Factor used when printing walls. A value of '0' means no linear advance compensation is applied for this feature.",
"type": "float",
"default_value": 0,
"minimum_value": "0",
"maximum_value_warning": "10.0",
"settable_per_mesh": false,
"settable_per_extruder": true,
"settable_per_meshgroup": false,
"value": "material_linear_advance_factor",
"enabled": "resolveOrValue('material_linear_advance_enable')",
"children": {
"material_linear_advance_factor_wall_0": {
"label": "Outer Wall Linear Advance Factor",
"description": "The Linear Advance Factor used when printing the outermost wall. A value of '0' means no linear advance compensation is applied for this feature.",
"type": "float",
"default_value": 0,
"minimum_value": "0",
"maximum_value_warning": "10.0",
"settable_per_mesh": false,
"settable_per_extruder": true,
"settable_per_meshgroup": false,
"value": "material_linear_advance_factor_wall",
"enabled": "resolveOrValue('material_linear_advance_enable')",
"limit_to_extruder": "wall_0_extruder_nr"
},
"material_linear_advance_factor_wall_x": {
"label": "Inner Wall Linear Advance Factor",
"description": "The Linear Advance Factor used when printing all inner walls. A value of '0' means no linear advance compensation is applied for this feature.",
"type": "float",
"default_value": 0,
"minimum_value": "0",
"maximum_value_warning": "10.0",
"settable_per_mesh": false,
"settable_per_extruder": true,
"settable_per_meshgroup": false,
"value": "material_linear_advance_factor_wall",
"enabled": "resolveOrValue('material_linear_advance_enable')",
"limit_to_extruder": "wall_x_extruder_nr"
}
}
},
"material_linear_advance_factor_topbottom": {
"label": "Top/Bottom Skin Linear Advance Factor",
"description": "The Linear Advance Factor used when printing top/bottom skin layers. A value of '0' means no linear advance compensation is applied for this feature.",
"type": "float",
"default_value": 0,
"minimum_value": "0",
"maximum_value_warning": "10.0",
"settable_per_mesh": false,
"settable_per_extruder": true,
"settable_per_meshgroup": false,
"value": "material_linear_advance_factor",
"enabled": "resolveOrValue('material_linear_advance_enable')",
"limit_to_extruder": "top_bottom_extruder_nr"
},
"material_linear_advance_factor_support": {
"label": "Support Linear Advance Factor",
"description": "The Linear Advance Factor used when printing support structures. A value of '0' means no linear advance compensation is applied for this feature.",
"type": "float",
"default_value": 0,
"minimum_value": "0",
"maximum_value_warning": "10.0",
"settable_per_mesh": false,
"settable_per_extruder": true,
"settable_per_meshgroup": false,
"value": "material_linear_advance_factor",
"enabled": "resolveOrValue('material_linear_advance_enable') and (support_enable or support_tree_enable)",
"limit_to_extruder": "support_extruder_nr"
},
"material_linear_advance_factor_support_interface": {
"label": "Support Interface Linear Advance Factor",
"description": "The Linear Advance Factor used when printing support interfaces. A value of '0' means no linear advance compensation is applied for this feature.",
"type": "float",
"default_value": 0,
"minimum_value": "0",
"maximum_value_warning": "10.0",
"settable_per_mesh": false,
"settable_per_extruder": true,
"settable_per_meshgroup": false,
"value": "material_linear_advance_factor_support",
"enabled": "resolveOrValue('material_linear_advance_enable') and support_interface_enable and (support_enable or support_tree_enable)",
"limit_to_extruder": "support_interface_extruder_nr"
},
"material_linear_advance_factor_prime_tower": {
"label": "Prime Tower Linear Advance Factor",
"description": "The Linear Advance Factor used when printing the prime tower. A value of '0' means no linear advance compensation is applied for this feature.",
"type": "float",
"default_value": 0,
"minimum_value": "0",
"maximum_value_warning": "10.0",
"settable_per_mesh": false,
"settable_per_extruder": true,
"settable_per_meshgroup": false,
"value": "material_linear_advance_factor",
"enabled": "resolveOrValue('material_linear_advance_enable') and resolveOrValue('prime_tower_enable')"
},
"material_linear_advance_factor_skirt_brim": {
"label": "Skirt/Brim Linear Advance Factor",
"description": "The Linear Advance Factor used when printing adhesion skirts or brims. A value of '0' means no linear advance compensation is applied for this feature.",
"type": "float",
"default_value": 0,
"minimum_value": "0",
"maximum_value_warning": "10.0",
"settable_per_mesh": false,
"settable_per_extruder": true,
"settable_per_meshgroup": false,
"value": "material_linear_advance_factor",
"enabled": "resolveOrValue('material_linear_advance_enable') and (resolveOrValue('adhesion_type') == 'skirt' or resolveOrValue('adhesion_type') == 'brim' or resolveOrValue('draft_shield_enabled') or resolveOrValue('ooze_shield_enabled'))",
"limit_to_extruder": "adhesion_extruder_nr"
},
"material_linear_advance_factor_layer_0": {
"label": "Initial Layer Linear Advance Factor",
"description": "The Linear Advance Factor used when printing the first layer. A value of '0' means no linear advance compensation is applied for this feature.",
"type": "float",
"default_value": 0,
"minimum_value": "0",
"maximum_value_warning": "10.0",
"settable_per_mesh": false,
"settable_per_extruder": true,
"settable_per_meshgroup": false,
"enabled": "resolveOrValue('material_linear_advance_enable')",
"value": "material_linear_advance_factor"
}
},
"material_linear_advance_factor_topbottom": {
"label": "Top/Bottom Skin Linear Advance Factor",
"description": "The Linear Advance Factor used when printing top/bottom skin layers. A value of '0' means no linear advance compensation is applied for this feature.",
"type": "float",
"default_value": 0,
"minimum_value": "0",
"maximum_value_warning": "10.0",
"settable_per_mesh": false,
"settable_per_extruder": true,
"settable_per_meshgroup": false,
"value": "material_linear_advance_factor",
"enabled": "resolveOrValue('material_linear_advance_enable')",
"limit_to_extruder": "top_bottom_extruder_nr"
},
"material_linear_advance_factor_support": {
"label": "Support Linear Advance Factor",
"description": "The Linear Advance Factor used when printing support structures. A value of '0' means no linear advance compensation is applied for this feature.",
"type": "float",
"default_value": 0,
"minimum_value": "0",
"maximum_value_warning": "10.0",
"settable_per_mesh": false,
"settable_per_extruder": true,
"settable_per_meshgroup": false,
"value": "material_linear_advance_factor",
"enabled": "resolveOrValue('material_linear_advance_enable') and (support_enable or support_tree_enable)",
"limit_to_extruder": "support_extruder_nr"
},
"material_linear_advance_factor_support_interface": {
"label": "Support Interface Linear Advance Factor",
"description": "The Linear Advance Factor used when printing support interfaces. A value of '0' means no linear advance compensation is applied for this feature.",
"type": "float",
"default_value": 0,
"minimum_value": "0",
"maximum_value_warning": "10.0",
"settable_per_mesh": false,
"settable_per_extruder": true,
"settable_per_meshgroup": false,
"value": "material_linear_advance_factor_support",
"enabled": "resolveOrValue('material_linear_advance_enable') and support_interface_enable and (support_enable or support_tree_enable)",
"limit_to_extruder": "support_interface_extruder_nr"
},
"material_linear_advance_factor_prime_tower": {
"label": "Prime Tower Linear Advance Factor",
"description": "The Linear Advance Factor used when printing the prime tower. A value of '0' means no linear advance compensation is applied for this feature.",
"type": "float",
"default_value": 0,
"minimum_value": "0",
"maximum_value_warning": "10.0",
"settable_per_mesh": false,
"settable_per_extruder": true,
"settable_per_meshgroup": false,
"value": "material_linear_advance_factor",
"enabled": "resolveOrValue('material_linear_advance_enable') and resolveOrValue('prime_tower_enable')"
},
"material_linear_advance_factor_skirt_brim": {
"label": "Skirt/Brim Linear Advance Factor",
"description": "The Linear Advance Factor used when printing adhesion skirts or brims. A value of '0' means no linear advance compensation is applied for this feature.",
"type": "float",
"default_value": 0,
"minimum_value": "0",
"maximum_value_warning": "10.0",
"settable_per_mesh": false,
"settable_per_extruder": true,
"settable_per_meshgroup": false,
"value": "material_linear_advance_factor",
"enabled": "resolveOrValue('material_linear_advance_enable') and (resolveOrValue('adhesion_type') == 'skirt' or resolveOrValue('adhesion_type') == 'brim' or resolveOrValue('draft_shield_enabled') or resolveOrValue('ooze_shield_enabled'))",
"limit_to_extruder": "adhesion_extruder_nr"
},
"material_linear_advance_factor_layer_0": {
"label": "Initial Layer Linear Advance Factor",
"description": "The Linear Advance Factor used when printing the first layer. A value of '0' means no linear advance compensation is applied for this feature.",
"type": "float",
"default_value": 0,
"minimum_value": "0",
"maximum_value_warning": "10.0",
"settable_per_mesh": false,
"settable_per_extruder": true,
"settable_per_meshgroup": false,
"enabled": "resolveOrValue('material_linear_advance_enable')",
"value": "material_linear_advance_factor"
}
}
}
Expand Down
Loading

0 comments on commit bc9dcf7

Please sign in to comment.