GCodeProcessor/GCodeViewer -> Extract bed shape from gcode files generated by PrusaSlicer

This commit is contained in:
enricoturri1966 2020-07-29 12:47:42 +02:00
parent 16e282110d
commit 9d4344a78c
3 changed files with 36 additions and 10 deletions

View file

@ -356,6 +356,10 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config)
m_filament_diameters.push_back(static_cast<float>(diam));
}
}
const ConfigOptionPoints* bed_shape = config.option<ConfigOptionPoints>("bed_shape");
if (bed_shape != nullptr)
m_result.bed_shape = bed_shape->values;
}
void GCodeProcessor::enable_stealth_time_estimator(bool enabled)

View file

@ -210,11 +210,27 @@ namespace Slic3r {
{
unsigned int id;
std::vector<MoveVertex> moves;
#if ENABLE_GCODE_VIEWER_AS_STATE
Pointfs bed_shape;
#endif // ENABLE_GCODE_VIEWER_AS_STATE
#if ENABLE_GCODE_VIEWER_STATISTICS
long long time{ 0 };
void reset() { time = 0; moves = std::vector<MoveVertex>(); }
void reset()
{
time = 0;
moves = std::vector<MoveVertex>();
#if ENABLE_GCODE_VIEWER_AS_STATE
bed_shape = Pointfs();
#endif // ENABLE_GCODE_VIEWER_AS_STATE
}
#else
void reset() { moves = std::vector<MoveVertex>(); }
void reset()
{
moves = std::vector<MoveVertex>();
#if ENABLE_GCODE_VIEWER_AS_STATE
bed_shape = Pointfs();
#endif // ENABLE_GCODE_VIEWER_AS_STATE
}
#endif // ENABLE_GCODE_VIEWER_STATISTICS
};