From c7f6e5436c0215d34ed4ba417288876fcde02df5 Mon Sep 17 00:00:00 2001 From: bubnikv Date: Fri, 17 May 2019 11:46:46 +0200 Subject: [PATCH] Fix of Extend the "filament type" list with PC or allow free form text into the filament type field. #1704 --- src/libslic3r/GCode/WipeTowerPrusaMM.cpp | 3 +++ src/libslic3r/GCode/WipeTowerPrusaMM.hpp | 3 ++- src/libslic3r/PrintConfig.cpp | 14 ++++++++++++-- src/libslic3r/PrintConfig.hpp | 4 ++++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/GCode/WipeTowerPrusaMM.cpp b/src/libslic3r/GCode/WipeTowerPrusaMM.cpp index 34065a491..edfe475b5 100644 --- a/src/libslic3r/GCode/WipeTowerPrusaMM.cpp +++ b/src/libslic3r/GCode/WipeTowerPrusaMM.cpp @@ -474,6 +474,8 @@ WipeTowerPrusaMM::material_type WipeTowerPrusaMM::parse_material(const char *nam return NGEN; if (strcasecmp(name, "PVA") == 0) return PVA; + if (strcasecmp(name, "PC") == 0) + return PC; return INVALID; } @@ -489,6 +491,7 @@ std::string WipeTowerPrusaMM::to_string(material_type material) case EDGE: return "EDGE"; case NGEN: return "NGEN"; case PVA: return "PVA"; + case PC: return "PC"; case INVALID: default: return "INVALID"; } diff --git a/src/libslic3r/GCode/WipeTowerPrusaMM.hpp b/src/libslic3r/GCode/WipeTowerPrusaMM.hpp index 90f50b57a..f8adf4c5f 100644 --- a/src/libslic3r/GCode/WipeTowerPrusaMM.hpp +++ b/src/libslic3r/GCode/WipeTowerPrusaMM.hpp @@ -34,7 +34,8 @@ public: SCAFF = 5, // E:215C B:55C EDGE = 6, // E:240C B:80C NGEN = 7, // E:230C B:80C - PVA = 8 // E:210C B:80C + PVA = 8, // E:210C B:80C + PC = 9 }; // Parse material name into material_type. diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 3c8849d78..87ea26301 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -699,12 +699,22 @@ void PrintConfigDef::init_fff_params() def->enum_values.push_back("PLA"); def->enum_values.push_back("ABS"); def->enum_values.push_back("PET"); - def->enum_values.push_back("HIPS"); def->enum_values.push_back("FLEX"); - def->enum_values.push_back("SCAFF"); + def->enum_values.push_back("HIPS"); def->enum_values.push_back("EDGE"); def->enum_values.push_back("NGEN"); + def->enum_values.push_back("NYLON"); def->enum_values.push_back("PVA"); + def->enum_values.push_back("PC"); + def->enum_values.push_back("PP"); + def->enum_values.push_back("PEI"); + def->enum_values.push_back("PEEK"); + def->enum_values.push_back("PEKK"); + def->enum_values.push_back("POM"); + def->enum_values.push_back("PSU"); + def->enum_values.push_back("PVDF"); + def->enum_values.push_back("SCAFF"); + def->mode = comAdvanced; def->set_default_value(new ConfigOptionStrings { "PLA" }); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index d4ad1db8c..1da22b377 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -46,9 +46,11 @@ enum SeamPosition { spRandom, spNearest, spAligned, spRear }; +/* enum FilamentType { ftPLA, ftABS, ftPET, ftHIPS, ftFLEX, ftSCAFF, ftEDGE, ftNGEN, ftPVA }; +*/ enum SLADisplayOrientation { sladoLandscape, @@ -137,6 +139,7 @@ template<> inline const t_config_enum_values& ConfigOptionEnum::ge return keys_map; } +/* template<> inline const t_config_enum_values& ConfigOptionEnum::get_enum_values() { static t_config_enum_values keys_map; if (keys_map.empty()) { @@ -152,6 +155,7 @@ template<> inline const t_config_enum_values& ConfigOptionEnum::ge } return keys_map; } +*/ template<> inline const t_config_enum_values& ConfigOptionEnum::get_enum_values() { static const t_config_enum_values keys_map = {