bed exclude area, change thumbnails to PNG, printer webview
This commit is contained in:
QIDI TECH
2023-12-26 15:25:38 +08:00
parent 5079fb72f8
commit 8ef002af7e
17 changed files with 305 additions and 87 deletions

View File

@@ -205,6 +205,10 @@ void AppConfig::set_defaults()
if (get("sys_menu_enabled").empty())
set("sys_menu_enabled", "1");
//B45
if (get("machine_list_minification").empty())
set("machine_list_minification", "1");
#endif // _WIN32
// Remove legacy window positions/sizes

View File

@@ -1146,15 +1146,14 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
// Unit tests or command line slicing may not define "thumbnails" or "thumbnails_format".
// If "thumbnails_format" is not defined, export to PNG.
//B3
// if (const auto [thumbnails, thumbnails_format] = std::make_pair(
// print.full_print_config().option<ConfigOptionPoints>("thumbnails"),
// print.full_print_config().option<ConfigOptionEnum<GCodeThumbnailsFormat>>("thumbnails_format"));
// thumbnails)
// GCodeThumbnails::export_thumbnails_to_file(
// thumbnail_cb, thumbnails->values, thumbnails_format ? thumbnails_format->value : GCodeThumbnailsFormat::PNG,
// [&file](const char* sz) { file.write(sz); },
// [&print]() { print.throw_if_canceled(); });
if (const auto [thumbnails, thumbnails_format] = std::make_pair(
print.full_print_config().option<ConfigOptionPoints>("thumbnails"),
print.full_print_config().option<ConfigOptionEnum<GCodeThumbnailsFormat>>("thumbnails_format"));
thumbnails)
GCodeThumbnails::export_thumbnails_to_file(
thumbnail_cb, thumbnails->values, thumbnails_format ? thumbnails_format->value : GCodeThumbnailsFormat::PNG,
[&file](const char* sz) { file.write(sz); },
[&print]() { print.throw_if_canceled(); });
// Write notes (content of the Print Settings tab -> Notes)
{
@@ -1528,15 +1527,6 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
if (print.m_print_statistics.total_toolchanges > 0)
file.write_format("; total toolchanges = %i\n", print.m_print_statistics.total_toolchanges);
file.write_format(";%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Estimated_Printing_Time_Placeholder).c_str());
//B3
if (const auto [thumbnails, thumbnails_format] = std::make_pair(
print.full_print_config().option<ConfigOptionPoints>("thumbnails"),
print.full_print_config().option<ConfigOptionEnum<GCodeThumbnailsFormat>>("thumbnails_format"));
thumbnails)
GCodeThumbnails::export_thumbnails_to_file(
thumbnail_cb, thumbnails->values, thumbnails_format ? thumbnails_format->value : GCodeThumbnailsFormat::PNG,
[&file](const char* sz) { file.write(sz); },
[&print]() { print.throw_if_canceled(); });
// Append full config, delimited by two 'phony' configuration keys qidislicer_config = begin and qidislicer_config = end.
// The delimiters are structured as configuration key / value pairs to be parsable by older versions of QIDISlicer G-code viewer.
{

View File

@@ -545,6 +545,8 @@ static std::vector<std::string> s_Preset_printer_options {
"default_print_profile", "inherits",
"remaining_times", "silent_mode",
"machine_limits_usage", "thumbnails", "thumbnails_format",
//Y18
"bed_exclude_area",
//Y16
"chamber_temperature", "auxiliary_fan", "chamber_fan"
};
@@ -1349,6 +1351,8 @@ static const std::set<std::string> independent_from_extruder_number_options = {
"gcode_substitutions",
"post_process",
"thumbnails",
//Y18
"bed_exclude_area",
};
bool PresetCollection::is_independent_from_extruder_number_option(const std::string& opt_key)

View File

@@ -60,6 +60,8 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
"autoemit_temperature_commands",
"avoid_crossing_perimeters",
"avoid_crossing_perimeters_max_detour",
//Y18
"bed_exclude_area",
"bed_shape",
"bed_temperature",
"before_layer_gcode",

View File

@@ -259,6 +259,15 @@ 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;

View File

@@ -774,6 +774,8 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE(
((ConfigOptionBool, avoid_crossing_perimeters))
((ConfigOptionFloatOrPercent, avoid_crossing_perimeters_max_detour))
((ConfigOptionPoints, bed_shape))
//Y18
((ConfigOptionPoints, bed_exclude_area))
((ConfigOptionInts, bed_temperature))
//Y16
((ConfigOptionBool, chamber_temperature))