diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index bff72a9c0c..4d314004d6 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -103,8 +103,7 @@ OozePrevention::_get_temp(GCode &gcodegen) : gcodegen.config().temperature.get_at(gcodegen.writer().extruder()->id()); } -std::string -Wipe::wipe(GCode &gcodegen, bool toolchange) +std::string Wipe::wipe(GCode &gcodegen, bool toolchange) { std::string gcode; @@ -137,19 +136,22 @@ Wipe::wipe(GCode &gcodegen, bool toolchange) wipe_path.clip_end(wipe_path.length() - wipe_dist); // subdivide the retraction in segments - for (const Line &line : wipe_path.lines()) { - double segment_length = line.length(); - /* Reduce retraction length a bit to avoid effective retraction speed to be greater than the configured one - due to rounding (TODO: test and/or better math for this) */ - double dE = length * (segment_length / wipe_dist) * 0.95; - //FIXME one shall not generate the unnecessary G1 Fxxx commands, here wipe_speed is a constant inside this cycle. - // Is it here for the cooling markers? Or should it be outside of the cycle? - gcode += gcodegen.writer().set_speed(wipe_speed*60, "", gcodegen.enable_cooling_markers() ? ";_WIPE" : ""); - gcode += gcodegen.writer().extrude_to_xy( - gcodegen.point_to_gcode(line.b), - -dE, - "wipe and retract" - ); + if (! wipe_path.empty()) { + for (const Line &line : wipe_path.lines()) { + double segment_length = line.length(); + /* Reduce retraction length a bit to avoid effective retraction speed to be greater than the configured one + due to rounding (TODO: test and/or better math for this) */ + double dE = length * (segment_length / wipe_dist) * 0.95; + //FIXME one shall not generate the unnecessary G1 Fxxx commands, here wipe_speed is a constant inside this cycle. + // Is it here for the cooling markers? Or should it be outside of the cycle? + gcode += gcodegen.writer().set_speed(wipe_speed*60, "", gcodegen.enable_cooling_markers() ? ";_WIPE" : ""); + gcode += gcodegen.writer().extrude_to_xy( + gcodegen.point_to_gcode(line.b), + -dE, + "wipe and retract" + ); + } + gcodegen.set_last_pos(wipe_path.points.back()); } // prevent wiping again on same path @@ -2577,9 +2579,11 @@ std::string GCode::travel_to(const Point &point, ExtrusionRole role, std::string // use G1 because we rely on paths being straight (G0 may make round paths) Lines lines = travel.lines(); - for (Lines::const_iterator line = lines.begin(); line != lines.end(); ++line) - gcode += m_writer.travel_to_xy(this->point_to_gcode(line->b), comment); - + if (! lines.empty()) { + for (const Line &line : lines) + gcode += m_writer.travel_to_xy(this->point_to_gcode(line.b), comment); + this->set_last_pos(lines.back().b); + } return gcode; } diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index 32a7057512..86a6cacee3 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -155,11 +155,11 @@ public: void do_export(Print *print, const char *path, GCodePreviewData *preview_data = nullptr); // Exported for the helper classes (OozePrevention, Wipe) and for the Perl binding for unit tests. - const Vec2d& origin() const { return m_origin; } + const Vec2d& origin() const { return m_origin; } void set_origin(const Vec2d &pointf); void set_origin(const coordf_t x, const coordf_t y) { this->set_origin(Vec2d(x, y)); } const Point& last_pos() const { return m_last_pos; } - Vec2d point_to_gcode(const Point &point) const; + Vec2d point_to_gcode(const Point &point) const; Point gcode_to_point(const Vec2d &point) const; const FullPrintConfig &config() const { return m_config; } const Layer* layer() const { return m_layer; } @@ -360,6 +360,7 @@ protected: size_t num_objects, size_t num_islands); + friend class Wipe; friend class WipeTowerIntegration; }; diff --git a/src/libslic3r/Geometry.cpp b/src/libslic3r/Geometry.cpp index 11a9955133..37484de613 100644 --- a/src/libslic3r/Geometry.cpp +++ b/src/libslic3r/Geometry.cpp @@ -1182,15 +1182,17 @@ Transform3d assemble_transform(const Vec3d& translation, const Vec3d& rotation, Vec3d extract_euler_angles(const Eigen::Matrix& rotation_matrix) { #if ENABLE_NEW_EULER_ANGLES - bool x_only = (rotation_matrix(0, 0) == 1.0) && (rotation_matrix(0, 1) == 0.0) && (rotation_matrix(0, 2) == 0.0) && (rotation_matrix(1, 0) == 0.0) && (rotation_matrix(2, 0) == 0.0); - bool y_only = (rotation_matrix(0, 1) == 0.0) && (rotation_matrix(1, 0) == 0.0) && (rotation_matrix(1, 1) == 1.0) && (rotation_matrix(1, 2) == 0.0) && (rotation_matrix(2, 1) == 0.0); - bool z_only = (rotation_matrix(0, 2) == 0.0) && (rotation_matrix(1, 2) == 0.0) && (rotation_matrix(2, 0) == 0.0) && (rotation_matrix(2, 1) == 0.0) && (rotation_matrix(2, 2) == 1.0); -// bool xy_only = (rotation_matrix(0, 1) == 0.0); // Rx * Ry - bool yx_only = (rotation_matrix(1, 0) == 0.0); // Ry * Rx -// bool xz_only = (rotation_matrix(0, 2) == 0.0); // Rx * Rz -// bool zx_only = (rotation_matrix(2, 0) == 0.0); // Rz * Rx -// bool yz_only = (rotation_matrix(1, 2) == 0.0); // Ry * Rz -// bool zy_only = (rotation_matrix(2, 1) == 0.0); // Rz * Ry + auto is_approx = [](double value, double test_value) -> bool { return std::abs(value - test_value) < EPSILON; }; + + bool x_only = is_approx(rotation_matrix(0, 0), 1.0) && is_approx(rotation_matrix(0, 1), 0.0) && is_approx(rotation_matrix(0, 2), 0.0) && is_approx(rotation_matrix(1, 0), 0.0) && is_approx(rotation_matrix(2, 0), 0.0); + bool y_only = is_approx(rotation_matrix(0, 1), 0.0) && is_approx(rotation_matrix(1, 0), 0.0) && is_approx(rotation_matrix(1, 1), 1.0) && is_approx(rotation_matrix(1, 2), 0.0) && is_approx(rotation_matrix(2, 1), 0.0); + bool z_only = is_approx(rotation_matrix(0, 2), 0.0) && is_approx(rotation_matrix(1, 2), 0.0) && is_approx(rotation_matrix(2, 0), 0.0) && is_approx(rotation_matrix(2, 1), 0.0) && is_approx(rotation_matrix(2, 2), 1.0); +// bool xy_only = is_approx(rotation_matrix(0, 1), 0.0); // Rx * Ry + bool yx_only = is_approx(rotation_matrix(1, 0), 0.0); // Ry * Rx +// bool xz_only = is_approx(rotation_matrix(0, 2), 0.0); // Rx * Rz +// bool zx_only = is_approx(rotation_matrix(2, 0), 0.0); // Rz * Rx +// bool yz_only = is_approx(rotation_matrix(1, 2), 0.0); // Ry * Rz +// bool zy_only = is_approx(rotation_matrix(2, 1), 0.0); // Rz * Ry Vec3d angles = Vec3d::Zero(); if (x_only || y_only || z_only) diff --git a/src/libslic3r/MultiPoint.cpp b/src/libslic3r/MultiPoint.cpp index 7b483cba04..ee3b997476 100644 --- a/src/libslic3r/MultiPoint.cpp +++ b/src/libslic3r/MultiPoint.cpp @@ -206,6 +206,26 @@ std::vector MultiPoint::_douglas_peucker(const std::vector& pts, c floater = &pts[floater_idx]; } } + assert(result_pts.front() == pts.front()); + assert(result_pts.back() == pts.back()); + +#if 0 + { + static int iRun = 0; + BoundingBox bbox(pts); + BoundingBox bbox2(result_pts); + bbox.merge(bbox2); + SVG svg(debug_out_path("douglas_peucker_%d.svg", iRun ++).c_str(), bbox); + if (pts.front() == pts.back()) + svg.draw(Polygon(pts), "black"); + else + svg.draw(Polyline(pts), "black"); + if (result_pts.front() == result_pts.back()) + svg.draw(Polygon(result_pts), "green", scale_(0.1)); + else + svg.draw(Polyline(result_pts), "green", scale_(0.1)); + } +#endif } return result_pts; } diff --git a/src/libslic3r/SLA/SLASupportTree.cpp b/src/libslic3r/SLA/SLASupportTree.cpp index 3178160849..7bba1c80e7 100644 --- a/src/libslic3r/SLA/SLASupportTree.cpp +++ b/src/libslic3r/SLA/SLASupportTree.cpp @@ -1204,8 +1204,8 @@ bool SLASupportTree::generate(const PointSet &points, // there is no need to bridge them together. if(pillar_dist > 2*cfg.head_back_radius_mm && bridge_distance < cfg.max_bridge_length_mm) - while(sj(Z) > pillar.endpoint(Z) && - ej(Z) > nextpillar.endpoint(Z)) + while(sj(Z) > pillar.endpoint(Z) + cfg.base_radius_mm && + ej(Z) > nextpillar.endpoint(Z) + + cfg.base_radius_mm) { if(chkd >= bridge_distance) { result.add_bridge(sj, ej, pillar.r); @@ -1702,7 +1702,7 @@ SlicedSupports SLASupportTree::slice(float layerh, float init_layerh) const const Pad& pad = m_impl->pad(); if(!pad.empty()) gndlvl -= float(get_pad_elevation(pad.cfg)); - std::vector heights = {gndlvl}; + std::vector heights; heights.reserve(size_t(modelh/layerh) + 1); for(float h = gndlvl + init_layerh; h < gndlvl + modelh; h += layerh) { diff --git a/src/libslic3r/SLAPrint.cpp b/src/libslic3r/SLAPrint.cpp index 445c785763..e18b73816a 100644 --- a/src/libslic3r/SLAPrint.cpp +++ b/src/libslic3r/SLAPrint.cpp @@ -732,9 +732,7 @@ void SLAPrint::process() po.m_supportdata->level_ids.reserve(sslices.size()); for(int i = 0; i < int(sslices.size()); ++i) { - int a = i == 0 ? 0 : 1; - int b = i == 0 ? 0 : i - 1; - LevelID h = sminZ + a * sih + b * slh; + LevelID h = sminZ + sih + i * slh; po.m_supportdata->level_ids.emplace_back(h); float fh = float(double(h) * SCALING_FACTOR); diff --git a/src/libslic3r/SLAPrint.hpp b/src/libslic3r/SLAPrint.hpp index 9fab4d5500..21503c6f6a 100644 --- a/src/libslic3r/SLAPrint.hpp +++ b/src/libslic3r/SLAPrint.hpp @@ -148,8 +148,16 @@ private: // Which steps have to be performed. Implicitly: all std::vector m_stepmask; + + // Individual 2d slice polygons from lower z to higher z levels std::vector m_model_slices; + + // Exact (float) height levels mapped to the slices. Each record contains + // the index to the model and the support slice vectors. SliceIndex m_slice_index; + + // The height levels corrected and scaled up in integer values. This will + // be used at rasterization. std::vector m_level_ids; // Caching the transformed (m_trafo) raw mesh of the object diff --git a/src/libslic3r/TriangleMesh.cpp b/src/libslic3r/TriangleMesh.cpp index 359e144b5a..8a0a087c02 100644 --- a/src/libslic3r/TriangleMesh.cpp +++ b/src/libslic3r/TriangleMesh.cpp @@ -860,12 +860,12 @@ void TriangleMeshSlicer::_slice_do(size_t facet_idx, std::vector::const_iterator min_layer, max_layer; min_layer = std::lower_bound(z.begin(), z.end(), min_z); // first layer whose slice_z is >= min_z - max_layer = std::upper_bound(z.begin() + (min_layer - z.begin()), z.end(), max_z) - 1; // last layer whose slice_z is <= max_z + max_layer = std::upper_bound(min_layer, z.end(), max_z); // first layer whose slice_z is > max_z #ifdef SLIC3R_TRIANGLEMESH_DEBUG printf("layers: min = %d, max = %d\n", (int)(min_layer - z.begin()), (int)(max_layer - z.begin())); #endif /* SLIC3R_TRIANGLEMESH_DEBUG */ - for (std::vector::const_iterator it = min_layer; it != max_layer + 1; ++ it) { + for (std::vector::const_iterator it = min_layer; it != max_layer; ++ it) { std::vector::size_type layer_idx = it - z.begin(); IntersectionLine il; if (this->slice_facet(*it / SCALING_FACTOR, facet, facet_idx, min_z, max_z, &il) == TriangleMeshSlicer::Slicing) { diff --git a/src/slic3r/GUI/AboutDialog.cpp b/src/slic3r/GUI/AboutDialog.cpp index 582496506b..a4bb6c814a 100644 --- a/src/slic3r/GUI/AboutDialog.cpp +++ b/src/slic3r/GUI/AboutDialog.cpp @@ -114,7 +114,7 @@ AboutDialog::AboutDialog() this->Bind(wxEVT_BUTTON, &AboutDialog::onCloseDialog, this, wxID_CLOSE); vsizer->Add(buttons, 0, wxEXPAND | wxRIGHT | wxBOTTOM, 3); - this->Bind(wxEVT_LEFT_DOWN, &AboutDialog::onCloseDialog, this); +// this->Bind(wxEVT_LEFT_DOWN, &AboutDialog::onCloseDialog, this); logo->Bind(wxEVT_LEFT_DOWN, &AboutDialog::onCloseDialog, this); SetSizer(main_sizer); diff --git a/src/slic3r/GUI/FirmwareDialog.cpp b/src/slic3r/GUI/FirmwareDialog.cpp index 418d1a3c9d..2df1f0bc99 100644 --- a/src/slic3r/GUI/FirmwareDialog.cpp +++ b/src/slic3r/GUI/FirmwareDialog.cpp @@ -775,6 +775,8 @@ FirmwareDialog::FirmwareDialog(wxWindow *parent) : SetSize(std::max(size.GetWidth(), static_cast(MIN_WIDTH)), std::max(size.GetHeight(), static_cast(MIN_HEIGHT))); Layout(); + SetEscapeId(wxID_CLOSE); // To close the dialog using "Esc" button + // Bind events p->hex_picker->Bind(wxEVT_FILEPICKER_CHANGED, [this](wxFileDirPickerEvent& evt) { @@ -826,6 +828,7 @@ FirmwareDialog::FirmwareDialog(wxWindow *parent) : if (this->p->avrdude) { evt.Veto(); } else { + this->EndModal(wxID_CLOSE); evt.Skip(); } }); diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 50cc028a9a..9a2ea4b44c 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -1609,13 +1609,12 @@ void GLCanvas3D::Selection::rotate(const Vec3d& rotation, bool local) else if (is_single_volume() || is_single_modifier()) #if ENABLE_WORLD_ROTATIONS { - if (requires_local_axes()) + if (local) (*m_volumes)[i]->set_volume_rotation(rotation); else { Transform3d m = Geometry::assemble_transform(Vec3d::Zero(), rotation); - const Transform3d& inst_m = m_cache.volumes_data[i].get_instance_rotation_matrix(); - Vec3d new_rotation = Geometry::extract_euler_angles(inst_m.inverse() * m * inst_m * m_cache.volumes_data[i].get_volume_rotation_matrix()); + Vec3d new_rotation = Geometry::extract_euler_angles(m * m_cache.volumes_data[i].get_volume_rotation_matrix()); (*m_volumes)[i]->set_volume_rotation(new_rotation); } } @@ -5709,7 +5708,7 @@ void GLCanvas3D::set_camera_zoom(float zoom) // Don't allow to zoom too far outside the scene. float zoom_min = _get_zoom_to_bounding_box_factor(_max_bounding_box()); if (zoom_min > 0.0f) - zoom = std::max(zoom, zoom_min * 0.8f); + zoom = std::max(zoom, zoom_min * 0.7f); m_camera.zoom = zoom; viewport_changed(); diff --git a/src/slic3r/GUI/GUI_ObjectManipulation.cpp b/src/slic3r/GUI/GUI_ObjectManipulation.cpp index 7c6ac111a3..3e6fe228c9 100644 --- a/src/slic3r/GUI/GUI_ObjectManipulation.cpp +++ b/src/slic3r/GUI/GUI_ObjectManipulation.cpp @@ -497,7 +497,11 @@ void ObjectManipulation::change_rotation_value(const Vec3d& rotation) } canvas->get_selection().start_dragging(); +#if ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION + canvas->get_selection().rotate(rad_rotation, selection.is_single_full_instance() || selection.requires_local_axes()); +#else canvas->get_selection().rotate(rad_rotation, selection.is_single_full_instance()); +#endif // ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION canvas->do_rotate(); #if ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION diff --git a/src/slic3r/GUI/GUI_ObjectSettings.hpp b/src/slic3r/GUI/GUI_ObjectSettings.hpp index 19140efe3b..3e72713bfb 100644 --- a/src/slic3r/GUI/GUI_ObjectSettings.hpp +++ b/src/slic3r/GUI/GUI_ObjectSettings.hpp @@ -24,7 +24,7 @@ public: virtual void Hide(); virtual void UpdateAndShow(const bool show); - wxSizer* get_sizer(); + virtual wxSizer* get_sizer(); ConfigOptionsGroup* get_og() { return m_og.get(); } }; diff --git a/src/slic3r/GUI/GUI_Preview.cpp b/src/slic3r/GUI/GUI_Preview.cpp index 560d5b69cb..f791145a2b 100644 --- a/src/slic3r/GUI/GUI_Preview.cpp +++ b/src/slic3r/GUI/GUI_Preview.cpp @@ -751,30 +751,20 @@ void Preview::load_print_as_fff() if (IsShown()) { if (gcode_preview_data_valid) - { + // Load the real G-code preview. m_canvas->load_gcode_preview(*m_gcode_preview_data, colors); - show_hide_ui_elements("full"); - - // recalculates zs and update sliders accordingly - has_layers = ! m_canvas->get_current_print_zs(true).empty(); - if (! has_layers) - { - // all layers filtered out - reset_sliders(); - m_canvas_widget->Refresh(); - } - } else - { - // load skirt and brim + // Load the initial preview based on slices, not the final G-code. m_canvas->load_preview(colors); - show_hide_ui_elements("simple"); - } - - - if (has_layers) - update_sliders(m_canvas->get_current_print_zs(true)); - + show_hide_ui_elements(gcode_preview_data_valid ? "full" : "simple"); + // recalculates zs and update sliders accordingly + std::vector zs = m_canvas->get_current_print_zs(true); + if (zs.empty()) { + // all layers filtered out + reset_sliders(); + m_canvas_widget->Refresh(); + } else + update_sliders(zs); m_loaded = true; } } diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 7015084cd2..a6ad715d59 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -286,12 +286,17 @@ class FreqChangedParams : public OG_Settings { double m_brim_width = 0.0; wxButton* m_wiping_dialog_button{ nullptr }; + wxSizer* m_sizer {nullptr}; + + std::shared_ptr m_og_sla; public: FreqChangedParams(wxWindow* parent, const int label_width); ~FreqChangedParams() {} wxButton* get_wiping_dialog_button() { return m_wiping_dialog_button; } - void Show(const bool show); + wxSizer* get_sizer() override; + ConfigOptionsGroup* get_og(const bool is_fff); + void Show(const bool is_fff); }; FreqChangedParams::FreqChangedParams(wxWindow* parent, const int label_width) : @@ -299,22 +304,13 @@ FreqChangedParams::FreqChangedParams(wxWindow* parent, const int label_width) : { DynamicPrintConfig* config = &wxGetApp().preset_bundle->prints.get_edited_preset().config; + // Frequently changed parameters for FFF_technology m_og->set_config(config); m_og->label_width = label_width; m_og->m_on_change = [config, this](t_config_option_key opt_key, boost::any value) { - TabPrint* tab_print = nullptr; - for (size_t i = 0; i < wxGetApp().tab_panel()->GetPageCount(); ++i) { - Tab *tab = dynamic_cast(wxGetApp().tab_panel()->GetPage(i)); - if (!tab) - continue; - if (tab->name() == "print") { - tab_print = static_cast(tab); - break; - } - } - if (tab_print == nullptr) - return; + Tab* tab_print = wxGetApp().get_tab(Preset::TYPE_PRINT); + if (!tab_print) return; if (opt_key == "fill_density") { value = m_og->get_config_value(*config, opt_key); @@ -413,19 +409,56 @@ FreqChangedParams::FreqChangedParams(wxWindow* parent, const int label_width) : return sizer; }; m_og->append_line(line); + + + // Frequently changed parameters for SLA_technology + m_og_sla = std::make_shared(parent, ""); + DynamicPrintConfig* config_sla = &wxGetApp().preset_bundle->sla_prints.get_edited_preset().config; + m_og_sla->set_config(config_sla); + m_og_sla->label_width = label_width*2; + + m_og_sla->m_on_change = [config_sla, this](t_config_option_key opt_key, boost::any value) { + Tab* tab = wxGetApp().get_tab(Preset::TYPE_SLA_PRINT); + if (!tab) return; + + tab->set_value(opt_key, value); + + DynamicPrintConfig new_conf = *config_sla; + new_conf.set_key_value(opt_key, new ConfigOptionBool(boost::any_cast(value))); + tab->load_config(new_conf); + tab->update_dirty(); + }; + + m_og_sla->append_single_option_line("supports_enable"); + m_og_sla->append_single_option_line("pad_enable"); + + m_sizer = new wxBoxSizer(wxVERTICAL); + m_sizer->Add(m_og->sizer, 0, wxEXPAND); + m_sizer->Add(m_og_sla->sizer, 0, wxEXPAND | wxTOP, 5); } -void FreqChangedParams::Show(const bool show) +wxSizer* FreqChangedParams::get_sizer() { - bool is_wdb_shown = m_wiping_dialog_button->IsShown(); - m_og->Show(show); + return m_sizer; +} + +void FreqChangedParams::Show(const bool is_fff) +{ + const bool is_wdb_shown = m_wiping_dialog_button->IsShown(); + m_og->Show(is_fff); + m_og_sla->Show(!is_fff); // correct showing of the FreqChangedParams sizer when m_wiping_dialog_button is hidden - if (show && !is_wdb_shown) + if (is_fff && !is_wdb_shown) m_wiping_dialog_button->Hide(); } +ConfigOptionsGroup* FreqChangedParams::get_og(const bool is_fff) +{ + return is_fff ? m_og.get() : m_og_sla.get(); +} + // Sidebar / private struct Sidebar::priv @@ -703,9 +736,9 @@ wxScrolledWindow* Sidebar::scrolled_panel() return p->scrolled; } -ConfigOptionsGroup* Sidebar::og_freq_chng_params() +ConfigOptionsGroup* Sidebar::og_freq_chng_params(const bool is_fff) { - return p->frequently_changed_parameters->get_og(); + return p->frequently_changed_parameters->get_og(is_fff); } wxButton* Sidebar::get_wiping_dialog_button() diff --git a/src/slic3r/GUI/Plater.hpp b/src/slic3r/GUI/Plater.hpp index 373d7dc28e..7b19d6f313 100644 --- a/src/slic3r/GUI/Plater.hpp +++ b/src/slic3r/GUI/Plater.hpp @@ -76,7 +76,7 @@ public: ObjectSettings* obj_settings(); wxScrolledWindow* scrolled_panel(); - ConfigOptionsGroup* og_freq_chng_params(); + ConfigOptionsGroup* og_freq_chng_params(const bool is_fff); wxButton* get_wiping_dialog_button(); void update_objects_list_extruder_column(int extruders_count); void show_info_sizer(); diff --git a/src/slic3r/GUI/SysInfoDialog.cpp b/src/slic3r/GUI/SysInfoDialog.cpp index 110bfaf44a..5da74b4bb9 100644 --- a/src/slic3r/GUI/SysInfoDialog.cpp +++ b/src/slic3r/GUI/SysInfoDialog.cpp @@ -120,7 +120,7 @@ SysInfoDialog::SysInfoDialog() this->Bind(wxEVT_BUTTON, &SysInfoDialog::onCloseDialog, this, wxID_OK); main_sizer->Add(buttons, 0, wxEXPAND | wxRIGHT | wxBOTTOM, 3); - this->Bind(wxEVT_LEFT_DOWN, &SysInfoDialog::onCloseDialog, this); +// this->Bind(wxEVT_LEFT_DOWN, &SysInfoDialog::onCloseDialog, this); logo->Bind(wxEVT_LEFT_DOWN, &SysInfoDialog::onCloseDialog, this); SetSizer(main_sizer); diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index d78e9c695e..452e3bf202 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -751,8 +751,8 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value) wxPostEvent(this, event); - auto og_freq_chng_params = wxGetApp().sidebar().og_freq_chng_params(); - if (opt_key == "fill_density") + ConfigOptionsGroup* og_freq_chng_params = wxGetApp().sidebar().og_freq_chng_params(supports_printer_technology(ptFFF)); + if (opt_key == "fill_density" || opt_key == "supports_enable" || opt_key == "pad_enable") { boost::any val = og_freq_chng_params->get_config_value(*m_config, opt_key); og_freq_chng_params->set_value(opt_key, val); @@ -881,8 +881,20 @@ void Tab::update_preset_description_line() void Tab::update_frequently_changed_parameters() { - auto og_freq_chng_params = wxGetApp().sidebar().og_freq_chng_params(); + auto og_freq_chng_params = wxGetApp().sidebar().og_freq_chng_params(supports_printer_technology(ptFFF)); if (!og_freq_chng_params) return; + + if (m_type == Preset::TYPE_SLA_PRINT) + { + for (auto opt_key : { "supports_enable", "pad_enable" }) + { + boost::any val = og_freq_chng_params->get_config_value(*m_config, opt_key); + og_freq_chng_params->set_value(opt_key, val); + } + return; + } + + // for m_type == Preset::TYPE_PRINT boost::any value = og_freq_chng_params->get_config_value(*m_config, "fill_density"); og_freq_chng_params->set_value("fill_density", value); @@ -2370,7 +2382,7 @@ void Tab::load_current_preset() } else { on_presets_changed(); - if (m_name == "print") + if (m_type == Preset::TYPE_SLA_PRINT || m_type == Preset::TYPE_PRINT)// if (m_name == "print") update_frequently_changed_parameters(); }