Skip to content

Commit 3079669

Browse files
committed
test mac build
2 parents c5c8cd3 + 9e51196 commit 3079669

33 files changed

+220
-203
lines changed

resources/ui_layout/default/printer_fff.ui

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ group:Thumbnails
5757
line:Thumbnail options
5858
setting:thumbnails_format
5959
setting:thumbnails_with_bed
60+
setting:thumbnails_tag_format
6061
setting:thumbnails_end_file
6162
end_line
6263
group:Advanced

resources/ui_layout/default/printer_sla.ui

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ group:Thumbnails
5353
line:Options
5454
setting:thumbnails_with_bed
5555
setting:thumbnails_with_support
56+
setting:thumbnails_tag_format
5657
end_line
5758
group:Print Host upload
5859
build_printhost

resources/ui_layout/example/printer_fff.ui

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ group:Thumbnails
5656
line:Thumbnail options
5757
setting:thumbnails_format
5858
setting:thumbnails_with_bed
59+
setting:thumbnails_tag_format
5960
setting:thumbnails_end_file
6061
end_line
6162
group:Advanced

resources/ui_layout/example/printer_sla.ui

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ group:Thumbnails
5252
line:Options
5353
setting:thumbnails_with_bed
5454
setting:thumbnails_with_support
55+
setting:thumbnails_tag_format
5556
end_line
5657
group:Print Host upload
5758
build_printhost

src/PrusaSlicer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ int CLI::run(int argc, char **argv)
237237

238238
// The default bed shape should reflect the default display parameters
239239
// and not the fff defaults.
240-
double w = sla_print_config.display_width.get_float();
241-
double h = sla_print_config.display_height.get_float();
240+
double w = sla_print_config.display_width.get_float();
241+
double h = sla_print_config.display_height.get_float();
242242
sla_print_config.bed_shape.values = { Vec2d(0, 0), Vec2d(w, 0), Vec2d(w, h), Vec2d(0, h) };
243243

244244
sla_print_config.apply(m_print_config, true);

