diff --git a/src/libslic3r/SLAPrint.cpp b/src/libslic3r/SLAPrint.cpp index fc63ca90d4..33e57ed5cb 100644 --- a/src/libslic3r/SLAPrint.cpp +++ b/src/libslic3r/SLAPrint.cpp @@ -685,8 +685,8 @@ std::string SLAPrint::validate(std::vector*) const } } - if (!m_material_config.use_tilt.get_at(0) && m_material_config.tower_hop_height.get_at(0) == 0 - || !m_material_config.use_tilt.get_at(1) && m_material_config.tower_hop_height.get_at(1) == 0) + if ((!m_material_config.use_tilt.get_at(0) && m_material_config.tower_hop_height.get_at(0) == 0) + || (!m_material_config.use_tilt.get_at(1) && m_material_config.tower_hop_height.get_at(1) == 0)) return _u8L("Disabling the 'Use tilt' function causes the object to separate away from the film in the " "vertical direction only. Therefore, it is necessary to set the 'Tower hop height' parameter " "to reasonable value. The recommended value is 5 mm."); diff --git a/src/libslic3r/SLAPrintSteps.cpp b/src/libslic3r/SLAPrintSteps.cpp index 420887bb28..326d6992a1 100644 --- a/src/libslic3r/SLAPrintSteps.cpp +++ b/src/libslic3r/SLAPrintSteps.cpp @@ -1127,9 +1127,6 @@ void SLAPrint::Steps::merge_slices_and_eval_stats() { const auto height = scaled(printer_config.display_height.getFloat()); const double display_area = width*height; - double supports_volume(0.0); - double models_volume(0.0); - std::vector> layers_info; // time, area, is_fast, models_volume, supports_volume layers_info.resize(printer_input.size()); @@ -1220,7 +1217,7 @@ void SLAPrint::Steps::merge_slices_and_eval_stats() { bool is_fast_layer = false; if (is_prusa_print) { - is_fast_layer = sliced_layer_cnt < first_slow_layers || layer_area <= display_area * area_fill; + is_fast_layer = int(sliced_layer_cnt) < first_slow_layers || layer_area <= display_area * area_fill; const int l_height_nm = 1000000 * l_height; layer_times = layer_peel_move_time(l_height_nm, is_fast_layer ? below : above) + diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 9fa16cb3e4..f977125e60 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -6529,7 +6529,7 @@ static void render_sla_layer_legend(const SLAPrint& print, int layer_idx, int cn const std::vector& areas = print.print_statistics().layers_areas; const std::vector& times = print.print_statistics().layers_times_running_total; const double display_area = print.printer_config().display_height * print.printer_config().display_width; - if (layer_idx >= 0 && layer_idx < areas.size()) { + if (layer_idx >= 0 && layer_idx < int(areas.size())) { const double area = areas[layer_idx]; const double time = times[layer_idx] - (layer_idx == 0 ? 0. : times[layer_idx-1]); const double time_until_layer = times[layer_idx]; @@ -6539,13 +6539,18 @@ static void render_sla_layer_legend(const SLAPrint& print, int layer_idx, int cn ImGui::SetNextWindowBgAlpha(0.6f); imgui.begin(_u8L("Layer statistics"), ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoFocusOnAppearing); - ImGui::Text(_u8L("Layer area: %.0f mm²").c_str(), area); + // FIXME: The snprintf would better be replaced by GUI::format, but I don't want to + // touch translated strings before the release. + char text[50]; + snprintf(text, 50, _u8L("Layer area: %.0f mm²").c_str(), area); + ImGui::Text("%s", text); int area_percent_int = int(std::round(100. * area/display_area)); - ImGui::Text(GUI::format(_u8L("Area fill: %1% %%%%"), area_percent_int == 0 ? "<1" : std::to_string(area_percent_int)).c_str()); + snprintf(text, 50, GUI::format(_u8L("Area fill: %1% %%%%"), area_percent_int == 0 ? "<1" : std::to_string(area_percent_int)).c_str()); + ImGui::Text("%s", text); ImGui::Separator(); - ImGui::Text(GUI::format(_u8L("Layer time: %1%"), get_time_dhms(time)).c_str()); + ImGui::Text("%s", GUI::format(_u8L("Layer time: %1%"), get_time_dhms(time)).c_str()); std::string buffer_str = _u8L("Time since start: %1%"); - ImGui::Text(GUI::format(buffer_str, get_time_dhms(time_until_layer)).c_str()); + ImGui::Text("%s", GUI::format(buffer_str, get_time_dhms(time_until_layer)).c_str()); // The dummy control below uses the assumption that the total time string will be the longest // and forces the width of the window large enough so it does not resize depending on the current value. @@ -6567,10 +6572,8 @@ void GLCanvas3D::_render_sla_slices() // nothing to render, return return; - if (print->finished()) { - double slider_width = 0.; + if (print->finished()) render_sla_layer_legend(*print, m_layer_slider_index, get_canvas_size().get_width()); - } double clip_min_z = -m_clipping_planes[0].get_data()[3]; double clip_max_z = m_clipping_planes[1].get_data()[3]; diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index af90cc18c3..d1ddf343ee 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -5472,7 +5472,6 @@ void TabSLAMaterial::build_tilt_group(Slic3r::GUI::PageShp page) { if (key.find_first_of("use_tilt") == 0) toggle_tilt_options(key == "use_tilt#0"); - update_dirty(); update(); }; @@ -5481,36 +5480,6 @@ void TabSLAMaterial::build_tilt_group(Slic3r::GUI::PageShp page) append_tilt_options_line(optgroup, opt_key); } -static boost::any get_def_config_value(const DynamicPrintConfig& config, const std::string& opt_key, int idx) -{ - boost::any ret; - - const ConfigOptionDef* opt = config.def()->get(opt_key); - auto def_values = opt->default_value; - if (def_values) { - switch (def_values->type()) { - case coFloats: { - double val = static_cast(def_values.get())->get_at(idx); - ret = double_to_string(val); - } - break; - case coInts: - ret = static_cast(def_values.get())->get_at(idx); - break; - case coBools: - ret = static_cast(def_values.get())->get_at(idx); - break; - case coEnums: - ret = static_cast(def_values.get())->get_at(idx); - break; - case coNone: - default: - break; - } - } - return ret; -} - std::vector disable_tilt_options = { "tilt_down_initial_speed" ,"tilt_down_offset_steps"