mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-31 19:32:00 +08:00
Fixed couple of compiler warnings
This commit is contained in:
parent
9f95a25040
commit
f35f34376c
@ -685,8 +685,8 @@ std::string SLAPrint::validate(std::vector<std::string>*) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_material_config.use_tilt.get_at(0) && m_material_config.tower_hop_height.get_at(0) == 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)
|
|| (!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 "
|
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 "
|
"vertical direction only. Therefore, it is necessary to set the 'Tower hop height' parameter "
|
||||||
"to reasonable value. The recommended value is 5 mm.");
|
"to reasonable value. The recommended value is 5 mm.");
|
||||||
|
@ -1127,9 +1127,6 @@ void SLAPrint::Steps::merge_slices_and_eval_stats() {
|
|||||||
const auto height = scaled<double>(printer_config.display_height.getFloat());
|
const auto height = scaled<double>(printer_config.display_height.getFloat());
|
||||||
const double display_area = width*height;
|
const double display_area = width*height;
|
||||||
|
|
||||||
double supports_volume(0.0);
|
|
||||||
double models_volume(0.0);
|
|
||||||
|
|
||||||
std::vector<std::tuple<double, double, bool, double, double>> layers_info; // time, area, is_fast, models_volume, supports_volume
|
std::vector<std::tuple<double, double, bool, double, double>> layers_info; // time, area, is_fast, models_volume, supports_volume
|
||||||
layers_info.resize(printer_input.size());
|
layers_info.resize(printer_input.size());
|
||||||
|
|
||||||
@ -1220,7 +1217,7 @@ void SLAPrint::Steps::merge_slices_and_eval_stats() {
|
|||||||
bool is_fast_layer = false;
|
bool is_fast_layer = false;
|
||||||
|
|
||||||
if (is_prusa_print) {
|
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;
|
const int l_height_nm = 1000000 * l_height;
|
||||||
|
|
||||||
layer_times = layer_peel_move_time(l_height_nm, is_fast_layer ? below : above) +
|
layer_times = layer_peel_move_time(l_height_nm, is_fast_layer ? below : above) +
|
||||||
|
@ -6529,7 +6529,7 @@ static void render_sla_layer_legend(const SLAPrint& print, int layer_idx, int cn
|
|||||||
const std::vector<double>& areas = print.print_statistics().layers_areas;
|
const std::vector<double>& areas = print.print_statistics().layers_areas;
|
||||||
const std::vector<double>& times = print.print_statistics().layers_times_running_total;
|
const std::vector<double>& times = print.print_statistics().layers_times_running_total;
|
||||||
const double display_area = print.printer_config().display_height * print.printer_config().display_width;
|
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 area = areas[layer_idx];
|
||||||
const double time = times[layer_idx] - (layer_idx == 0 ? 0. : times[layer_idx-1]);
|
const double time = times[layer_idx] - (layer_idx == 0 ? 0. : times[layer_idx-1]);
|
||||||
const double time_until_layer = times[layer_idx];
|
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::SetNextWindowBgAlpha(0.6f);
|
||||||
|
|
||||||
imgui.begin(_u8L("Layer statistics"), ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoFocusOnAppearing);
|
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));
|
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::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%");
|
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
|
// 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.
|
// 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
|
// nothing to render, return
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (print->finished()) {
|
if (print->finished())
|
||||||
double slider_width = 0.;
|
|
||||||
render_sla_layer_legend(*print, m_layer_slider_index, get_canvas_size().get_width());
|
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_min_z = -m_clipping_planes[0].get_data()[3];
|
||||||
double clip_max_z = m_clipping_planes[1].get_data()[3];
|
double clip_max_z = m_clipping_planes[1].get_data()[3];
|
||||||
|
@ -5472,7 +5472,6 @@ void TabSLAMaterial::build_tilt_group(Slic3r::GUI::PageShp page)
|
|||||||
{
|
{
|
||||||
if (key.find_first_of("use_tilt") == 0)
|
if (key.find_first_of("use_tilt") == 0)
|
||||||
toggle_tilt_options(key == "use_tilt#0");
|
toggle_tilt_options(key == "use_tilt#0");
|
||||||
|
|
||||||
update_dirty();
|
update_dirty();
|
||||||
update();
|
update();
|
||||||
};
|
};
|
||||||
@ -5481,36 +5480,6 @@ void TabSLAMaterial::build_tilt_group(Slic3r::GUI::PageShp page)
|
|||||||
append_tilt_options_line(optgroup, opt_key);
|
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<const ConfigOptionFloats*>(def_values.get())->get_at(idx);
|
|
||||||
ret = double_to_string(val);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case coInts:
|
|
||||||
ret = static_cast<const ConfigOptionInts*>(def_values.get())->get_at(idx);
|
|
||||||
break;
|
|
||||||
case coBools:
|
|
||||||
ret = static_cast<const ConfigOptionBools*>(def_values.get())->get_at(idx);
|
|
||||||
break;
|
|
||||||
case coEnums:
|
|
||||||
ret = static_cast<const ConfigOptionEnumsGeneric*>(def_values.get())->get_at(idx);
|
|
||||||
break;
|
|
||||||
case coNone:
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<std::string> disable_tilt_options = {
|
std::vector<std::string> disable_tilt_options = {
|
||||||
"tilt_down_initial_speed"
|
"tilt_down_initial_speed"
|
||||||
,"tilt_down_offset_steps"
|
,"tilt_down_offset_steps"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user