src/libslic3r/Config.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -781,8 +781,8 @@ double ConfigBase::get_computed_value(const t_config_option_key &opt_key, int ex
781781
if (extruder_id < 0) {
782782
const ConfigOption* opt_extruder_id = nullptr;
783783
if ((opt_extruder_id = this->option("extruder")) == nullptr)
784-
if ((opt_extruder_id = this->option("current_extruder")) == nullptr ||
785-
opt_extruder_id->get_int() < 0 || opt_extruder_id->get_int() >= vector_opt->size()) {
784+
if ((opt_extruder_id = this->option("current_extruder")) == nullptr
785+
|| opt_extruder_id->get_int() < 0 || opt_extruder_id->get_int() >= vector_opt->size()) {
786786
std::stringstream ss; ss << "ConfigBase::get_abs_value(): " << opt_key << " need to has the extuder id to get the right value, but it's not available";
787787
throw ConfigurationError(ss.str());
788788
}

src/libslic3r/Config.hpp

Lines changed: 76 additions & 97 deletions
Large diffs are not rendered by default.

src/libslic3r/GCode.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1377,13 +1377,15 @@ void GCode::_do_export(Print& print_mod, GCodeOutputStream &file, ThumbnailsGene
13771377
const ConfigOptionBool* thumbnails_end_file = print.full_print_config().option<ConfigOptionBool>("thumbnails_end_file");
13781378
if(!thumbnails_end_file || !thumbnails_end_file->value) {
13791379
const ConfigOptionBool* thumbnails_with_bed = print.full_print_config().option<ConfigOptionBool>("thumbnails_with_bed");
1380+
const ConfigOptionBool* thumbnails_tag_with_format = print.full_print_config().option<ConfigOptionBool>("thumbnails_tag_format");
13801381
const ConfigOptionEnum<GCodeThumbnailsFormat>* thumbnails_format = print.full_print_config().option<ConfigOptionEnum<GCodeThumbnailsFormat>>("thumbnails_format");
13811382
// Unit tests or command line slicing may not define "thumbnails" or "thumbnails_format".
13821383
// If "thumbnails_format" is not defined, export to PNG.
13831384
GCodeThumbnails::export_thumbnails_to_file(thumbnail_cb,
13841385
print.full_print_config().option<ConfigOptionPoints>("thumbnails")->values,
1385-
thumbnails_with_bed == nullptr ? false : thumbnails_with_bed->value,
1386+
thumbnails_with_bed ? thumbnails_with_bed->value : false,
13861387
thumbnails_format ? thumbnails_format->value : GCodeThumbnailsFormat::PNG,
1388+
thumbnails_tag_with_format ? thumbnails_tag_with_format->value : false,
13871389
[&file](const char* sz) { file.write(sz); },
13881390
[&print]() { print.throw_if_canceled(); });
13891391
}
@@ -2085,13 +2087,15 @@ void GCode::_do_export(Print& print_mod, GCodeOutputStream &file, ThumbnailsGene
20852087
//print thumbnails at the end instead of the start if requested
20862088
if (thumbnails_end_file && thumbnails_end_file->value) {
20872089
const ConfigOptionBool* thumbnails_with_bed = print.full_print_config().option<ConfigOptionBool>("thumbnails_with_bed");
2090+
const ConfigOptionBool* thumbnails_tag_with_format = print.full_print_config().option<ConfigOptionBool>("thumbnails_tag_format");
20882091
const ConfigOptionEnum<GCodeThumbnailsFormat>* thumbnails_format = print.full_print_config().option<ConfigOptionEnum<GCodeThumbnailsFormat>>("thumbnails_format");
20892092
// Unit tests or command line slicing may not define "thumbnails" or "thumbnails_format".
20902093
// If "thumbnails_format" is not defined, export to PNG.
20912094
GCodeThumbnails::export_thumbnails_to_file(thumbnail_cb,
20922095
print.full_print_config().option<ConfigOptionPoints>("thumbnails")->values,
2093-
thumbnails_with_bed==nullptr? false:thumbnails_with_bed->value,
2096+
thumbnails_with_bed ? thumbnails_with_bed->value : false,
20942097
thumbnails_format ? thumbnails_format->value : GCodeThumbnailsFormat::PNG,
2098+
thumbnails_tag_with_format ? thumbnails_tag_with_format->value: false,
20952099
[&file](const char* sz) { file.write(sz); },
20962100
[&print]() { print.throw_if_canceled(); });
20972101
}
@@ -5436,7 +5440,7 @@ double_t GCode::_compute_speed_mm_per_sec(const ExtrusionPath& path, double spee
54365440

54375441

54385442
void GCode::cooldown_marker_init() {
5439-
if (!_cooldown_marker_speed[ExtrusionRole::erExternalPerimeter].empty()) {
5443+
if (_cooldown_marker_speed[ExtrusionRole::erExternalPerimeter].empty()) {
54405444
std::string allow_speed_change = ";CM_extrude_speed;_EXTRUDE_SET_SPEED";
54415445
//only change speed on external perimeter (and similar) speed if really necessary.
54425446
std::string maybe_allow_speed_change = ";CM_extrude_speed_external;_EXTRUDE_SET_SPEED_MAYBE";

src/libslic3r/GCode/CoolingBuffer.cpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ void CoolingBuffer::reset(const Vec3d &position)
4545
struct CoolingLine
4646
{
4747
enum Type : uint32_t {
48+
TYPE_NONE = 0,
4849
//first 5 bits are for the extrusiontype (not a flag)
4950

5051
TYPE_SET_TOOL = 1 << 7,
@@ -401,6 +402,8 @@ std::vector<PerExtruderAdjustments> CoolingBuffer::parse_layer_gcode(const std::
401402
// Index of an existing CoolingLine of the current adjustment, which holds the feedrate setting command
402403
// for a sequence of extrusion moves.
403404
size_t active_speed_modifier = size_t(-1);
405+
// type to add to each next G1 (just for adjustable for now)
406+
size_t current_stamp = CoolingLine::TYPE_NONE;
404407

405408
for (; *line_start != 0; line_start = line_end)
406409
{
@@ -460,10 +463,13 @@ std::vector<PerExtruderAdjustments> CoolingBuffer::parse_layer_gcode(const std::
460463
if (wipe)
461464
line.type |= CoolingLine::TYPE_WIPE;
462465
if (boost::contains(sline, ";_EXTRUDE_SET_SPEED") && ! wipe) {
463-
line.type |= CoolingLine::TYPE_ADJUSTABLE;
464466
active_speed_modifier = adjustment->lines.size();
465-
if (boost::contains(sline, ";_EXTRUDE_SET_SPEED_MAYBE"))
467+
line.type |= CoolingLine::TYPE_ADJUSTABLE;
468+
current_stamp |= CoolingLine::TYPE_ADJUSTABLE;
469+
if (boost::contains(sline, ";_EXTRUDE_SET_SPEED_MAYBE")) {
466470
line.type |= CoolingLine::TYPE_ADJUSTABLE_MAYBE;
471+
current_stamp |= CoolingLine::TYPE_ADJUSTABLE_MAYBE;
472+
}
467473
}
468474
if ((line.type & CoolingLine::TYPE_G92) == 0) {
469475
// G0 or G1. Calculate the duration.
@@ -494,6 +500,12 @@ std::vector<PerExtruderAdjustments> CoolingBuffer::parse_layer_gcode(const std::
494500
line.length = std::abs(dif[3]);
495501
}
496502
line.feedrate = new_pos[4];
503+
if (line.feedrate > 0.f && line.length > 0.f) {
504+
assert((line.type & CoolingLine::TYPE_ADJUSTABLE) == 0);
505+
// there can be no active_speed_modifier in custom gcode.
506+
assert(active_speed_modifier != size_t(-1) || current_stamp == CoolingLine::TYPE_NONE);
507+
line.type |= current_stamp;
508+
}
497509
assert((line.type & CoolingLine::TYPE_ADJUSTABLE) == 0 || line.feedrate > 0.f);
498510
if (line.length > 0) {
499511
assert(line.feedrate > 0);
@@ -546,6 +558,7 @@ std::vector<PerExtruderAdjustments> CoolingBuffer::parse_layer_gcode(const std::
546558
}
547559
}
548560
active_speed_modifier = size_t(-1);
561+
current_stamp = CoolingLine::TYPE_NONE;
549562
} else if (boost::starts_with(sline, ";_TOOLCHANGE")) {
550563
//not using m_toolchange_prefix anymore because there is no use case for it, there is always a _TOOLCHANGE for when a fan change is needed.
551564
int prefix = 13;

src/libslic3r/GCode/Thumbnails.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ using namespace std::literals;
1212
struct CompressedPNG : CompressedImageBuffer
1313
{
1414
~CompressedPNG() override { if (data) mz_free(data); }
15-
std::string_view tag() const override { return "thumbnail"sv; }
15+
std::string_view tag() const override { return "thumbnail_PNG"sv; }
1616
};
1717

1818
struct CompressedJPG : CompressedImageBuffer

0 commit comments

Comments
 (0)