mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-24 09:11:23 -06:00
Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_sequential
This commit is contained in:
commit
e78e3ad80b
83 changed files with 5187 additions and 4933 deletions
|
|
@ -16,15 +16,9 @@
|
|||
#include "libslic3r/ExtrusionEntity.hpp"
|
||||
#include "libslic3r/ExtrusionEntityCollection.hpp"
|
||||
#include "libslic3r/Geometry.hpp"
|
||||
#if !ENABLE_GCODE_VIEWER
|
||||
#include "libslic3r/GCode/PreviewData.hpp"
|
||||
#endif // !ENABLE_GCODE_VIEWER
|
||||
#include "libslic3r/Print.hpp"
|
||||
#include "libslic3r/SLAPrint.hpp"
|
||||
#include "libslic3r/Slicing.hpp"
|
||||
#if !ENABLE_GCODE_VIEWER
|
||||
#include "libslic3r/GCode/Analyzer.hpp"
|
||||
#endif // !ENABLE_GCODE_VIEWER
|
||||
#include "slic3r/GUI/BitmapCache.hpp"
|
||||
#include "libslic3r/Format/STL.hpp"
|
||||
#include "libslic3r/Utils.hpp"
|
||||
|
|
|
|||
|
|
@ -19,9 +19,6 @@
|
|||
#include "libslic3r/SLAPrint.hpp"
|
||||
#include "libslic3r/Utils.hpp"
|
||||
#include "libslic3r/GCode/PostProcessor.hpp"
|
||||
#if !ENABLE_GCODE_VIEWER
|
||||
#include "libslic3r/GCode/PreviewData.hpp"
|
||||
#endif // !ENABLE_GCODE_VIEWER
|
||||
#include "libslic3r/Format/SL1.hpp"
|
||||
#include "libslic3r/Thread.hpp"
|
||||
#include "libslic3r/libslic3r.h"
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
#include <wx/debug.h>
|
||||
|
||||
#include "libslic3r/Utils.hpp"
|
||||
#include "libslic3r/Config.hpp"
|
||||
#include "GUI.hpp"
|
||||
#include "GUI_App.hpp"
|
||||
#include "GUI_Utils.hpp"
|
||||
|
|
@ -273,8 +274,8 @@ PrinterPicker::PrinterPicker(wxWindow *parent, const VendorProfile &vendor, wxSt
|
|||
const size_t odd_items = titles.size() % cols;
|
||||
|
||||
for (size_t i = 0; i < titles.size() - odd_items; i += cols) {
|
||||
for (size_t j = i; j < i + cols; j++) { printer_grid->Add(titles[j], 0, wxBOTTOM, 3); }
|
||||
for (size_t j = i; j < i + cols; j++) { printer_grid->Add(bitmaps[j], 0, wxBOTTOM, 20); }
|
||||
for (size_t j = i; j < i + cols; j++) { printer_grid->Add(titles[j], 0, wxBOTTOM, 3); }
|
||||
for (size_t j = i; j < i + cols; j++) { printer_grid->Add(variants_panels[j]); }
|
||||
|
||||
// Add separator space to multiliners
|
||||
|
|
@ -285,10 +286,10 @@ PrinterPicker::PrinterPicker(wxWindow *parent, const VendorProfile &vendor, wxSt
|
|||
if (odd_items > 0) {
|
||||
const size_t rem = titles.size() - odd_items;
|
||||
|
||||
for (size_t i = rem; i < titles.size(); i++) { printer_grid->Add(titles[i], 0, wxBOTTOM, 3); }
|
||||
for (size_t i = 0; i < cols - odd_items; i++) { printer_grid->AddSpacer(1); }
|
||||
for (size_t i = rem; i < titles.size(); i++) { printer_grid->Add(bitmaps[i], 0, wxBOTTOM, 20); }
|
||||
for (size_t i = 0; i < cols - odd_items; i++) { printer_grid->AddSpacer(1); }
|
||||
for (size_t i = rem; i < titles.size(); i++) { printer_grid->Add(titles[i], 0, wxBOTTOM, 3); }
|
||||
for (size_t i = 0; i < cols - odd_items; i++) { printer_grid->AddSpacer(1); }
|
||||
for (size_t i = rem; i < titles.size(); i++) { printer_grid->Add(variants_panels[i]); }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
#include "libslic3r/GCode.hpp"
|
||||
#else
|
||||
#include "wxExtensions.hpp"
|
||||
#include "libslic3r/GCode/PreviewData.hpp"
|
||||
#endif // ENABLE_GCODE_VIEWER
|
||||
#include "GUI.hpp"
|
||||
#include "GUI_App.hpp"
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ ExtruderSequenceDialog::ExtruderSequenceDialog(const DoubleSlider::ExtrudersSequ
|
|||
|
||||
auto option_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
auto intervals_box = new wxStaticBox(this, wxID_ANY, _(L("Set extruder change for every"))+ " : ");
|
||||
auto intervals_box = new wxStaticBox(this, wxID_ANY, _(L("Set extruder change for every"))+ ": ");
|
||||
auto intervals_box_sizer = new wxStaticBoxSizer(intervals_box, wxVERTICAL);
|
||||
|
||||
m_intervals_grid_sizer = new wxFlexGridSizer(3, 5, em);
|
||||
|
|
@ -114,26 +114,26 @@ ExtruderSequenceDialog::ExtruderSequenceDialog(const DoubleSlider::ExtrudersSequ
|
|||
rb_by_mm->SetValue(true);
|
||||
});
|
||||
|
||||
m_interval_by_mm->Bind(wxEVT_KILL_FOCUS, [this, change_value](wxFocusEvent& event)
|
||||
m_interval_by_mm->Bind(wxEVT_KILL_FOCUS, [change_value](wxFocusEvent& event)
|
||||
{
|
||||
change_value();
|
||||
event.Skip();
|
||||
});
|
||||
|
||||
m_interval_by_mm->Bind(wxEVT_TEXT_ENTER, [this, change_value](wxEvent&)
|
||||
m_interval_by_mm->Bind(wxEVT_TEXT_ENTER, [change_value](wxEvent&)
|
||||
{
|
||||
change_value();
|
||||
});
|
||||
|
||||
m_intervals_grid_sizer->Add(rb_by_mm, 0, wxALIGN_CENTER_VERTICAL);
|
||||
m_intervals_grid_sizer->Add(m_interval_by_mm,0, wxALIGN_CENTER_VERTICAL);
|
||||
m_intervals_grid_sizer->Add(m_interval_by_mm, 0, wxALIGN_CENTER_VERTICAL);
|
||||
m_intervals_grid_sizer->Add(st_by_mm,0, wxALIGN_CENTER_VERTICAL);
|
||||
|
||||
intervals_box_sizer->Add(m_intervals_grid_sizer, 0, wxLEFT, em);
|
||||
option_sizer->Add(intervals_box_sizer, 0, wxEXPAND);
|
||||
|
||||
|
||||
auto extruders_box = new wxStaticBox(this, wxID_ANY, _(L("Set extruder(tool) sequence"))+ " : ");
|
||||
auto extruders_box = new wxStaticBox(this, wxID_ANY, _(L("Set extruder(tool) sequence"))+ ": ");
|
||||
auto extruders_box_sizer = new wxStaticBoxSizer(extruders_box, wxVERTICAL);
|
||||
|
||||
m_extruders_grid_sizer = new wxFlexGridSizer(3, 5, em);
|
||||
|
|
|
|||
|
|
@ -693,6 +693,11 @@ void SpinCtrl::BUILD() {
|
|||
|
||||
auto temp = new wxSpinCtrl(m_parent, wxID_ANY, text_value, wxDefaultPosition, size,
|
||||
0|wxTE_PROCESS_ENTER, min_val, max_val, default_value);
|
||||
#ifdef __WXGTK3__
|
||||
wxSize best_sz = temp->GetBestSize();
|
||||
if (best_sz.x > size.x)
|
||||
temp->SetSize(wxSize(size.x + 2 * best_sz.y, best_sz.y));
|
||||
#endif //__WXGTK3__
|
||||
temp->SetFont(Slic3r::GUI::wxGetApp().normal_font());
|
||||
if (!wxOSX) temp->SetBackgroundStyle(wxBG_STYLE_PAINT);
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,6 @@
|
|||
#include "polypartition.h"
|
||||
#include "libslic3r/ClipperUtils.hpp"
|
||||
#include "libslic3r/PrintConfig.hpp"
|
||||
#if !ENABLE_GCODE_VIEWER
|
||||
#include "libslic3r/GCode/PreviewData.hpp"
|
||||
#endif // !ENABLE_GCODE_VIEWER
|
||||
#include "libslic3r/GCode/ThumbnailData.hpp"
|
||||
#include "libslic3r/Geometry.hpp"
|
||||
#include "libslic3r/ExtrusionEntity.hpp"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,4 @@
|
|||
#include "libslic3r/libslic3r.h"
|
||||
#if !ENABLE_GCODE_VIEWER
|
||||
#include "libslic3r/GCode/PreviewData.hpp"
|
||||
#endif // !ENABLE_GCODE_VIEWER
|
||||
#include "GUI_Preview.hpp"
|
||||
#include "GUI_App.hpp"
|
||||
#include "GUI.hpp"
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ void GLGizmoFdmSupports::on_render_input_window(float x, float y, float bottom_l
|
|||
|
||||
m_imgui->text("");
|
||||
|
||||
if (m_imgui->button("Autoset by angle...")) {
|
||||
if (m_imgui->button(_L("Autoset by angle") + "...")) {
|
||||
m_setting_angle = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -720,7 +720,7 @@ void ImGuiWrapper::search_list(const ImVec2& size_, bool (*items_getter)(int, co
|
|||
// The press on Esc key invokes editing of InputText (removes last changes)
|
||||
// So we should save previous value...
|
||||
std::string str = search_str;
|
||||
ImGui::InputTextEx("", NULL, search_str, 20, search_size, ImGuiInputTextFlags_AutoSelectAll, NULL, NULL);
|
||||
ImGui::InputTextEx("", NULL, search_str, 40, search_size, ImGuiInputTextFlags_AutoSelectAll, NULL, NULL);
|
||||
edited = ImGui::IsItemEdited();
|
||||
if (edited)
|
||||
hovered_id = 0;
|
||||
|
|
@ -798,6 +798,8 @@ void ImGuiWrapper::search_list(const ImVec2& size_, bool (*items_getter)(int, co
|
|||
}
|
||||
};
|
||||
|
||||
ImGui::AlignTextToFramePadding();
|
||||
|
||||
// add checkboxes for show/hide Categories and Groups
|
||||
text(_L("Use for search")+":");
|
||||
check_box(_L("Category"), view_params.category);
|
||||
|
|
|
|||
|
|
@ -173,9 +173,9 @@ wxPoint OG_CustomCtrl::get_pos(const Line& line, Field* field_in/* = nullptr*/)
|
|||
_CTX(option.label, "Layers") : _(option.label);
|
||||
label += ":";
|
||||
|
||||
wxPaintDC dc(this);
|
||||
dc.SetFont(m_font);
|
||||
h_pos += dc.GetMultiLineTextExtent(label).x + m_h_gap;
|
||||
wxCoord label_w, label_h;
|
||||
GetTextExtent(label, &label_w, &label_h, 0, 0, &m_font);
|
||||
h_pos += label_w + 1 + m_h_gap;
|
||||
}
|
||||
h_pos += 3 * blinking_button_width;
|
||||
|
||||
|
|
@ -205,12 +205,6 @@ wxPoint OG_CustomCtrl::get_pos(const Line& line, Field* field_in/* = nullptr*/)
|
|||
|
||||
void OG_CustomCtrl::OnPaint(wxPaintEvent&)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
|
||||
#else
|
||||
SetBackgroundColour(GetParent()->GetBackgroundColour());
|
||||
#endif // _WIN32
|
||||
|
||||
// case, when custom controll is destroyed but doesn't deleted from the evet loop
|
||||
if(!this->opt_group->custom_ctrl)
|
||||
return;
|
||||
|
|
@ -424,12 +418,6 @@ void OG_CustomCtrl::CtrlLine::msw_rescale()
|
|||
wxSize label_sz = ctrl->GetTextExtent(og_line.label);
|
||||
height = label_sz.y * (label_sz.GetWidth() > int(ctrl->opt_group->label_width * ctrl->m_em_unit) ? 2 : 1) + ctrl->m_v_gap;
|
||||
}
|
||||
|
||||
if (og_line.get_options().front().opt.full_width) {
|
||||
Field* field = ctrl->opt_group->get_field(og_line.get_options().front().opt_id);
|
||||
if (field->getWindow())
|
||||
field->getWindow()->SetSize(wxSize(3 * Field::def_width_wider() * ctrl->m_em_unit, -1));
|
||||
}
|
||||
|
||||
correct_items_positions();
|
||||
}
|
||||
|
|
@ -509,7 +497,10 @@ void OG_CustomCtrl::CtrlLine::render(wxDC& dc, wxCoord v_pos)
|
|||
option_set.front().side_widget == nullptr && og_line.get_extra_widgets().size() == 0)
|
||||
{
|
||||
if (field && field->undo_to_sys_bitmap())
|
||||
draw_act_bmps(dc, wxPoint(h_pos, v_pos), field->undo_to_sys_bitmap()->bmp(), field->undo_bitmap()->bmp(), field->blink());
|
||||
h_pos = draw_act_bmps(dc, wxPoint(h_pos, v_pos), field->undo_to_sys_bitmap()->bmp(), field->undo_bitmap()->bmp(), field->blink()) + ctrl->m_h_gap;
|
||||
// update width for full_width fields
|
||||
if (option_set.front().opt.full_width && field->getWindow())
|
||||
field->getWindow()->SetSize(ctrl->GetSize().x - h_pos, -1);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -115,10 +115,15 @@ void ObjectDataViewModelNode::set_action_and_extruder_icons()
|
|||
m_type & (itVolume | itLayer) ? "cog" : /*m_type & itInstance*/ "set_separate_obj";
|
||||
m_action_icon = create_scaled_bitmap(m_action_icon_name); // FIXME: pass window ptr
|
||||
|
||||
// set extruder bitmap
|
||||
set_extruder_icon();
|
||||
}
|
||||
|
||||
void ObjectDataViewModelNode::set_extruder_icon()
|
||||
{
|
||||
if (m_type & itInstance)
|
||||
return; // don't set colored bitmap for Instance
|
||||
|
||||
// set extruder bitmap
|
||||
int extruder_idx = atoi(m_extruder.c_str());
|
||||
if (extruder_idx > 0) --extruder_idx;
|
||||
m_extruder_bmp = get_extruder_color_icon(extruder_idx);
|
||||
|
|
@ -180,6 +185,8 @@ void ObjectDataViewModelNode::msw_rescale()
|
|||
|
||||
if (!m_opt_categories.empty())
|
||||
update_settings_digest_bitmaps();
|
||||
|
||||
set_extruder_icon();
|
||||
}
|
||||
|
||||
bool ObjectDataViewModelNode::SetValue(const wxVariant& variant, unsigned col)
|
||||
|
|
|
|||
|
|
@ -209,8 +209,10 @@ public:
|
|||
return true;
|
||||
}
|
||||
|
||||
// Set action icons for node
|
||||
// Set action and extruder(if any exist) icons for node
|
||||
void set_action_and_extruder_icons();
|
||||
// set extruder icon for node
|
||||
void set_extruder_icon();
|
||||
// Set printable icon for node
|
||||
void set_printable_icon(PrintIndicator printable);
|
||||
|
||||
|
|
|
|||
|
|
@ -296,11 +296,7 @@ void OptionsGroup::activate_line(Line& line)
|
|||
const auto& option = option_set.front();
|
||||
const auto& field = build_field(option);
|
||||
|
||||
if (custom_ctrl) {
|
||||
if (is_window_field(field) && option.opt.full_width)
|
||||
field->getWindow()->SetSize(wxSize(3 * Field::def_width_wider() * wxGetApp().em_unit(), -1));
|
||||
}
|
||||
else {
|
||||
if (!custom_ctrl) {
|
||||
if (is_window_field(field))
|
||||
sizer->Add(field->getWindow(), option.opt.full_width ? 1 : 0,
|
||||
wxBOTTOM | wxTOP | (option.opt.full_width ? wxEXPAND : wxALIGN_CENTER_VERTICAL), (wxOSX || !staticbox) ? 0 : 2);
|
||||
|
|
|
|||
|
|
@ -269,6 +269,8 @@ void PhysicalPrinterDialog::build_printhost_settings(ConfigOptionsGroup* m_optgr
|
|||
m_optgroup->m_on_change = [this](t_config_option_key opt_key, boost::any value) {
|
||||
if (opt_key == "host_type" || opt_key == "printhost_authorization_type")
|
||||
this->update();
|
||||
if (opt_key == "print_host")
|
||||
this->update_printhost_buttons();
|
||||
};
|
||||
|
||||
m_optgroup->append_single_option_line("host_type");
|
||||
|
|
@ -413,6 +415,23 @@ void PhysicalPrinterDialog::build_printhost_settings(ConfigOptionsGroup* m_optgr
|
|||
|
||||
m_optgroup->activate();
|
||||
|
||||
Field* printhost_field = m_optgroup->get_field("print_host");
|
||||
if (printhost_field)
|
||||
{
|
||||
wxTextCtrl* temp = dynamic_cast<wxTextCtrl*>(printhost_field->getWindow());
|
||||
if (temp)
|
||||
temp->Bind(wxEVT_TEXT, ([this, printhost_field, temp](wxEvent& e)
|
||||
{
|
||||
#ifndef __WXGTK__
|
||||
e.Skip();
|
||||
temp->GetToolTip()->Enable(true);
|
||||
#endif // __WXGTK__
|
||||
TextCtrl* field = dynamic_cast<TextCtrl*>(printhost_field);
|
||||
if (field)
|
||||
field->propagate_value();
|
||||
}), temp->GetId());
|
||||
}
|
||||
|
||||
// Always fill in the "printhost_port" combo box from the config and select it.
|
||||
{
|
||||
Choice* choice = dynamic_cast<Choice*>(m_optgroup->get_field("printhost_port"));
|
||||
|
|
@ -423,6 +442,13 @@ void PhysicalPrinterDialog::build_printhost_settings(ConfigOptionsGroup* m_optgr
|
|||
update();
|
||||
}
|
||||
|
||||
void PhysicalPrinterDialog::update_printhost_buttons()
|
||||
{
|
||||
std::unique_ptr<PrintHost> host(PrintHost::get_print_host(m_config));
|
||||
m_printhost_test_btn->Enable(!m_config->opt_string("print_host").empty() && host->can_test());
|
||||
m_printhost_browse_btn->Enable(host->has_auto_discovery());
|
||||
}
|
||||
|
||||
void PhysicalPrinterDialog::update()
|
||||
{
|
||||
m_optgroup->reload_config();
|
||||
|
|
@ -455,9 +481,7 @@ void PhysicalPrinterDialog::update()
|
|||
m_optgroup->show_field("printhost_port", supports_multiple_printers);
|
||||
m_printhost_port_browse_btn->Show(supports_multiple_printers);
|
||||
|
||||
std::unique_ptr<PrintHost> host(PrintHost::get_print_host(m_config));
|
||||
m_printhost_test_btn->Enable(!m_config->opt_string("print_host").empty() && host->can_test());
|
||||
m_printhost_browse_btn->Enable(host->has_auto_discovery());
|
||||
update_printhost_buttons();
|
||||
|
||||
this->SetSize(this->GetBestSize());
|
||||
this->Layout();
|
||||
|
|
|
|||
|
|
@ -86,6 +86,7 @@ public:
|
|||
~PhysicalPrinterDialog();
|
||||
|
||||
void update();
|
||||
void update_printhost_buttons();
|
||||
void update_printers();
|
||||
wxString get_printer_name();
|
||||
void update_full_printer_names();
|
||||
|
|
|
|||
|
|
@ -32,9 +32,6 @@
|
|||
#include "libslic3r/Format/STL.hpp"
|
||||
#include "libslic3r/Format/AMF.hpp"
|
||||
#include "libslic3r/Format/3mf.hpp"
|
||||
#if !ENABLE_GCODE_VIEWER
|
||||
#include "libslic3r/GCode/PreviewData.hpp"
|
||||
#endif // !ENABLE_GCODE_VIEWER
|
||||
#include "libslic3r/GCode/ThumbnailData.hpp"
|
||||
#include "libslic3r/Model.hpp"
|
||||
#include "libslic3r/SLA/Hollowing.hpp"
|
||||
|
|
@ -3563,7 +3560,7 @@ bool Plater::priv::warnings_dialog()
|
|||
{
|
||||
if (current_warnings.empty())
|
||||
return true;
|
||||
std::string text = _u8L("There are active warnings concerning sliced models:\n");
|
||||
std::string text = _u8L("There are active warnings concerning sliced models:") + "\n";
|
||||
bool empt = true;
|
||||
for (auto const& it : current_warnings) {
|
||||
int next_n = it.first.message.find_first_of('\n', 0);
|
||||
|
|
|
|||
|
|
@ -734,7 +734,7 @@ void UnsavedChangesDialog::show_info_line(Action action, std::string preset_name
|
|||
if (action == Action::Undef)
|
||||
text = _L("Some fields are too long to fit. Right mouse click reveals the full text.");
|
||||
else if (action == Action::Discard)
|
||||
text = _L("All modified options will be reverted.");
|
||||
text = _L("All settings changes will be discarded.");
|
||||
else {
|
||||
if (preset_name.empty())
|
||||
text = action == Action::Save ? _L("Save the selected options.") : _L("Transfer the selected settings to the newly selected preset.");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue