mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 19:33:47 +00:00
FIX: Old version of gcode cannot be opened normally
jira: STUDIO-10825 Change-Id: Ibf512cd4abc5315bb090d39974fb436e328214c7 (cherry picked from commit de449496b5c4c3f37bdcd115c6ea308ecb92d2a2)
This commit is contained in:
@@ -1662,7 +1662,7 @@ void GCodeProcessor::register_commands()
|
|||||||
if (auto lowercase_cmd = to_lowercase(uppercase_cmd); lowercase_cmd != uppercase_cmd)
|
if (auto lowercase_cmd = to_lowercase(uppercase_cmd); lowercase_cmd != uppercase_cmd)
|
||||||
m_command_processor.register_command(lowercase_cmd, handler,early_quit);
|
m_command_processor.register_command(lowercase_cmd, handler,early_quit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GCodeProcessor::check_multi_extruder_gcode_valid(const std::vector<Polygons> &unprintable_areas, const std::vector<double>& printable_heights, const std::vector<int> &filament_map)
|
bool GCodeProcessor::check_multi_extruder_gcode_valid(const std::vector<Polygons> &unprintable_areas, const std::vector<double>& printable_heights, const std::vector<int> &filament_map)
|
||||||
{
|
{
|
||||||
@@ -2343,6 +2343,13 @@ void GCodeProcessor::process_file(const std::string& filename, std::function<voi
|
|||||||
// Showing substitution log or errors may make sense, but we are not really reading many values from the G-code config,
|
// Showing substitution log or errors may make sense, but we are not really reading many values from the G-code config,
|
||||||
// thus a probability of incorrect substitution is low and the G-code viewer is a consumer-only anyways.
|
// thus a probability of incorrect substitution is low and the G-code viewer is a consumer-only anyways.
|
||||||
config.load_from_gcode_file(filename, ForwardCompatibilitySubstitutionRule::EnableSilent);
|
config.load_from_gcode_file(filename, ForwardCompatibilitySubstitutionRule::EnableSilent);
|
||||||
|
|
||||||
|
ConfigOptionStrings *filament_color = config.opt<ConfigOptionStrings>("filament_colour");
|
||||||
|
ConfigOptionInts *filament_map = config.opt<ConfigOptionInts>("filament_map", true);
|
||||||
|
if (filament_color && filament_color->size() != filament_map->size()) {
|
||||||
|
filament_map->values.resize(filament_color->size(), 1);
|
||||||
|
}
|
||||||
|
|
||||||
apply_config(config);
|
apply_config(config);
|
||||||
}
|
}
|
||||||
else if (m_producer == EProducer::Simplify3D)
|
else if (m_producer == EProducer::Simplify3D)
|
||||||
|
|||||||
Reference in New Issue
Block a user