mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 05:05:56 +08:00
Fixed warnings
This commit is contained in:
parent
1d6fb321af
commit
1489e6d121
@ -63,9 +63,6 @@ static unsigned char buffer_id(EMoveType type) {
|
||||
static EMoveType buffer_type(unsigned char id) {
|
||||
return static_cast<EMoveType>(static_cast<unsigned char>(EMoveType::Retract) + id);
|
||||
}
|
||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
#endif // !ENABLE_NEW_GCODE_VIEWER
|
||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
|
||||
// Round to a bin with minimum two digits resolution.
|
||||
// Equivalent to conversion to string with sprintf(buf, "%.2g", value) and conversion back to float, but faster.
|
||||
@ -87,9 +84,6 @@ static float round_to_bin(const float value)
|
||||
return fast_round_up<int64_t>(a) * invscale[i];
|
||||
}
|
||||
|
||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
#if !ENABLE_NEW_GCODE_VIEWER
|
||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
void GCodeViewer::VBuffer::reset()
|
||||
{
|
||||
// release gpu memory
|
||||
@ -4301,7 +4295,6 @@ void GCodeViewer::render_legend(float& legend_height)
|
||||
append_range_item(0, values.front(), decimals);
|
||||
}
|
||||
else {
|
||||
const float step_size = range.get_step_size();
|
||||
for (int i = static_cast<int>(libvgcode::Ranges_Colors.size()) - 1; i >= 0; --i) {
|
||||
append_range_item(i, values[i], decimals);
|
||||
}
|
||||
@ -4364,7 +4357,6 @@ void GCodeViewer::render_legend(float& legend_height)
|
||||
append_range_item(0, values.front());
|
||||
}
|
||||
else {
|
||||
const float step_size = range.get_step_size();
|
||||
for (int i = static_cast<int>(libvgcode::Ranges_Colors.size()) - 1; i >= 0; --i) {
|
||||
append_range_item(i, values[i]);
|
||||
}
|
||||
@ -4770,7 +4762,7 @@ void GCodeViewer::render_legend(float& legend_height)
|
||||
#if ENABLE_NEW_GCODE_VIEWER
|
||||
append_item(EItemType::Rect, libvgcode::convert(libvgcode::Extrusion_Roles_Colors[static_cast<size_t>(role)]), labels[i],
|
||||
visible, times[i], percents[i], max_time_percent, offsets, used_filaments_m[i], used_filaments_g[i],
|
||||
[this, role, visible]() {
|
||||
[this, role]() {
|
||||
m_new_viewer.toggle_extrusion_role_visibility((libvgcode::EGCodeExtrusionRole)role);
|
||||
wxGetApp().plater()->update_preview_moves_slider();
|
||||
wxGetApp().plater()->get_current_canvas3D()->set_as_dirty();
|
||||
@ -5388,7 +5380,7 @@ void GCodeViewer::render_legend(float& legend_height)
|
||||
|
||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
#if ENABLE_NEW_GCODE_VIEWER
|
||||
auto show_mode_button = [this, &imgui, can_show_mode_button, new_view_type](const wxString& label, libvgcode::ETimeMode mode) {
|
||||
auto show_mode_button = [this, &imgui, can_show_mode_button](const wxString& label, libvgcode::ETimeMode mode) {
|
||||
#else
|
||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
auto show_mode_button = [this, &imgui, can_show_mode_button](const wxString& label, PrintEstimatedStatistics::ETimeMode mode) {
|
||||
@ -5445,7 +5437,7 @@ void GCodeViewer::render_legend(float& legend_height)
|
||||
// toolbar section
|
||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
#if ENABLE_NEW_GCODE_VIEWER
|
||||
auto toggle_button = [this, &imgui, icon_size, new_view_type](Preview::OptionType type, const std::string& name,
|
||||
auto toggle_button = [this, &imgui, icon_size](Preview::OptionType type, const std::string& name,
|
||||
#else
|
||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
auto toggle_button = [this, &imgui, icon_size](Preview::OptionType type, const std::string& name,
|
||||
|
@ -71,9 +71,8 @@ static Slic3r::GCodeExtrusionRole convert(EGCodeExtrusionRole role)
|
||||
case EGCodeExtrusionRole::SupportMaterialInterface: { return Slic3r::GCodeExtrusionRole::SupportMaterialInterface; }
|
||||
case EGCodeExtrusionRole::WipeTower: { return Slic3r::GCodeExtrusionRole::WipeTower; }
|
||||
case EGCodeExtrusionRole::Custom: { return Slic3r::GCodeExtrusionRole::Custom; }
|
||||
default: { return Slic3r::GCodeExtrusionRole::None; }
|
||||
}
|
||||
assert(false);
|
||||
return Slic3r::GCodeExtrusionRole::None;
|
||||
}
|
||||
|
||||
// mapping from Slic3r::GCodeExtrusionRole to libvgcode::EGCodeExtrusionRole
|
||||
@ -96,9 +95,8 @@ static EGCodeExtrusionRole convert(Slic3r::GCodeExtrusionRole role)
|
||||
case Slic3r::GCodeExtrusionRole::SupportMaterialInterface: { return EGCodeExtrusionRole::SupportMaterialInterface; }
|
||||
case Slic3r::GCodeExtrusionRole::WipeTower: { return EGCodeExtrusionRole::WipeTower; }
|
||||
case Slic3r::GCodeExtrusionRole::Custom: { return EGCodeExtrusionRole::Custom; }
|
||||
default: { return EGCodeExtrusionRole::None; }
|
||||
}
|
||||
assert(false);
|
||||
return EGCodeExtrusionRole::None;
|
||||
}
|
||||
|
||||
// mapping from Slic3r::EMoveType to libvgcode::EMoveType
|
||||
@ -117,9 +115,8 @@ static EMoveType convert(Slic3r::EMoveType type)
|
||||
case Slic3r::EMoveType::Travel: { return EMoveType::Travel; }
|
||||
case Slic3r::EMoveType::Wipe: { return EMoveType::Wipe; }
|
||||
case Slic3r::EMoveType::Extrude: { return EMoveType::Extrude; }
|
||||
default: { return EMoveType::COUNT; }
|
||||
}
|
||||
assert(false);
|
||||
return EMoveType::COUNT;
|
||||
}
|
||||
|
||||
// mapping from Slic3r::GUI::Preview::OptionType to libvgcode::EOptionType
|
||||
@ -143,9 +140,8 @@ static EOptionType convert(const Slic3r::GUI::Preview::OptionType& type)
|
||||
case Slic3r::GUI::Preview::OptionType::CenterOfGravity: { return EOptionType::CenterOfGravity; }
|
||||
case Slic3r::GUI::Preview::OptionType::ToolMarker: { return EOptionType::ToolMarker; }
|
||||
#endif // !ENABLE_NEW_GCODE_VIEWER_NO_COG_AND_TOOL_MARKERS
|
||||
default: { return EOptionType::COUNT; }
|
||||
}
|
||||
assert(false);
|
||||
return EOptionType::COUNT;
|
||||
}
|
||||
|
||||
// mapping from Slic3r::PrintEstimatedStatistics::ETimeMode to libvgcode::ETimeMode
|
||||
@ -155,9 +151,8 @@ static ETimeMode convert(const Slic3r::PrintEstimatedStatistics::ETimeMode& mode
|
||||
{
|
||||
case Slic3r::PrintEstimatedStatistics::ETimeMode::Normal: { return ETimeMode::Normal; }
|
||||
case Slic3r::PrintEstimatedStatistics::ETimeMode::Stealth: { return ETimeMode::Stealth; }
|
||||
default: { return ETimeMode::COUNT; }
|
||||
}
|
||||
assert(false);
|
||||
return ETimeMode::COUNT;
|
||||
}
|
||||
|
||||
// mapping from libvgcode::ETimeMode to Slic3r::PrintEstimatedStatistics::ETimeMode
|
||||
@ -167,9 +162,8 @@ static Slic3r::PrintEstimatedStatistics::ETimeMode convert(const ETimeMode& mode
|
||||
{
|
||||
case ETimeMode::Normal: { return Slic3r::PrintEstimatedStatistics::ETimeMode::Normal; }
|
||||
case ETimeMode::Stealth: { return Slic3r::PrintEstimatedStatistics::ETimeMode::Stealth; }
|
||||
default: { return Slic3r::PrintEstimatedStatistics::ETimeMode::Count; }
|
||||
}
|
||||
assert(false);
|
||||
return Slic3r::PrintEstimatedStatistics::ETimeMode::Count;
|
||||
}
|
||||
|
||||
// mapping from Slic3r::GCodeProcessorResult to libvgcode::GCodeInputData
|
||||
@ -182,7 +176,6 @@ static GCodeInputData convert(const Slic3r::GCodeProcessorResult& result)
|
||||
const Slic3r::GCodeProcessorResult::MoveVertex& curr = moves[i];
|
||||
const Slic3r::GCodeProcessorResult::MoveVertex& prev = moves[i - 1];
|
||||
const EMoveType curr_type = convert(curr.type);
|
||||
const EGCodeExtrusionRole curr_role = convert(curr.extrusion_role);
|
||||
|
||||
EGCodeExtrusionRole extrusion_role;
|
||||
if (curr_type == EMoveType::Travel) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user