mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 18:55:54 +08:00
Tech ENABLE_FIX_SUPERSLICER_GCODE_IMPORT set as default
This commit is contained in:
parent
152c3be53a
commit
ef059404b3
@ -740,11 +740,7 @@ ConfigSubstitutions ConfigBase::load(const boost::property_tree::ptree &tree, Fo
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Load the config keys from the given string.
|
// Load the config keys from the given string.
|
||||||
#if ENABLE_FIX_SUPERSLICER_GCODE_IMPORT
|
|
||||||
size_t ConfigBase::load_from_gcode_string_legacy(ConfigBase& config, const char* str, ConfigSubstitutionContext& substitutions)
|
size_t ConfigBase::load_from_gcode_string_legacy(ConfigBase& config, const char* str, ConfigSubstitutionContext& substitutions)
|
||||||
#else
|
|
||||||
static inline size_t load_from_gcode_string_legacy(ConfigBase& config, const char* str, ConfigSubstitutionContext& substitutions)
|
|
||||||
#endif // ENABLE_FIX_SUPERSLICER_GCODE_IMPORT
|
|
||||||
{
|
{
|
||||||
if (str == nullptr)
|
if (str == nullptr)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2017,9 +2017,7 @@ public:
|
|||||||
// Set all the nullable values to nils.
|
// Set all the nullable values to nils.
|
||||||
void null_nullables();
|
void null_nullables();
|
||||||
|
|
||||||
#if ENABLE_FIX_SUPERSLICER_GCODE_IMPORT
|
|
||||||
static size_t load_from_gcode_string_legacy(ConfigBase& config, const char* str, ConfigSubstitutionContext& substitutions);
|
static size_t load_from_gcode_string_legacy(ConfigBase& config, const char* str, ConfigSubstitutionContext& substitutions);
|
||||||
#endif // ENABLE_FIX_SUPERSLICER_GCODE_IMPORT
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Set a configuration value from a string.
|
// Set a configuration value from a string.
|
||||||
|
@ -748,9 +748,7 @@ const std::vector<std::pair<GCodeProcessor::EProducer, std::string>> GCodeProces
|
|||||||
{ EProducer::PrusaSlicer, "generated by PrusaSlicer" },
|
{ EProducer::PrusaSlicer, "generated by PrusaSlicer" },
|
||||||
{ EProducer::Slic3rPE, "generated by Slic3r Prusa Edition" },
|
{ EProducer::Slic3rPE, "generated by Slic3r Prusa Edition" },
|
||||||
{ EProducer::Slic3r, "generated by Slic3r" },
|
{ EProducer::Slic3r, "generated by Slic3r" },
|
||||||
#if ENABLE_FIX_SUPERSLICER_GCODE_IMPORT
|
|
||||||
{ EProducer::SuperSlicer, "generated by SuperSlicer" },
|
{ EProducer::SuperSlicer, "generated by SuperSlicer" },
|
||||||
#endif // ENABLE_FIX_SUPERSLICER_GCODE_IMPORT
|
|
||||||
{ EProducer::Cura, "Cura_SteamEngine" },
|
{ EProducer::Cura, "Cura_SteamEngine" },
|
||||||
{ EProducer::Simplify3D, "G-Code generated by Simplify3D(R)" },
|
{ EProducer::Simplify3D, "G-Code generated by Simplify3D(R)" },
|
||||||
{ EProducer::CraftWare, "CraftWare" },
|
{ EProducer::CraftWare, "CraftWare" },
|
||||||
@ -1234,10 +1232,8 @@ void GCodeProcessor::process_file(const std::string& filename, std::function<voi
|
|||||||
}
|
}
|
||||||
else if (m_producer == EProducer::Simplify3D)
|
else if (m_producer == EProducer::Simplify3D)
|
||||||
apply_config_simplify3d(filename);
|
apply_config_simplify3d(filename);
|
||||||
#if ENABLE_FIX_SUPERSLICER_GCODE_IMPORT
|
|
||||||
else if (m_producer == EProducer::SuperSlicer)
|
else if (m_producer == EProducer::SuperSlicer)
|
||||||
apply_config_superslicer(filename);
|
apply_config_superslicer(filename);
|
||||||
#endif // ENABLE_FIX_SUPERSLICER_GCODE_IMPORT
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// process gcode
|
// process gcode
|
||||||
@ -1371,7 +1367,6 @@ std::vector<std::pair<ExtrusionRole, float>> GCodeProcessor::get_roles_time(Prin
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_FIX_SUPERSLICER_GCODE_IMPORT
|
|
||||||
ConfigSubstitutions load_from_superslicer_gcode_file(const std::string& filename, DynamicPrintConfig& config, ForwardCompatibilitySubstitutionRule compatibility_rule)
|
ConfigSubstitutions load_from_superslicer_gcode_file(const std::string& filename, DynamicPrintConfig& config, ForwardCompatibilitySubstitutionRule compatibility_rule)
|
||||||
{
|
{
|
||||||
// for reference, see: ConfigBase::load_from_gcode_file()
|
// for reference, see: ConfigBase::load_from_gcode_file()
|
||||||
@ -1404,7 +1399,6 @@ void GCodeProcessor::apply_config_superslicer(const std::string& filename)
|
|||||||
load_from_superslicer_gcode_file(filename, config, ForwardCompatibilitySubstitutionRule::EnableSilent);
|
load_from_superslicer_gcode_file(filename, config, ForwardCompatibilitySubstitutionRule::EnableSilent);
|
||||||
apply_config(config);
|
apply_config(config);
|
||||||
}
|
}
|
||||||
#endif // ENABLE_FIX_SUPERSLICER_GCODE_IMPORT
|
|
||||||
|
|
||||||
std::vector<float> GCodeProcessor::get_layers_time(PrintEstimatedStatistics::ETimeMode mode) const
|
std::vector<float> GCodeProcessor::get_layers_time(PrintEstimatedStatistics::ETimeMode mode) const
|
||||||
{
|
{
|
||||||
@ -1890,9 +1884,7 @@ bool GCodeProcessor::process_producers_tags(const std::string_view comment)
|
|||||||
{
|
{
|
||||||
case EProducer::Slic3rPE:
|
case EProducer::Slic3rPE:
|
||||||
case EProducer::Slic3r:
|
case EProducer::Slic3r:
|
||||||
#if ENABLE_FIX_SUPERSLICER_GCODE_IMPORT
|
|
||||||
case EProducer::SuperSlicer:
|
case EProducer::SuperSlicer:
|
||||||
#endif // ENABLE_FIX_SUPERSLICER_GCODE_IMPORT
|
|
||||||
case EProducer::PrusaSlicer: { return process_prusaslicer_tags(comment); }
|
case EProducer::PrusaSlicer: { return process_prusaslicer_tags(comment); }
|
||||||
case EProducer::Cura: { return process_cura_tags(comment); }
|
case EProducer::Cura: { return process_cura_tags(comment); }
|
||||||
case EProducer::Simplify3D: { return process_simplify3d_tags(comment); }
|
case EProducer::Simplify3D: { return process_simplify3d_tags(comment); }
|
||||||
|
@ -542,9 +542,7 @@ namespace Slic3r {
|
|||||||
PrusaSlicer,
|
PrusaSlicer,
|
||||||
Slic3rPE,
|
Slic3rPE,
|
||||||
Slic3r,
|
Slic3r,
|
||||||
#if ENABLE_FIX_SUPERSLICER_GCODE_IMPORT
|
|
||||||
SuperSlicer,
|
SuperSlicer,
|
||||||
#endif // ENABLE_FIX_SUPERSLICER_GCODE_IMPORT
|
|
||||||
Cura,
|
Cura,
|
||||||
Simplify3D,
|
Simplify3D,
|
||||||
CraftWare,
|
CraftWare,
|
||||||
@ -601,9 +599,7 @@ namespace Slic3r {
|
|||||||
private:
|
private:
|
||||||
void apply_config(const DynamicPrintConfig& config);
|
void apply_config(const DynamicPrintConfig& config);
|
||||||
void apply_config_simplify3d(const std::string& filename);
|
void apply_config_simplify3d(const std::string& filename);
|
||||||
#if ENABLE_FIX_SUPERSLICER_GCODE_IMPORT
|
|
||||||
void apply_config_superslicer(const std::string& filename);
|
void apply_config_superslicer(const std::string& filename);
|
||||||
#endif // ENABLE_FIX_SUPERSLICER_GCODE_IMPORT
|
|
||||||
void process_gcode_line(const GCodeReader::GCodeLine& line, bool producers_enabled);
|
void process_gcode_line(const GCodeReader::GCodeLine& line, bool producers_enabled);
|
||||||
|
|
||||||
// Process tags embedded into comments
|
// Process tags embedded into comments
|
||||||
|
@ -36,15 +36,6 @@
|
|||||||
#define ENABLE_FIXED_SCREEN_SIZE_POINT_MARKERS 1
|
#define ENABLE_FIXED_SCREEN_SIZE_POINT_MARKERS 1
|
||||||
|
|
||||||
|
|
||||||
//====================
|
|
||||||
// 2.4.0.alpha3 techs
|
|
||||||
//====================
|
|
||||||
#define ENABLE_2_4_0_ALPHA3 1
|
|
||||||
|
|
||||||
// Enable fixing loading of gcode files generated with SuperSlicer in GCodeViewer
|
|
||||||
#define ENABLE_FIX_SUPERSLICER_GCODE_IMPORT (1 && ENABLE_2_4_0_ALPHA3)
|
|
||||||
|
|
||||||
|
|
||||||
//====================
|
//====================
|
||||||
// 2.4.0.beta1 techs
|
// 2.4.0.beta1 techs
|
||||||
//====================
|
//====================
|
||||||
|
Loading…
x
Reference in New Issue
Block a user