ENH: save filament sequences in gcode result

jira: NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I79c2eb4002c72568d487df417c914ab0b8a14a67
(cherry picked from commit a289370b19e78693698db388d4057e25ba285d6b)
This commit is contained in:
xun.zhang
2024-10-25 11:13:31 +08:00
committed by Noisyfox
parent 53745a5767
commit d7af75359f
4 changed files with 51 additions and 3 deletions

View File

@@ -145,6 +145,15 @@ class Print;
struct GCodeProcessorResult
{
struct FilamentSequenceHash
{
uint64_t operator()(const std::vector<unsigned int>& layer_filament) const {
uint64_t key = 0;
for (auto& f : layer_filament)
key |= (uint64_t(1) << f);
return key;
}
};
ConflictResultOpt conflict_result;
GCodeCheckResult gcode_check_result;
FilamentPrintableResult filament_printable_reuslt;
@@ -241,6 +250,8 @@ class Print;
std::vector<SliceWarning> warnings;
int nozzle_hrc;
std::vector<NozzleType> nozzle_type;
// first key stores filaments, second keys stores the layer ranges(enclosed) that use the filaments
std::unordered_map<std::vector<unsigned int>, std::vector<std::pair<int, int>>,FilamentSequenceHash> layer_filaments;
BedType bed_type = BedType::btCount;
#if ENABLE_GCODE_VIEWER_STATISTICS
int64_t time{ 0 };