Skip to content

Commit

Permalink
Merge branch 'merill-merge'
Browse files Browse the repository at this point in the history
  • Loading branch information
remi durand committed Jun 9, 2021
2 parents 37cb188 + f6fdc36 commit ea2aea4
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 68 deletions.
15 changes: 12 additions & 3 deletions src/slic3r/GUI/GCodeViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,25 +151,29 @@ bool GCodeViewer::Path::matches(const GCodeProcessor::MoveVertex& move) const
#if ENABLE_TOOLPATHS_WIDTH_HEIGHT_FROM_GCODE
return type == move.type && extruder_id == move.extruder_id && cp_color_id == move.cp_color_id && role == move.extrusion_role &&
move.position[2] <= sub_paths.front().first.position[2] && feedrate == move.feedrate && fan_speed == move.fan_speed &&
layer_time == move.layer_duration && elapsed_time == move.time && extruder_temp == move.temperature &&
height == round_to_nearest(move.height, 2) && width == round_to_nearest(move.width, 2) &&
matches_percent(volumetric_rate, move.volumetric_rate(), 0.05f);
#else
return type == move.type && move.position[2] <= sub_paths.front().position[2] && role == move.extrusion_role && height == round_to_nearest(move.height, 2) &&
width == round_to_nearest(move.width, 2) && feedrate == move.feedrate && fan_speed == move.fan_speed &&
layer_time == move.layer_duration && elapsed_time == move.time && extruder_temp == move.temperature &&
volumetric_rate == round_to_nearest(move.volumetric_rate(), 2) && extruder_id == move.extruder_id &&
cp_color_id == move.cp_color_id;
#endif // ENABLE_TOOLPATHS_WIDTH_HEIGHT_FROM_GCODE
#else
#if ENABLE_TOOLPATHS_WIDTH_HEIGHT_FROM_GCODE
return type == move.type && extruder_id == move.extruder_id && cp_color_id == move.cp_color_id && role == move.extrusion_role &&
move.position[2] <= first.position[2] && feedrate == move.feedrate && fan_speed == move.fan_speed &&
layer_time == move.layer_duration && elapsed_time == move.time && extruder_temp == move.temperature &&
height == round_to_nearest(move.height, 2) && width == round_to_nearest(move.width, 2) &&
matches_percent(volumetric_rate, move.volumetric_rate(), 0.05f);
#else
return type == move.type && move.position[2] <= first.position[2] && role == move.extrusion_role && height == round_to_nearest(move.height, 2) &&
width == round_to_nearest(move.width, 2) && feedrate == move.feedrate && fan_speed == move.fan_speed &&
layer_time == move.layer_duration && elapsed_time == move.time && extruder_temp == move.temperature &&
volumetric_rate == round_to_nearest(move.volumetric_rate(), 2) && extruder_id == move.extruder_id &&
cp_color_id == move.cp_color_id && extruder_temp == move.temperature;
cp_color_id == move.cp_color_id;
#endif // ENABLE_TOOLPATHS_WIDTH_HEIGHT_FROM_GCODE
#endif // ENABLE_SPLITTED_VERTEX_BUFFER
}
Expand Down Expand Up @@ -202,11 +206,11 @@ void GCodeViewer::TBuffer::add_path(const GCodeProcessor::MoveVertex& move, unsi
#if ENABLE_TOOLPATHS_WIDTH_HEIGHT_FROM_GCODE
paths.push_back({ move.type, move.extrusion_role, move.delta_extruder,
round_to_nearest(move.height, 2), round_to_nearest(move.width, 2), move.feedrate, move.fan_speed,
move.volumetric_rate(), move.extruder_id, move.cp_color_id, { { endpoint, endpoint } } });
move.volumetric_rate(), move.extruder_id, move.cp_color_id, { { endpoint, endpoint } }, move.layer_duration, move.time, move.temperature });
#else
paths.push_back({ move.type, move.extrusion_role, move.delta_extruder,
round_to_nearest(move.height, 2), round_to_nearest(move.width, 2), move.feedrate, move.fan_speed,
round_to_nearest(move.volumetric_rate(), 2), move.extruder_id, move.cp_color_id, { { endpoint, endpoint } } });
round_to_nearest(move.volumetric_rate(), 2), move.extruder_id, move.cp_color_id, { { endpoint, endpoint } }, move.layer_duration, move.time, move.temperature });
#endif // ENABLE_TOOLPATHS_WIDTH_HEIGHT_FROM_GCODE
#else
#if ENABLE_TOOLPATHS_WIDTH_HEIGHT_FROM_GCODE
Expand Down Expand Up @@ -3285,8 +3289,13 @@ void GCodeViewer::refresh_render_paths(bool keep_sequential_current_first, bool
case EViewType::Width: { color = m_extrusions.ranges.width.get_color_at(path.width); break; }
case EViewType::Feedrate: { color = m_extrusions.ranges.feedrate.get_color_at(path.feedrate); break; }
case EViewType::FanSpeed: { color = m_extrusions.ranges.fan_speed.get_color_at(path.fan_speed); break; }
case EViewType::LayerTime: { color = m_extrusions.ranges.layer_duration.get_color_at(path.layer_time); break; }
case EViewType::LayerTimeLog: { color = m_extrusions.ranges.layer_duration.get_color_at(path.layer_time, true); break; }
case EViewType::Chronology: { color = m_extrusions.ranges.elapsed_time.get_color_at(path.elapsed_time); break; }
case EViewType::VolumetricRate: { color = m_extrusions.ranges.volumetric_rate.get_color_at(path.volumetric_rate); break; }
case EViewType::Tool: { color = m_tool_colors[path.extruder_id]; break; }
case EViewType::Filament: { color = m_filament_colors[path.extruder_id]; break; }
case EViewType::ExtruderTemp: { color = m_extrusions.ranges.extruder_temp.get_color_at(path.extruder_temp); break; }
case EViewType::ColorPrint: {
if (path.cp_color_id >= static_cast<unsigned char>(m_tool_colors.size())) {
color = { 0.5f, 0.5f, 0.5f };
Expand Down
3 changes: 2 additions & 1 deletion src/slic3r/GUI/GLCanvas3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2812,7 +2812,8 @@ void GLCanvas3D::on_key(wxKeyEvent& evt)
}
else if (keyCode == WXK_TAB && evt.ShiftDown() && !evt.ControlDown() && ! wxGetApp().is_gcode_viewer()) {
// Collapse side-panel with Shift+Tab
post_event(SimpleEvent(EVT_GLCANVAS_COLLAPSE_SIDEBAR));
// already done with the menu entry, don't re-do the call here.
//post_event(SimpleEvent(EVT_GLCANVAS_COLLAPSE_SIDEBAR));
}
else if (keyCode == WXK_SHIFT) {
translationProcessor.process(evt);
Expand Down
1 change: 1 addition & 0 deletions src/slic3r/GUI/KBShortcutsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ void KBShortcutsDialog::fill_shortcuts()
{ "I", L("Zoom in") },
{ "O", L("Zoom out") },
{ "Tab", L("Switch between Editor/Preview") },
{ "Ctrl+Tab", L("Switch between Tab") },
{ "Shift+Tab", L("Collapse/Expand the sidebar") },
#if ENABLE_CTRL_M_ON_WINDOWS
#ifdef _WIN32
Expand Down
Loading

0 comments on commit ea2aea4

Please sign in to comment.