mirror of
https://github.com/Dark98/SliceBeam.git
synced 2026-07-07 08:49:06 +00:00
Srat Refactoring To Santoku
This commit is contained in:
@@ -535,7 +535,7 @@ void GCodeProcessorResult::reset() {
|
||||
}
|
||||
|
||||
const std::vector<std::pair<GCodeProcessor::EProducer, std::string>> GCodeProcessor::Producers = {
|
||||
{ EProducer::SliceBeam, "generated by Slice Beam" },
|
||||
{ EProducer::Santoku, "generated by Santoku" },
|
||||
{ EProducer::PrusaSlicer, "generated by PrusaSlicer" },
|
||||
{ EProducer::Slic3rPE, "generated by Slic3r Prusa Edition" },
|
||||
{ EProducer::Slic3r, "generated by Slic3r" },
|
||||
@@ -619,7 +619,7 @@ void GCodeProcessor::apply_config(const PrintConfig& config)
|
||||
m_binarizer.set_enabled(config.binary_gcode);
|
||||
m_result.is_binary_file = config.binary_gcode;
|
||||
|
||||
m_producer = EProducer::SliceBeam;
|
||||
m_producer = EProducer::Santoku;
|
||||
m_flavor = config.gcode_flavor;
|
||||
|
||||
m_result.backtrace_enabled = is_XL_printer(config);
|
||||
@@ -1124,7 +1124,7 @@ void GCodeProcessor::process_ascii_file(const std::string& filename, GCodeReader
|
||||
|
||||
// if the gcode was produced by PrusaSlicer,
|
||||
// extract the config from it
|
||||
if (m_producer == EProducer::SliceBeam || m_producer == EProducer::PrusaSlicer || m_producer == EProducer::Slic3rPE || m_producer == EProducer::Slic3r) {
|
||||
if (m_producer == EProducer::Santoku || m_producer == EProducer::PrusaSlicer || m_producer == EProducer::Slic3rPE || m_producer == EProducer::Slic3r) {
|
||||
DynamicPrintConfig config;
|
||||
config.apply(FullPrintConfig::defaults());
|
||||
// Silently substitute unknown values by new ones for loading configurations from PrusaSlicer's own G-code.
|
||||
@@ -1231,7 +1231,7 @@ void GCodeProcessor::process_binary_file(const std::string& filename, GCodeReade
|
||||
auto producer_it = std::find_if(file_metadata_block.raw_data.begin(), file_metadata_block.raw_data.end(),
|
||||
[](const std::pair<std::string, std::string>& item) { return item.first == "Producer"; });
|
||||
if (producer_it != file_metadata_block.raw_data.end() && boost::starts_with(producer_it->second, std::string(SLIC3R_APP_NAME)))
|
||||
m_producer = EProducer::SliceBeam;
|
||||
m_producer = EProducer::Santoku;
|
||||
else
|
||||
m_producer = EProducer::Unknown;
|
||||
res = read_next_block_header(*file.f, file_header, block_header, cs_buffer.data(), cs_buffer.size());
|
||||
@@ -1892,7 +1892,7 @@ void GCodeProcessor::process_tags(const std::string_view comment, bool producers
|
||||
return;
|
||||
}
|
||||
|
||||
if (!producers_enabled || m_producer == EProducer::PrusaSlicer || m_producer == EProducer::SliceBeam) {
|
||||
if (!producers_enabled || m_producer == EProducer::PrusaSlicer || m_producer == EProducer::Santoku) {
|
||||
// height tag
|
||||
if (boost::starts_with(comment, reserved_tag(ETags::Height))) {
|
||||
if (!parse_number(comment.substr(reserved_tag(ETags::Height).size()), m_forced_height))
|
||||
@@ -2011,7 +2011,7 @@ bool GCodeProcessor::process_producers_tags(const std::string_view comment)
|
||||
case EProducer::Slic3rPE:
|
||||
case EProducer::Slic3r:
|
||||
case EProducer::SuperSlicer:
|
||||
case EProducer::SliceBeam:
|
||||
case EProducer::Santoku:
|
||||
case EProducer::PrusaSlicer: { return process_prusaslicer_tags(comment); }
|
||||
case EProducer::Cura: { return process_cura_tags(comment); }
|
||||
case EProducer::Simplify3D: { return process_simplify3d_tags(comment); }
|
||||
@@ -3669,8 +3669,8 @@ void GCodeProcessor::process_T(const std::string_view command)
|
||||
else {
|
||||
unsigned char id = static_cast<unsigned char>(eid);
|
||||
if (m_extruder_id != id) {
|
||||
if (((m_producer == EProducer::SliceBeam || m_producer == EProducer::PrusaSlicer || m_producer == EProducer::Slic3rPE || m_producer == EProducer::Slic3r) && id >= m_result.extruders_count) ||
|
||||
((m_producer != EProducer::SliceBeam && m_producer != EProducer::PrusaSlicer && m_producer != EProducer::Slic3rPE && m_producer != EProducer::Slic3r) && id >= m_result.extruder_colors.size()))
|
||||
if (((m_producer == EProducer::Santoku || m_producer == EProducer::PrusaSlicer || m_producer == EProducer::Slic3rPE || m_producer == EProducer::Slic3r) && id >= m_result.extruders_count) ||
|
||||
((m_producer != EProducer::Santoku && m_producer != EProducer::PrusaSlicer && m_producer != EProducer::Slic3rPE && m_producer != EProducer::Slic3r) && id >= m_result.extruder_colors.size()))
|
||||
BOOST_LOG_TRIVIAL(error) << "GCodeProcessor encountered an invalid toolchange, maybe from a custom gcode (" << command << ").";
|
||||
else {
|
||||
unsigned char old_extruder_id = m_extruder_id;
|
||||
|
||||
@@ -544,7 +544,7 @@ namespace Slic3r {
|
||||
enum class EProducer
|
||||
{
|
||||
Unknown,
|
||||
SliceBeam,
|
||||
Santoku,
|
||||
PrusaSlicer,
|
||||
Slic3rPE,
|
||||
Slic3r,
|
||||
|
||||
Reference in New Issue
Block a user