mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-13 22:25:54 +08:00
Merge branch 'master' into vb_build_volume
This commit is contained in:
commit
e3339fa622
File diff suppressed because it is too large
Load Diff
@ -490,6 +490,8 @@ std::vector<GCode::LayerToPrint> GCode::collect_layers_to_print(const PrintObjec
|
|||||||
gap_over_supports += support_layer_height_min;
|
gap_over_supports += support_layer_height_min;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<std::pair<double, double>> warning_ranges;
|
||||||
|
|
||||||
// Pair the object layers with the support layers by z.
|
// Pair the object layers with the support layers by z.
|
||||||
size_t idx_object_layer = 0;
|
size_t idx_object_layer = 0;
|
||||||
size_t idx_support_layer = 0;
|
size_t idx_support_layer = 0;
|
||||||
@ -535,15 +537,8 @@ std::vector<GCode::LayerToPrint> GCode::collect_layers_to_print(const PrintObjec
|
|||||||
// Negative support_contact_z is not taken into account, it can result in false positives in cases
|
// Negative support_contact_z is not taken into account, it can result in false positives in cases
|
||||||
// where previous layer has object extrusions too (https://github.com/prusa3d/PrusaSlicer/issues/2752)
|
// where previous layer has object extrusions too (https://github.com/prusa3d/PrusaSlicer/issues/2752)
|
||||||
|
|
||||||
if (has_extrusions && layer_to_print.print_z() > maximal_print_z + 2. * EPSILON) {
|
if (has_extrusions && layer_to_print.print_z() > maximal_print_z + 2. * EPSILON)
|
||||||
const_cast<Print*>(object.print())->active_step_add_warning(PrintStateBase::WarningLevel::CRITICAL,
|
warning_ranges.emplace_back(std::make_pair((last_extrusion_layer ? last_extrusion_layer->print_z() : 0.), layers_to_print.back().print_z()));
|
||||||
Slic3r::format(_(L("Empty layer detected between heights %1% and %2%. Make sure the object is printable.")),
|
|
||||||
(last_extrusion_layer ? last_extrusion_layer->print_z() : 0.),
|
|
||||||
layers_to_print.back().print_z())
|
|
||||||
+ "\n" + Slic3r::format(_(L("Object name: %1%")), object.model_object()->name) + "\n\n"
|
|
||||||
+ _(L("This is usually caused by negligibly small extrusions or by a faulty model. "
|
|
||||||
"Try to repair the model or change its orientation on the bed.")));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remember last layer with extrusions.
|
// Remember last layer with extrusions.
|
||||||
if (has_extrusions)
|
if (has_extrusions)
|
||||||
@ -551,6 +546,23 @@ std::vector<GCode::LayerToPrint> GCode::collect_layers_to_print(const PrintObjec
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! warning_ranges.empty()) {
|
||||||
|
std::string warning;
|
||||||
|
size_t i = 0;
|
||||||
|
for (i = 0; i < std::min(warning_ranges.size(), size_t(3)); ++i)
|
||||||
|
warning += Slic3r::format(_(L("Empty layer between %1% and %2%.")),
|
||||||
|
warning_ranges[i].first, warning_ranges[i].second) + "\n";
|
||||||
|
if (i < warning_ranges.size())
|
||||||
|
warning += _(L("(Some lines not shown)")) + "\n";
|
||||||
|
warning += "\n";
|
||||||
|
warning += Slic3r::format(_(L("Object name: %1%")), object.model_object()->name) + "\n\n"
|
||||||
|
+ _(L("Make sure the object is printable. This is usually caused by negligibly small extrusions or by a faulty model. "
|
||||||
|
"Try to repair the model or change its orientation on the bed."));
|
||||||
|
|
||||||
|
const_cast<Print*>(object.print())->active_step_add_warning(
|
||||||
|
PrintStateBase::WarningLevel::CRITICAL, warning);
|
||||||
|
}
|
||||||
|
|
||||||
return layers_to_print;
|
return layers_to_print;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2441,13 +2441,13 @@ void PrintConfigDef::init_fff_params()
|
|||||||
def = this->add("slicing_mode", coEnum);
|
def = this->add("slicing_mode", coEnum);
|
||||||
def->label = L("Slicing Mode");
|
def->label = L("Slicing Mode");
|
||||||
def->category = L("Advanced");
|
def->category = L("Advanced");
|
||||||
def->tooltip = L("Use \"Even / Odd\" for 3DLabPrint airplane models. Use \"Close holes\" to close all holes in the model.");
|
def->tooltip = L("Use \"Even-odd\" for 3DLabPrint airplane models. Use \"Close holes\" to close all holes in the model.");
|
||||||
def->enum_keys_map = &ConfigOptionEnum<SlicingMode>::get_enum_values();
|
def->enum_keys_map = &ConfigOptionEnum<SlicingMode>::get_enum_values();
|
||||||
def->enum_values.push_back("regular");
|
def->enum_values.push_back("regular");
|
||||||
def->enum_values.push_back("even_odd");
|
def->enum_values.push_back("even_odd");
|
||||||
def->enum_values.push_back("close_holes");
|
def->enum_values.push_back("close_holes");
|
||||||
def->enum_labels.push_back(L("Regular"));
|
def->enum_labels.push_back(L("Regular"));
|
||||||
def->enum_labels.push_back(L("Even / Odd"));
|
def->enum_labels.push_back(L("Even-odd"));
|
||||||
def->enum_labels.push_back(L("Close holes"));
|
def->enum_labels.push_back(L("Close holes"));
|
||||||
def->mode = comAdvanced;
|
def->mode = comAdvanced;
|
||||||
def->set_default_value(new ConfigOptionEnum<SlicingMode>(SlicingMode::Regular));
|
def->set_default_value(new ConfigOptionEnum<SlicingMode>(SlicingMode::Regular));
|
||||||
|
1
src/nanosvg/README-prusa.txt
Normal file
1
src/nanosvg/README-prusa.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
Upstream source: https://github.com/memononen/nanosvg/tree/c1f6e209c16b18b46aa9f45d7e619acf42c29726
|
@ -162,8 +162,8 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
|
|||||||
|
|
||||||
if (config->opt_bool("support_material")) {
|
if (config->opt_bool("support_material")) {
|
||||||
// Ask only once.
|
// Ask only once.
|
||||||
if (!m_support_material_overhangs_queried) {
|
if (!support_material_overhangs_queried) {
|
||||||
m_support_material_overhangs_queried = true;
|
support_material_overhangs_queried = true;
|
||||||
if (!config->opt_bool("overhangs")/* != 1*/) {
|
if (!config->opt_bool("overhangs")/* != 1*/) {
|
||||||
wxString msg_text = _(L("Supports work better, if the following feature is enabled:\n"
|
wxString msg_text = _(L("Supports work better, if the following feature is enabled:\n"
|
||||||
"- Detect bridging perimeters"));
|
"- Detect bridging perimeters"));
|
||||||
@ -182,7 +182,7 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_support_material_overhangs_queried = false;
|
support_material_overhangs_queried = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config->option<ConfigOptionPercent>("fill_density")->value == 100) {
|
if (config->option<ConfigOptionPercent>("fill_density")->value == 100) {
|
||||||
|
@ -17,11 +17,14 @@ class ModelConfig;
|
|||||||
|
|
||||||
namespace GUI {
|
namespace GUI {
|
||||||
|
|
||||||
|
// This variable have to be static because of use its value from Preset configuration
|
||||||
|
// and from object/parts configuration from the Settings in sidebar
|
||||||
|
static bool support_material_overhangs_queried {false};
|
||||||
|
|
||||||
class ConfigManipulation
|
class ConfigManipulation
|
||||||
{
|
{
|
||||||
bool is_msg_dlg_already_exist{ false };
|
bool is_msg_dlg_already_exist{ false };
|
||||||
|
|
||||||
bool m_support_material_overhangs_queried{false};
|
|
||||||
bool m_is_initialized_support_material_overhangs_queried{ false };
|
bool m_is_initialized_support_material_overhangs_queried{ false };
|
||||||
|
|
||||||
// function to loading of changed configuration
|
// function to loading of changed configuration
|
||||||
@ -63,7 +66,7 @@ public:
|
|||||||
void initialize_support_material_overhangs_queried(bool queried)
|
void initialize_support_material_overhangs_queried(bool queried)
|
||||||
{
|
{
|
||||||
m_is_initialized_support_material_overhangs_queried = true;
|
m_is_initialized_support_material_overhangs_queried = true;
|
||||||
m_support_material_overhangs_queried = queried;
|
support_material_overhangs_queried = queried;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -772,9 +772,11 @@ void PageMaterials::set_compatible_printers_html_window(const std::vector<std::s
|
|||||||
, second_line
|
, second_line
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
wxString second_line = printer_names.empty() ? "" : format_wxstr(_L("Only the following installed printers are compatible with the selected %1%:"),
|
wxString second_line;
|
||||||
materials->technology == T_FFF ? _CTX(L_CONTEXT("filaments", "WithSelected"), "WithSelected") :
|
if (!printer_names.empty())
|
||||||
_CTX(L_CONTEXT("SLA materials", "WithSelected"), "WithSelected"));
|
second_line = (materials->technology == T_FFF ?
|
||||||
|
_L("Only the following installed printers are compatible with the selected filaments") :
|
||||||
|
_L("Only the following installed printers are compatible with the selected SLA materials")) + ":";
|
||||||
text = wxString::Format(
|
text = wxString::Format(
|
||||||
"<html>"
|
"<html>"
|
||||||
"<style>"
|
"<style>"
|
||||||
@ -2563,7 +2565,7 @@ bool ConfigWizard::priv::apply_config(AppConfig *app_config, PresetBundle *prese
|
|||||||
}
|
}
|
||||||
if (!check_unsaved_preset_changes)
|
if (!check_unsaved_preset_changes)
|
||||||
if ((check_unsaved_preset_changes = install_bundles.size() > 0))
|
if ((check_unsaved_preset_changes = install_bundles.size() > 0))
|
||||||
header = _L_PLURAL("New vendor was installed and one of its printer will be activated", "New vendors were installed and one of theirs printer will be activated", install_bundles.size());
|
header = _L_PLURAL("A new vendor was installed and one of its printers will be activated", "New vendors were installed and one of theirs printers will be activated", install_bundles.size());
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
// Desktop integration on Linux
|
// Desktop integration on Linux
|
||||||
|
@ -812,13 +812,11 @@ static boost::optional<Semver> parse_semver_from_ini(std::string path)
|
|||||||
std::stringstream buffer;
|
std::stringstream buffer;
|
||||||
buffer << stream.rdbuf();
|
buffer << stream.rdbuf();
|
||||||
std::string body = buffer.str();
|
std::string body = buffer.str();
|
||||||
size_t end_line = body.find_first_of("\n\r");
|
|
||||||
body.resize(end_line);
|
|
||||||
size_t start = body.find("PrusaSlicer ");
|
size_t start = body.find("PrusaSlicer ");
|
||||||
if (start == std::string::npos)
|
if (start == std::string::npos)
|
||||||
return boost::none;
|
return boost::none;
|
||||||
body = body.substr(start + 12);
|
body = body.substr(start + 12);
|
||||||
size_t end = body.find_first_of(" \n\r");
|
size_t end = body.find_first_of(" \n");
|
||||||
if (end < body.size())
|
if (end < body.size())
|
||||||
body.resize(end);
|
body.resize(end);
|
||||||
return Semver::parse(body);
|
return Semver::parse(body);
|
||||||
|
@ -419,7 +419,7 @@ MeshErrorsInfo ObjectList::get_mesh_errors_info(const int obj_idx, const int vol
|
|||||||
if (repaired.facets_reversed > 0)
|
if (repaired.facets_reversed > 0)
|
||||||
tooltip += "\t" + format_wxstr(_L_PLURAL("%1$d facet reversed", "%1$d facets reversed", repaired.facets_reversed), repaired.facets_reversed) + "\n";
|
tooltip += "\t" + format_wxstr(_L_PLURAL("%1$d facet reversed", "%1$d facets reversed", repaired.facets_reversed), repaired.facets_reversed) + "\n";
|
||||||
if (repaired.backwards_edges > 0)
|
if (repaired.backwards_edges > 0)
|
||||||
tooltip += "\t" + format_wxstr(_L_PLURAL("%1$d backwards edge", "%1$d backwards edges", repaired.backwards_edges), repaired.backwards_edges) + "\n";
|
tooltip += "\t" + format_wxstr(_L_PLURAL("%1$d backward edge", "%1$d backward edges", repaired.backwards_edges), repaired.backwards_edges) + "\n";
|
||||||
}
|
}
|
||||||
if (!stats.manifold()) {
|
if (!stats.manifold()) {
|
||||||
remaining_info = format_wxstr(_L_PLURAL("%1$d open edge", "%1$d open edges", stats.open_edges), stats.open_edges);
|
remaining_info = format_wxstr(_L_PLURAL("%1$d open edge", "%1$d open edges", stats.open_edges), stats.open_edges);
|
||||||
@ -4152,7 +4152,7 @@ void ObjectList::fix_through_netfabb()
|
|||||||
wxString msg;
|
wxString msg;
|
||||||
wxString bullet_suf = "\n - ";
|
wxString bullet_suf = "\n - ";
|
||||||
if (!succes_models.empty()) {
|
if (!succes_models.empty()) {
|
||||||
msg = _L_PLURAL("Folowing model is repaired successfully", "Folowing models are repaired successfully", succes_models.size()) + ":";
|
msg = _L_PLURAL("The following model was repaired successfully", "The following models were repaired successfully", succes_models.size()) + ":";
|
||||||
for (auto& model : succes_models)
|
for (auto& model : succes_models)
|
||||||
msg += bullet_suf + from_u8(model);
|
msg += bullet_suf + from_u8(model);
|
||||||
msg += "\n\n";
|
msg += "\n\n";
|
||||||
|
@ -97,6 +97,8 @@ public:
|
|||||||
// will be also extended to support additional states, requiring at least one state to remain free out of 19 states.
|
// will be also extended to support additional states, requiring at least one state to remain free out of 19 states.
|
||||||
static const constexpr size_t EXTRUDERS_LIMIT = 16;
|
static const constexpr size_t EXTRUDERS_LIMIT = 16;
|
||||||
|
|
||||||
|
virtual const float get_cursor_radius_min() const { return CursorRadiusMin; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::array<float, 4> get_cursor_sphere_left_button_color() const override;
|
std::array<float, 4> get_cursor_sphere_left_button_color() const override;
|
||||||
std::array<float, 4> get_cursor_sphere_right_button_color() const override;
|
std::array<float, 4> get_cursor_sphere_right_button_color() const override;
|
||||||
@ -120,6 +122,8 @@ protected:
|
|||||||
std::vector<std::array<float, 4>> m_modified_extruders_colors;
|
std::vector<std::array<float, 4>> m_modified_extruders_colors;
|
||||||
std::vector<int> m_original_volumes_extruder_idxs;
|
std::vector<int> m_original_volumes_extruder_idxs;
|
||||||
|
|
||||||
|
static const constexpr float CursorRadiusMin = 0.1f; // cannot be zero
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool on_init() override;
|
bool on_init() override;
|
||||||
|
|
||||||
|
@ -254,8 +254,8 @@ bool GLGizmoPainterBase::gizmo_event(SLAGizmoEventType action, const Vec2d& mous
|
|||||||
}
|
}
|
||||||
else if (alt_down) {
|
else if (alt_down) {
|
||||||
if (m_tool_type == ToolType::BRUSH && (m_cursor_type == TriangleSelector::CursorType::SPHERE || m_cursor_type == TriangleSelector::CursorType::CIRCLE)) {
|
if (m_tool_type == ToolType::BRUSH && (m_cursor_type == TriangleSelector::CursorType::SPHERE || m_cursor_type == TriangleSelector::CursorType::CIRCLE)) {
|
||||||
m_cursor_radius = action == SLAGizmoEventType::MouseWheelDown ? std::max(m_cursor_radius - CursorRadiusStep, CursorRadiusMin)
|
m_cursor_radius = action == SLAGizmoEventType::MouseWheelDown ? std::max(m_cursor_radius - this->get_cursor_radius_step(), this->get_cursor_radius_min())
|
||||||
: std::min(m_cursor_radius + CursorRadiusStep, CursorRadiusMax);
|
: std::min(m_cursor_radius + this->get_cursor_radius_step(), this->get_cursor_radius_max());
|
||||||
m_parent.set_as_dirty();
|
m_parent.set_as_dirty();
|
||||||
return true;
|
return true;
|
||||||
} else if (m_tool_type == ToolType::SMART_FILL) {
|
} else if (m_tool_type == ToolType::SMART_FILL) {
|
||||||
|
@ -122,6 +122,10 @@ public:
|
|||||||
// after all volumes (including transparent ones) are rendered.
|
// after all volumes (including transparent ones) are rendered.
|
||||||
virtual void render_painter_gizmo() const = 0;
|
virtual void render_painter_gizmo() const = 0;
|
||||||
|
|
||||||
|
virtual const float get_cursor_radius_min() const { return CursorRadiusMin; }
|
||||||
|
virtual const float get_cursor_radius_max() const { return CursorRadiusMax; }
|
||||||
|
virtual const float get_cursor_radius_step() const { return CursorRadiusStep; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void render_triangles(const Selection& selection) const;
|
virtual void render_triangles(const Selection& selection) const;
|
||||||
void render_cursor() const;
|
void render_cursor() const;
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include "libslic3r/Config.hpp"
|
#include "libslic3r/Config.hpp"
|
||||||
#include "../Utils/PrintHost.hpp"
|
#include "../Utils/PrintHost.hpp"
|
||||||
#include "libslic3r/Config.hpp"
|
#include "libslic3r/Config.hpp"
|
||||||
|
#include "format.hpp"
|
||||||
|
|
||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
#include <boost/log/trivial.hpp>
|
#include <boost/log/trivial.hpp>
|
||||||
@ -1068,14 +1069,12 @@ void NotificationManager::UpdatedItemsInfoNotification::add_type(InfoItemType ty
|
|||||||
for (it = m_types_and_counts.begin(); it != m_types_and_counts.end(); ++it) {
|
for (it = m_types_and_counts.begin(); it != m_types_and_counts.end(); ++it) {
|
||||||
if ((*it).second == 0)
|
if ((*it).second == 0)
|
||||||
continue;
|
continue;
|
||||||
text += std::to_string((*it).second);
|
|
||||||
text += _L_PLURAL(" Object was loaded with "," Objects were loaded with ", (*it).second).ToUTF8().data();
|
|
||||||
switch ((*it).first) {
|
switch ((*it).first) {
|
||||||
case InfoItemType::CustomSupports: text += _utf8("custom supports.\n"); break;
|
case InfoItemType::CustomSupports: text += format(_L_PLURAL("%1$d Object was loaded with custom supports.", "%1$d Objects were loaded with custom supports.", (*it).second), (*it).second) + "\n"; break;
|
||||||
case InfoItemType::CustomSeam: text += _utf8("custom seam.\n"); break;
|
case InfoItemType::CustomSeam: text += format(_L_PLURAL("%1$d Object was loaded with custom seam.", "%1$d Objects were loaded with custom seam.", (*it).second), (*it).second) + "\n"; break;
|
||||||
case InfoItemType::MmuSegmentation: text += _utf8("multimaterial painting.\n"); break;
|
case InfoItemType::MmuSegmentation: text += format(_L_PLURAL("%1$d Object was loaded with multimaterial painting.", "%1$d Objects were loaded with multimaterial painting.",(*it).second), (*it).second) + "\n"; break;
|
||||||
case InfoItemType::VariableLayerHeight: text += _utf8("variable layer height.\n"); break;
|
case InfoItemType::VariableLayerHeight: text += format(_L_PLURAL("%1$d Object was loaded with variable layer height.", "%1$d Objects were loaded with variable layer height.", (*it).second), (*it).second) + "\n"; break;
|
||||||
case InfoItemType::Sinking: text += _utf8("Partial sinking.\n"); break;
|
case InfoItemType::Sinking: text += format(_L_PLURAL("%1$d Object was loaded with partial sinking.", "%1$d Objects were loaded with partial sinking.", (*it).second), (*it).second) + "\n"; break;
|
||||||
default: BOOST_LOG_TRIVIAL(error) << "Unknown InfoItemType: " << (*it).second; break;
|
default: BOOST_LOG_TRIVIAL(error) << "Unknown InfoItemType: " << (*it).second; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -457,6 +457,7 @@ FreqChangedParams::FreqChangedParams(wxWindow* parent) :
|
|||||||
std::vector<float> extruders = dlg.get_extruders();
|
std::vector<float> extruders = dlg.get_extruders();
|
||||||
(project_config.option<ConfigOptionFloats>("wiping_volumes_matrix"))->values = std::vector<double>(matrix.begin(), matrix.end());
|
(project_config.option<ConfigOptionFloats>("wiping_volumes_matrix"))->values = std::vector<double>(matrix.begin(), matrix.end());
|
||||||
(project_config.option<ConfigOptionFloats>("wiping_volumes_extruders"))->values = std::vector<double>(extruders.begin(), extruders.end());
|
(project_config.option<ConfigOptionFloats>("wiping_volumes_extruders"))->values = std::vector<double>(extruders.begin(), extruders.end());
|
||||||
|
wxGetApp().plater()->update_project_dirty_from_presets();
|
||||||
wxPostEvent(parent, SimpleEvent(EVT_SCHEDULE_BACKGROUND_PROCESS, parent));
|
wxPostEvent(parent, SimpleEvent(EVT_SCHEDULE_BACKGROUND_PROCESS, parent));
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
@ -2396,8 +2397,8 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
|
|||||||
|
|
||||||
// show notification about temporarily installed presets
|
// show notification about temporarily installed presets
|
||||||
if (!names.empty()) {
|
if (!names.empty()) {
|
||||||
std::string notif_text = into_u8(_L_PLURAL("The preset below was temporarily installed on active instance of PrusaSlicer",
|
std::string notif_text = into_u8(_L_PLURAL("The preset below was temporarily installed on the active instance of PrusaSlicer",
|
||||||
"The presets below were temporarily installed on active instance of PrusaSlicer", names.size())) + ":";
|
"The presets below were temporarily installed on the active instance of PrusaSlicer", names.size())) + ":";
|
||||||
for (std::string& name : names)
|
for (std::string& name : names)
|
||||||
notif_text += "\n - " + name;
|
notif_text += "\n - " + name;
|
||||||
notification_manager->push_notification(NotificationType::CustomNotification,
|
notification_manager->push_notification(NotificationType::CustomNotification,
|
||||||
@ -2448,9 +2449,9 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
|
|||||||
MessageDialog(q, format_wxstr(_L_PLURAL(
|
MessageDialog(q, format_wxstr(_L_PLURAL(
|
||||||
"Object size from file %s appears to be zero.\n"
|
"Object size from file %s appears to be zero.\n"
|
||||||
"This object has been removed from the model",
|
"This object has been removed from the model",
|
||||||
"Objects size from file %s appear to be zero.\n"
|
"Objects size from file %s appears to be zero.\n"
|
||||||
"These objects have been removed from the model", deleted_objects), from_path(filename)) + "\n",
|
"These objects have been removed from the model", deleted_objects), from_path(filename)) + "\n",
|
||||||
_L("Object size is zero"), wxICON_INFORMATION | wxOK).ShowModal();
|
_L("The size of the object is zero"), wxICON_INFORMATION | wxOK).ShowModal();
|
||||||
}
|
}
|
||||||
if (imperial_units)
|
if (imperial_units)
|
||||||
// Convert even if the object is big.
|
// Convert even if the object is big.
|
||||||
@ -2464,9 +2465,9 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
|
|||||||
if (answer_convert_from_meters == wxOK_DEFAULT) {
|
if (answer_convert_from_meters == wxOK_DEFAULT) {
|
||||||
RichMessageDialog dlg(q, format_wxstr(_L_PLURAL(
|
RichMessageDialog dlg(q, format_wxstr(_L_PLURAL(
|
||||||
"The dimensions of the object from file %s seem to be defined in meters.\n"
|
"The dimensions of the object from file %s seem to be defined in meters.\n"
|
||||||
"The internal unit of PrusaSlicer are millimeters. Do you want to recalculate the dimensions of the object?",
|
"The internal unit of PrusaSlicer is a millimeter. Do you want to recalculate the dimensions of the object?",
|
||||||
"The dimensions of some objects from file %s seem to be defined in meters.\n"
|
"The dimensions of some objects from file %s seem to be defined in meters.\n"
|
||||||
"The internal unit of PrusaSlicer are millimeters. Do you want to recalculate the dimensions of these objects?", model.objects.size()), from_path(filename)) + "\n",
|
"The internal unit of PrusaSlicer is a millimeter. Do you want to recalculate the dimensions of these objects?", model.objects.size()), from_path(filename)) + "\n",
|
||||||
_L("The object is too small"), wxICON_QUESTION | wxYES_NO);
|
_L("The object is too small"), wxICON_QUESTION | wxYES_NO);
|
||||||
dlg.ShowCheckBox(_L("Apply to all the remaining small objects being loaded."));
|
dlg.ShowCheckBox(_L("Apply to all the remaining small objects being loaded."));
|
||||||
int answer = dlg.ShowModal();
|
int answer = dlg.ShowModal();
|
||||||
@ -2486,9 +2487,9 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
|
|||||||
if (answer_convert_from_imperial_units == wxOK_DEFAULT) {
|
if (answer_convert_from_imperial_units == wxOK_DEFAULT) {
|
||||||
RichMessageDialog dlg(q, format_wxstr(_L_PLURAL(
|
RichMessageDialog dlg(q, format_wxstr(_L_PLURAL(
|
||||||
"The dimensions of the object from file %s seem to be defined in inches.\n"
|
"The dimensions of the object from file %s seem to be defined in inches.\n"
|
||||||
"The internal unit of PrusaSlicer are millimeters. Do you want to recalculate the dimensions of the object?",
|
"The internal unit of PrusaSlicer is a millimeter. Do you want to recalculate the dimensions of the object?",
|
||||||
"The dimensions of some objects from file %s seem to be defined in inches.\n"
|
"The dimensions of some objects from file %s seem to be defined in inches.\n"
|
||||||
"The internal unit of PrusaSlicer are millimeters. Do you want to recalculate the dimensions of these objects?", model.objects.size()), from_path(filename)) + "\n",
|
"The internal unit of PrusaSlicer is a millimeter. Do you want to recalculate the dimensions of these objects?", model.objects.size()), from_path(filename)) + "\n",
|
||||||
_L("The object is too small"), wxICON_QUESTION | wxYES_NO);
|
_L("The object is too small"), wxICON_QUESTION | wxYES_NO);
|
||||||
dlg.ShowCheckBox(_L("Apply to all the remaining small objects being loaded."));
|
dlg.ShowCheckBox(_L("Apply to all the remaining small objects being loaded."));
|
||||||
int answer = dlg.ShowModal();
|
int answer = dlg.ShowModal();
|
||||||
|
@ -218,7 +218,7 @@ void PreferencesDialog::build(size_t selected_tab)
|
|||||||
|
|
||||||
m_optgroup_general->append_separator();
|
m_optgroup_general->append_separator();
|
||||||
|
|
||||||
def.label = L("Ask to save unsaved changes when closing the application or when loading a new project.");
|
def.label = L("Ask to save unsaved changes when closing the application or when loading a new project");
|
||||||
def.type = coBool;
|
def.type = coBool;
|
||||||
def.tooltip = L("Always ask for unsaved changes, when: \n"
|
def.tooltip = L("Always ask for unsaved changes, when: \n"
|
||||||
"- Closing PrusaSlicer while some presets are modified,\n"
|
"- Closing PrusaSlicer while some presets are modified,\n"
|
||||||
|
@ -26,12 +26,14 @@ void ProjectDirtyStateManager::update_from_presets()
|
|||||||
{
|
{
|
||||||
m_presets_dirty = false;
|
m_presets_dirty = false;
|
||||||
// check switching of the presets only for exist/loaded project, but not for new
|
// check switching of the presets only for exist/loaded project, but not for new
|
||||||
if (!wxGetApp().plater()->get_project_filename().IsEmpty()) {
|
GUI_App &app = wxGetApp();
|
||||||
for (const auto& [type, name] : wxGetApp().get_selected_presets())
|
if (!app.plater()->get_project_filename().IsEmpty()) {
|
||||||
|
for (const auto& [type, name] : app.get_selected_presets())
|
||||||
m_presets_dirty |= !m_initial_presets[type].empty() && m_initial_presets[type] != name;
|
m_presets_dirty |= !m_initial_presets[type].empty() && m_initial_presets[type] != name;
|
||||||
}
|
}
|
||||||
m_presets_dirty |= wxGetApp().has_unsaved_preset_changes();
|
m_presets_dirty |= app.has_unsaved_preset_changes();
|
||||||
wxGetApp().mainframe->update_title();
|
m_project_config_dirty = m_initial_project_config != app.preset_bundle->project_config;
|
||||||
|
app.mainframe->update_title();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectDirtyStateManager::reset_after_save()
|
void ProjectDirtyStateManager::reset_after_save()
|
||||||
@ -39,14 +41,17 @@ void ProjectDirtyStateManager::reset_after_save()
|
|||||||
this->reset_initial_presets();
|
this->reset_initial_presets();
|
||||||
m_plater_dirty = false;
|
m_plater_dirty = false;
|
||||||
m_presets_dirty = false;
|
m_presets_dirty = false;
|
||||||
|
m_project_config_dirty = false;
|
||||||
wxGetApp().mainframe->update_title();
|
wxGetApp().mainframe->update_title();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectDirtyStateManager::reset_initial_presets()
|
void ProjectDirtyStateManager::reset_initial_presets()
|
||||||
{
|
{
|
||||||
m_initial_presets.fill(std::string{});
|
m_initial_presets.fill(std::string{});
|
||||||
for (const auto& [type, name] : wxGetApp().get_selected_presets())
|
GUI_App &app = wxGetApp();
|
||||||
|
for (const auto& [type, name] : app.get_selected_presets())
|
||||||
m_initial_presets[type] = name;
|
m_initial_presets[type] = name;
|
||||||
|
m_initial_project_config = app.preset_bundle->project_config;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_PROJECT_DIRTY_STATE_DEBUG_WINDOW
|
#if ENABLE_PROJECT_DIRTY_STATE_DEBUG_WINDOW
|
||||||
|
@ -14,7 +14,7 @@ public:
|
|||||||
void reset_after_save();
|
void reset_after_save();
|
||||||
void reset_initial_presets();
|
void reset_initial_presets();
|
||||||
|
|
||||||
bool is_dirty() const { return m_plater_dirty || m_presets_dirty; }
|
bool is_dirty() const { return m_plater_dirty || m_project_config_dirty || m_presets_dirty; }
|
||||||
|
|
||||||
#if ENABLE_PROJECT_DIRTY_STATE_DEBUG_WINDOW
|
#if ENABLE_PROJECT_DIRTY_STATE_DEBUG_WINDOW
|
||||||
void render_debug_window() const;
|
void render_debug_window() const;
|
||||||
@ -25,8 +25,11 @@ private:
|
|||||||
bool m_plater_dirty { false };
|
bool m_plater_dirty { false };
|
||||||
// Do the presets indicate the project is dirty?
|
// Do the presets indicate the project is dirty?
|
||||||
bool m_presets_dirty { false };
|
bool m_presets_dirty { false };
|
||||||
|
// Is the project config dirty?
|
||||||
|
bool m_project_config_dirty { false };
|
||||||
// Keeps track of preset names selected at the time of last project save.
|
// Keeps track of preset names selected at the time of last project save.
|
||||||
std::array<std::string, Preset::TYPE_COUNT> m_initial_presets;
|
std::array<std::string, Preset::TYPE_COUNT> m_initial_presets;
|
||||||
|
DynamicPrintConfig m_initial_project_config;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace GUI
|
} // namespace GUI
|
||||||
|
@ -1478,7 +1478,7 @@ void TabPrint::build()
|
|||||||
optgroup = page->new_optgroup(L("Advanced"));
|
optgroup = page->new_optgroup(L("Advanced"));
|
||||||
optgroup->append_single_option_line("seam_position", category_path + "seam-position");
|
optgroup->append_single_option_line("seam_position", category_path + "seam-position");
|
||||||
optgroup->append_single_option_line("external_perimeters_first", category_path + "external-perimeters-first");
|
optgroup->append_single_option_line("external_perimeters_first", category_path + "external-perimeters-first");
|
||||||
optgroup->append_single_option_line("gap_fill_enabled");
|
optgroup->append_single_option_line("gap_fill_enabled", category_path + "fill-gaps");
|
||||||
|
|
||||||
optgroup = page->new_optgroup(L("Fuzzy skin (experimental)"));
|
optgroup = page->new_optgroup(L("Fuzzy skin (experimental)"));
|
||||||
category_path = "fuzzy-skin_246186/#";
|
category_path = "fuzzy-skin_246186/#";
|
||||||
@ -1497,12 +1497,14 @@ void TabPrint::build()
|
|||||||
optgroup->append_single_option_line("bottom_fill_pattern", category_path + "bottom-fill-pattern");
|
optgroup->append_single_option_line("bottom_fill_pattern", category_path + "bottom-fill-pattern");
|
||||||
|
|
||||||
optgroup = page->new_optgroup(L("Ironing"));
|
optgroup = page->new_optgroup(L("Ironing"));
|
||||||
optgroup->append_single_option_line("ironing");
|
category_path = "ironing_177488#";
|
||||||
optgroup->append_single_option_line("ironing_type");
|
optgroup->append_single_option_line("ironing", category_path);
|
||||||
optgroup->append_single_option_line("ironing_flowrate");
|
optgroup->append_single_option_line("ironing_type", category_path + "ironing-type");
|
||||||
optgroup->append_single_option_line("ironing_spacing");
|
optgroup->append_single_option_line("ironing_flowrate", category_path + "flow-rate");
|
||||||
|
optgroup->append_single_option_line("ironing_spacing", category_path + "spacing-between-ironing-passes");
|
||||||
|
|
||||||
optgroup = page->new_optgroup(L("Reducing printing time"));
|
optgroup = page->new_optgroup(L("Reducing printing time"));
|
||||||
|
category_path = "infill_42#";
|
||||||
optgroup->append_single_option_line("infill_every_layers", category_path + "combine-infill-every-x-layers");
|
optgroup->append_single_option_line("infill_every_layers", category_path + "combine-infill-every-x-layers");
|
||||||
optgroup->append_single_option_line("infill_only_where_needed", category_path + "only-infill-where-needed");
|
optgroup->append_single_option_line("infill_only_where_needed", category_path + "only-infill-where-needed");
|
||||||
|
|
||||||
@ -1540,7 +1542,7 @@ void TabPrint::build()
|
|||||||
|
|
||||||
optgroup = page->new_optgroup(L("Raft"));
|
optgroup = page->new_optgroup(L("Raft"));
|
||||||
optgroup->append_single_option_line("raft_layers", category_path + "raft-layers");
|
optgroup->append_single_option_line("raft_layers", category_path + "raft-layers");
|
||||||
optgroup->append_single_option_line("raft_contact_distance");
|
optgroup->append_single_option_line("raft_contact_distance", category_path + "raft-layers");
|
||||||
optgroup->append_single_option_line("raft_expansion");
|
optgroup->append_single_option_line("raft_expansion");
|
||||||
|
|
||||||
optgroup = page->new_optgroup(L("Options for support material and raft"));
|
optgroup = page->new_optgroup(L("Options for support material and raft"));
|
||||||
@ -3650,8 +3652,8 @@ void Tab::delete_preset()
|
|||||||
for (const std::string& printer : ph_printers)
|
for (const std::string& printer : ph_printers)
|
||||||
msg += "\n \"" + from_u8(printer) + "\",";
|
msg += "\n \"" + from_u8(printer) + "\",";
|
||||||
msg.RemoveLast();
|
msg.RemoveLast();
|
||||||
msg += "\n" + _L_PLURAL("Note, that selected preset will be deleted from this printer too.",
|
msg += "\n" + _L_PLURAL("Note, that the selected preset will be deleted from this printer too.",
|
||||||
"Note, that selected preset will be deleted from these printers too.", ph_printers.size()) + "\n\n";
|
"Note, that the selected preset will be deleted from these printers too.", ph_printers.size()) + "\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ph_printers_only.empty()) {
|
if (!ph_printers_only.empty()) {
|
||||||
@ -3660,8 +3662,8 @@ void Tab::delete_preset()
|
|||||||
for (const std::string& printer : ph_printers_only)
|
for (const std::string& printer : ph_printers_only)
|
||||||
msg += "\n \"" + from_u8(printer) + "\",";
|
msg += "\n \"" + from_u8(printer) + "\",";
|
||||||
msg.RemoveLast();
|
msg.RemoveLast();
|
||||||
msg += "\n" + _L_PLURAL("Note, that this printer will be deleted after deleting of the selected preset.",
|
msg += "\n" + _L_PLURAL("Note, that this printer will be deleted after deleting the selected preset.",
|
||||||
"Note, that these printers will be deleted after deleting of the selected preset.", ph_printers_only.size()) + "\n\n";
|
"Note, that these printers will be deleted after deleting the selected preset.", ph_printers_only.size()) + "\n\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user