Fixed conflicts after merge with master

This commit is contained in:
Enrico Turri 2019-02-22 09:11:49 +01:00
commit eb0b3aea09
23 changed files with 598 additions and 120 deletions

View file

@ -13,6 +13,7 @@
#include "libslic3r/Utils.hpp"
#include "avrdude/avrdude-slic3r.hpp"
#include "GUI.hpp"
#include "GUI_App.hpp"
#include "I18N.hpp"
#include "MsgDialog.hpp"
#include "../Utils/HexFile.hpp"
@ -36,7 +37,6 @@
#include <wx/collpane.h>
#include <wx/msgdlg.h>
#include <wx/filefn.h>
#include "GUI_App.hpp"
namespace fs = boost::filesystem;
@ -693,11 +693,16 @@ FirmwareDialog::FirmwareDialog(wxWindow *parent) :
enum {
DIALOG_MARGIN = 15,
SPACING = 10,
MIN_WIDTH = 600,
MIN_HEIGHT = 200,
MIN_HEIGHT_EXPANDED = 500,
MIN_WIDTH = 50,
MIN_HEIGHT = 18,
MIN_HEIGHT_EXPANDED = 40,
};
const int em = GUI::wxGetApp().em_unit();
int min_width = MIN_WIDTH * em;
int min_height = MIN_HEIGHT * em;
int min_height_expanded = MIN_HEIGHT_EXPANDED * em;
wxFont status_font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
status_font.MakeBold();
wxFont mono_font(wxFontInfo().Family(wxFONTFAMILY_TELETYPE));
@ -769,10 +774,10 @@ FirmwareDialog::FirmwareDialog(wxWindow *parent) :
auto *topsizer = new wxBoxSizer(wxVERTICAL);
topsizer->Add(panel, 1, wxEXPAND | wxALL, DIALOG_MARGIN);
SetMinSize(wxSize(MIN_WIDTH, MIN_HEIGHT));
SetMinSize(wxSize(min_width, min_height));
SetSizerAndFit(topsizer);
const auto size = GetSize();
SetSize(std::max(size.GetWidth(), static_cast<int>(MIN_WIDTH)), std::max(size.GetHeight(), static_cast<int>(MIN_HEIGHT)));
SetSize(std::max(size.GetWidth(), static_cast<int>(min_width)), std::max(size.GetHeight(), static_cast<int>(min_height)));
Layout();
SetEscapeId(wxID_CLOSE); // To close the dialog using "Esc" button
@ -786,13 +791,13 @@ FirmwareDialog::FirmwareDialog(wxWindow *parent) :
}
});
p->spoiler->Bind(wxEVT_COLLAPSIBLEPANE_CHANGED, [this](wxCollapsiblePaneEvent &evt) {
p->spoiler->Bind(wxEVT_COLLAPSIBLEPANE_CHANGED, [=](wxCollapsiblePaneEvent &evt) {
if (evt.GetCollapsed()) {
this->SetMinSize(wxSize(MIN_WIDTH, MIN_HEIGHT));
this->SetMinSize(wxSize(min_width, min_height));
const auto new_height = this->GetSize().GetHeight() - this->p->txt_stdout->GetSize().GetHeight();
this->SetSize(this->GetSize().GetWidth(), new_height);
} else {
this->SetMinSize(wxSize(MIN_WIDTH, MIN_HEIGHT_EXPANDED));
this->SetMinSize(wxSize(min_width, min_height_expanded));
}
this->Layout();

View file

@ -3279,8 +3279,8 @@ bool GLCanvas3D::LegendTexture::generate(const GCodePreviewData& preview_data, c
wxMemoryDC mask_memDC;
// calculate scaling
// const float scale = canvas.get_canvas_size().get_scale_factor();
const float scale = wxGetApp().em_unit()*0.1; // get scale from em_unit() value, because of get_scale_factor() return 1
const float scale_gl = canvas.get_canvas_size().get_scale_factor();
const float scale = scale_gl * wxGetApp().em_unit()*0.1; // get scale from em_unit() value, because of get_scale_factor() return 1
const int scaled_square = std::floor((float)Px_Square * scale);
const int scaled_title_offset = Px_Title_Offset * scale;
const int scaled_text_offset = Px_Text_Offset * scale;
@ -3288,7 +3288,7 @@ bool GLCanvas3D::LegendTexture::generate(const GCodePreviewData& preview_data, c
const int scaled_border = Px_Border * scale;
// select default font
const wxFont font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)/*.Scale(scale)*/; // font is no need to scale now
const wxFont font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).Scale(scale_gl);
memDC.SetFont(font);
mask_memDC.SetFont(font);
@ -3486,6 +3486,7 @@ wxDEFINE_EVENT(EVT_GLCANVAS_ENABLE_ACTION_BUTTONS, Event<bool>);
wxDEFINE_EVENT(EVT_GLCANVAS_UPDATE_GEOMETRY, Vec3dsEvent<2>);
wxDEFINE_EVENT(EVT_GLCANVAS_MOUSE_DRAGGING_FINISHED, SimpleEvent);
wxDEFINE_EVENT(EVT_GLCANVAS_UPDATE_BED_SHAPE, SimpleEvent);
wxDEFINE_EVENT(EVT_GLCANVAS_TAB, SimpleEvent);
GLCanvas3D::GLCanvas3D(wxGLCanvas* canvas)
: m_canvas(canvas)
@ -3516,6 +3517,7 @@ GLCanvas3D::GLCanvas3D(wxGLCanvas* canvas)
, m_multisample_allowed(false)
, m_regenerate_volumes(true)
, m_moving(false)
, m_tab_down(false)
, m_color_by("volume")
, m_reload_delayed(false)
, m_render_sla_auxiliaries(true)
@ -4673,6 +4675,8 @@ void GLCanvas3D::on_char(wxKeyEvent& evt)
void GLCanvas3D::on_key(wxKeyEvent& evt)
{
const int keyCode = evt.GetKeyCode();
#if ENABLE_IMGUI
auto imgui = wxGetApp().imgui();
if (imgui->update_key_data(evt)) {
@ -4680,14 +4684,25 @@ void GLCanvas3D::on_key(wxKeyEvent& evt)
} else
#endif // ENABLE_IMGUI
if (evt.GetEventType() == wxEVT_KEY_UP) {
const int keyCode = evt.GetKeyCode();
// shift has been just released - SLA gizmo might want to close rectangular selection.
if (m_gizmos.get_current_type() == Gizmos::SlaSupports && keyCode == WXK_SHIFT && m_gizmos.mouse_event(SLAGizmoEventType::ShiftUp))
if (m_tab_down && keyCode == WXK_TAB && !evt.HasAnyModifiers()) {
// Enable switching between 3D and Preview with Tab
// m_canvas->HandleAsNavigationKey(evt); // XXX: Doesn't work in some cases / on Linux
post_event(SimpleEvent(EVT_GLCANVAS_TAB));
} else if (m_gizmos.get_current_type() == Gizmos::SlaSupports && keyCode == WXK_SHIFT && m_gizmos.mouse_event(SLAGizmoEventType::ShiftUp)) {
// shift has been just released - SLA gizmo might want to close rectangular selection.
m_dirty = true;
}
} else if (evt.GetEventType() == wxEVT_KEY_DOWN) {
m_tab_down = keyCode == WXK_TAB && !evt.HasAnyModifiers();
}
evt.Skip(); // Needed to have EVT_CHAR generated as well
if (keyCode != WXK_TAB
&& keyCode != WXK_LEFT
&& keyCode != WXK_UP
&& keyCode != WXK_RIGHT
&& keyCode != WXK_DOWN) {
evt.Skip(); // Needed to have EVT_CHAR generated as well
}
}
void GLCanvas3D::on_mouse_wheel(wxMouseEvent& evt)

View file

@ -115,6 +115,7 @@ wxDECLARE_EVENT(EVT_GLCANVAS_ENABLE_ACTION_BUTTONS, Event<bool>);
wxDECLARE_EVENT(EVT_GLCANVAS_UPDATE_GEOMETRY, Vec3dsEvent<2>);
wxDECLARE_EVENT(EVT_GLCANVAS_MOUSE_DRAGGING_FINISHED, SimpleEvent);
wxDECLARE_EVENT(EVT_GLCANVAS_UPDATE_BED_SHAPE, SimpleEvent);
wxDECLARE_EVENT(EVT_GLCANVAS_TAB, SimpleEvent);
// this describes events being passed from GLCanvas3D to SlaSupport gizmo
enum class SLAGizmoEventType {
@ -837,6 +838,7 @@ private:
bool m_multisample_allowed;
bool m_regenerate_volumes;
bool m_moving;
bool m_tab_down;
bool m_render_sla_auxiliaries;
std::string m_color_by;

View file

@ -1790,7 +1790,7 @@ void GLGizmoSlaSupports::set_sla_support_data(ModelObject* model_object, const G
update_mesh();
// If there are no points, let's ask the backend if it calculated some.
if (m_editing_mode_cache.empty() && m_parent.sla_print()->is_step_done(slaposSupportPoints))
if (m_editing_mode_cache.empty())
get_data_from_backend();
if (m_model_object != m_old_model_object)
@ -2169,7 +2169,7 @@ void GLGizmoSlaSupports::delete_selected_points()
m_unsaved_changes = true;
}
// This should trigger the support generation
// wxGetApp().plater()->reslice();
// wxGetApp().plater()->reslice_SLA_supports(*m_model_object);
}
select_point(NoPoints);
@ -2283,7 +2283,9 @@ RENDER_AGAIN:
if (apply_changes) {
editing_mode_apply_changes();
force_refresh = true;
m_parent.post_event(SimpleEvent(EVT_GLCANVAS_SCHEDULE_BACKGROUND_PROCESS));
// Recalculate support structures once the editing mode is left.
// m_parent.post_event(SimpleEvent(EVT_GLCANVAS_SCHEDULE_BACKGROUND_PROCESS));
wxGetApp().plater()->reslice_SLA_supports(*m_model_object);
}
ImGui::SameLine();
bool discard_changes = m_imgui->button(_(L("Discard changes")));
@ -2316,7 +2318,7 @@ RENDER_AGAIN:
if (m_model_object->sla_support_points.empty() || dlg.ShowModal() == wxID_YES) {
m_model_object->sla_support_points.clear();
m_editing_mode_cache.clear();
wxGetApp().plater()->reslice();
wxGetApp().plater()->reslice_SLA_supports(*m_model_object);
}
#endif
}
@ -2335,7 +2337,7 @@ RENDER_AGAIN:
m_model_object->sla_support_points.clear();
m_editing_mode_cache.clear();
wxGetApp().plater()->reslice();
wxGetApp().plater()->reslice_SLA_supports(*m_model_object);
}
ImGui::SameLine();
if (m_imgui->button(_(L("Cancel")))) {
@ -2496,7 +2498,7 @@ void GLGizmoSlaSupports::editing_mode_reload_cache()
void GLGizmoSlaSupports::get_data_from_backend()
{
for (const SLAPrintObject* po : m_parent.sla_print()->objects()) {
if (po->model_object()->id() == m_model_object->id()) {
if (po->model_object()->id() == m_model_object->id() && po->is_step_done(slaposSupportPoints)) {
const std::vector<sla::SupportPoint>& points = po->get_support_points();
auto mat = po->trafo().inverse().cast<float>();
for (unsigned int i=0; i<points.size();++i)

View file

@ -78,6 +78,7 @@ IMPLEMENT_APP(GUI_App)
GUI_App::GUI_App()
: wxApp()
, m_em_unit(10)
#if ENABLE_IMGUI
, m_imgui(new ImGuiWrapper())
#endif // ENABLE_IMGUI

View file

@ -44,7 +44,7 @@ ObjectManipulation::ObjectManipulation(wxWindow* parent) :
def.label = L("Name");
def.gui_type = "legend";
def.tooltip = L("Object name");
def.width = 200;
def.width = 21 * wxGetApp().em_unit();
def.default_value = new ConfigOptionString{ " " };
m_og->append_single_option_line(Option(def, "object_name"));

View file

@ -52,7 +52,7 @@ View3D::~View3D()
bool View3D::init(wxWindow* parent, Model* model, DynamicPrintConfig* config, BackgroundSlicingProcess* process)
{
if (!Create(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize))
if (!Create(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 /* disable wxTAB_TRAVERSAL */))
return false;
m_canvas_widget = GLCanvas3DManager::create_wxglcanvas(this);
@ -227,7 +227,7 @@ bool Preview::init(wxWindow* parent, DynamicPrintConfig* config, BackgroundSlici
if ((config == nullptr) || (process == nullptr) || (gcode_preview_data == nullptr))
return false;
if (!Create(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize))
if (!Create(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 /* disable wxTAB_TRAVERSAL */))
return false;
m_canvas_widget = GLCanvas3DManager::create_wxglcanvas(this);

View file

@ -138,11 +138,8 @@ bool ImGuiWrapper::update_key_data(wxKeyEvent &evt)
io.KeyAlt = evt.AltDown();
io.KeySuper = evt.MetaDown();
// XXX: Unfortunatelly this seems broken due to some interference with wxWidgets,
// we have to return true always (perform re-render).
// new_frame();
// return want_keyboard() || want_text_input();
return true;
new_frame();
return want_keyboard() || want_text_input();
}
}

View file

@ -32,8 +32,8 @@ struct MsgDialog : wxDialog
protected:
enum {
CONTENT_WIDTH = 50,//500,
CONTENT_MAX_HEIGHT = 60,//600,
CONTENT_WIDTH = 50,
CONTENT_MAX_HEIGHT = 60,
BORDER = 30,
VERT_SPACING = 15,
HORIZ_SPACING = 5,

View file

@ -99,6 +99,11 @@ public:
wxStaticText *info_facets;
wxStaticText *info_materials;
wxStaticText *info_manifold;
wxStaticText *label_volume;
wxStaticText *label_materials;
std::vector<wxStaticText *> sla_hidden_items;
bool showing_manifold_warning_icon;
void show_sizer(bool show);
};
@ -120,15 +125,16 @@ ObjectInfo::ObjectInfo(wxWindow *parent) :
(*info_label)->SetFont(wxGetApp().small_font());
grid_sizer->Add(text, 0);
grid_sizer->Add(*info_label, 0);
return text;
};
init_info_label(&info_size, _(L("Size")));
init_info_label(&info_volume, _(L("Volume")));
label_volume = init_info_label(&info_volume, _(L("Volume")));
init_info_label(&info_facets, _(L("Facets")));
init_info_label(&info_materials, _(L("Materials")));
label_materials = init_info_label(&info_materials, _(L("Materials")));
Add(grid_sizer, 0, wxEXPAND);
auto *info_manifold_text = new wxStaticText(parent, wxID_ANY, _(L("Manifold")));
auto *info_manifold_text = new wxStaticText(parent, wxID_ANY, _(L("Manifold")) + ":");
info_manifold_text->SetFont(wxGetApp().small_font());
info_manifold = new wxStaticText(parent, wxID_ANY, "");
info_manifold->SetFont(wxGetApp().small_font());
@ -139,6 +145,8 @@ ObjectInfo::ObjectInfo(wxWindow *parent) :
sizer_manifold->Add(manifold_warning_icon, 0, wxLEFT, 2);
sizer_manifold->Add(info_manifold, 0, wxLEFT, 2);
Add(sizer_manifold, 0, wxEXPAND | wxTOP, 4);
sla_hidden_items = { label_volume, info_volume, label_materials, info_materials };
}
void ObjectInfo::show_sizer(bool show)
@ -153,6 +161,7 @@ enum SlisedInfoIdx
siFilament_m,
siFilament_mm3,
siFilament_g,
siMateril_unit,
siCost,
siEstimatedTime,
siWTNumbetOfToolchanges,
@ -193,6 +202,7 @@ SlicedInfo::SlicedInfo(wxWindow *parent) :
init_info_label(_(L("Used Filament (m)")));
init_info_label(_(L("Used Filament (mm³)")));
init_info_label(_(L("Used Filament (g)")));
init_info_label(_(L("Used Material (unit)")));
init_info_label(_(L("Cost")));
init_info_label(_(L("Estimated printing time")));
init_info_label(_(L("Number of tool changes")));
@ -828,6 +838,11 @@ void Sidebar::show_info_sizer()
}
p->object_info->show_sizer(true);
if (p->plater->printer_technology() == ptSLA) {
for (auto item: p->object_info->sla_hidden_items)
item->Show(false);
}
}
void Sidebar::show_sliced_info_sizer(const bool show)
@ -836,53 +851,83 @@ void Sidebar::show_sliced_info_sizer(const bool show)
p->sliced_info->Show(show);
if (show) {
const PrintStatistics& ps = p->plater->fff_print().print_statistics();
const bool is_wipe_tower = ps.total_wipe_tower_filament > 0;
if (p->plater->printer_technology() == ptSLA)
{
const SLAPrintStatistics& ps = p->plater->sla_print().print_statistics();
wxString new_label = _(L("Used Material (ml)")) + " :";
const bool is_supports = ps.support_used_material > 0.0;
if (is_supports)
new_label += wxString::Format("\n - %s\n - %s", _(L("object(s)")), _(L("supports and pad")));
wxString new_label = _(L("Used Filament (m)"));
if (is_wipe_tower)
new_label += wxString::Format(" :\n - %s\n - %s", _(L("objects")), _(L("wipe tower")));
wxString info_text = is_supports ?
wxString::Format("%.2f \n%.2f \n%.2f", (ps.objects_used_material + ps.support_used_material) / 1000,
ps.objects_used_material / 1000,
ps.support_used_material / 1000) :
wxString::Format("%.2f", (ps.objects_used_material + ps.support_used_material) / 1000);
p->sliced_info->SetTextAndShow(siMateril_unit, info_text, new_label);
wxString info_text = is_wipe_tower ?
wxString::Format("%.2f \n%.2f \n%.2f", ps.total_used_filament / 1000,
(ps.total_used_filament - ps.total_wipe_tower_filament) / 1000,
ps.total_wipe_tower_filament / 1000) :
wxString::Format("%.2f", ps.total_used_filament / 1000);
p->sliced_info->SetTextAndShow(siFilament_m, info_text, new_label);
p->sliced_info->SetTextAndShow(siCost, "N/A"/*wxString::Format("%.2f", ps.total_cost)*/);
p->sliced_info->SetTextAndShow(siEstimatedTime, ps.estimated_print_time, _(L("Estimated printing time")) + " :");
p->sliced_info->SetTextAndShow(siFilament_mm3, wxString::Format("%.2f", ps.total_extruded_volume));
p->sliced_info->SetTextAndShow(siFilament_g, wxString::Format("%.2f", ps.total_weight));
new_label = _(L("Cost"));
if (is_wipe_tower)
new_label += wxString::Format(" :\n - %s\n - %s", _(L("objects")), _(L("wipe tower")));
info_text = is_wipe_tower ?
wxString::Format("%.2f \n%.2f \n%.2f", ps.total_cost,
(ps.total_cost - ps.total_wipe_tower_cost),
ps.total_wipe_tower_cost) :
wxString::Format("%.2f", ps.total_cost);
p->sliced_info->SetTextAndShow(siCost, info_text, new_label);
if (ps.estimated_normal_print_time == "N/A" && ps.estimated_silent_print_time == "N/A")
p->sliced_info->SetTextAndShow(siEstimatedTime, "N/A");
else {
new_label = _(L("Estimated printing time")) +" :";
info_text = "";
if (ps.estimated_normal_print_time != "N/A") {
new_label += wxString::Format("\n - %s", _(L("normal mode")));
info_text += wxString::Format("\n%s", ps.estimated_normal_print_time);
}
if (ps.estimated_silent_print_time != "N/A") {
new_label += wxString::Format("\n - %s", _(L("silent mode")));
info_text += wxString::Format("\n%s", ps.estimated_silent_print_time);
}
p->sliced_info->SetTextAndShow(siEstimatedTime, info_text, new_label);
// Hide non-SLA sliced info parameters
p->sliced_info->SetTextAndShow(siFilament_m, "N/A");
p->sliced_info->SetTextAndShow(siFilament_mm3, "N/A");
p->sliced_info->SetTextAndShow(siFilament_g, "N/A");
p->sliced_info->SetTextAndShow(siWTNumbetOfToolchanges, "N/A");
}
else
{
const PrintStatistics& ps = p->plater->fff_print().print_statistics();
const bool is_wipe_tower = ps.total_wipe_tower_filament > 0;
// if there is a wipe tower, insert number of toolchanges info into the array:
p->sliced_info->SetTextAndShow(siWTNumbetOfToolchanges, is_wipe_tower ? wxString::Format("%.d", p->plater->fff_print().wipe_tower_data().number_of_toolchanges) : "N/A");
wxString new_label = _(L("Used Filament (m)"));
if (is_wipe_tower)
new_label += wxString::Format(" :\n - %s\n - %s", _(L("objects")), _(L("wipe tower")));
wxString info_text = is_wipe_tower ?
wxString::Format("%.2f \n%.2f \n%.2f", ps.total_used_filament / 1000,
(ps.total_used_filament - ps.total_wipe_tower_filament) / 1000,
ps.total_wipe_tower_filament / 1000) :
wxString::Format("%.2f", ps.total_used_filament / 1000);
p->sliced_info->SetTextAndShow(siFilament_m, info_text, new_label);
p->sliced_info->SetTextAndShow(siFilament_mm3, wxString::Format("%.2f", ps.total_extruded_volume));
p->sliced_info->SetTextAndShow(siFilament_g, wxString::Format("%.2f", ps.total_weight));
new_label = _(L("Cost"));
if (is_wipe_tower)
new_label += wxString::Format(" :\n - %s\n - %s", _(L("objects")), _(L("wipe tower")));
info_text = is_wipe_tower ?
wxString::Format("%.2f \n%.2f \n%.2f", ps.total_cost,
(ps.total_cost - ps.total_wipe_tower_cost),
ps.total_wipe_tower_cost) :
wxString::Format("%.2f", ps.total_cost);
p->sliced_info->SetTextAndShow(siCost, info_text, new_label);
if (ps.estimated_normal_print_time == "N/A" && ps.estimated_silent_print_time == "N/A")
p->sliced_info->SetTextAndShow(siEstimatedTime, "N/A");
else {
new_label = _(L("Estimated printing time")) +" :";
info_text = "";
if (ps.estimated_normal_print_time != "N/A") {
new_label += wxString::Format("\n - %s", _(L("normal mode")));
info_text += wxString::Format("\n%s", ps.estimated_normal_print_time);
}
if (ps.estimated_silent_print_time != "N/A") {
new_label += wxString::Format("\n - %s", _(L("silent mode")));
info_text += wxString::Format("\n%s", ps.estimated_silent_print_time);
}
p->sliced_info->SetTextAndShow(siEstimatedTime, info_text, new_label);
}
// if there is a wipe tower, insert number of toolchanges info into the array:
p->sliced_info->SetTextAndShow(siWTNumbetOfToolchanges, is_wipe_tower ? wxString::Format("%.d", p->plater->fff_print().wipe_tower_data().number_of_toolchanges) : "N/A");
// Hide non-FFF sliced info parameters
p->sliced_info->SetTextAndShow(siMateril_unit, "N/A");
}
}
Layout();
@ -1154,9 +1199,6 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
view3D = new View3D(q, &model, config, &background_process);
preview = new Preview(q, config, &background_process, &gcode_preview_data, [this](){ schedule_background_process(); });
// Let the Tab key switch between the 3D view and the layer preview.
view3D->Bind(wxEVT_NAVIGATION_KEY, [this](wxNavigationKeyEvent &evt) { if (evt.IsFromTab()) this->select_next_view_3D(); });
preview->Bind(wxEVT_NAVIGATION_KEY, [this](wxNavigationKeyEvent &evt) { if (evt.IsFromTab()) this->select_next_view_3D(); });
view3D->set_bed(&bed);
preview->set_bed(&bed);
@ -1206,6 +1248,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
view3D_canvas->Bind(EVT_GLCANVAS_ENABLE_ACTION_BUTTONS, [this](Event<bool> &evt) { this->sidebar->enable_buttons(evt.data); });
view3D_canvas->Bind(EVT_GLCANVAS_UPDATE_GEOMETRY, &priv::on_update_geometry, this);
view3D_canvas->Bind(EVT_GLCANVAS_MOUSE_DRAGGING_FINISHED, &priv::on_3dcanvas_mouse_dragging_finished, this);
view3D_canvas->Bind(EVT_GLCANVAS_TAB, [this](SimpleEvent&) { select_next_view_3D(); });
// 3DScene/Toolbar:
view3D_canvas->Bind(EVT_GLTOOLBAR_ADD, &priv::on_action_add, this);
view3D_canvas->Bind(EVT_GLTOOLBAR_DELETE, [q](SimpleEvent&) { q->remove_selected(); });
@ -1223,6 +1266,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
preview->get_wxglcanvas()->Bind(EVT_GLCANVAS_VIEWPORT_CHANGED, &priv::on_viewport_changed, this);
preview->get_wxglcanvas()->Bind(EVT_GLCANVAS_QUESTION_MARK, [this](SimpleEvent&) { wxGetApp().keyboard_shortcuts(); });
preview->get_wxglcanvas()->Bind(EVT_GLCANVAS_UPDATE_BED_SHAPE, [this](SimpleEvent&) { set_bed_shape(config->option<ConfigOptionPoints>("bed_shape")->values); });
preview->get_wxglcanvas()->Bind(EVT_GLCANVAS_TAB, [this](SimpleEvent&) { select_next_view_3D(); });
view3D_canvas->Bind(EVT_GLCANVAS_INIT, [this](SimpleEvent&) { init_view_toolbar(); });
@ -2043,8 +2087,9 @@ unsigned int Plater::priv::update_background_process(bool force_validation)
//background_process.is_export_scheduled() - byl zavolan "Export G-code", background processing ma jmeno export souboru
//background_process.is_upload_scheduled() - byl zavolan "Send to OctoPrint", jeste nebylo doslajsovano (pak se preda upload fronte a background process zapomene)
//background_process.empty() - prazdna plocha
// pokud (invalidated != Print::APPLY_STATUS_UNCHANGED) a ! background_process.empty() -> je neco ke slajsovani (povol tlacitko)
// pokud (return_state & UPDATE_BACKGROUND_PROCESS_INVALID) != 0 -> doslo k chybe (gray out "Slice now")
// pokud (return_state & UPDATE_BACKGROUND_PROCESS_INVALID) != 0 -> doslo k chybe (gray out "Slice now") mozna "Invalid data"???
// jinak background_process.running() -> Zobraz "Slicing ..."
// jinak pokud ! background_process.empty() && ! background_process.finished() -> je neco ke slajsovani (povol tlacitko) "Slice Now"
return return_state;
}

View file

@ -444,6 +444,7 @@ const std::vector<std::string>& Preset::sla_print_options()
if (s_opts.empty()) {
s_opts = {
"layer_height",
"faded_layers",
"supports_enable",
"support_head_front_diameter",
"support_head_penetration",
@ -500,6 +501,7 @@ const std::vector<std::string>& Preset::sla_printer_options()
"bed_shape", "max_print_height",
"display_width", "display_height", "display_pixels_x", "display_pixels_y",
"display_orientation",
"fast_tilt_time", "slow_tilt_time", "area_fill",
"printer_correction",
"print_host", "printhost_apikey", "printhost_cafile",
"printer_notes",

View file

@ -38,7 +38,7 @@ PrintHostSendDialog::PrintHostSendDialog(const fs::path &path)
#endif
auto *label_dir_hint = new wxStaticText(this, wxID_ANY, _(L("Use forward slashes ( / ) as a directory separator if needed.")));
label_dir_hint->Wrap(CONTENT_WIDTH);
label_dir_hint->Wrap(CONTENT_WIDTH * wxGetApp().em_unit());
content_sizer->Add(txt_filename, 0, wxEXPAND);
content_sizer->Add(label_dir_hint);
@ -135,10 +135,11 @@ PrintHostQueueDialog::PrintHostQueueDialog(wxWindow *parent)
, on_error_evt(this, EVT_PRINTHOST_ERROR, &PrintHostQueueDialog::on_error, this)
, on_cancel_evt(this, EVT_PRINTHOST_CANCEL, &PrintHostQueueDialog::on_cancel, this)
{
enum { HEIGHT = 800, WIDTH = 400, SPACING = 5 };
enum { HEIGHT = 60, WIDTH = 30, SPACING = 5 };
SetSize(wxSize(HEIGHT, WIDTH));
SetSize(GetMinSize());
const auto em = GetTextExtent("m").x;
SetSize(wxSize(HEIGHT * em, WIDTH * em));
auto *topsizer = new wxBoxSizer(wxVERTICAL);

View file

@ -1977,6 +1977,13 @@ void TabPrinter::build_sla()
optgroup->append_line(line);
optgroup->append_single_option_line("display_orientation");
optgroup = page->new_optgroup(_(L("Tilt")));
line = { _(L("Tilt time")), "" };
line.append_option(optgroup->get_option("fast_tilt_time"));
line.append_option(optgroup->get_option("slow_tilt_time"));
optgroup->append_line(line);
optgroup->append_single_option_line("area_fill");
optgroup = page->new_optgroup(_(L("Corrections")));
line = Line{ m_config->def()->get("printer_correction")->full_label, "" };
std::vector<std::string> axes{ "X", "Y", "Z" };
@ -3210,6 +3217,7 @@ void TabSLAPrint::build()
auto optgroup = page->new_optgroup(_(L("Layers")));
optgroup->append_single_option_line("layer_height");
optgroup->append_single_option_line("faded_layers");
page = add_options_page(_(L("Supports")), "building.png");
optgroup = page->new_optgroup(_(L("Supports")));

View file

@ -204,7 +204,7 @@ protected:
void set_type();
int m_em_unit;
std::set<std::string> m_dirty_options = {};
std::set<std::string> m_dirty_options;
public:
PresetBundle* m_preset_bundle;

View file

@ -12,6 +12,7 @@
#include "libslic3r/libslic3r.h"
#include "libslic3r/Utils.hpp"
#include "GUI.hpp"
#include "GUI_App.hpp"
#include "I18N.hpp"
#include "ConfigWizard.hpp"
@ -34,7 +35,8 @@ MsgUpdateSlic3r::MsgUpdateSlic3r(const Semver &ver_current, const Semver &ver_on
auto *text = new wxStaticText(this, wxID_ANY, _(L("To download, follow the link below.")));
const auto link_width = link->GetSize().GetWidth();
text->Wrap(CONTENT_WIDTH > link_width ? CONTENT_WIDTH : link_width);
const int content_width = CONTENT_WIDTH * wxGetApp().em_unit();
text->Wrap(content_width > link_width ? content_width : link_width);
content_sizer->Add(text);
content_sizer->AddSpacer(VERT_SPACING);
@ -75,7 +77,7 @@ MsgUpdateConfig::MsgUpdateConfig(const std::unordered_map<std::string, std::stri
"should there be a problem with the new version.\n\n"
"Updated configuration bundles:"
)));
text->Wrap(CONTENT_WIDTH);
text->Wrap(CONTENT_WIDTH * wxGetApp().em_unit());
content_sizer->Add(text);
content_sizer->AddSpacer(VERT_SPACING);
@ -115,16 +117,16 @@ MsgDataIncompatible::MsgDataIncompatible(const std::unordered_map<std::string, w
"You may either exit Slic3r and try again with a newer version, or you may re-run the initial configuration. "
"Doing so will create a backup snapshot of the existing configuration before installing files compatible with this Slic3r.\n"
)));
text->Wrap(CONTENT_WIDTH);
text->Wrap(CONTENT_WIDTH * wxGetApp().em_unit());
content_sizer->Add(text);
auto *text2 = new wxStaticText(this, wxID_ANY, wxString::Format(_(L("This Slic3r PE version: %s")), SLIC3R_VERSION));
text2->Wrap(CONTENT_WIDTH);
text2->Wrap(CONTENT_WIDTH * wxGetApp().em_unit());
content_sizer->Add(text2);
content_sizer->AddSpacer(VERT_SPACING);
auto *text3 = new wxStaticText(this, wxID_ANY, _(L("Incompatible bundles:")));
text3->Wrap(CONTENT_WIDTH);
text3->Wrap(CONTENT_WIDTH * wxGetApp().em_unit());
content_sizer->Add(text3);
content_sizer->AddSpacer(VERT_SPACING);
@ -175,7 +177,7 @@ MsgDataLegacy::MsgDataLegacy() :
)),
ConfigWizard::name()
));
text->Wrap(CONTENT_WIDTH);
text->Wrap(CONTENT_WIDTH * wxGetApp().em_unit());
content_sizer->Add(text);
content_sizer->AddSpacer(VERT_SPACING);