mirror of
https://github.com/QIDITECH/QIDISlicer.git
synced 2026-01-31 16:08:43 +03:00
PRUSA 2.7.0
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
#include "PrintConfig.hpp"
|
||||
#include "Config.hpp"
|
||||
#include "I18N.hpp"
|
||||
#include "format.hpp"
|
||||
|
||||
#include "SLA/SupportTree.hpp"
|
||||
#include "GCode/Thumbnails.hpp"
|
||||
|
||||
#include <set>
|
||||
#include <boost/algorithm/string/replace.hpp>
|
||||
@@ -34,6 +36,11 @@ static t_config_enum_names enum_names_from_keys_map(const t_config_enum_values &
|
||||
template<> const t_config_enum_values& ConfigOptionEnum<NAME>::get_enum_values() { return s_keys_map_##NAME; } \
|
||||
template<> const t_config_enum_names& ConfigOptionEnum<NAME>::get_enum_names() { return s_keys_names_##NAME; }
|
||||
|
||||
static const t_config_enum_values s_keys_map_ArcFittingType {
|
||||
{ "disabled", int(ArcFittingType::Disabled) },
|
||||
{ "emit_center", int(ArcFittingType::EmitCenter) }
|
||||
};
|
||||
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(ArcFittingType)
|
||||
static t_config_enum_values s_keys_map_PrinterTechnology {
|
||||
{ "FFF", ptFFF },
|
||||
{ "SLA", ptSLA }
|
||||
@@ -199,8 +206,13 @@ static const t_config_enum_values s_keys_map_DraftShield = {
|
||||
};
|
||||
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(DraftShield)
|
||||
|
||||
static const t_config_enum_values s_keys_map_LabelObjectsStyle = {
|
||||
{ "disabled", int(LabelObjectsStyle::Disabled) },
|
||||
{ "octoprint", int(LabelObjectsStyle::Octoprint) },
|
||||
{ "firmware", int(LabelObjectsStyle::Firmware) }
|
||||
};
|
||||
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(LabelObjectsStyle)
|
||||
static const t_config_enum_values s_keys_map_GCodeThumbnailsFormat = {
|
||||
{ "QIDI", int(GCodeThumbnailsFormat::QIDI) },
|
||||
{ "PNG", int(GCodeThumbnailsFormat::PNG) },
|
||||
{ "JPG", int(GCodeThumbnailsFormat::JPG) },
|
||||
{ "QOI", int(GCodeThumbnailsFormat::QOI) }
|
||||
@@ -259,15 +271,6 @@ void PrintConfigDef::init_common_params()
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionPoints{ Vec2d(0, 0), Vec2d(200, 0), Vec2d(200, 200), Vec2d(0, 200) });
|
||||
|
||||
//Y18
|
||||
def = this->add("bed_exclude_area", coPoints);
|
||||
def->label = L("Bed exclude area");
|
||||
def->tooltip = L("Unprintable area in XY plane. For example, X1 Series printers use the front left corner to cut filament during filament change. "
|
||||
"The area is expressed as polygon by points in following format: \"XxY, XxY, ...\"");
|
||||
def->mode = comExpert;
|
||||
def->gui_type = ConfigOptionDef::GUIType::one_string;
|
||||
def->set_default_value(new ConfigOptionPoints{ Vec2d(0, 0) });
|
||||
|
||||
def = this->add("bed_custom_texture", coString);
|
||||
def->label = L("Bed custom texture");
|
||||
def->mode = comAdvanced;
|
||||
@@ -288,20 +291,20 @@ void PrintConfigDef::init_common_params()
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionFloat(0.));
|
||||
|
||||
def = this->add("thumbnails", coPoints);
|
||||
def = this->add("thumbnails", coString);
|
||||
def->label = L("G-code thumbnails");
|
||||
def->tooltip = L("Picture sizes to be stored into a .gcode and .sl1 / .sl1s files, in the following format: \"XxY, XxY, ...\"");
|
||||
def->tooltip = L("Picture sizes to be stored into a .gcode / .bgcode and .sl1 / .sl1s files, in the following format: \"XxY/EXT, XxY/EXT, ...\"\n"
|
||||
"Currently supported extensions are PNG, QOI and JPG.");
|
||||
def->mode = comExpert;
|
||||
def->gui_type = ConfigOptionDef::GUIType::one_string;
|
||||
def->set_default_value(new ConfigOptionPoints());
|
||||
def->set_default_value(new ConfigOptionString());
|
||||
|
||||
def = this->add("thumbnails_format", coEnum);
|
||||
def->label = L("Format of G-code thumbnails");
|
||||
def->tooltip = L("Format of G-code thumbnails: PNG for best quality, JPG for smallest size, QOI for low memory firmware");
|
||||
def->mode = comExpert;
|
||||
//B3
|
||||
def->set_enum<GCodeThumbnailsFormat>({ "QIDI","PNG", "JPG", "QOI" });
|
||||
def->set_default_value(new ConfigOptionEnum<GCodeThumbnailsFormat>(GCodeThumbnailsFormat::QIDI));
|
||||
def->set_enum<GCodeThumbnailsFormat>({"PNG", "JPG", "QOI" });
|
||||
def->set_default_value(new ConfigOptionEnum<GCodeThumbnailsFormat>(GCodeThumbnailsFormat::PNG));
|
||||
|
||||
def = this->add("layer_height", coFloat);
|
||||
def->label = L("Layer height");
|
||||
@@ -408,6 +411,16 @@ void PrintConfigDef::init_fff_params()
|
||||
{
|
||||
ConfigOptionDef* def;
|
||||
|
||||
def = this->add("arc_fitting", coEnum);
|
||||
def->label = L("Arc fitting");
|
||||
def->tooltip = L("Enable to get a G-code file which has G2 and G3 moves. "
|
||||
"G-code resolution will be used as the fitting tolerance.");
|
||||
def->set_enum<ArcFittingType>({
|
||||
{ "disabled", "Disabled" },
|
||||
{ "emit_center", "Enabled: G2/3 I J" }
|
||||
});
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionEnum<ArcFittingType>(ArcFittingType::Disabled));
|
||||
// Maximum extruder temperature, bumped to 1500 to support printing of glass.
|
||||
const int max_temp = 1500;
|
||||
def = this->add("avoid_crossing_curled_overhangs", coBool);
|
||||
@@ -1512,13 +1525,20 @@ void PrintConfigDef::init_fff_params()
|
||||
def->mode = comExpert;
|
||||
def->set_default_value(new ConfigOptionEnum<GCodeFlavor>(gcfRepRapSprinter));
|
||||
|
||||
def = this->add("gcode_label_objects", coBool);
|
||||
def = this->add("gcode_label_objects", coEnum);
|
||||
def->label = L("Label objects");
|
||||
def->tooltip = L("Enable this to add comments into the G-Code labeling print moves with what object they belong to,"
|
||||
" which is useful for the Octoprint CancelObject plugin. This settings is NOT compatible with "
|
||||
"Single Extruder Multi Material setup and Wipe into Object / Wipe into Infill.");
|
||||
def->tooltip = L("Selects whether labels should be exported at object boundaries and in what format.\n"
|
||||
"OctoPrint = comments to be consumed by OctoPrint CancelObject plugin.\n"
|
||||
"Firmware = firmware specific G-code (it will be chosen based on firmware flavor and it can end up to be empty).\n\n"
|
||||
"This settings is NOT compatible with Single Extruder Multi Material setup and Wipe into Object / Wipe into Infill.");
|
||||
|
||||
def->set_enum<LabelObjectsStyle>({
|
||||
{ "disabled", L("Disabled") },
|
||||
{ "octoprint", L("OctoPrint comments") },
|
||||
{ "firmware", L("Firmware-specific") }
|
||||
});
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionBool(0));
|
||||
def->set_default_value(new ConfigOptionEnum<LabelObjectsStyle>(LabelObjectsStyle::Disabled));
|
||||
|
||||
def = this->add("gcode_substitutions", coStrings);
|
||||
def->label = L("G-code substitutions");
|
||||
@@ -1526,6 +1546,11 @@ void PrintConfigDef::init_fff_params()
|
||||
def->mode = comExpert;
|
||||
def->set_default_value(new ConfigOptionStrings());
|
||||
|
||||
def = this->add("gcode_binary", coBool);
|
||||
def->label = L("Export as binary G-code");
|
||||
def->tooltip = L("Export G-code in binary format.");
|
||||
def->mode = comExpert;
|
||||
def->set_default_value(new ConfigOptionBool(0));
|
||||
def = this->add("high_current_on_filament_swap", coBool);
|
||||
def->label = L("High extruder current on filament swap");
|
||||
def->tooltip = L("It may be beneficial to increase the extruder motor current during the filament exchange"
|
||||
@@ -2121,7 +2146,7 @@ void PrintConfigDef::init_fff_params()
|
||||
def->label = L("Output filename format");
|
||||
def->tooltip = L("You can use all configuration options as variables inside this template. "
|
||||
"For example: [layer_height], [fill_density] etc. You can also use [timestamp], "
|
||||
"[year], [month], [day], [hour], [minute], [second], [version], [input_filename], "
|
||||
"[year], [month], [day], [hour], [minute], [second], [version], "
|
||||
"[input_filename_base], [default_output_extension].");
|
||||
def->full_width = true;
|
||||
def->mode = comExpert;
|
||||
@@ -2359,7 +2384,7 @@ void PrintConfigDef::init_fff_params()
|
||||
def->set_default_value(new ConfigOptionBools { false });
|
||||
|
||||
def = this->add("retract_length", coFloats);
|
||||
def->label = L("Length");
|
||||
def->label = L("Retraction length");
|
||||
def->full_label = L("Retraction Length");
|
||||
def->tooltip = L("When retraction is triggered, filament is pulled back by the specified amount "
|
||||
"(the length is measured on raw filament, before it enters the extruder).");
|
||||
@@ -2376,12 +2401,46 @@ void PrintConfigDef::init_fff_params()
|
||||
def->mode = comExpert;
|
||||
def->set_default_value(new ConfigOptionFloats { 10. });
|
||||
|
||||
def = this->add("retract_lift", coFloats);
|
||||
def->label = L("Lift Z");
|
||||
def->tooltip = L("If you set this to a positive value, Z is quickly raised every time a retraction "
|
||||
"is triggered. When using multiple extruders, only the setting for the first extruder "
|
||||
"will be considered.");
|
||||
def = this->add("travel_slope", coFloats);
|
||||
def->label = L("Ramping slope angle");
|
||||
def->tooltip = L("Slope of the ramp in the initial phase of the travel.");
|
||||
def->sidetext = L("°");
|
||||
def->min = 0;
|
||||
def->max = 90;
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionFloats{0.0});
|
||||
|
||||
def = this->add("travel_ramping_lift", coBools);
|
||||
def->label = L("Use ramping lift");
|
||||
def->tooltip = L("Generates a ramping lift instead of lifting the extruder directly upwards. "
|
||||
"The travel is split into two phases: the ramp and the standard horizontal travel. "
|
||||
"This option helps reduce stringing.");
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionBools{ false });
|
||||
|
||||
def = this->add("travel_max_lift", coFloats);
|
||||
def->label = L("Maximum ramping lift");
|
||||
def->tooltip = L("Maximum lift height of the ramping lift. It may not be reached if the next position "
|
||||
"is close to the old one.");
|
||||
def->sidetext = L("mm");
|
||||
def->min = 0;
|
||||
def->max_literal = 1000;
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionFloats{0.0});
|
||||
|
||||
def = this->add("travel_lift_before_obstacle", coBools);
|
||||
def->label = L("Steeper ramp before obstacles");
|
||||
def->tooltip = L("If enabled, PrusaSlicer detects obstacles along the travel path and makes the slope steeper "
|
||||
"in case an obstacle might be hit during the initial phase of the travel.");
|
||||
def->mode = comExpert;
|
||||
def->set_default_value(new ConfigOptionBools{false});
|
||||
def = this->add("retract_lift", coFloats);
|
||||
def->label = L("Lift height");
|
||||
def->tooltip = L("Lift height applied before travel.");
|
||||
def->sidetext = L("mm");
|
||||
def->min = 0;
|
||||
def->max_literal = 1000;
|
||||
def->mode = comSimple;
|
||||
def->set_default_value(new ConfigOptionFloats { 0. });
|
||||
|
||||
def = this->add("retract_lift_above", coFloats);
|
||||
@@ -2404,7 +2463,7 @@ void PrintConfigDef::init_fff_params()
|
||||
def->set_default_value(new ConfigOptionFloats { 0. });
|
||||
|
||||
def = this->add("retract_restart_extra", coFloats);
|
||||
def->label = L("Extra length on restart");
|
||||
def->label = L("Deretraction extra length");
|
||||
def->tooltip = L("When the retraction is compensated after the travel move, the extruder will push "
|
||||
"this additional amount of filament. This setting is rarely needed.");
|
||||
def->sidetext = L("mm");
|
||||
@@ -2529,7 +2588,7 @@ void PrintConfigDef::init_fff_params()
|
||||
def = this->add("small_perimeter_speed", coFloatOrPercent);
|
||||
def->label = L("Small perimeters");
|
||||
def->category = L("Speed");
|
||||
def->tooltip = L("This separate setting will affect the speed of perimeters having radius <= 4mm "
|
||||
def->tooltip = L("This separate setting will affect the speed of perimeters having radius <= 6.5mm "
|
||||
"(usually holes). If expressed as percentage (for example: 80%) it will be calculated "
|
||||
"on the perimeters speed setting above. Set to zero for auto.");
|
||||
def->sidetext = L("mm/s or %");
|
||||
@@ -3144,17 +3203,6 @@ void PrintConfigDef::init_fff_params()
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionBool(true));
|
||||
|
||||
def = this->add("threads", coInt);
|
||||
def->label = L("Threads");
|
||||
def->tooltip = L("Threads are used to parallelize long-running tasks. Optimal threads number "
|
||||
"is slightly above the number of available cores/processors.");
|
||||
def->readonly = true;
|
||||
def->min = 1;
|
||||
{
|
||||
int threads = (unsigned int)boost::thread::hardware_concurrency();
|
||||
def->set_default_value(new ConfigOptionInt(threads > 0 ? threads : 2));
|
||||
def->cli = ConfigOptionDef::nocli;
|
||||
}
|
||||
|
||||
def = this->add("toolchange_gcode", coString);
|
||||
def->label = L("Tool change G-code");
|
||||
@@ -3235,8 +3283,8 @@ void PrintConfigDef::init_fff_params()
|
||||
|
||||
def = this->add("use_firmware_retraction", coBool);
|
||||
def->label = L("Use firmware retraction");
|
||||
def->tooltip = L("This experimental setting uses G10 and G11 commands to have the firmware "
|
||||
"handle the retraction. This is only supported in recent Marlin.");
|
||||
def->tooltip = L("This setting uses G10 and G11 commands to have the firmware "
|
||||
"handle the retraction. Note that this has to be supported by firmware.");
|
||||
def->mode = comExpert;
|
||||
def->set_default_value(new ConfigOptionBool(false));
|
||||
|
||||
@@ -3525,14 +3573,15 @@ void PrintConfigDef::init_fff_params()
|
||||
for (const char *opt_key : {
|
||||
// floats
|
||||
"retract_length", "retract_lift", "retract_lift_above", "retract_lift_below", "retract_speed",
|
||||
"travel_max_lift",
|
||||
"deretract_speed", "retract_restart_extra", "retract_before_travel", "retract_length_toolchange", "retract_restart_extra_toolchange",
|
||||
//B34
|
||||
"filament_diameter",
|
||||
"extrusion_multiplier",
|
||||
// bools
|
||||
"retract_layer_change", "wipe",
|
||||
"retract_layer_change", "wipe", "travel_lift_before_obstacle", "travel_ramping_lift",
|
||||
// percents
|
||||
"retract_before_wipe"}) {
|
||||
"retract_before_wipe", "travel_slope"}) {
|
||||
auto it_opt = options.find(opt_key);
|
||||
assert(it_opt != options.end());
|
||||
def = this->add_nullable(std::string("filament_") + opt_key, it_opt->second.type);
|
||||
@@ -3567,6 +3616,7 @@ void PrintConfigDef::init_extruder_option_keys()
|
||||
"nozzle_diameter", "min_layer_height", "max_layer_height", "extruder_offset",
|
||||
"retract_length", "retract_lift", "retract_lift_above", "retract_lift_below", "retract_speed", "deretract_speed",
|
||||
"retract_before_wipe", "retract_restart_extra", "retract_before_travel", "wipe",
|
||||
"travel_slope", "travel_max_lift", "travel_ramping_lift", "travel_lift_before_obstacle",
|
||||
"retract_layer_change", "retract_length_toolchange", "retract_restart_extra_toolchange", "extruder_colour",
|
||||
//B34
|
||||
"filament_diameter",
|
||||
@@ -3590,6 +3640,10 @@ void PrintConfigDef::init_extruder_option_keys()
|
||||
"retract_restart_extra",
|
||||
"retract_restart_extra_toolchange",
|
||||
"retract_speed",
|
||||
"travel_lift_before_obstacle",
|
||||
"travel_max_lift",
|
||||
"travel_ramping_lift",
|
||||
"travel_slope",
|
||||
"wipe"
|
||||
};
|
||||
assert(std::is_sorted(m_extruder_retract_keys.begin(), m_extruder_retract_keys.end()));
|
||||
@@ -4457,6 +4511,10 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va
|
||||
} else if (opt_key == "draft_shield" && (value == "1" || value == "0")) {
|
||||
// draft_shield used to be a bool, it was turned into an enum in QIDISlicer 2.4.0.
|
||||
value = value == "1" ? "enabled" : "disabled";
|
||||
} else if (opt_key == "gcode_label_objects" && (value == "1" || value == "0")) {
|
||||
// gcode_label_objects used to be a bool (the behavior was nothing or "octoprint"), it is
|
||||
// and enum since PrusaSlicer 2.6.2.
|
||||
value = value == "1" ? "octoprint" : "disabled";
|
||||
} else if (opt_key == "octoprint_host") {
|
||||
opt_key = "print_host";
|
||||
} else if (opt_key == "octoprint_cafile") {
|
||||
@@ -4496,6 +4554,35 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va
|
||||
// Don't convert single options here, implement such conversion in PrintConfigDef::handle_legacy() instead.
|
||||
void PrintConfigDef::handle_legacy_composite(DynamicPrintConfig &config)
|
||||
{
|
||||
if (config.has("thumbnails")) {
|
||||
std::string extention;
|
||||
if (config.has("thumbnails_format")) {
|
||||
if (const ConfigOptionDef* opt = config.def()->get("thumbnails_format")) {
|
||||
auto label = opt->enum_def->enum_to_label(config.option("thumbnails_format")->getInt());
|
||||
if (label.has_value())
|
||||
extention = *label;
|
||||
}
|
||||
}
|
||||
|
||||
std::string thumbnails_str = config.opt_string("thumbnails");
|
||||
auto [thumbnails_list, errors] = GCodeThumbnails::make_and_check_thumbnail_list(thumbnails_str, extention);
|
||||
|
||||
if (errors != enum_bitmask<ThumbnailError>()) {
|
||||
std::string error_str = "\n" + format("Invalid value provided for parameter %1%: %2%", "thumbnails", thumbnails_str);
|
||||
error_str += GCodeThumbnails::get_error_string(errors);
|
||||
throw BadOptionValueException(error_str);
|
||||
}
|
||||
|
||||
if (!thumbnails_list.empty()) {
|
||||
const auto& extentions = ConfigOptionEnum<GCodeThumbnailsFormat>::get_enum_names();
|
||||
thumbnails_str.clear();
|
||||
for (const auto& [ext, size] : thumbnails_list)
|
||||
thumbnails_str += format("%1%x%2%/%3%, ", size.x(), size.y(), extentions[int(ext)]);
|
||||
thumbnails_str.resize(thumbnails_str.length() - 2);
|
||||
|
||||
config.set_key_value("thumbnails", new ConfigOptionString(thumbnails_str));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const PrintConfigDef print_config_def;
|
||||
@@ -5138,6 +5225,309 @@ void DynamicPrintAndCLIConfig::handle_legacy(t_config_option_key &opt_key, std::
|
||||
}
|
||||
}
|
||||
|
||||
// SlicingStatesConfigDefs
|
||||
|
||||
ReadOnlySlicingStatesConfigDef::ReadOnlySlicingStatesConfigDef()
|
||||
{
|
||||
ConfigOptionDef* def;
|
||||
|
||||
def = this->add("zhop", coFloat);
|
||||
def->label = L("Current z-hop");
|
||||
def->tooltip = L("Contains z-hop present at the beginning of the custom G-code block.");
|
||||
}
|
||||
|
||||
ReadWriteSlicingStatesConfigDef::ReadWriteSlicingStatesConfigDef()
|
||||
{
|
||||
ConfigOptionDef* def;
|
||||
|
||||
def = this->add("position", coFloats);
|
||||
def->label = L("Position");
|
||||
def->tooltip = L("Position of the extruder at the beginning of the custom G-code block. If the custom G-code travels somewhere else, "
|
||||
"it should write to this variable so PrusaSlicer knows where it travels from when it gets control back.");
|
||||
|
||||
def = this->add("e_retracted", coFloats);
|
||||
def->label = L("Retraction");
|
||||
def->tooltip = L("Retraction state at the beginning of the custom G-code block. If the custom G-code moves the extruder axis, "
|
||||
"it should write to this variable so PrusaSlicer deretracts correctly when it gets control back.");
|
||||
|
||||
def = this->add("e_restart_extra", coFloats);
|
||||
def->label = L("Extra deretraction");
|
||||
def->tooltip = L("Currently planned extra extruder priming after deretraction.");
|
||||
|
||||
def = this->add("e_position", coFloats);
|
||||
def->label = L("Absolute E position");
|
||||
def->tooltip = L("Current position of the extruder axis. Only used with absolute extruder addressing.");
|
||||
}
|
||||
|
||||
OtherSlicingStatesConfigDef::OtherSlicingStatesConfigDef()
|
||||
{
|
||||
ConfigOptionDef* def;
|
||||
|
||||
def = this->add("current_extruder", coInt);
|
||||
def->label = L("Current extruder");
|
||||
def->tooltip = L("Zero-based index of currently used extruder.");
|
||||
|
||||
def = this->add("current_object_idx", coInt);
|
||||
def->label = L("Current object index");
|
||||
def->tooltip = L("Specific for sequential printing. Zero-based index of currently printed object.");
|
||||
|
||||
def = this->add("has_single_extruder_multi_material_priming", coBool);
|
||||
def->label = L("Has single extruder MM priming");
|
||||
def->tooltip = L("Are the extra multi-material priming regions used in this print?");
|
||||
|
||||
def = this->add("has_wipe_tower", coBool);
|
||||
def->label = L("Has wipe tower");
|
||||
def->tooltip = L("Whether or not wipe tower is being generated in the print.");
|
||||
|
||||
def = this->add("initial_extruder", coInt);
|
||||
def->label = L("Initial extruder");
|
||||
def->tooltip = L("Zero-based index of the first extruder used in the print. Same as initial_tool.");
|
||||
|
||||
def = this->add("initial_filament_type", coString);
|
||||
// TRN: Meaning 'filament type of the initial filament'
|
||||
def->label = L("Initial filament type");
|
||||
def->tooltip = L("String containing filament type of the first used extruder.");
|
||||
|
||||
def = this->add("initial_tool", coInt);
|
||||
def->label = L("Initial tool");
|
||||
def->tooltip = L("Zero-based index of the first extruder used in the print. Same as initial_extruder.");
|
||||
|
||||
def = this->add("is_extruder_used", coBools);
|
||||
def->label = L("Is extruder used?");
|
||||
def->tooltip = L("Vector of booleans stating whether a given extruder is used in the print.");
|
||||
}
|
||||
|
||||
PrintStatisticsConfigDef::PrintStatisticsConfigDef()
|
||||
{
|
||||
ConfigOptionDef* def;
|
||||
|
||||
def = this->add("extruded_volume", coFloats);
|
||||
def->label = L("Volume per extruder");
|
||||
def->tooltip = L("Total filament volume extruded per extruder during the entire print.");
|
||||
|
||||
def = this->add("normal_print_time", coString);
|
||||
def->label = L("Print time (normal mode)");
|
||||
def->tooltip = L("Estimated print time when printed in normal mode (i.e. not in silent mode). Same as print_time.");
|
||||
|
||||
def = this->add("num_printing_extruders", coInt);
|
||||
def->label = L("Number of printing extruders");
|
||||
def->tooltip = L("Number of extruders used during the print.");
|
||||
|
||||
def = this->add("print_time", coString);
|
||||
def->label = L("Print time (normal mode)");
|
||||
def->tooltip = L("Estimated print time when printed in normal mode (i.e. not in silent mode). Same as normal_print_time.");
|
||||
|
||||
def = this->add("printing_filament_types", coString);
|
||||
def->label = L("Used filament types");
|
||||
def->tooltip = L("Comma-separated list of all filament types used during the print.");
|
||||
|
||||
def = this->add("silent_print_time", coString);
|
||||
def->label = L("Print time (silent mode)");
|
||||
def->tooltip = L("Estimated print time when printed in silent mode.");
|
||||
|
||||
def = this->add("total_cost", coFloat);
|
||||
def->label = L("Total cost");
|
||||
def->tooltip = L("Total cost of all material used in the print. Calculated from cost in Filament Settings.");
|
||||
|
||||
def = this->add("total_weight", coFloat);
|
||||
def->label = L("Total weight");
|
||||
def->tooltip = L("Total weight of the print. Calculated from density in Filament Settings.");
|
||||
|
||||
def = this->add("total_wipe_tower_cost", coFloat);
|
||||
def->label = L("Total wipe tower cost");
|
||||
def->tooltip = L("Total cost of the material wasted on the wipe tower. Calculated from cost in Filament Settings.");
|
||||
|
||||
def = this->add("total_wipe_tower_filament", coFloat);
|
||||
def->label = L("Wipe tower volume");
|
||||
def->tooltip = L("Total filament volume extruded on the wipe tower.");
|
||||
|
||||
def = this->add("used_filament", coFloat);
|
||||
def->label = L("Used filament");
|
||||
def->tooltip = L("Total length of filament used in the print.");
|
||||
|
||||
def = this->add("total_toolchanges", coInt);
|
||||
def->label = L("Total number of toolchanges");
|
||||
def->tooltip = L("Number of toolchanges during the print.");
|
||||
|
||||
def = this->add("extruded_volume_total", coFloat);
|
||||
def->label = L("Total volume");
|
||||
def->tooltip = L("Total volume of filament used during the entire print.");
|
||||
|
||||
def = this->add("extruded_weight", coFloats);
|
||||
def->label = L("Weight per extruder");
|
||||
def->tooltip = L("Weight per extruder extruded during the entire print. Calculated from density in Filament Settings.");
|
||||
|
||||
def = this->add("extruded_weight_total", coFloat);
|
||||
def->label = L("Total weight");
|
||||
def->tooltip = L("Total weight of the print. Calculated from density in Filament Settings.");
|
||||
|
||||
def = this->add("total_layer_count", coInt);
|
||||
def->label = L("Total layer count");
|
||||
def->tooltip = L("Number of layers in the entire print.");
|
||||
}
|
||||
|
||||
ObjectsInfoConfigDef::ObjectsInfoConfigDef()
|
||||
{
|
||||
ConfigOptionDef* def;
|
||||
|
||||
def = this->add("num_objects", coInt);
|
||||
def->label = L("Number of objects");
|
||||
def->tooltip = L("Total number of objects in the print.");
|
||||
|
||||
def = this->add("num_instances", coInt);
|
||||
def->label = L("Number of instances");
|
||||
def->tooltip = L("Total number of object instances in the print, summed over all objects.");
|
||||
|
||||
def = this->add("scale", coStrings);
|
||||
def->label = L("Scale per object");
|
||||
def->tooltip = L("Contains a string with the information about what scaling was applied to the individual objects. "
|
||||
"Indexing of the objects is zero-based (first object has index 0).\n"
|
||||
"Example: 'x:100% y:50% z:100%'.");
|
||||
|
||||
def = this->add("input_filename_base", coString);
|
||||
def->label = L("Input filename without extension");
|
||||
def->tooltip = L("Source filename of the first object, without extension.");
|
||||
}
|
||||
|
||||
DimensionsConfigDef::DimensionsConfigDef()
|
||||
{
|
||||
ConfigOptionDef* def;
|
||||
|
||||
const std::string point_tooltip = L("The vector has two elements: x and y coordinate of the point. Values in mm.");
|
||||
const std::string bb_size_tooltip = L("The vector has two elements: x and y dimension of the bounding box. Values in mm.");
|
||||
|
||||
def = this->add("first_layer_print_convex_hull", coPoints);
|
||||
def->label = L("First layer convex hull");
|
||||
def->tooltip = L("Vector of points of the first layer convex hull. Each element has the following format: "
|
||||
"'[x, y]' (x and y are floating-point numbers in mm).");
|
||||
|
||||
def = this->add("first_layer_print_min", coFloats);
|
||||
def->label = L("Bottom-left corner of first layer bounding box");
|
||||
def->tooltip = point_tooltip;
|
||||
|
||||
def = this->add("first_layer_print_max", coFloats);
|
||||
def->label = L("Top-right corner of first layer bounding box");
|
||||
def->tooltip = point_tooltip;
|
||||
|
||||
def = this->add("first_layer_print_size", coFloats);
|
||||
def->label = L("Size of the first layer bounding box");
|
||||
def->tooltip = bb_size_tooltip;
|
||||
|
||||
def = this->add("print_bed_min", coFloats);
|
||||
def->label = L("Bottom-left corner of print bed bounding box");
|
||||
def->tooltip = point_tooltip;
|
||||
|
||||
def = this->add("print_bed_max", coFloats);
|
||||
def->label = L("Top-right corner of print bed bounding box");
|
||||
def->tooltip = point_tooltip;
|
||||
|
||||
def = this->add("print_bed_size", coFloats);
|
||||
def->label = L("Size of the print bed bounding box");
|
||||
def->tooltip = bb_size_tooltip;
|
||||
}
|
||||
|
||||
TimestampsConfigDef::TimestampsConfigDef()
|
||||
{
|
||||
ConfigOptionDef* def;
|
||||
|
||||
def = this->add("timestamp", coString);
|
||||
def->label = L("Timestamp");
|
||||
def->tooltip = L("String containing current time in yyyyMMdd-hhmmss format.");
|
||||
|
||||
def = this->add("year", coInt);
|
||||
def->label = L("Year");
|
||||
|
||||
def = this->add("month", coInt);
|
||||
def->label = L("Month");
|
||||
|
||||
def = this->add("day", coInt);
|
||||
def->label = L("Day");
|
||||
|
||||
def = this->add("hour", coInt);
|
||||
def->label = L("Hour");
|
||||
|
||||
def = this->add("minute", coInt);
|
||||
def->label = L("Minute");
|
||||
|
||||
def = this->add("second", coInt);
|
||||
def->label = L("Second");
|
||||
}
|
||||
|
||||
OtherPresetsConfigDef::OtherPresetsConfigDef()
|
||||
{
|
||||
ConfigOptionDef* def;
|
||||
|
||||
def = this->add("num_extruders", coInt);
|
||||
def->label = L("Number of extruders");
|
||||
def->tooltip = L("Total number of extruders, regardless of whether they are used in the current print.");
|
||||
|
||||
def = this->add("print_preset", coString);
|
||||
def->label = L("Print preset name");
|
||||
def->tooltip = L("Name of the print preset used for slicing.");
|
||||
|
||||
def = this->add("filament_preset", coStrings);
|
||||
def->label = L("Filament preset name");
|
||||
def->tooltip = L("Names of the filament presets used for slicing. The variable is a vector "
|
||||
"containing one name for each extruder.");
|
||||
|
||||
def = this->add("printer_preset", coString);
|
||||
def->label = L("Printer preset name");
|
||||
def->tooltip = L("Name of the printer preset used for slicing.");
|
||||
|
||||
def = this->add("physical_printer_preset", coString);
|
||||
def->label = L("Physical printer name");
|
||||
def->tooltip = L("Name of the physical printer used for slicing.");
|
||||
}
|
||||
|
||||
|
||||
static std::map<t_custom_gcode_key, t_config_option_keys> s_CustomGcodeSpecificPlaceholders{
|
||||
{"start_filament_gcode", {"layer_num", "layer_z", "max_layer_z", "filament_extruder_id"}},
|
||||
{"end_filament_gcode", {"layer_num", "layer_z", "max_layer_z", "filament_extruder_id"}},
|
||||
{"end_gcode", {"layer_num", "layer_z", "max_layer_z", "filament_extruder_id"}},
|
||||
{"before_layer_gcode", {"layer_num", "layer_z", "max_layer_z"}},
|
||||
{"layer_gcode", {"layer_num", "layer_z", "max_layer_z"}},
|
||||
{"toolchange_gcode", {"layer_num", "layer_z", "max_layer_z", "previous_extruder", "next_extruder", "toolchange_z"}},
|
||||
};
|
||||
|
||||
const std::map<t_custom_gcode_key, t_config_option_keys>& custom_gcode_specific_placeholders()
|
||||
{
|
||||
return s_CustomGcodeSpecificPlaceholders;
|
||||
}
|
||||
|
||||
CustomGcodeSpecificConfigDef::CustomGcodeSpecificConfigDef()
|
||||
{
|
||||
ConfigOptionDef* def;
|
||||
|
||||
def = this->add("layer_num", coInt);
|
||||
def->label = L("Layer number");
|
||||
def->tooltip = L("Zero-based index of the current layer (i.e. first layer is number 0).");
|
||||
|
||||
def = this->add("layer_z", coFloat);
|
||||
def->label = L("Layer Z");
|
||||
def->tooltip = L("Height of the current layer above the print bed, measured to the top of the layer.");
|
||||
|
||||
def = this->add("max_layer_z", coFloat);
|
||||
def->label = L("Maximal layer Z");
|
||||
def->tooltip = L("Height of the last layer above the print bed.");
|
||||
|
||||
def = this->add("filament_extruder_id", coInt);
|
||||
def->label = L("Current extruder index");
|
||||
def->tooltip = L("Zero-based index of currently used extruder (i.e. first extruder has index 0).");
|
||||
|
||||
def = this->add("previous_extruder", coInt);
|
||||
def->label = L("Previous extruder");
|
||||
def->tooltip = L("Index of the extruder that is being unloaded. The index is zero based (first extruder has index 0).");
|
||||
|
||||
def = this->add("next_extruder", coInt);
|
||||
def->label = L("Next extruder");
|
||||
def->tooltip = L("Index of the extruder that is being loaded. The index is zero based (first extruder has index 0).");
|
||||
|
||||
def = this->add("toolchange_z", coFloat);
|
||||
def->label = L("Toolchange Z");
|
||||
def->tooltip = L("Height above the print bed when the toolchange takes place. Usually the same as layer_z, but can be different.");
|
||||
}
|
||||
|
||||
const CustomGcodeSpecificConfigDef custom_gcode_specific_config_def;
|
||||
uint64_t ModelConfig::s_last_timestamp = 1;
|
||||
|
||||
static Points to_points(const std::vector<Vec2d> &dpts)
|
||||
|
||||
Reference in New Issue
Block a user