Different arrange dialog when seq printing is active

This commit is contained in:
Lukas Matena 2025-01-27 14:33:10 +01:00
parent 8a0e093862
commit e244eca3c2

View File

@ -7,6 +7,11 @@
#include "slic3r/GUI/format.hpp"
#include "slic3r/GUI/GUI.hpp"
// These two should not be here. 2.9.1 is getting near and we need a quick
// way of detecting if complete_objects is used.
#include "slic3r/GUI/GUI_App.hpp"
#include "libslic3r/PresetBundle.hpp"
namespace Slic3r { namespace GUI {
struct Settings {
@ -44,6 +49,7 @@ void ArrangeSettingsDialogImgui::render(float pos_x, float pos_y, bool current_b
ImGuiWindowFlags_NoMove | ImGuiWindowFlags_AlwaysAutoResize |
ImGuiWindowFlags_NoCollapse);
if (! wxGetApp().preset_bundle->prints.get_edited_preset().config.opt_bool("complete_objects")) {
Settings settings;
read_settings(settings, m_db.get());
@ -57,7 +63,7 @@ void ArrangeSettingsDialogImgui::render(float pos_x, float pos_y, bool current_b
m_db->distance_from_obj_range(dobj_min, dobj_max);
m_db->distance_from_bed_range(dbed_min, dbed_max);
if(dobj_min > settings.d_obj) {
if (dobj_min > settings.d_obj) {
settings.d_obj = std::max(dobj_min, settings.d_obj);
m_db->set_distance_from_objects(settings.d_obj);
}
@ -86,9 +92,9 @@ void ArrangeSettingsDialogImgui::render(float pos_x, float pos_y, bool current_b
if (m_show_xl_combo_predicate() &&
settings.xl_align >= 0 &&
ImGuiPureWrap::combo(_u8L("Alignment"),
{_u8L("Center"), _u8L("Rear left"), _u8L("Front left"),
{ _u8L("Center"), _u8L("Rear left"), _u8L("Front left"),
_u8L("Front right"), _u8L("Rear right"),
_u8L("Random")},
_u8L("Random") },
settings.xl_align)) {
if (settings.xl_align >= 0 &&
settings.xl_align < ArrangeSettingsView::xlpCount)
@ -99,11 +105,11 @@ void ArrangeSettingsDialogImgui::render(float pos_x, float pos_y, bool current_b
// TRN ArrangeDialog
if (ImGuiPureWrap::combo(_u8L("Geometry handling"),
// TRN ArrangeDialog: Type of "Geometry handling"
{_u8L("Fast"),
{ _u8L("Fast"),
// TRN ArrangeDialog: Type of "Geometry handling"
_u8L("Balanced"),
// TRN ArrangeDialog: Type of "Geometry handling"
_u8L("Accurate")},
_u8L("Accurate") },
settings.geom_handling)) {
if (settings.geom_handling >= 0 &&
settings.geom_handling < ArrangeSettingsView::ghCount)
@ -128,8 +134,15 @@ void ArrangeSettingsDialogImgui::render(float pos_x, float pos_y, bool current_b
if (m_on_reset_btn)
m_on_reset_btn();
}
ImGui::SameLine();
} else {
ImGui::PushTextWrapPos(350.f);
ImGuiPureWrap::text(_u8L("Sequential printing is active. Arrange algorithm will use geometry of the printer "
"to optimize objects placement and avoid collisions with the gantry."));
ImGui::PopTextWrapPos();
ImGui::Separator();
}
if (!current_bed && ImGuiPureWrap::button(_u8L("Arrange")) && m_on_arrange_btn) {
m_on_arrange_btn();