mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-20 19:04:06 +00:00
Make typo verification more robust
This commit is contained in:
@@ -45,6 +45,34 @@ enum OptionListMembership {
|
||||
LIST_VARIANT_OPTION_KEYS = 3;
|
||||
}
|
||||
|
||||
// C++ co_type override values, used when the proto wire type (float/int32) is
|
||||
// ambiguous about the real ConfigOption class. Each value name is the coXXX
|
||||
// identifier the codegen emits, and must have a matching entry in
|
||||
// hint_class_map (config_codegen.py). Making this an enum lets protoc reject a
|
||||
// typo'd hint (e.g. coFloar) at compile time instead of silently mis-typing a
|
||||
// setting. To add a new override: add a value here AND its hint_class_map entry.
|
||||
enum CoTypeHint {
|
||||
CO_TYPE_HINT_UNSET = 0;
|
||||
coPercent = 1;
|
||||
coPercents = 2;
|
||||
coEnum = 3;
|
||||
coEnums = 4;
|
||||
}
|
||||
|
||||
// Mirrors ConfigOptionDef::GUIType in src/libslic3r/Config.hpp. The codegen
|
||||
// emits ConfigOptionDef::GUIType::<name>, so each value name must match a C++
|
||||
// enumerator there. As an enum, a typo'd gui_type fails at protoc time.
|
||||
enum GuiType {
|
||||
GUI_TYPE_UNSET = 0;
|
||||
i_enum_open = 1;
|
||||
f_enum_open = 2;
|
||||
color = 3;
|
||||
select_open = 4;
|
||||
slider = 5;
|
||||
legend = 6;
|
||||
one_string = 7;
|
||||
}
|
||||
|
||||
// --- Custom field options ---
|
||||
|
||||
extend google.protobuf.FieldOptions {
|
||||
@@ -78,8 +106,8 @@ extend google.protobuf.FieldOptions {
|
||||
// Nullable support (for ConfigOptionFloatsNullable, etc.)
|
||||
bool is_nullable = 50017;
|
||||
|
||||
// GUI type override (e.g. "i_enum_open", "color", "f_enum_open")
|
||||
string gui_type = 50019;
|
||||
// GUI type override (e.g. i_enum_open, color, f_enum_open)
|
||||
GuiType gui_type = 50019;
|
||||
string gui_flags = 50020;
|
||||
|
||||
// Enum metadata (key map reference for C++ enum binding)
|
||||
@@ -91,9 +119,9 @@ extend google.protobuf.FieldOptions {
|
||||
// ConfigOptionDef::readonly
|
||||
bool readonly = 50023;
|
||||
|
||||
// Override the auto-detected co_type (e.g. "coPercent", "coEnum")
|
||||
// Override the auto-detected co_type (e.g. coPercent, coEnum)
|
||||
// Used when proto type (float, int32) is ambiguous
|
||||
string co_type_hint = 50024;
|
||||
CoTypeHint co_type_hint = 50024;
|
||||
|
||||
// Default value — constructor args only (e.g. "1.0", "5000.0, 5000.0")
|
||||
// Codegen reconstructs full C++ from co_type + this value
|
||||
|
||||
@@ -109,7 +109,7 @@ message FilamentSettings {
|
||||
(tooltip) = "When the overhang exceeds this specified threshold, force the cooling fan to run at the 'Overhang Fan Speed' set below. This threshold is expressed as a percentage, indicating the portion of each line's width that is unsupported by the layer beneath it. Setting this value to 0% forces the cooling fan to run for all outer walls, regardless of the overhang degree.",
|
||||
(category) = "Filament/Cooling",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<OverhangFanThreshold>::get_enum_values()",
|
||||
(co_type_hint) = "coEnums",
|
||||
(co_type_hint) = coEnums,
|
||||
(tab_type) = "Filament",
|
||||
(tab_page) = "Cooling",
|
||||
(tab_optgroup) = "Part cooling fan",
|
||||
@@ -805,7 +805,7 @@ message FilamentSettings {
|
||||
(label) = "Default color",
|
||||
(tooltip) = "Default filament color.\\nRight click to reset value to system default.",
|
||||
(category) = "Filament/Filament",
|
||||
(gui_type) = "color",
|
||||
(gui_type) = color,
|
||||
(tab_type) = "Filament",
|
||||
(tab_page) = "Filament",
|
||||
(tab_optgroup) = "Basic information",
|
||||
@@ -905,7 +905,7 @@ message FilamentSettings {
|
||||
(tooltip) = "Enter the shrinkage percentage that the filament will get after cooling (94% if you measure 94mm instead of 100mm). The part will be scaled in XY to compensate. For multi-material prints, ensure filament shrinkage matches across all used filaments\\nBe sure to allow enough space between objects, as this compensation is done after the checks.",
|
||||
(category) = "Filament/Filament",
|
||||
(sidetext) = "%",
|
||||
(co_type_hint) = "coPercents",
|
||||
(co_type_hint) = coPercents,
|
||||
(tab_type) = "Filament",
|
||||
(tab_page) = "Filament",
|
||||
(tab_optgroup) = "Basic information",
|
||||
@@ -924,7 +924,7 @@ message FilamentSettings {
|
||||
(tooltip) = "Enter the shrinkage percentage that the filament will get after cooling (94% if you measure 94mm instead of 100mm). The part will be scaled in Z to compensate.",
|
||||
(category) = "Filament/Filament",
|
||||
(sidetext) = "%",
|
||||
(co_type_hint) = "coPercents",
|
||||
(co_type_hint) = coPercents,
|
||||
(tab_type) = "Filament",
|
||||
(tab_page) = "Filament",
|
||||
(tab_optgroup) = "Basic information",
|
||||
@@ -976,7 +976,7 @@ message FilamentSettings {
|
||||
(label) = "Type",
|
||||
(tooltip) = "The material type of filament.",
|
||||
(category) = "Filament/Filament",
|
||||
(gui_type) = "f_enum_open",
|
||||
(gui_type) = f_enum_open,
|
||||
(gui_flags) = "show_value",
|
||||
(tab_type) = "Filament",
|
||||
(tab_page) = "Filament",
|
||||
@@ -1591,7 +1591,7 @@ message FilamentSettings {
|
||||
(tooltip) = "Filament-specific override for ironing flow. This allows you to customize the ironing flow for each filament type. Too high value results in overextrusion on the surface.",
|
||||
(category) = "Quality",
|
||||
(sidetext) = "%",
|
||||
(co_type_hint) = "coPercents",
|
||||
(co_type_hint) = coPercents,
|
||||
(min_value) = 0,
|
||||
(max_value) = 100,
|
||||
(mode) = MODE_ADVANCED,
|
||||
@@ -1761,7 +1761,7 @@ message FilamentSettings {
|
||||
(label) = "Z-hop type",
|
||||
(tooltip) = "Type of Z-hop.",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<ZHopType>::get_enum_values()",
|
||||
(co_type_hint) = "coEnums",
|
||||
(co_type_hint) = coEnums,
|
||||
(mode) = MODE_ADVANCED,
|
||||
(is_nullable) = true,
|
||||
(preset) = PRESET_FILAMENT,
|
||||
@@ -1803,7 +1803,7 @@ message FilamentSettings {
|
||||
(label) = "On surfaces",
|
||||
(tooltip) = "Enforce Z-Hop behavior. This setting is impacted by the above settings (Only lift Z above/below).",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<RetractLiftEnforceType>::get_enum_values()",
|
||||
(co_type_hint) = "coEnums",
|
||||
(co_type_hint) = coEnums,
|
||||
(mode) = MODE_ADVANCED,
|
||||
(is_nullable) = true,
|
||||
(preset) = PRESET_FILAMENT,
|
||||
@@ -1901,7 +1901,7 @@ message FilamentSettings {
|
||||
(label) = "Retract amount before wipe",
|
||||
(tooltip) = "The length of fast retraction before wipe, relative to retraction length.",
|
||||
(sidetext) = "%",
|
||||
(co_type_hint) = "coPercents",
|
||||
(co_type_hint) = coPercents,
|
||||
(mode) = MODE_ADVANCED,
|
||||
(is_nullable) = true,
|
||||
(preset) = PRESET_FILAMENT,
|
||||
|
||||
@@ -20,7 +20,7 @@ message PrintSettings {
|
||||
int32 extruder = 1 [
|
||||
(label) = "Extruder",
|
||||
(category) = "Extruders",
|
||||
(gui_type) = "i_enum_open",
|
||||
(gui_type) = i_enum_open,
|
||||
(mode) = MODE_ADVANCED,
|
||||
(enum_label_entries) = "default",
|
||||
(enum_label_entries) = "1",
|
||||
@@ -326,7 +326,7 @@ message PrintSettings {
|
||||
(tooltip) = "Choose the input shaper algorithm.\\nDefault uses the firmware default settings.\\nDisable turns off input shaping in the firmware.",
|
||||
(category) = "PrinterKinematics/Motion ability",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<InputShaperType>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "PrinterKinematics",
|
||||
(tab_page) = "Motion ability",
|
||||
(tab_optgroup) = "Resonance Compensation",
|
||||
@@ -413,7 +413,7 @@ message PrintSettings {
|
||||
(tooltip) = "This controls the generation of the brim at outer and/or inner side of models. Auto means the brim width is analyzed and calculated automatically.",
|
||||
(category) = "Print/Others",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<BrimType>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Others",
|
||||
(tab_optgroup) = "Brim",
|
||||
@@ -529,7 +529,7 @@ message PrintSettings {
|
||||
(tooltip) = "Print sequence, layer by layer or object by object.",
|
||||
(category) = "Print/Others",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<PrintSequence>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Others",
|
||||
(tab_optgroup) = "Special mode",
|
||||
@@ -549,7 +549,7 @@ message PrintSettings {
|
||||
(tooltip) = "Print order within a single layer.",
|
||||
(category) = "Print/Others",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<PrintOrder>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Others",
|
||||
(tab_optgroup) = "Special mode",
|
||||
@@ -572,7 +572,7 @@ message PrintSettings {
|
||||
(tooltip) = "Randomly jitter while printing the wall, so that the surface has a rough look. This setting controls the fuzzy position.",
|
||||
(category) = "Print/Others",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<FuzzySkinType>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Others",
|
||||
(tab_optgroup) = "Fuzzy Skin",
|
||||
@@ -639,7 +639,7 @@ message PrintSettings {
|
||||
(tooltip) = "Fuzzy skin generation mode. Works only with Arachne!\\nDisplacement: Сlassic mode when the pattern is formed by shifting the nozzle sideways from the original path.\\nExtrusion: The mode when the pattern formed by the amount of extruded plastic. This is the fast and straight algorithm without unnecessary nozzle shake that gives a smooth pattern. But it is more useful for forming loose walls in the entire they array.\\nCombined: Joint mode [Displacement] + [Extrusion]. The appearance of the walls is similar to [Displacement] Mode, but it leaves no pores between the perimeters.\\n\\nAttention! The [Extrusion] and [Combined] modes works only the fuzzy_skin_thickness parameter not more than the thickness of printed loop. At the same time, the width of the extrusion for a particular layer should also not be below a certain level. It is usually equal 15-25%% of a layer height. Therefore, the maximum fuzzy skin thickness with a perimeter width of 0.4 mm and a layer height of 0.2 mm will be 0.4-(0.2*0.25)=±0.35mm! If you enter a higher parameter than this, the error Flow::spacing() will displayed, and the model will not be sliced. You can choose this number until this error is repeated.",
|
||||
(category) = "Print/Others",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<FuzzySkinMode>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Others",
|
||||
(tab_optgroup) = "Fuzzy Skin",
|
||||
@@ -659,7 +659,7 @@ message PrintSettings {
|
||||
(tooltip) = "Noise type to use for fuzzy skin generation:\\nClassic: Classic uniform random noise.\\nPerlin: Perlin noise, which gives a more consistent texture.\\nBillow: Similar to perlin noise, but clumpier.\\nRidged Multifractal: Ridged noise with sharp, jagged features. Creates marble-like textures.\\nVoronoi: Divides the surface into voronoi cells, and displaces each one by a random amount. Creates a patchwork texture.\\nRipple: Uniform ripple pattern that ripples left and right of the original path. Repeating pattern, woven appearance.",
|
||||
(category) = "Print/Others",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<NoiseType>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Others",
|
||||
(tab_optgroup) = "Fuzzy Skin",
|
||||
@@ -745,7 +745,7 @@ message PrintSettings {
|
||||
(tooltip) = "Shifts the ripple phase forward along the print path by the specified percentage of a wavelength each layer period.\\n- 0% keeps every layer identical.\\n- 50% shifts the pattern by half a wavelength, effectively inverting the phase.\\n- 100% shifts the pattern by a full wavelength, returning to the original phase.\\n\\nThe shift is applied once every number of layers set by Layers between ripple offset, so layers within the same group are printed identically.",
|
||||
(category) = "Print/Others",
|
||||
(sidetext) = "%",
|
||||
(co_type_hint) = "coPercent",
|
||||
(co_type_hint) = coPercent,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Others",
|
||||
(tab_optgroup) = "Fuzzy Skin",
|
||||
@@ -989,7 +989,7 @@ message PrintSettings {
|
||||
(tooltip) = "A draft shield is useful to protect an ABS or ASA print from warping and detaching from print bed due to wind draft. It is usually needed only with open frame printers, i.e. without an enclosure.\\n\\nEnabled = skirt is as tall as the highest printed object. Otherwise 'Skirt height' is used.\\nNote: With the draft shield active, the skirt will be printed at skirt distance from the object. Therefore, if brims are active it may intersect with them. To avoid this, increase the skirt distance value.\\n",
|
||||
(category) = "Print/Others",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<DraftShield>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Others",
|
||||
(tab_optgroup) = "Skirt",
|
||||
@@ -1010,7 +1010,7 @@ message PrintSettings {
|
||||
(tooltip) = "Combined - single skirt for all objects, Per object - individual object skirt.",
|
||||
(category) = "Print/Others",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<SkirtType>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Others",
|
||||
(tab_optgroup) = "Skirt",
|
||||
@@ -1153,7 +1153,7 @@ message PrintSettings {
|
||||
(tooltip) = "If smooth or traditional mode is selected, a timelapse video will be generated for each print. After each layer is printed, a snapshot is taken with the chamber camera. All of these snapshots are composed into a timelapse video when printing completes. If smooth mode is selected, the toolhead will move to the excess chute after each layer is printed and then take a snapshot. Since the melt filament may leak from the nozzle during the process of taking a snapshot, a prime tower is required for smooth mode to wipe nozzle.",
|
||||
(category) = "Print/Others",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<TimelapseType>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Others",
|
||||
(tab_optgroup) = "Special mode",
|
||||
@@ -1171,7 +1171,7 @@ message PrintSettings {
|
||||
(tooltip) = "Use \\\"Even-odd\\\" for 3DLabPrint airplane models. Use \\\"Close holes\\\" to close all holes in the model.",
|
||||
(category) = "Print/Others",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<SlicingMode>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Others",
|
||||
(tab_optgroup) = "Special mode",
|
||||
@@ -1189,16 +1189,16 @@ message PrintSettings {
|
||||
|
||||
int32 sparse_infill_filament = 79 [
|
||||
(label) = "Infill",
|
||||
(tooltip) = "Filament to print internal sparse infill.",
|
||||
(tooltip) = "Filament to print internal sparse infill.\n\\\"Default\\\" uses the active object/part filament.",
|
||||
(category) = "Print/Multimaterial",
|
||||
(gui_type) = "i_enum_open",
|
||||
(gui_type) = i_enum_open,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Multimaterial",
|
||||
(tab_optgroup) = "Filament for Features",
|
||||
(min_value) = 1,
|
||||
(min_value) = 0,
|
||||
(mode) = MODE_ADVANCED,
|
||||
(has_default) = true,
|
||||
(default_value) = "1"
|
||||
(default_value) = "0"
|
||||
];
|
||||
|
||||
|
||||
@@ -1347,31 +1347,31 @@ message PrintSettings {
|
||||
|
||||
int32 wall_filament = 90 [
|
||||
(label) = "Walls",
|
||||
(tooltip) = "Filament to print walls.",
|
||||
(tooltip) = "Filament to print walls.\n\\\"Default\\\" uses the active object/part filament.",
|
||||
(category) = "Print/Multimaterial",
|
||||
(gui_type) = "i_enum_open",
|
||||
(gui_type) = i_enum_open,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Multimaterial",
|
||||
(tab_optgroup) = "Filament for Features",
|
||||
(min_value) = 1,
|
||||
(min_value) = 0,
|
||||
(mode) = MODE_ADVANCED,
|
||||
(has_default) = true,
|
||||
(default_value) = "1"
|
||||
(default_value) = "0"
|
||||
];
|
||||
|
||||
|
||||
int32 solid_infill_filament = 91 [
|
||||
(label) = "Solid infill",
|
||||
(tooltip) = "Filament to print solid infill.",
|
||||
(tooltip) = "Filament to print solid infill.\n\\\"Default\\\" uses the active object/part filament.",
|
||||
(category) = "Print/Multimaterial",
|
||||
(gui_type) = "i_enum_open",
|
||||
(gui_type) = i_enum_open,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Multimaterial",
|
||||
(tab_optgroup) = "Filament for Features",
|
||||
(min_value) = 1,
|
||||
(min_value) = 0,
|
||||
(mode) = MODE_ADVANCED,
|
||||
(has_default) = true,
|
||||
(default_value) = "1"
|
||||
(default_value) = "0"
|
||||
];
|
||||
|
||||
|
||||
@@ -1533,7 +1533,7 @@ message PrintSettings {
|
||||
(tooltip) = "Brim width of prime tower, negative number means auto calculated width based on the height of prime tower.",
|
||||
(category) = "Print/Multimaterial",
|
||||
(sidetext) = "mm",
|
||||
(gui_type) = "f_enum_open",
|
||||
(gui_type) = f_enum_open,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Multimaterial",
|
||||
(tab_optgroup) = "Prime tower",
|
||||
@@ -1588,7 +1588,7 @@ message PrintSettings {
|
||||
(tooltip) = "Wipe tower outer wall type.\\n1. Rectangle: The default wall type, a rectangle with fixed width and height.\\n2. Cone: A cone with a fillet at the bottom to help stabilize the wipe tower.\\n3. Rib: Adds four ribs to the tower wall for enhanced stability.",
|
||||
(category) = "Print/Multimaterial",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<WipeTowerWallType>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Multimaterial",
|
||||
(tab_optgroup) = "Prime tower",
|
||||
@@ -1660,7 +1660,7 @@ message PrintSettings {
|
||||
(label) = "Wipe tower",
|
||||
(tooltip) = "The extruder to use when printing perimeter of the wipe tower. Set to 0 to use the one that is available (non-soluble would be preferred).",
|
||||
(category) = "Print/Multimaterial",
|
||||
(gui_type) = "i_enum_open",
|
||||
(gui_type) = i_enum_open,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Multimaterial",
|
||||
(tab_optgroup) = "Filament for Features",
|
||||
@@ -1721,7 +1721,7 @@ message PrintSettings {
|
||||
(tooltip) = "Infill gap.",
|
||||
(category) = "Print/Multimaterial",
|
||||
(sidetext) = "%",
|
||||
(co_type_hint) = "coPercent",
|
||||
(co_type_hint) = coPercent,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Multimaterial",
|
||||
(tab_optgroup) = "Prime tower",
|
||||
@@ -1793,7 +1793,7 @@ message PrintSettings {
|
||||
(tooltip) = "Spacing of purge lines on the wipe tower.",
|
||||
(category) = "Print/Multimaterial",
|
||||
(sidetext) = "%",
|
||||
(co_type_hint) = "coPercent",
|
||||
(co_type_hint) = coPercent,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Multimaterial",
|
||||
(tab_optgroup) = "Prime tower",
|
||||
@@ -1812,7 +1812,7 @@ message PrintSettings {
|
||||
(tooltip) = "Extra flow used for the purging lines on the wipe tower. This makes the purging lines thicker or narrower than they normally would be. The spacing is adjusted automatically.",
|
||||
(category) = "Print/Multimaterial",
|
||||
(sidetext) = "%",
|
||||
(co_type_hint) = "coPercent",
|
||||
(co_type_hint) = coPercent,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Multimaterial",
|
||||
(tab_optgroup) = "Prime tower",
|
||||
@@ -1862,7 +1862,7 @@ message PrintSettings {
|
||||
(tooltip) = "Controls the density (spacing) of external bridge lines. Default is 100%.\\n\\nLower density external bridges can help improve reliability as there is more space for air to circulate around the extruded bridge, improving its cooling speed. Minimum is 10%.\\n\\nHigher densities can produce smoother bridge surfaces, as overlapping lines provide additional support during printing. Maximum is 120%.\\nNote: Bridge density that is too high can cause warping or overextrusion.",
|
||||
(category) = "Print/Quality",
|
||||
(sidetext) = "%",
|
||||
(co_type_hint) = "coPercent",
|
||||
(co_type_hint) = coPercent,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Quality",
|
||||
(tab_optgroup) = "Bridging",
|
||||
@@ -1879,7 +1879,7 @@ message PrintSettings {
|
||||
(tooltip) = "Controls the density (spacing) of internal bridge lines. 100% means solid bridge. Default is 100%.\\n\\nLower density internal bridges can help reduce top surface pillowing and improve internal bridge reliability as there is more space for air to circulate around the extruded bridge, improving its cooling speed.\\n\\nThis option works particularly well when combined with the second internal bridge over infill option, further improving internal bridging structure before solid infill is extruded.",
|
||||
(category) = "Print/Quality",
|
||||
(sidetext) = "%",
|
||||
(co_type_hint) = "coPercent",
|
||||
(co_type_hint) = coPercent,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Quality",
|
||||
(tab_optgroup) = "Bridging",
|
||||
@@ -2198,7 +2198,7 @@ message PrintSettings {
|
||||
(tooltip) = "This option creates bridges for counterbore holes, allowing them to be printed without support. Available modes include:\\n1. None: No bridge is created\\n2. Partially Bridged: Only a part of the unsupported area will be bridged\\n3. Sacrificial Layer: A full sacrificial bridge layer is created",
|
||||
(category) = "Print/Quality",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<CounterboreHoleBridgingOption>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Quality",
|
||||
(tab_optgroup) = "Bridging",
|
||||
@@ -2263,7 +2263,7 @@ message PrintSettings {
|
||||
(tooltip) = "This option enables the generation of an extra bridge layer over internal and/or external bridges.\\n\\nExtra bridge layers help improve bridge appearance and reliability, as the solid infill is better supported. This is especially useful in fast printers, where the bridge and solid infill speeds vary greatly. The extra bridge layer results in reduced pillowing on top surfaces, as well as reduced separation of the external bridge layer from its surrounding perimeters.\\n\\nIt is generally recommended to set this to at least 'External bridge only', unless specific issues with the sliced model are found.\\n\\nOptions:\\n1. Disabled - does not generate second bridge layers. This is the default and is set for compatibility purposes\\n2. External bridge only - generates second bridge layers for external-facing bridges only. Please note that small bridges that are shorter or narrower than the set number of perimeters will be skipped as they would not benefit from a second bridge layer. If generated, the second bridge layer will be extruded parallel to the first bridge layer to reinforce the bridge strength\\n3. Internal bridge only - generates second bridge layers for internal bridges over sparse infill only. Please note that the internal bridges count towards the top shell layer count of your model. The second internal bridge layer will be extruded as close to perpendicular to the first as possible. If multiple regions in the same island, with varying bridge angles are present, the last region of that island will be selected as the angle reference\\n4. Apply to all - generates second bridge layers for both internal and external-facing bridges\\n",
|
||||
(category) = "Print/Quality",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<EnableExtraBridgeLayer>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Quality",
|
||||
(tab_optgroup) = "Bridging",
|
||||
@@ -2286,7 +2286,7 @@ message PrintSettings {
|
||||
(tooltip) = "This option can help reduce pillowing on top surfaces in heavily slanted or curved models.\\nBy default, small internal bridges are filtered out and the internal solid infill is printed directly over the sparse infill. This works well in most cases, speeding up printing without too much compromise on top surface quality.\\nHowever, in heavily slanted or curved models, especially where too low a sparse infill density is used, this may result in curling of the unsupported solid infill, causing pillowing.\\nEnabling limited filtering or no filtering will print internal bridge layer over slightly unsupported internal solid infill. The options below control the sensitivity of the filtering, i.e. they control where internal bridges are created:\\n1. Filter - enables this option. This is the default behavior and works well in most cases\\n2. Limited filtering - creates internal bridges on heavily slanted surfaces while avoiding unnecessary bridges. This works well for most difficult models\\n3. No filtering - creates internal bridges on every potential internal overhang. This option is useful for heavily slanted top surface models; however, in most cases, it creates too many ",
|
||||
(category) = "Print/Quality",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<InternalBridgeFilter>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Quality",
|
||||
(tab_optgroup) = "Bridging",
|
||||
@@ -2325,7 +2325,7 @@ message PrintSettings {
|
||||
(tooltip) = "Print sequence of the internal (inner) and external (outer) walls.\\n\\nUse Inner/Outer for best overhangs. This is because the overhanging walls can adhere to a neighbouring perimeter while printing. However, this option results in slightly reduced surface quality as the external perimeter is deformed by being squashed to the internal perimeter.\\n\\nUse Inner/Outer/Inner for the best external surface finish and dimensional accuracy as the external wall is printed undisturbed from an internal perimeter. However, overhang performance will reduce as there is no internal perimeter to print the external wall against. This option requires a minimum of 3 walls to be effective as it prints the internal walls from the 3rd perimeter onwards first, then the external perimeter and, finally, the first internal perimeter. This option is recommended against the Outer/Inner option in most cases.\\n\\nUse Outer/Inner for the same external wall quality and dimensional accuracy benefits of Inner/Outer/Inner option. However, the Z seams will appear less consistent as the first extrusion of a new layer starts on a visible surface.",
|
||||
(category) = "Print/Quality",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<WallSequence>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Quality",
|
||||
(tab_optgroup) = "Walls and surfaces",
|
||||
@@ -2364,7 +2364,7 @@ message PrintSettings {
|
||||
(tooltip) = "The direction which the contour wall loops are extruded when looking down from the top.\\nHoles are printed in the opposite direction to the contour to maintain alignment with layers whose contour polygons are incomplete and change direction, also partially forming the contour of a hole.\\n\\nThis option will be disabled if spiral vase mode is enabled.",
|
||||
(category) = "Print/Quality",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<WallDirection>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Quality",
|
||||
(tab_optgroup) = "Walls and surfaces",
|
||||
@@ -2502,7 +2502,7 @@ message PrintSettings {
|
||||
(tooltip) = "Ironing is using small flow to print on same height of surface again to make flat surface more smooth. This setting controls which layer being ironed.",
|
||||
(category) = "Print/Quality",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<IroningType>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Quality",
|
||||
(tab_optgroup) = "Ironing",
|
||||
@@ -2525,7 +2525,7 @@ message PrintSettings {
|
||||
(tooltip) = "The pattern that will be used when ironing.",
|
||||
(category) = "Print/Quality",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<InfillPattern>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Quality",
|
||||
(tab_optgroup) = "Ironing",
|
||||
@@ -2545,7 +2545,7 @@ message PrintSettings {
|
||||
(category) = "Print/Quality",
|
||||
(sidetext) = "%",
|
||||
(ratio_over) = "layer_height",
|
||||
(co_type_hint) = "coPercent",
|
||||
(co_type_hint) = coPercent,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Quality",
|
||||
(tab_optgroup) = "Ironing",
|
||||
@@ -2802,7 +2802,7 @@ message PrintSettings {
|
||||
(tooltip) = "The start position to print each part of outer wall.",
|
||||
(category) = "Print/Quality",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<SeamPosition>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Quality",
|
||||
(tab_optgroup) = "Seam",
|
||||
@@ -2855,7 +2855,7 @@ message PrintSettings {
|
||||
(tooltip) = "Use scarf joint to minimize seam visibility and increase seam strength.",
|
||||
(category) = "Print/Quality",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<SeamScarfType>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Quality",
|
||||
(tab_optgroup) = "Seam",
|
||||
@@ -2905,7 +2905,7 @@ message PrintSettings {
|
||||
(tooltip) = "This option determines the overhang threshold for the application of scarf joint seams. If the unsupported portion of the perimeter is less than this threshold, scarf joint seams will be applied. The default threshold is set at 40% of the external wall's width. Due to performance considerations, the degree of overhang is estimated.",
|
||||
(category) = "Print/Quality",
|
||||
(sidetext) = "%",
|
||||
(co_type_hint) = "coPercent",
|
||||
(co_type_hint) = coPercent,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Quality",
|
||||
(tab_optgroup) = "Seam",
|
||||
@@ -3217,7 +3217,7 @@ message PrintSettings {
|
||||
(tooltip) = "Classic wall generator produces walls with constant extrusion width and for very thin areas is used gap-fill. Arachne engine produces walls with variable extrusion width.",
|
||||
(category) = "Print/Quality",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<PerimeterGeneratorType>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Quality",
|
||||
(tab_optgroup) = "Wall generator",
|
||||
@@ -3236,7 +3236,7 @@ message PrintSettings {
|
||||
(tooltip) = "When transitioning between different numbers of walls as the part becomes thinner, a certain amount of space is allotted to split or join the wall segments. It's expressed as a percentage over nozzle diameter.",
|
||||
(category) = "Print/Quality",
|
||||
(sidetext) = "%",
|
||||
(co_type_hint) = "coPercent",
|
||||
(co_type_hint) = coPercent,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Quality",
|
||||
(tab_optgroup) = "Wall generator",
|
||||
@@ -3252,7 +3252,7 @@ message PrintSettings {
|
||||
(tooltip) = "Prevent transitioning back and forth between one extra wall and one less. This margin extends the range of extrusion widths which follow to [Minimum wall width - margin, 2 * Minimum wall width + margin]. Increasing this margin reduces the number of transitions, which reduces the number of extrusion starts/stops and travel time. However, large extrusion width variation can lead to under- or overextrusion problems. It's expressed as a percentage over nozzle diameter.",
|
||||
(category) = "Print/Quality",
|
||||
(sidetext) = "%",
|
||||
(co_type_hint) = "coPercent",
|
||||
(co_type_hint) = coPercent,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Quality",
|
||||
(tab_optgroup) = "Wall generator",
|
||||
@@ -3298,7 +3298,7 @@ message PrintSettings {
|
||||
(tooltip) = "Minimum thickness of thin features. Model features that are thinner than this value will not be printed, while features thicker than than this value will be widened to the minimum wall width. It's expressed as a percentage over nozzle diameter.",
|
||||
(category) = "Print/Quality",
|
||||
(sidetext) = "%",
|
||||
(co_type_hint) = "coPercent",
|
||||
(co_type_hint) = coPercent,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Quality",
|
||||
(tab_optgroup) = "Wall generator",
|
||||
@@ -3360,7 +3360,7 @@ message PrintSettings {
|
||||
(tooltip) = "The minimum wall width that should be used for the first layer is recommended to be set to the same size as the nozzle. This adjustment is expected to enhance adhesion.",
|
||||
(category) = "Print/Quality",
|
||||
(sidetext) = "%",
|
||||
(co_type_hint) = "coPercent",
|
||||
(co_type_hint) = coPercent,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Quality",
|
||||
(tab_optgroup) = "Wall generator",
|
||||
@@ -3376,7 +3376,7 @@ message PrintSettings {
|
||||
(tooltip) = "Width of the wall that will replace thin features (according to the Minimum feature size) of the model. If the Minimum wall width is thinner than the thickness of the feature, the wall will become as thick as the feature itself. It's expressed as a percentage over nozzle diameter.",
|
||||
(category) = "Print/Quality",
|
||||
(sidetext) = "%",
|
||||
(co_type_hint) = "coPercent",
|
||||
(co_type_hint) = coPercent,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Quality",
|
||||
(tab_optgroup) = "Wall generator",
|
||||
@@ -3738,7 +3738,7 @@ message PrintSettings {
|
||||
(tooltip) = "Klipper's max_accel_to_decel will be adjusted to this %% of acceleration.",
|
||||
(category) = "Print/Speed",
|
||||
(sidetext) = "%",
|
||||
(co_type_hint) = "coPercent",
|
||||
(co_type_hint) = coPercent,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Speed",
|
||||
(tab_optgroup) = "Acceleration",
|
||||
@@ -4191,7 +4191,7 @@ message PrintSettings {
|
||||
(tooltip) = "Density of the first raft or support layer.",
|
||||
(category) = "Print/Support",
|
||||
(sidetext) = "%",
|
||||
(co_type_hint) = "coPercent",
|
||||
(co_type_hint) = coPercent,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Support",
|
||||
(tab_optgroup) = "Support",
|
||||
@@ -4251,7 +4251,7 @@ message PrintSettings {
|
||||
(tooltip) = "Normal (auto) and Tree (auto) are used to generate support automatically. If Normal (manual) or Tree (manual) is selected, only support enforcers are generated.",
|
||||
(category) = "Print/Support",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<SupportType>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Support",
|
||||
(tab_optgroup) = "Support",
|
||||
@@ -4394,7 +4394,7 @@ message PrintSettings {
|
||||
(label) = "Support/raft base",
|
||||
(tooltip) = "Filament to print support base and raft. \\\"Default\\\" means no specific filament for support and current filament is used.",
|
||||
(category) = "Print/Support",
|
||||
(gui_type) = "i_enum_open",
|
||||
(gui_type) = i_enum_open,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Support",
|
||||
(tab_optgroup) = "Support filament",
|
||||
@@ -4420,7 +4420,7 @@ message PrintSettings {
|
||||
(label) = "Support/raft interface",
|
||||
(tooltip) = "Filament to print support interface. \\\"Default\\\" means no specific filament for support interface and current filament is used.",
|
||||
(category) = "Print/Support",
|
||||
(gui_type) = "i_enum_open",
|
||||
(gui_type) = i_enum_open,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Support",
|
||||
(tab_optgroup) = "Support filament",
|
||||
@@ -4435,7 +4435,7 @@ message PrintSettings {
|
||||
(tooltip) = "Number of top interface layers.",
|
||||
(category) = "Print/Support",
|
||||
(sidetext) = "layers",
|
||||
(gui_type) = "i_enum_open",
|
||||
(gui_type) = i_enum_open,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Support",
|
||||
(tab_optgroup) = "Advanced",
|
||||
@@ -4459,7 +4459,7 @@ message PrintSettings {
|
||||
(tooltip) = "Number of bottom interface layers.",
|
||||
(category) = "Print/Support",
|
||||
(sidetext) = "layers",
|
||||
(gui_type) = "i_enum_open",
|
||||
(gui_type) = i_enum_open,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Support",
|
||||
(tab_optgroup) = "Advanced",
|
||||
@@ -4507,7 +4507,7 @@ message PrintSettings {
|
||||
(tooltip) = "Line pattern of support.\\n\\nThe Default option for Tree supports is Hollow, which means no base pattern. For other support types, the Default option is the Rectilinear pattern.\\n\\nNOTE: For Organic supports, the two walls are supported only with the Hollow/Default base pattern. The Lightning base pattern is supported only by Tree Slim/Strong/Hybrid supports. For the other support types, the Rectilinear will be used instead of Lightning.",
|
||||
(category) = "Print/Support",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<SupportMaterialPattern>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Support",
|
||||
(tab_optgroup) = "Advanced",
|
||||
@@ -4534,7 +4534,7 @@ message PrintSettings {
|
||||
(tooltip) = "Line pattern of support interface. Default pattern for non-soluble support interface is Rectilinear, while default pattern for soluble support interface is Concentric.",
|
||||
(category) = "Print/Support",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<SupportMaterialInterfacePattern>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Support",
|
||||
(tab_optgroup) = "Advanced",
|
||||
@@ -4588,7 +4588,7 @@ message PrintSettings {
|
||||
(tooltip) = "Style and shape of the support. For normal support, projecting the supports into a regular grid will create more stable supports (default), while snug support towers will save material and reduce object scarring.\\nFor tree support, slim and organic style will merge branches more aggressively and save a lot of material (default organic), while hybrid style will create similar structure to normal support under large flat overhangs.",
|
||||
(category) = "Print/Support",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<SupportMaterialStyle>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Support",
|
||||
(tab_optgroup) = "Support",
|
||||
@@ -4743,7 +4743,7 @@ message PrintSettings {
|
||||
(tooltip) = "Adjusts the density of the support structure used to generate the tips of the branches. A higher value results in better overhangs but the supports are harder to remove, thus it is recommended to enable top support interfaces instead of a high branch density value if dense interfaces are needed.",
|
||||
(category) = "Print/Support",
|
||||
(sidetext) = "%",
|
||||
(co_type_hint) = "coPercent",
|
||||
(co_type_hint) = coPercent,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Support",
|
||||
(tab_optgroup) = "Tree supports",
|
||||
@@ -4877,7 +4877,7 @@ message PrintSettings {
|
||||
(tooltip) = "The pattern that will be used when ironing.",
|
||||
(category) = "Print/Support",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<InfillPattern>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Support",
|
||||
(tab_optgroup) = "Support ironing",
|
||||
@@ -4897,7 +4897,7 @@ message PrintSettings {
|
||||
(category) = "Print/Support",
|
||||
(sidetext) = "%",
|
||||
(ratio_over) = "layer_height",
|
||||
(co_type_hint) = "coPercent",
|
||||
(co_type_hint) = coPercent,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Support",
|
||||
(tab_optgroup) = "Support ironing",
|
||||
@@ -4929,7 +4929,7 @@ message PrintSettings {
|
||||
(label) = "First layer filament sequence",
|
||||
(category) = "Quality",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<LayerSeq>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(has_default) = true,
|
||||
(default_value) = "flsAuto",
|
||||
(enum_value_entries) = "Auto",
|
||||
@@ -4943,7 +4943,7 @@ message PrintSettings {
|
||||
(label) = "Other layers filament sequence",
|
||||
(category) = "Quality",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<LayerSeq>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(has_default) = true,
|
||||
(default_value) = "flsAuto",
|
||||
(enum_value_entries) = "Auto",
|
||||
@@ -5000,7 +5000,7 @@ message PrintSettings {
|
||||
(tooltip) = "Enables gap fill for the selected solid surfaces. The minimum gap length that will be filled can be controlled from the filter out tiny gaps option below.\\n\\nOptions:\\n1. Everywhere: Applies gap fill to top, bottom and internal solid surfaces for maximum strength\\n2. Top and Bottom surfaces: Applies gap fill to top and bottom surfaces only, balancing print speed, reducing potential over extrusion in the solid infill and making sure the top and bottom surfaces have no pinhole gaps\\n3. Nowhere: Disables gap fill for all solid infill areas\\n\\nNote that if using the classic perimeter generator, gap fill may also be generated between perimeters, if a full width line cannot fit between them. That perimeter gap fill is not controlled by this setting.\\n\\nIf you would like all gap fill, including the classic perimeter generated one, removed, set the filter out tiny gaps value to a large number, like 999999.\\n\\nHowever this is not advised, as gap fill between perimeters is contributing to the model's strength. For models where excessive gap fill is generated between perimeters, a better option would be to switch to the arachne wall generator and use this option to control whether the cosmetic top and bottom surface gap fill is generated.",
|
||||
(category) = "Print/Strength",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<GapFillTarget>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Strength",
|
||||
(tab_optgroup) = "Infill",
|
||||
@@ -5051,7 +5051,7 @@ message PrintSettings {
|
||||
(tooltip) = "Add solid infill near sloping surfaces to guarantee the vertical shell thickness (top+bottom solid layers)\\nNone: No solid infill will be added anywhere. Caution: Use this option carefully if your model has sloped surfaces\\nCritical Only: Avoid adding solid infill for walls\\nModerate: Add solid infill for heavily sloping surfaces only\\nAll: Add solid infill for all suitable sloping surfaces\\nDefault value is All.",
|
||||
(category) = "Print/Strength",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<EnsureVerticalShellThickness>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Strength",
|
||||
(tab_optgroup) = "Advanced",
|
||||
@@ -5074,7 +5074,7 @@ message PrintSettings {
|
||||
(tooltip) = "Line pattern of top surface infill.",
|
||||
(category) = "Print/Strength",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<InfillPattern>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Strength",
|
||||
(tab_optgroup) = "Top/bottom shells",
|
||||
@@ -5104,7 +5104,7 @@ message PrintSettings {
|
||||
(tooltip) = "Line pattern of bottom surface infill, not bridge infill.",
|
||||
(category) = "Print/Strength",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<InfillPattern>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Strength",
|
||||
(tab_optgroup) = "Top/bottom shells",
|
||||
@@ -5134,7 +5134,7 @@ message PrintSettings {
|
||||
(tooltip) = "Line pattern of internal solid infill. if the detect narrow internal solid infill be enabled, the concentric pattern will be used for the small area.",
|
||||
(category) = "Print/Strength",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<InfillPattern>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Strength",
|
||||
(tab_optgroup) = "Infill",
|
||||
@@ -5196,7 +5196,7 @@ message PrintSettings {
|
||||
(tooltip) = "Density of internal sparse infill, 100% turns all sparse infill into solid infill and internal solid infill pattern will be used.",
|
||||
(category) = "Print/Strength",
|
||||
(sidetext) = "%",
|
||||
(co_type_hint) = "coPercent",
|
||||
(co_type_hint) = coPercent,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Strength",
|
||||
(tab_optgroup) = "Infill",
|
||||
@@ -5263,7 +5263,7 @@ message PrintSettings {
|
||||
(tooltip) = "Line pattern for internal sparse infill.",
|
||||
(category) = "Print/Strength",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<InfillPattern>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Strength",
|
||||
(tab_optgroup) = "Infill",
|
||||
@@ -5378,7 +5378,7 @@ message PrintSettings {
|
||||
(category) = "Print/Strength",
|
||||
(sidetext) = "mm or %",
|
||||
(ratio_over) = "sparse_infill_line_width",
|
||||
(gui_type) = "f_enum_open",
|
||||
(gui_type) = f_enum_open,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Strength",
|
||||
(tab_optgroup) = "Infill",
|
||||
@@ -5496,7 +5496,7 @@ message PrintSettings {
|
||||
(tooltip) = "The remaining part of the model contour after removing a certain depth from the surface is called the skeleton. This parameter is used to adjust the density of this section. When two regions have the same sparse infill settings but different skeleton densities, their skeleton areas will develop overlapping sections. Default is as same as infill density.",
|
||||
(category) = "Print/Strength",
|
||||
(sidetext) = "%",
|
||||
(co_type_hint) = "coPercent",
|
||||
(co_type_hint) = coPercent,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Strength",
|
||||
(tab_optgroup) = "Infill",
|
||||
@@ -5513,7 +5513,7 @@ message PrintSettings {
|
||||
(tooltip) = "The portion of the model's outer surface within a certain depth range is called the skin. This parameter is used to adjust the density of this section. When two regions have the same sparse infill settings but different skin densities, this area will not be split into two separate regions. Default is as same as infill density.",
|
||||
(category) = "Print/Strength",
|
||||
(sidetext) = "%",
|
||||
(co_type_hint) = "coPercent",
|
||||
(co_type_hint) = coPercent,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Strength",
|
||||
(tab_optgroup) = "Infill",
|
||||
@@ -5623,7 +5623,7 @@ message PrintSettings {
|
||||
(category) = "Print/Strength",
|
||||
(sidetext) = "%",
|
||||
(ratio_over) = "inner_wall_line_width",
|
||||
(co_type_hint) = "coPercent",
|
||||
(co_type_hint) = coPercent,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Strength",
|
||||
(tab_optgroup) = "Infill",
|
||||
@@ -5639,7 +5639,7 @@ message PrintSettings {
|
||||
(category) = "Print/Strength",
|
||||
(sidetext) = "%",
|
||||
(ratio_over) = "inner_wall_line_width",
|
||||
(co_type_hint) = "coPercent",
|
||||
(co_type_hint) = coPercent,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Strength",
|
||||
(tab_optgroup) = "Top/bottom shells",
|
||||
@@ -5739,7 +5739,7 @@ message PrintSettings {
|
||||
(tooltip) = "Density of top surface layer. A value of 100% creates a fully solid, smooth top layer. Reducing this value results in a textured top surface, according to the chosen top surface pattern. A value of 0% will result in only the walls on the top layer being created. Intended for aesthetic or functional purposes, not to fix issues such as over-extrusion.",
|
||||
(category) = "Print/Strength",
|
||||
(sidetext) = "%",
|
||||
(co_type_hint) = "coPercent",
|
||||
(co_type_hint) = coPercent,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Strength",
|
||||
(tab_optgroup) = "Top/bottom shells",
|
||||
@@ -5755,7 +5755,7 @@ message PrintSettings {
|
||||
(tooltip) = "Density of the bottom surface layer. Intended for aesthetic or functional purposes, not to fix issues such as over-extrusion.\\nWARNING: Lowering this value may negatively affect bed adhesion.",
|
||||
(category) = "Print/Strength",
|
||||
(sidetext) = "%",
|
||||
(co_type_hint) = "coPercent",
|
||||
(co_type_hint) = coPercent,
|
||||
(tab_type) = "Print",
|
||||
(tab_page) = "Strength",
|
||||
(tab_optgroup) = "Top/bottom shells",
|
||||
@@ -5836,7 +5836,7 @@ message PrintSettings {
|
||||
(label) = "Bed type",
|
||||
(tooltip) = "Bed types supported by the printer.",
|
||||
(enum_keys_map_ref) = "s_keys_map_BedType",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(has_default) = true,
|
||||
(default_value) = "btPC",
|
||||
(enum_value_entries) = "Cool Plate",
|
||||
@@ -5997,7 +5997,7 @@ message PrintSettings {
|
||||
repeated string extruder_colour = 385 [
|
||||
(label) = "Extruder Color",
|
||||
(tooltip) = "Only used as a visual help on UI.",
|
||||
(gui_type) = "color",
|
||||
(gui_type) = color,
|
||||
(mode) = MODE_ADVANCED,
|
||||
(has_default) = true,
|
||||
(default_value) = "\"\"",
|
||||
@@ -6020,7 +6020,7 @@ message PrintSettings {
|
||||
repeated string filament_colour = 387 [
|
||||
(label) = "Color",
|
||||
(tooltip) = "Only used as a visual help on UI.",
|
||||
(gui_type) = "color",
|
||||
(gui_type) = color,
|
||||
(mode) = MODE_ADVANCED,
|
||||
(has_default) = true,
|
||||
(default_value) = "\"#F2754E\"",
|
||||
@@ -6065,7 +6065,7 @@ message PrintSettings {
|
||||
(label) = "filament mapping mode",
|
||||
(tooltip) = "Filament mapping mode used as plate param.",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<FilamentMapMode>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(mode) = MODE_ADVANCED,
|
||||
(has_default) = true,
|
||||
(default_value) = "fmmAutoForFlush",
|
||||
@@ -6155,7 +6155,7 @@ message PrintSettings {
|
||||
(label) = "Bed temperature type",
|
||||
(tooltip) = "This option determines how the bed temperature is set during slicing: based on the temperature of the first filament or the highest temperature of the printed filaments.",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<BedTempFormula>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(mode) = MODE_ADVANCED,
|
||||
(has_default) = true,
|
||||
(default_value) = "BedTempFormula::btfHighestTemp",
|
||||
@@ -6228,7 +6228,7 @@ message PrintSettings {
|
||||
repeated Point2D wrapping_exclude_area = 409 [
|
||||
(label) = "Probing exclude area of clumping",
|
||||
(tooltip) = "Probing exclude area of clumping.",
|
||||
(gui_type) = "one_string",
|
||||
(gui_type) = one_string,
|
||||
(mode) = MODE_ADVANCED,
|
||||
(has_default) = true,
|
||||
(default_value) = ""
|
||||
@@ -6320,7 +6320,7 @@ message PrintSettings {
|
||||
(label) = "Host Type",
|
||||
(tooltip) = "Orca Slicer can upload G-code files to a printer host. This field must contain the kind of the host.",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<PrintHostType>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(mode) = MODE_ADVANCED,
|
||||
(no_cli) = true,
|
||||
(has_default) = true,
|
||||
@@ -6479,7 +6479,7 @@ message PrintSettings {
|
||||
(label) = "Retract amount before wipe",
|
||||
(tooltip) = "The length of fast retraction before wipe, relative to retraction length.",
|
||||
(sidetext) = "%",
|
||||
(co_type_hint) = "coPercents",
|
||||
(co_type_hint) = coPercents,
|
||||
(mode) = MODE_ADVANCED,
|
||||
(has_default) = true,
|
||||
(default_value) = "100",
|
||||
@@ -6605,7 +6605,7 @@ message PrintSettings {
|
||||
(label) = "Z-hop type",
|
||||
(tooltip) = "Type of Z-hop.",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<ZHopType>::get_enum_values()",
|
||||
(co_type_hint) = "coEnums",
|
||||
(co_type_hint) = coEnums,
|
||||
(mode) = MODE_ADVANCED,
|
||||
(has_default) = true,
|
||||
(default_value) = "ZHopType::zhtSlope",
|
||||
@@ -6640,7 +6640,7 @@ message PrintSettings {
|
||||
(label) = "On surfaces",
|
||||
(tooltip) = "Enforce Z-Hop behavior. This setting is impacted by the above settings (Only lift Z above/below).",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<RetractLiftEnforceType>::get_enum_values()",
|
||||
(co_type_hint) = "coEnums",
|
||||
(co_type_hint) = coEnums,
|
||||
(mode) = MODE_ADVANCED,
|
||||
(has_default) = true,
|
||||
(default_value) = "RetractLiftEnforceType ::rletAllSurfaces",
|
||||
@@ -6662,7 +6662,7 @@ message PrintSettings {
|
||||
(label) = "Type",
|
||||
(tooltip) = "This setting is only used for initial value of manual calibration of pressure advance. Bowden extruder usually has larger PA value. This setting doesn't influence normal slicing.",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<ExtruderType>::get_enum_values()",
|
||||
(co_type_hint) = "coEnums",
|
||||
(co_type_hint) = coEnums,
|
||||
(mode) = MODE_ADVANCED,
|
||||
(has_default) = true,
|
||||
(default_value) = "ExtruderType::etDirectDrive",
|
||||
@@ -6678,7 +6678,7 @@ message PrintSettings {
|
||||
(label) = "Nozzle Volume Type",
|
||||
(tooltip) = "Nozzle volume type for extruders.",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<NozzleVolumeType>::get_enum_values()",
|
||||
(co_type_hint) = "coEnums",
|
||||
(co_type_hint) = coEnums,
|
||||
(has_default) = true,
|
||||
(default_value) = "NozzleVolumeType::nvtStandard",
|
||||
(enum_value_entries) = "Standard",
|
||||
@@ -6692,7 +6692,7 @@ message PrintSettings {
|
||||
(label) = "Default Nozzle Volume Type.",
|
||||
(tooltip) = "Default Nozzle volume type for extruders in this printer.",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<NozzleVolumeType>::get_enum_values()",
|
||||
(co_type_hint) = "coEnums",
|
||||
(co_type_hint) = coEnums,
|
||||
(mode) = MODE_DEVELOP,
|
||||
(has_default) = true,
|
||||
(default_value) = "NozzleVolumeType::nvtStandard",
|
||||
@@ -6872,7 +6872,7 @@ message PrintSettings {
|
||||
(label) = "Wipe tower type",
|
||||
(tooltip) = "Choose the wipe tower implementation for multi-material prints. Type 1 is recommended for Bambu and Qidi printers with a filament cutter. Type 2 offers better compatibility with multi-tool and MMU printers and provide overall better compatibility.",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<WipeTowerType>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(mode) = MODE_ADVANCED,
|
||||
(has_default) = true,
|
||||
(default_value) = "WipeTowerType::Type2",
|
||||
@@ -7026,7 +7026,7 @@ message PrintSettings {
|
||||
(label) = "Format of G-code thumbnails",
|
||||
(tooltip) = "Format of G-code thumbnails: PNG for best quality, JPG for smallest size, QOI for low memory firmware.",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<GCodeThumbnailsFormat>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(mode) = MODE_ADVANCED,
|
||||
(has_default) = true,
|
||||
(default_value) = "GCodeThumbnailsFormat::PNG",
|
||||
|
||||
@@ -203,7 +203,7 @@ message PrinterSettings {
|
||||
(tooltip) = "Choose how to control power loss recovery. When set to Printer configuration, the slicer will not emit power loss recovery G-code and will leave the printer's configuration unchanged. Applicable to Bambu Lab or Marlin 2 firmware based printers.",
|
||||
(category) = "Printer/Basic information",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<PowerLossRecoveryMode>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Printer",
|
||||
(tab_page) = "Basic information",
|
||||
(tab_optgroup) = "Advanced",
|
||||
@@ -224,7 +224,7 @@ message PrinterSettings {
|
||||
(tooltip) = "The metallic material of nozzle. This determines the abrasive resistance of nozzle, and what kind of filament can be printed.",
|
||||
(category) = "Printer/Basic information",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<NozzleType>::get_enum_values()",
|
||||
(co_type_hint) = "coEnums",
|
||||
(co_type_hint) = coEnums,
|
||||
(tab_type) = "Printer",
|
||||
(tab_page) = "Basic information",
|
||||
(tab_optgroup) = "Accessory",
|
||||
@@ -268,7 +268,7 @@ message PrinterSettings {
|
||||
(tooltip) = "The physical arrangement and components of a printing device.",
|
||||
(category) = "Printer/Basic information",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<PrinterStructure>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Printer",
|
||||
(tab_page) = "Basic information",
|
||||
(tab_optgroup) = "Advanced",
|
||||
@@ -421,7 +421,7 @@ message PrinterSettings {
|
||||
(tooltip) = "What kind of G-code the printer is compatible with.",
|
||||
(category) = "Printer/Basic information",
|
||||
(enum_keys_map_ref) = "ConfigOptionEnum<GCodeFlavor>::get_enum_values()",
|
||||
(co_type_hint) = "coEnum",
|
||||
(co_type_hint) = coEnum,
|
||||
(tab_type) = "Printer",
|
||||
(tab_page) = "Basic information",
|
||||
(tab_optgroup) = "Advanced",
|
||||
@@ -533,7 +533,7 @@ message PrinterSettings {
|
||||
(label) = "G-code thumbnails",
|
||||
(tooltip) = "Picture sizes to be stored into a .gcode and .sl1 / .sl1s files, in the following format: \\\"XxY, XxY, ...\\\"",
|
||||
(category) = "Printer/Basic information",
|
||||
(gui_type) = "one_string",
|
||||
(gui_type) = one_string,
|
||||
(tab_type) = "Printer",
|
||||
(tab_page) = "Basic information",
|
||||
(tab_optgroup) = "Advanced",
|
||||
|
||||
@@ -66,6 +66,19 @@ LABEL_REQUIRED = 2
|
||||
LABEL_REPEATED = 3
|
||||
|
||||
|
||||
def _enum_opt_name(opts, ext):
|
||||
"""Return the value *name* of an enum-typed field extension, or None if
|
||||
unset / the 0 sentinel. The proto enum constrains valid values at protoc
|
||||
time, while the codegen keeps using the name string (which matches the
|
||||
coXXX / ConfigOptionDef::GUIType C++ identifier)."""
|
||||
if not opts.HasExtension(ext):
|
||||
return None
|
||||
val = opts.Extensions[ext]
|
||||
if val == 0:
|
||||
return None
|
||||
return ext.enum_type.values_by_number[val].name
|
||||
|
||||
|
||||
def mode_to_cpp(mode_val):
|
||||
"""Convert mode enum value to C++ constant."""
|
||||
return {
|
||||
@@ -203,7 +216,7 @@ class FieldInfo:
|
||||
self.full_width = opts.Extensions[meta_pb2.full_width]
|
||||
self.height = opts.Extensions[meta_pb2.height] or None
|
||||
self.is_nullable = opts.Extensions[meta_pb2.is_nullable]
|
||||
self.gui_type = opts.Extensions[meta_pb2.gui_type] or None
|
||||
self.gui_type = _enum_opt_name(opts, meta_pb2.gui_type)
|
||||
self.gui_flags = opts.Extensions[meta_pb2.gui_flags] or None
|
||||
self.enum_keys_map = opts.Extensions[meta_pb2.enum_keys_map_ref] or None
|
||||
self.no_cli = opts.Extensions[meta_pb2.no_cli]
|
||||
@@ -218,7 +231,7 @@ class FieldInfo:
|
||||
self.default_value = opts.Extensions[meta_pb2.default_value] if self.has_default else None
|
||||
self.enum_value_entries = list(opts.Extensions[meta_pb2.enum_value_entries])
|
||||
self.enum_label_entries = list(opts.Extensions[meta_pb2.enum_label_entries])
|
||||
self.co_type_hint = opts.Extensions[meta_pb2.co_type_hint] or None
|
||||
self.co_type_hint = _enum_opt_name(opts, meta_pb2.co_type_hint)
|
||||
|
||||
# Resolve C++ type info - co_type_hint overrides auto-detection
|
||||
co_type, option_class, is_vec = proto_type_to_co_type(
|
||||
@@ -578,6 +591,129 @@ class CodeGenerator:
|
||||
return str(val)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Lint pass — catch typos that protoc accepts but break the build or runtime.
|
||||
# protoc only validates proto-level correctness (field numbers, option types).
|
||||
# It has no idea that option strings get pasted into C++ L("...") literals, or
|
||||
# that a default must lie within [min_value, max_value]. These checks close that
|
||||
# gap so a bad edit fails fast at codegen time instead of at C++ compile / DLL
|
||||
# load / slice time.
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# String options that the generator emits verbatim into C++ L("...") literals.
|
||||
_CPP_STRING_ATTRS = ("label", "full_label", "tooltip", "category", "sidetext")
|
||||
|
||||
_NUMERIC_SCALAR = {"coFloat", "coInt", "coPercent"}
|
||||
_NUMERIC_VECTOR = {"coFloats", "coInts", "coPercents"}
|
||||
_INT_TYPES = {"coInt", "coInts"}
|
||||
_BOOL_TYPES = {"coBool", "coBools"}
|
||||
|
||||
|
||||
def _has_unescaped_quote(s):
|
||||
"""True if the (proto-parsed) string contains a double-quote that is NOT
|
||||
backslash-escaped. Such a quote would terminate the generated C++ L("...")
|
||||
literal and break compilation. Mirrors how _escape_cpp passes strings
|
||||
through unchanged, so the proto must already carry '\\"' for a literal quote.
|
||||
"""
|
||||
if not s:
|
||||
return False
|
||||
t = s.replace('\\\\', '') # drop escaped backslashes so they don't mask a following quote
|
||||
t = t.replace('\\"', '') # drop already-escaped quotes
|
||||
return '"' in t
|
||||
|
||||
|
||||
# A plain C++ numeric literal: optional sign, digits/decimal, optional exponent,
|
||||
# optional float suffix (e.g. "200", "0.", "-5", "1.5e3", "60.0f"). Anything else
|
||||
# in default_value (identifiers, macros, "nil_value()", "{0.0}") is an intentional
|
||||
# C++ expression that the generator passes through verbatim — not range-checkable.
|
||||
_NUM_LIT = re.compile(r'^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?[fF]?$')
|
||||
|
||||
|
||||
def _num_tokens(dv):
|
||||
"""Split a default into comma-separated tokens. Returns (tokens, all_numeric)."""
|
||||
tokens = [t.strip() for t in dv.split(',') if t.strip() != ""]
|
||||
all_numeric = bool(tokens) and all(_NUM_LIT.match(t) for t in tokens)
|
||||
return tokens, all_numeric
|
||||
|
||||
|
||||
def _lint_default(field, errors):
|
||||
"""Validate a field's default_value against its type and numeric range.
|
||||
|
||||
Only plain numeric-literal defaults are checked; defaults that are C++
|
||||
expressions/constants are passed through by the generator and skipped here.
|
||||
"""
|
||||
dv = field.default_value
|
||||
name = field.name
|
||||
|
||||
if field.co_type in _NUMERIC_SCALAR or field.co_type in _NUMERIC_VECTOR:
|
||||
tokens, all_numeric = _num_tokens(dv)
|
||||
if not all_numeric:
|
||||
return # intentional C++ expression (e.g. macro, nil_value(), braced init)
|
||||
for tok in tokens:
|
||||
num = float(tok.rstrip('fF'))
|
||||
if field.co_type in _INT_TYPES and num != int(num):
|
||||
errors.append(f"{name}: default_value '{dv}' is not an integer for {field.co_type}")
|
||||
if field.min_value is not None and num < field.min_value:
|
||||
errors.append(f"{name}: default {tok} is below min_value {field.min_value}")
|
||||
if field.max_value is not None and num > field.max_value:
|
||||
errors.append(f"{name}: default {tok} is above max_value {field.max_value}")
|
||||
|
||||
elif field.co_type in _BOOL_TYPES:
|
||||
for tok in (t.strip().lower() for t in dv.split(',') if t.strip() != ""):
|
||||
# Only flag clear numeric mistakes; bare identifiers are C++ constants.
|
||||
if _NUM_LIT.match(tok) and tok not in ("0", "1"):
|
||||
errors.append(f"{name}: default_value token '{tok}' is not a valid bool for {field.co_type}")
|
||||
|
||||
|
||||
def lint_fields(fields):
|
||||
"""Return (errors, warnings) lists for the parsed fields.
|
||||
|
||||
Errors block code generation; warnings are advisory.
|
||||
"""
|
||||
errors = []
|
||||
warnings = []
|
||||
field_names = {f.name for f in fields}
|
||||
seen = set()
|
||||
|
||||
for f in fields:
|
||||
# Duplicate field name -> duplicate add() in generated C++ (redefinition).
|
||||
if f.name in seen:
|
||||
errors.append(f"{f.name}: duplicate field name across proto files")
|
||||
seen.add(f.name)
|
||||
|
||||
# min > max is always a mistake.
|
||||
if (f.min_value is not None and f.max_value is not None
|
||||
and f.min_value > f.max_value):
|
||||
errors.append(f"{f.name}: min_value ({f.min_value}) > max_value ({f.max_value})")
|
||||
|
||||
# Unescaped quotes in strings emitted into C++ L("...") break compilation.
|
||||
for attr in _CPP_STRING_ATTRS:
|
||||
val = getattr(f, attr)
|
||||
if val and _has_unescaped_quote(val):
|
||||
errors.append(f'{f.name}: ({attr}) has an unescaped double-quote — '
|
||||
f'use \\\\\\" in the proto for a literal quote')
|
||||
for el in f.enum_label_entries:
|
||||
if _has_unescaped_quote(el):
|
||||
errors.append(f"{f.name}: enum label '{el}' has an unescaped double-quote")
|
||||
|
||||
# coEnum with a keys map but no value entries can fail to deserialize unless
|
||||
# the keys map is supplied in C++ (see AGENTS.md). Advisory — some enums
|
||||
# legitimately source their values from a get_enum_values() keys map.
|
||||
if f.co_type == "coEnum" and f.enum_keys_map and not f.enum_value_entries:
|
||||
warnings.append(f"{f.name}: coEnum has (enum_keys_map_ref) but no (enum_value_entries) "
|
||||
f"— verify profile values deserialize (see AGENTS.md)")
|
||||
|
||||
# default_value type/range checks.
|
||||
if f.has_default and f.default_value:
|
||||
_lint_default(f, errors)
|
||||
|
||||
# ratio_over should point at a real key (advisory — may reference a virtual key).
|
||||
if f.ratio_over and f.ratio_over not in field_names:
|
||||
warnings.append(f"{f.name}: ratio_over references unknown key '{f.ratio_over}'")
|
||||
|
||||
return errors, warnings
|
||||
|
||||
|
||||
def _group_name_to_hook(name):
|
||||
"""Convert group name to a C++ hook method suffix: 'Cooling Fan' -> 'cooling_fan'."""
|
||||
return re.sub(r'[^a-z0-9]+', '_', name.lower()).strip('_')
|
||||
@@ -815,6 +951,8 @@ def main():
|
||||
help="Path to compiled .desc file (protoc --descriptor_set_out)")
|
||||
parser.add_argument("output_dir",
|
||||
help="Directory to write generated C++ files")
|
||||
parser.add_argument("--lint-only", action="store_true",
|
||||
help="Run proto lint checks and exit without writing files")
|
||||
args = parser.parse_args()
|
||||
|
||||
# Read descriptor set
|
||||
@@ -837,6 +975,21 @@ def main():
|
||||
# Generate code
|
||||
gen = CodeGenerator(file_descriptor_set)
|
||||
|
||||
# Lint before writing anything so a bad proto edit never produces broken
|
||||
# generated files (fails fast at codegen instead of C++ compile / runtime).
|
||||
errors, warnings = lint_fields(gen.fields)
|
||||
for w in warnings:
|
||||
print(f" LINT WARNING: {w}")
|
||||
if errors:
|
||||
print(f"\n*** Proto lint FAILED ({len(errors)} error(s)) ***")
|
||||
for e in errors:
|
||||
print(f" LINT ERROR: {e}")
|
||||
sys.exit(2)
|
||||
print(f"Lint passed ({len(gen.fields)} fields checked, {len(warnings)} warning(s))")
|
||||
|
||||
if args.lint_only:
|
||||
return
|
||||
|
||||
output_dir = Path(args.output_dir)
|
||||
output_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# NO CHECKED-IN PROTOBUF GENCODE
|
||||
# source: config_metadata.proto
|
||||
# Protobuf Python Version: 6.32.1
|
||||
# Protobuf Python Version: 6.33.5
|
||||
"""Generated protocol buffer code."""
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||
@@ -12,8 +12,8 @@ from google.protobuf.internal import builder as _builder
|
||||
_runtime_version.ValidateProtobufRuntimeVersion(
|
||||
_runtime_version.Domain.PUBLIC,
|
||||
6,
|
||||
32,
|
||||
1,
|
||||
33,
|
||||
5,
|
||||
'',
|
||||
'config_metadata.proto'
|
||||
)
|
||||
@@ -25,7 +25,7 @@ _sym_db = _symbol_database.Default()
|
||||
from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2
|
||||
|
||||
|
||||
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15\x63onfig_metadata.proto\x12\x04orca\x1a google/protobuf/descriptor.proto\"0\n\x0e\x46loatOrPercent\x12\r\n\x05value\x18\x01 \x01(\x01\x12\x0f\n\x07percent\x18\x02 \x01(\x08\"\x1f\n\x07Point2D\x12\t\n\x01x\x18\x01 \x01(\x01\x12\t\n\x01y\x18\x02 \x01(\x01*B\n\nConfigMode\x12\x0f\n\x0bMODE_SIMPLE\x10\x00\x12\x11\n\rMODE_ADVANCED\x10\x01\x12\x10\n\x0cMODE_DEVELOP\x10\x02*G\n\nPresetType\x12\x10\n\x0cPRESET_PRINT\x10\x00\x12\x13\n\x0fPRESET_FILAMENT\x10\x01\x12\x12\n\x0ePRESET_PRINTER\x10\x02*\xaa\x01\n\x10InvalidationStep\x12\x15\n\x11STEP_GCODE_EXPORT\x10\x00\x12\x13\n\x0fSTEP_SKIRT_BRIM\x10\x01\x12\x13\n\x0fSTEP_WIPE_TOWER\x10\x02\x12\x0e\n\nSTEP_SLICE\x10\x03\x12\x13\n\x0fSTEP_PERIMETERS\x10\x04\x12\x0f\n\x0bSTEP_INFILL\x10\x05\x12\x10\n\x0cSTEP_SUPPORT\x10\x06\x12\r\n\tSTEP_NONE\x10\x07*\x81\x01\n\x14OptionListMembership\x12\r\n\tLIST_NONE\x10\x00\x12\x1d\n\x19LIST_EXTRUDER_OPTION_KEYS\x10\x01\x12\x1d\n\x19LIST_FILAMENT_OPTION_KEYS\x10\x02\x12\x1c\n\x18LIST_VARIANT_OPTION_KEYS\x10\x03:.\n\x05label\x12\x1d.google.protobuf.FieldOptions\x18\xd1\x86\x03 \x01(\t:3\n\nfull_label\x12\x1d.google.protobuf.FieldOptions\x18\xd2\x86\x03 \x01(\t:0\n\x07tooltip\x12\x1d.google.protobuf.FieldOptions\x18\xd3\x86\x03 \x01(\t:1\n\x08\x63\x61tegory\x12\x1d.google.protobuf.FieldOptions\x18\xd4\x86\x03 \x01(\t:1\n\x08sidetext\x12\x1d.google.protobuf.FieldOptions\x18\xd5\x86\x03 \x01(\t:2\n\tmin_value\x12\x1d.google.protobuf.FieldOptions\x18\xd6\x86\x03 \x01(\x01:2\n\tmax_value\x12\x1d.google.protobuf.FieldOptions\x18\xd7\x86\x03 \x01(\x01:4\n\x0bmax_literal\x12\x1d.google.protobuf.FieldOptions\x18\xd8\x86\x03 \x01(\x01:?\n\x04mode\x12\x1d.google.protobuf.FieldOptions\x18\xd9\x86\x03 \x01(\x0e\x32\x10.orca.ConfigMode:3\n\nratio_over\x12\x1d.google.protobuf.FieldOptions\x18\xda\x86\x03 \x01(\t:2\n\tmultiline\x12\x1d.google.protobuf.FieldOptions\x18\xdd\x86\x03 \x01(\x08:3\n\nfull_width\x12\x1d.google.protobuf.FieldOptions\x18\xde\x86\x03 \x01(\x08:/\n\x06height\x12\x1d.google.protobuf.FieldOptions\x18\xdf\x86\x03 \x01(\x05:A\n\x06preset\x12\x1d.google.protobuf.FieldOptions\x18\xdb\x86\x03 \x01(\x0e\x32\x10.orca.PresetType:L\n\x0binvalidates\x12\x1d.google.protobuf.FieldOptions\x18\xdc\x86\x03 \x03(\x0e\x32\x16.orca.InvalidationStep:T\n\x0flist_membership\x12\x1d.google.protobuf.FieldOptions\x18\xe2\x86\x03 \x03(\x0e\x32\x1a.orca.OptionListMembership:4\n\x0blegacy_name\x12\x1d.google.protobuf.FieldOptions\x18\xe0\x86\x03 \x01(\t:4\n\x0bis_nullable\x12\x1d.google.protobuf.FieldOptions\x18\xe1\x86\x03 \x01(\x08:1\n\x08gui_type\x12\x1d.google.protobuf.FieldOptions\x18\xe3\x86\x03 \x01(\t:2\n\tgui_flags\x12\x1d.google.protobuf.FieldOptions\x18\xe4\x86\x03 \x01(\t::\n\x11\x65num_keys_map_ref\x12\x1d.google.protobuf.FieldOptions\x18\xe5\x86\x03 \x01(\t:/\n\x06no_cli\x12\x1d.google.protobuf.FieldOptions\x18\xe6\x86\x03 \x01(\x08:1\n\x08readonly\x12\x1d.google.protobuf.FieldOptions\x18\xe7\x86\x03 \x01(\x08:5\n\x0c\x63o_type_hint\x12\x1d.google.protobuf.FieldOptions\x18\xe8\x86\x03 \x01(\t:6\n\rdefault_value\x12\x1d.google.protobuf.FieldOptions\x18\xe9\x86\x03 \x01(\t:4\n\x0bhas_default\x12\x1d.google.protobuf.FieldOptions\x18\xec\x86\x03 \x01(\x08:;\n\x12\x65num_value_entries\x12\x1d.google.protobuf.FieldOptions\x18\xea\x86\x03 \x03(\t:;\n\x12\x65num_label_entries\x12\x1d.google.protobuf.FieldOptions\x18\xeb\x86\x03 \x03(\t:1\n\x08tab_type\x12\x1d.google.protobuf.FieldOptions\x18\xed\x86\x03 \x01(\t:1\n\x08tab_page\x12\x1d.google.protobuf.FieldOptions\x18\xee\x86\x03 \x01(\t:5\n\x0ctab_optgroup\x12\x1d.google.protobuf.FieldOptions\x18\xef\x86\x03 \x01(\t:>\n\x13virtual_preset_keys\x12\x1f.google.protobuf.MessageOptions\x18\xe1\xd4\x03 \x03(\tb\x06proto3')
|
||||
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15\x63onfig_metadata.proto\x12\x04orca\x1a google/protobuf/descriptor.proto\"0\n\x0e\x46loatOrPercent\x12\r\n\x05value\x18\x01 \x01(\x01\x12\x0f\n\x07percent\x18\x02 \x01(\x08\"\x1f\n\x07Point2D\x12\t\n\x01x\x18\x01 \x01(\x01\x12\t\n\x01y\x18\x02 \x01(\x01*B\n\nConfigMode\x12\x0f\n\x0bMODE_SIMPLE\x10\x00\x12\x11\n\rMODE_ADVANCED\x10\x01\x12\x10\n\x0cMODE_DEVELOP\x10\x02*G\n\nPresetType\x12\x10\n\x0cPRESET_PRINT\x10\x00\x12\x13\n\x0fPRESET_FILAMENT\x10\x01\x12\x12\n\x0ePRESET_PRINTER\x10\x02*\xaa\x01\n\x10InvalidationStep\x12\x15\n\x11STEP_GCODE_EXPORT\x10\x00\x12\x13\n\x0fSTEP_SKIRT_BRIM\x10\x01\x12\x13\n\x0fSTEP_WIPE_TOWER\x10\x02\x12\x0e\n\nSTEP_SLICE\x10\x03\x12\x13\n\x0fSTEP_PERIMETERS\x10\x04\x12\x0f\n\x0bSTEP_INFILL\x10\x05\x12\x10\n\x0cSTEP_SUPPORT\x10\x06\x12\r\n\tSTEP_NONE\x10\x07*\x81\x01\n\x14OptionListMembership\x12\r\n\tLIST_NONE\x10\x00\x12\x1d\n\x19LIST_EXTRUDER_OPTION_KEYS\x10\x01\x12\x1d\n\x19LIST_FILAMENT_OPTION_KEYS\x10\x02\x12\x1c\n\x18LIST_VARIANT_OPTION_KEYS\x10\x03*\\\n\nCoTypeHint\x12\x16\n\x12\x43O_TYPE_HINT_UNSET\x10\x00\x12\r\n\tcoPercent\x10\x01\x12\x0e\n\ncoPercents\x10\x02\x12\n\n\x06\x63oEnum\x10\x03\x12\x0b\n\x07\x63oEnums\x10\x04*\x83\x01\n\x07GuiType\x12\x12\n\x0eGUI_TYPE_UNSET\x10\x00\x12\x0f\n\x0bi_enum_open\x10\x01\x12\x0f\n\x0b\x66_enum_open\x10\x02\x12\t\n\x05\x63olor\x10\x03\x12\x0f\n\x0bselect_open\x10\x04\x12\n\n\x06slider\x10\x05\x12\n\n\x06legend\x10\x06\x12\x0e\n\none_string\x10\x07:.\n\x05label\x12\x1d.google.protobuf.FieldOptions\x18\xd1\x86\x03 \x01(\t:3\n\nfull_label\x12\x1d.google.protobuf.FieldOptions\x18\xd2\x86\x03 \x01(\t:0\n\x07tooltip\x12\x1d.google.protobuf.FieldOptions\x18\xd3\x86\x03 \x01(\t:1\n\x08\x63\x61tegory\x12\x1d.google.protobuf.FieldOptions\x18\xd4\x86\x03 \x01(\t:1\n\x08sidetext\x12\x1d.google.protobuf.FieldOptions\x18\xd5\x86\x03 \x01(\t:2\n\tmin_value\x12\x1d.google.protobuf.FieldOptions\x18\xd6\x86\x03 \x01(\x01:2\n\tmax_value\x12\x1d.google.protobuf.FieldOptions\x18\xd7\x86\x03 \x01(\x01:4\n\x0bmax_literal\x12\x1d.google.protobuf.FieldOptions\x18\xd8\x86\x03 \x01(\x01:?\n\x04mode\x12\x1d.google.protobuf.FieldOptions\x18\xd9\x86\x03 \x01(\x0e\x32\x10.orca.ConfigMode:3\n\nratio_over\x12\x1d.google.protobuf.FieldOptions\x18\xda\x86\x03 \x01(\t:2\n\tmultiline\x12\x1d.google.protobuf.FieldOptions\x18\xdd\x86\x03 \x01(\x08:3\n\nfull_width\x12\x1d.google.protobuf.FieldOptions\x18\xde\x86\x03 \x01(\x08:/\n\x06height\x12\x1d.google.protobuf.FieldOptions\x18\xdf\x86\x03 \x01(\x05:A\n\x06preset\x12\x1d.google.protobuf.FieldOptions\x18\xdb\x86\x03 \x01(\x0e\x32\x10.orca.PresetType:L\n\x0binvalidates\x12\x1d.google.protobuf.FieldOptions\x18\xdc\x86\x03 \x03(\x0e\x32\x16.orca.InvalidationStep:T\n\x0flist_membership\x12\x1d.google.protobuf.FieldOptions\x18\xe2\x86\x03 \x03(\x0e\x32\x1a.orca.OptionListMembership:4\n\x0blegacy_name\x12\x1d.google.protobuf.FieldOptions\x18\xe0\x86\x03 \x01(\t:4\n\x0bis_nullable\x12\x1d.google.protobuf.FieldOptions\x18\xe1\x86\x03 \x01(\x08:@\n\x08gui_type\x12\x1d.google.protobuf.FieldOptions\x18\xe3\x86\x03 \x01(\x0e\x32\r.orca.GuiType:2\n\tgui_flags\x12\x1d.google.protobuf.FieldOptions\x18\xe4\x86\x03 \x01(\t::\n\x11\x65num_keys_map_ref\x12\x1d.google.protobuf.FieldOptions\x18\xe5\x86\x03 \x01(\t:/\n\x06no_cli\x12\x1d.google.protobuf.FieldOptions\x18\xe6\x86\x03 \x01(\x08:1\n\x08readonly\x12\x1d.google.protobuf.FieldOptions\x18\xe7\x86\x03 \x01(\x08:G\n\x0c\x63o_type_hint\x12\x1d.google.protobuf.FieldOptions\x18\xe8\x86\x03 \x01(\x0e\x32\x10.orca.CoTypeHint:6\n\rdefault_value\x12\x1d.google.protobuf.FieldOptions\x18\xe9\x86\x03 \x01(\t:4\n\x0bhas_default\x12\x1d.google.protobuf.FieldOptions\x18\xec\x86\x03 \x01(\x08:;\n\x12\x65num_value_entries\x12\x1d.google.protobuf.FieldOptions\x18\xea\x86\x03 \x03(\t:;\n\x12\x65num_label_entries\x12\x1d.google.protobuf.FieldOptions\x18\xeb\x86\x03 \x03(\t:1\n\x08tab_type\x12\x1d.google.protobuf.FieldOptions\x18\xed\x86\x03 \x01(\t:1\n\x08tab_page\x12\x1d.google.protobuf.FieldOptions\x18\xee\x86\x03 \x01(\t:5\n\x0ctab_optgroup\x12\x1d.google.protobuf.FieldOptions\x18\xef\x86\x03 \x01(\t:>\n\x13virtual_preset_keys\x12\x1f.google.protobuf.MessageOptions\x18\xe1\xd4\x03 \x03(\tb\x06proto3')
|
||||
|
||||
_globals = globals()
|
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
||||
@@ -40,6 +40,10 @@ if not _descriptor._USE_C_DESCRIPTORS:
|
||||
_globals['_INVALIDATIONSTEP']._serialized_end=460
|
||||
_globals['_OPTIONLISTMEMBERSHIP']._serialized_start=463
|
||||
_globals['_OPTIONLISTMEMBERSHIP']._serialized_end=592
|
||||
_globals['_COTYPEHINT']._serialized_start=594
|
||||
_globals['_COTYPEHINT']._serialized_end=686
|
||||
_globals['_GUITYPE']._serialized_start=689
|
||||
_globals['_GUITYPE']._serialized_end=820
|
||||
_globals['_FLOATORPERCENT']._serialized_start=65
|
||||
_globals['_FLOATORPERCENT']._serialized_end=113
|
||||
_globals['_POINT2D']._serialized_start=115
|
||||
|
||||
@@ -87,6 +87,12 @@ def step_generate():
|
||||
str(DESC_FILE), str(CODEGEN_OUT)])
|
||||
|
||||
|
||||
def step_lint():
|
||||
print("\n=== Lint: proto sanity checks ===")
|
||||
return run([sys.executable, str(ROOT / "tools" / "config_codegen.py"),
|
||||
str(DESC_FILE), str(CODEGEN_OUT), "--lint-only"])
|
||||
|
||||
|
||||
def step_validate():
|
||||
print("\n=== Step 3: Validate ===")
|
||||
return run([sys.executable, str(ROOT / "tools" / "validate_codegen.py")])
|
||||
@@ -101,7 +107,8 @@ def main():
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.validate_only:
|
||||
sys.exit(0 if step_validate() else 1)
|
||||
# Compile + lint the protos, then check the committed generated files are current.
|
||||
sys.exit(0 if (step_compile() and step_lint() and step_validate()) else 1)
|
||||
|
||||
for name, fn in [("Compile", step_compile), ("Generate", step_generate)]:
|
||||
if not fn():
|
||||
|
||||
Reference in New Issue
Block a user