mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-15 00:55:53 +08:00
#222 expose thumbnails setting to gui
This commit is contained in:
parent
47e817a9a3
commit
8b416a083a
@ -13,6 +13,10 @@ group:Print Host upload
|
|||||||
printhost
|
printhost
|
||||||
group:silent_mode_event:Firmware
|
group:silent_mode_event:Firmware
|
||||||
setting:gcode_flavor
|
setting:gcode_flavor
|
||||||
|
line:Gcode thumbnails
|
||||||
|
setting:id$0:label$Small:thumbnails
|
||||||
|
setting:id$1:label$Big:thumbnails
|
||||||
|
end_line
|
||||||
setting:silent_mode
|
setting:silent_mode
|
||||||
setting:remaining_times
|
setting:remaining_times
|
||||||
setting:fan_speedup_time
|
setting:fan_speedup_time
|
||||||
|
@ -1011,9 +1011,14 @@ namespace DoExport {
|
|||||||
// Write thumbnails using base64 encoding
|
// Write thumbnails using base64 encoding
|
||||||
if (thumbnail_cb != nullptr)
|
if (thumbnail_cb != nullptr)
|
||||||
{
|
{
|
||||||
|
std::vector<Vec2d> good_sizes;
|
||||||
|
for (const Vec2d &size : sizes)
|
||||||
|
if (size.x() > 0 && size.y() > 0)
|
||||||
|
good_sizes.push_back(size);
|
||||||
|
|
||||||
const size_t max_row_length = 78;
|
const size_t max_row_length = 78;
|
||||||
ThumbnailsList thumbnails;
|
ThumbnailsList thumbnails;
|
||||||
thumbnail_cb(thumbnails, sizes, true, true, true, true);
|
thumbnail_cb(thumbnails, good_sizes, true, true, true, true);
|
||||||
for (const ThumbnailData& data : thumbnails)
|
for (const ThumbnailData& data : thumbnails)
|
||||||
{
|
{
|
||||||
if (data.is_valid())
|
if (data.is_valid())
|
||||||
|
@ -74,7 +74,7 @@ void PrintConfigDef::init_common_params()
|
|||||||
def = this->add("thumbnails", coPoints);
|
def = this->add("thumbnails", coPoints);
|
||||||
def->label = L("Picture sizes to be stored into a .gcode and .sl1 files");
|
def->label = L("Picture sizes to be stored into a .gcode and .sl1 files");
|
||||||
def->mode = comExpert;
|
def->mode = comExpert;
|
||||||
def->set_default_value(new ConfigOptionPoints());
|
def->set_default_value(new ConfigOptionPoints{ Vec2d(0,0), Vec2d(0,0) });
|
||||||
|
|
||||||
def = this->add("layer_height", coFloat);
|
def = this->add("layer_height", coFloat);
|
||||||
def->label = L("Base Layer height");
|
def->label = L("Base Layer height");
|
||||||
|
@ -1104,6 +1104,7 @@ public:
|
|||||||
ConfigOptionInt standby_temperature_delta;
|
ConfigOptionInt standby_temperature_delta;
|
||||||
ConfigOptionInts temperature;
|
ConfigOptionInts temperature;
|
||||||
ConfigOptionInt threads;
|
ConfigOptionInt threads;
|
||||||
|
ConfigOptionPoints thumbnails;
|
||||||
ConfigOptionPercent time_estimation_compensation;
|
ConfigOptionPercent time_estimation_compensation;
|
||||||
ConfigOptionInts top_fan_speed;
|
ConfigOptionInts top_fan_speed;
|
||||||
ConfigOptionBools wipe;
|
ConfigOptionBools wipe;
|
||||||
@ -1194,6 +1195,7 @@ protected:
|
|||||||
OPT_PTR(standby_temperature_delta);
|
OPT_PTR(standby_temperature_delta);
|
||||||
OPT_PTR(temperature);
|
OPT_PTR(temperature);
|
||||||
OPT_PTR(threads);
|
OPT_PTR(threads);
|
||||||
|
OPT_PTR(thumbnails);
|
||||||
OPT_PTR(time_estimation_compensation);
|
OPT_PTR(time_estimation_compensation);
|
||||||
OPT_PTR(top_fan_speed);
|
OPT_PTR(top_fan_speed);
|
||||||
OPT_PTR(wipe);
|
OPT_PTR(wipe);
|
||||||
|
@ -165,8 +165,12 @@ void BackgroundSlicingProcess::process_sla()
|
|||||||
if (m_thumbnail_cb != nullptr)
|
if (m_thumbnail_cb != nullptr)
|
||||||
{
|
{
|
||||||
ThumbnailsList thumbnails;
|
ThumbnailsList thumbnails;
|
||||||
m_thumbnail_cb(thumbnails, current_print()->full_print_config().option<ConfigOptionPoints>("thumbnails")->values, true, true, true, true);
|
std::vector<Vec2d> good_sizes;
|
||||||
// m_thumbnail_cb(thumbnails, current_print()->full_print_config().option<ConfigOptionPoints>("thumbnails")->values, true, false, true, true); // renders also supports and pad
|
for (const Vec2d &size : current_print()->full_print_config().option<ConfigOptionPoints>("thumbnails")->values)
|
||||||
|
if (size.x() > 0 && size.y() > 0)
|
||||||
|
good_sizes.push_back(size);
|
||||||
|
m_thumbnail_cb(thumbnails, good_sizes, true, true, true, true);
|
||||||
|
// m_thumbnail_cb(thumbnails, good_sizes, true, false, true, true); // renders also supports and pad
|
||||||
for (const ThumbnailData& data : thumbnails)
|
for (const ThumbnailData& data : thumbnails)
|
||||||
{
|
{
|
||||||
if (data.is_valid())
|
if (data.is_valid())
|
||||||
@ -493,8 +497,12 @@ void BackgroundSlicingProcess::prepare_upload()
|
|||||||
if (m_thumbnail_cb != nullptr)
|
if (m_thumbnail_cb != nullptr)
|
||||||
{
|
{
|
||||||
ThumbnailsList thumbnails;
|
ThumbnailsList thumbnails;
|
||||||
m_thumbnail_cb(thumbnails, current_print()->full_print_config().option<ConfigOptionPoints>("thumbnails")->values, true, true, true, true);
|
std::vector<Vec2d> good_sizes;
|
||||||
// m_thumbnail_cb(thumbnails, current_print()->full_print_config().option<ConfigOptionPoints>("thumbnails")->values, true, false, true, true); // renders also supports and pad
|
for (const Vec2d &size : current_print()->full_print_config().option<ConfigOptionPoints>("thumbnails")->values)
|
||||||
|
if (size.x() > 0 && size.y() > 0)
|
||||||
|
good_sizes.push_back(size);
|
||||||
|
m_thumbnail_cb(thumbnails, good_sizes, true, true, true, true);
|
||||||
|
// m_thumbnail_cb(thumbnails, good_sizes, true, false, true, true); // renders also supports and pad
|
||||||
for (const ThumbnailData& data : thumbnails)
|
for (const ThumbnailData& data : thumbnails)
|
||||||
{
|
{
|
||||||
if (data.is_valid())
|
if (data.is_valid())
|
||||||
|
@ -63,6 +63,7 @@ void Field::PostInitialize()
|
|||||||
case coFloats:
|
case coFloats:
|
||||||
case coStrings:
|
case coStrings:
|
||||||
case coBools:
|
case coBools:
|
||||||
|
case coPoints:
|
||||||
case coInts: {
|
case coInts: {
|
||||||
auto tag_pos = m_opt_id.find("#");
|
auto tag_pos = m_opt_id.find("#");
|
||||||
if (tag_pos != std::string::npos)
|
if (tag_pos != std::string::npos)
|
||||||
|
@ -614,6 +614,7 @@ const std::vector<std::string>& Preset::printer_options()
|
|||||||
"machine_max_feedrate_x", "machine_max_feedrate_y", "machine_max_feedrate_z", "machine_max_feedrate_e",
|
"machine_max_feedrate_x", "machine_max_feedrate_y", "machine_max_feedrate_z", "machine_max_feedrate_e",
|
||||||
"machine_min_extruding_rate", "machine_min_travel_rate",
|
"machine_min_extruding_rate", "machine_min_travel_rate",
|
||||||
"machine_max_jerk_x", "machine_max_jerk_y", "machine_max_jerk_z", "machine_max_jerk_e",
|
"machine_max_jerk_x", "machine_max_jerk_y", "machine_max_jerk_z", "machine_max_jerk_e",
|
||||||
|
"thumbnails",
|
||||||
"time_estimation_compensation",
|
"time_estimation_compensation",
|
||||||
"print_machine_envelope",
|
"print_machine_envelope",
|
||||||
"fan_speedup_time",
|
"fan_speedup_time",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user