Skip to content

Commit

Permalink
EViewType::ATCLayerBatching (PART 1)
Browse files Browse the repository at this point in the history
  • Loading branch information
apetsiuk committed Jul 12, 2023
1 parent 7705f61 commit e7b12c8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/slic3r/GUI/GCodeViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2432,6 +2432,8 @@ void GCodeViewer::refresh_render_paths(bool keep_sequential_current_first, bool
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::Temperature: { color = m_extrusions.ranges.temperature.get_color_at(path.temperature); break; }
// instead of 12 should be a batch number // check struct Path in GCodeViewer.hpp
case EViewType::ATCLayerBatching: { color = m_extrusions.ranges.atc_batching.get_color_at(132); break; }
#if ENABLE_PREVIEW_LAYER_TIME
case EViewType::LayerTimeLinear:
case EViewType::LayerTimeLogarithmic: {
Expand Down Expand Up @@ -3732,6 +3734,7 @@ void GCodeViewer::render_legend(float& legend_height)
_u8L("Fan speed (%)"),
_u8L("Temperature (°C)"),
_u8L("Volumetric flow rate (mm³/s)"),
_u8L("ATC layer batching"),
#if ENABLE_PREVIEW_LAYER_TIME
_u8L("Layer time (linear)"),
_u8L("Layer time (logarithmic)"),
Expand All @@ -3752,6 +3755,8 @@ void GCodeViewer::render_legend(float& legend_height)
append_headers({ _u8L(""), _u8L("Time"), _u8L("Percentage"), _u8L("Used filament") }, offsets);
else if (m_view_type == EViewType::Tool)
append_headers({ _u8L(""), _u8L("Used filament"), _u8L(""), _u8L("") }, offsets);
else if (m_view_type == EViewType::ATCLayerBatching)
append_headers({ _u8L(""), _u8L("Batch number"), _u8L(""), _u8L("") }, offsets);
else
ImGui::Separator();
#else
Expand Down Expand Up @@ -3826,6 +3831,7 @@ void GCodeViewer::render_legend(float& legend_height)
case EViewType::Feedrate: { append_range(m_extrusions.ranges.feedrate, 1); break; }
case EViewType::FanSpeed: { append_range(m_extrusions.ranges.fan_speed, 0); break; }
case EViewType::Temperature: { append_range(m_extrusions.ranges.temperature, 0); break; }
case EViewType::ATCLayerBatching: { append_range(m_extrusions.ranges.atc_batching, 0); break; }
case EViewType::VolumetricRate: { append_range(m_extrusions.ranges.volumetric_rate, 3); break; }
#if ENABLE_PREVIEW_LAYER_TIME
case EViewType::LayerTimeLinear: { append_time_range(m_extrusions.ranges.layer_time[static_cast<size_t>(m_time_estimate_mode)], Extrusions::Range::EType::Linear); break; }
Expand Down
5 changes: 5 additions & 0 deletions src/slic3r/GUI/GCodeViewer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ class GCodeViewer
float feedrate{ 0.0f };
float fan_speed{ 0.0f };
float temperature{ 0.0f };
//float atc_batching{ 0.0f };
float volumetric_rate{ 0.0f };
unsigned char extruder_id{ 0 };
unsigned char cp_color_id{ 0 };
Expand Down Expand Up @@ -475,6 +476,8 @@ class GCodeViewer
Range volumetric_rate;
// Color mapping by extrusion temperature.
Range temperature;
// Color mapping by ATC batch number.
Range atc_batching;
#if ENABLE_PREVIEW_LAYER_TIME
// Color mapping by layer time.
std::array<Range, static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Count)> layer_time;
Expand All @@ -487,6 +490,7 @@ class GCodeViewer
fan_speed.reset();
volumetric_rate.reset();
temperature.reset();
atc_batching.reset();
#if ENABLE_PREVIEW_LAYER_TIME
for (auto& range : layer_time) {
range.reset();
Expand Down Expand Up @@ -747,6 +751,7 @@ class GCodeViewer
FanSpeed,
Temperature,
VolumetricRate,
ATCLayerBatching,
#if ENABLE_PREVIEW_LAYER_TIME
LayerTimeLinear,
LayerTimeLogarithmic,
Expand Down

0 comments on commit e7b12c8

Please sign in to comment.