OrcaSlicer/doc/developer-reference/Preset-and-bundle.md
Ian Bassi 4e59b0abc6
Wiki + Readme: MD security and improvements (#9807)
* Wiki + Readme: MD, security and improvements

Standardized MD GitHub Wiki format
Removed outdated and malicious links
Modularized calibrations
Suggested calibration order added
Minor bug fixes
Image improvements and corrections
Added winget commands
Completed previous WIPs
Added new WIPs
Removed obsolete references
Visual Changes

Co-Authored-By: Noisyfox <timemanager.rick@gmail.com>
Co-Authored-By: dewi-ny-je <2866139+dewi-ny-je@users.noreply.github.com>
Co-Authored-By: Nico Domino <7415984+ndom91@users.noreply.github.com>
Co-Authored-By: Martin Ulmschneider <7497782+mulmschneider@users.noreply.github.com>
Co-Authored-By: Rodrigo <162915171+RF47@users.noreply.github.com>

* MD Indentation + images update

---------

Co-authored-by: Noisyfox <timemanager.rick@gmail.com>
Co-authored-by: dewi-ny-je <2866139+dewi-ny-je@users.noreply.github.com>
Co-authored-by: Nico Domino <7415984+ndom91@users.noreply.github.com>
Co-authored-by: Martin Ulmschneider <7497782+mulmschneider@users.noreply.github.com>
Co-authored-by: Rodrigo <162915171+RF47@users.noreply.github.com>
2025-06-08 11:11:43 +08:00

2.2 KiB

This page deals with the explanation for 3 classes in the code.

Preset

As the name might suggest this class deals with presets for various things. It defines an enum Type which basically tells you what kind of data the present contains. Below are a few explained and there corresponding UI elements

Warning

There is a lot of outdated and legacy code in the code base.

  • TYPE_PRINT: Refers to a process preset. It's called 'Print' probably due to some legacy code.
Example Image
  • TYPE_FILAMENT: As the name suggests this preset is for filaments
Example Image
  • TYPE_PRINTER: Preset for printers.
Example Image

There are other preset types but some of them are for SLA. Which is legacy code, since SLA printers are no longer supported. Above 3 are the important types.

PresetBundle

This is a bundle containing a few types of PresetCollection. One bundle has presets for some printers, filaments and some processes (TYPE_PRINT).

PresetCollection prints
PresetCollection filaments
PrinterPresetCollection printers

each one of these contains a collection of processes, filaments and printers respectively.\

Important

Printers, filaments and processes in the bundle don't all have to be compatible with each other. In fact all the saved presets are stored in one PresetBundle. The PresetBundle is loaded on start up. The list of filaments and processes shown for a particular printer is a subset of filaments and prints PresetCollections.

PresetCollection

PrinterPresetCollection is a class derived from PresetCollection.

These contain a collection of presets. The presets could be of any type.
functions of note here are:

get_edited_preset(): returns the current selected preset along with any modifications the user has made.
get_selected_preset(): returns the current selected preset without the modifications the user has made.