mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 17:27:52 -06:00
Logging of memory usage for the GCodeAnalyzer and GCodePreviewData.
This commit is contained in:
parent
59b01b4908
commit
1e6900afa2
7 changed files with 77 additions and 11 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include "../libslic3r.h"
|
||||
#include "../PrintConfig.hpp"
|
||||
#include "../Utils.hpp"
|
||||
#include "Print.hpp"
|
||||
|
||||
#include "Analyzer.hpp"
|
||||
|
@ -852,6 +853,16 @@ void GCodeAnalyzer::_calc_gcode_preview_unretractions(GCodePreviewData& preview_
|
|||
}
|
||||
}
|
||||
|
||||
// Return an estimate of the memory consumed by the time estimator.
|
||||
size_t GCodeAnalyzer::memory_used() const
|
||||
{
|
||||
size_t out = sizeof(*this);
|
||||
for (const std::pair<GCodeMove::EType, GCodeMovesList> &kvp : m_moves_map)
|
||||
out += sizeof(kvp) + SLIC3R_STDVEC_MEMSIZE(kvp.second, GCodeMove);
|
||||
out += m_process_output.size();
|
||||
return out;
|
||||
}
|
||||
|
||||
GCodePreviewData::Color operator + (const GCodePreviewData::Color& c1, const GCodePreviewData::Color& c2)
|
||||
{
|
||||
return GCodePreviewData::Color(clamp(0.0f, 1.0f, c1.rgba[0] + c2.rgba[0]),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue