Code cleanup
This commit is contained in:
parent
73603e4937
commit
c81d87b470
6 changed files with 34 additions and 197 deletions
|
@ -1183,16 +1183,11 @@ void GCode::_do_export(Print& print, FILE* file, ThumbnailsGeneratorCallback thu
|
||||||
|
|
||||||
// resets analyzer's tracking data
|
// resets analyzer's tracking data
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
// m_last_width = 0.0f;
|
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
m_last_height = 0.0f;
|
m_last_height = 0.0f;
|
||||||
m_last_layer_z = 0.0f;
|
m_last_layer_z = 0.0f;
|
||||||
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
m_last_mm3_per_mm = 0.0;
|
m_last_mm3_per_mm = 0.0;
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
m_last_width = 0.0f;
|
m_last_width = 0.0f;
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
#else
|
#else
|
||||||
m_last_mm3_per_mm = GCodeAnalyzer::Default_mm3_per_mm;
|
m_last_mm3_per_mm = GCodeAnalyzer::Default_mm3_per_mm;
|
||||||
|
@ -3256,18 +3251,12 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
|
||||||
}
|
}
|
||||||
|
|
||||||
// adds processor tags and updates processor tracking data
|
// adds processor tags and updates processor tracking data
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
if (m_enable_analyzer) {
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
// PrusaMultiMaterial::Writer may generate GCodeProcessor::Height_Tag lines without updating m_last_height
|
||||||
// PrusaMultiMaterial::Writer may generate GCodeProcessor::Height_Tag lines without updating m_last_height
|
// so, if the last role was erWipeTower we force export of GCodeProcessor::Height_Tag lines
|
||||||
// so, if the last role was erWipeTower we force export of GCodeProcessor::Height_Tag lines
|
bool last_was_wipe_tower = (m_last_processor_extrusion_role == erWipeTower);
|
||||||
// // PrusaMultiMaterial::Writer may generate GCodeProcessor::Height_Tag and GCodeProcessor::Width_Tag lines without updating m_last_height and m_last_width
|
|
||||||
// // so, if the last role was erWipeTower we force export of GCodeProcessor::Height_Tag and GCodeProcessor::Width_Tag lines
|
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
bool last_was_wipe_tower = (m_last_processor_extrusion_role == erWipeTower);
|
|
||||||
#else
|
#else
|
||||||
|
if (m_enable_analyzer) {
|
||||||
// PrusaMultiMaterial::Writer may generate GCodeAnalyzer::Height_Tag and GCodeAnalyzer::Width_Tag lines without updating m_last_height and m_last_width
|
// PrusaMultiMaterial::Writer may generate GCodeAnalyzer::Height_Tag and GCodeAnalyzer::Width_Tag lines without updating m_last_height and m_last_width
|
||||||
// so, if the last role was erWipeTower we force export of GCodeAnalyzer::Height_Tag and GCodeAnalyzer::Width_Tag lines
|
// so, if the last role was erWipeTower we force export of GCodeAnalyzer::Height_Tag and GCodeAnalyzer::Width_Tag lines
|
||||||
bool last_was_wipe_tower = (m_last_analyzer_extrusion_role == erWipeTower);
|
bool last_was_wipe_tower = (m_last_analyzer_extrusion_role == erWipeTower);
|
||||||
|
@ -3288,14 +3277,18 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
|
||||||
gcode += buf;
|
gcode += buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
if (last_was_wipe_tower || m_last_width != path.width) {
|
if (last_was_wipe_tower || m_last_width != path.width) {
|
||||||
m_last_width = path.width;
|
m_last_width = path.width;
|
||||||
sprintf(buf, ";%s%g\n", GCodeProcessor::Width_Tag.c_str(), m_last_width);
|
sprintf(buf, ";%s%g\n", GCodeProcessor::Width_Tag.c_str(), m_last_width);
|
||||||
gcode += buf;
|
gcode += buf;
|
||||||
}
|
}
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
|
|
||||||
|
if (last_was_wipe_tower || std::abs(m_last_height - path.height) > EPSILON) {
|
||||||
|
m_last_height = path.height;
|
||||||
|
sprintf(buf, ";%s%g\n", GCodeProcessor::Height_Tag.c_str(), m_last_height);
|
||||||
|
gcode += buf;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
if (path.role() != m_last_analyzer_extrusion_role) {
|
if (path.role() != m_last_analyzer_extrusion_role) {
|
||||||
m_last_analyzer_extrusion_role = path.role();
|
m_last_analyzer_extrusion_role = path.role();
|
||||||
|
@ -3309,35 +3302,12 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
|
||||||
gcode += buf;
|
gcode += buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
if (last_was_wipe_tower || m_last_width != path.width) {
|
if (last_was_wipe_tower || m_last_width != path.width) {
|
||||||
m_last_width = path.width;
|
m_last_width = path.width;
|
||||||
sprintf(buf, ";%s%f\n", GCodeAnalyzer::Width_Tag.c_str(), m_last_width);
|
sprintf(buf, ";%s%f\n", GCodeAnalyzer::Width_Tag.c_str(), m_last_width);
|
||||||
gcode += buf;
|
gcode += buf;
|
||||||
}
|
}
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
// if (last_was_wipe_tower || m_last_width != path.width) {
|
|
||||||
// m_last_width = path.width;
|
|
||||||
//#if ENABLE_GCODE_VIEWER
|
|
||||||
// sprintf(buf, ";%s%g\n", GCodeProcessor::Width_Tag.c_str(), m_last_width);
|
|
||||||
//#else
|
|
||||||
// sprintf(buf, ";%s%f\n", GCodeAnalyzer::Width_Tag.c_str(), m_last_width);
|
|
||||||
//#endif // ENABLE_GCODE_VIEWER
|
|
||||||
// gcode += buf;
|
|
||||||
// }
|
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
|
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
if (last_was_wipe_tower || std::abs(m_last_height - path.height) > EPSILON) {
|
|
||||||
m_last_height = path.height;
|
|
||||||
sprintf(buf, ";%s%g\n", GCodeProcessor::Height_Tag.c_str(), m_last_height);
|
|
||||||
gcode += buf;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
if (last_was_wipe_tower || m_last_height != path.height) {
|
if (last_was_wipe_tower || m_last_height != path.height) {
|
||||||
m_last_height = path.height;
|
m_last_height = path.height;
|
||||||
sprintf(buf, ";%s%f\n", GCodeAnalyzer::Height_Tag.c_str(), m_last_height);
|
sprintf(buf, ";%s%f\n", GCodeAnalyzer::Height_Tag.c_str(), m_last_height);
|
||||||
|
|
|
@ -174,9 +174,7 @@ public:
|
||||||
m_last_extrusion_role(erNone),
|
m_last_extrusion_role(erNone),
|
||||||
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
m_last_mm3_per_mm(0.0),
|
m_last_mm3_per_mm(0.0),
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
m_last_width(0.0f),
|
m_last_width(0.0f),
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
#if !ENABLE_GCODE_VIEWER
|
#if !ENABLE_GCODE_VIEWER
|
||||||
m_last_mm3_per_mm(GCodeAnalyzer::Default_mm3_per_mm),
|
m_last_mm3_per_mm(GCodeAnalyzer::Default_mm3_per_mm),
|
||||||
|
@ -384,16 +382,11 @@ private:
|
||||||
ExtrusionRole m_last_extrusion_role;
|
ExtrusionRole m_last_extrusion_role;
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
// Support for G-Code Processor
|
// Support for G-Code Processor
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
// float m_last_width{ 0.0f };
|
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
float m_last_height{ 0.0f };
|
float m_last_height{ 0.0f };
|
||||||
float m_last_layer_z{ 0.0f };
|
float m_last_layer_z{ 0.0f };
|
||||||
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
double m_last_mm3_per_mm;
|
double m_last_mm3_per_mm;
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
float m_last_width{ 0.0f };
|
float m_last_width{ 0.0f };
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
#else
|
#else
|
||||||
// Support for G-Code Analyzer
|
// Support for G-Code Analyzer
|
||||||
|
|
|
@ -22,24 +22,19 @@ static const float DEFAULT_ACCELERATION = 1500.0f; // Prusa Firmware 1_75mm_MK2
|
||||||
|
|
||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
|
|
||||||
const std::string GCodeProcessor::Extrusion_Role_Tag = "ExtrType:";
|
const std::string GCodeProcessor::Extrusion_Role_Tag = "TYPE:";
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
const std::string GCodeProcessor::Height_Tag = "HEIGHT:";
|
||||||
//const std::string GCodeProcessor::Width_Tag = "Width:";
|
const std::string GCodeProcessor::Color_Change_Tag = "COLOR CHANGE";
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
const std::string GCodeProcessor::Pause_Print_Tag = "PAUSE PRINT";
|
||||||
const std::string GCodeProcessor::Height_Tag = "Height:";
|
const std::string GCodeProcessor::Custom_Code_Tag = "CUSTOM GCODE";
|
||||||
const std::string GCodeProcessor::Color_Change_Tag = "Color change";
|
|
||||||
const std::string GCodeProcessor::Pause_Print_Tag = "Pause print";
|
|
||||||
const std::string GCodeProcessor::Custom_Code_Tag = "Custom gcode";
|
|
||||||
|
|
||||||
const std::string GCodeProcessor::First_Line_M73_Placeholder_Tag = "; _GP_FIRST_LINE_M73_PLACEHOLDER";
|
const std::string GCodeProcessor::First_Line_M73_Placeholder_Tag = "; _GP_FIRST_LINE_M73_PLACEHOLDER";
|
||||||
const std::string GCodeProcessor::Last_Line_M73_Placeholder_Tag = "; _GP_LAST_LINE_M73_PLACEHOLDER";
|
const std::string GCodeProcessor::Last_Line_M73_Placeholder_Tag = "; _GP_LAST_LINE_M73_PLACEHOLDER";
|
||||||
const std::string GCodeProcessor::Estimated_Printing_Time_Placeholder_Tag = "; _GP_ESTIMATED_PRINTING_TIME_PLACEHOLDER";
|
const std::string GCodeProcessor::Estimated_Printing_Time_Placeholder_Tag = "; _GP_ESTIMATED_PRINTING_TIME_PLACEHOLDER";
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
const std::string GCodeProcessor::Width_Tag = "WIDTH:";
|
||||||
const std::string GCodeProcessor::Width_Tag = "Width:";
|
const std::string GCodeProcessor::Mm3_Per_Mm_Tag = "MM3_PER_MM:";
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
const std::string GCodeProcessor::Mm3_Per_Mm_Tag = "Mm3_Per_Mm:";
|
|
||||||
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
|
|
||||||
static bool is_valid_extrusion_role(int value)
|
static bool is_valid_extrusion_role(int value)
|
||||||
|
@ -898,7 +893,6 @@ void GCodeProcessor::process_tags(const std::string& comment)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
// width tag
|
// width tag
|
||||||
pos = comment.find(Width_Tag);
|
pos = comment.find(Width_Tag);
|
||||||
|
@ -911,26 +905,7 @@ void GCodeProcessor::process_tags(const std::string& comment)
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
|
||||||
|
|
||||||
// // width tag
|
|
||||||
// pos = comment.find(Width_Tag);
|
|
||||||
// if (pos != comment.npos) {
|
|
||||||
// try {
|
|
||||||
// m_width = std::stof(comment.substr(pos + Width_Tag.length()));
|
|
||||||
//#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
|
||||||
// m_width_compare.last_tag_value = m_width;
|
|
||||||
//#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
|
||||||
// }
|
|
||||||
// catch (...) {
|
|
||||||
// BOOST_LOG_TRIVIAL(error) << "GCodeProcessor encountered an invalid value for Width (" << comment << ").";
|
|
||||||
// }
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
|
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
|
||||||
// height tag
|
// height tag
|
||||||
pos = comment.find(Height_Tag);
|
pos = comment.find(Height_Tag);
|
||||||
if (pos != comment.npos) {
|
if (pos != comment.npos) {
|
||||||
|
@ -944,22 +919,6 @@ void GCodeProcessor::process_tags(const std::string& comment)
|
||||||
}
|
}
|
||||||
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
|
|
||||||
// // height tag
|
|
||||||
// pos = comment.find(Height_Tag);
|
|
||||||
// if (pos != comment.npos) {
|
|
||||||
// try {
|
|
||||||
// m_height = std::stof(comment.substr(pos + Height_Tag.length()));
|
|
||||||
//#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
|
||||||
// m_height_compare.last_tag_value = m_height;
|
|
||||||
//#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
|
||||||
// }
|
|
||||||
// catch (...) {
|
|
||||||
// BOOST_LOG_TRIVIAL(error) << "GCodeProcessor encountered an invalid value for Height (" << comment << ").";
|
|
||||||
// }
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
|
|
||||||
// color change tag
|
// color change tag
|
||||||
pos = comment.find(Color_Change_Tag);
|
pos = comment.find(Color_Change_Tag);
|
||||||
if (pos != comment.npos) {
|
if (pos != comment.npos) {
|
||||||
|
@ -1178,12 +1137,10 @@ bool GCodeProcessor::process_simplify3d_tags(const std::string& comment)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
// geometry
|
// geometry
|
||||||
|
|
||||||
// ; tool
|
// ; tool
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
std::string tag = " tool";
|
std::string tag = " tool";
|
||||||
pos = comment.find(tag);
|
pos = comment.find(tag);
|
||||||
if (pos == 0) {
|
if (pos == 0) {
|
||||||
|
@ -1196,14 +1153,7 @@ bool GCodeProcessor::process_simplify3d_tags(const std::string& comment)
|
||||||
size_t w_end = data.find_first_of(' ', w_start);
|
size_t w_end = data.find_first_of(' ', w_start);
|
||||||
if (h_start != data.npos) {
|
if (h_start != data.npos) {
|
||||||
try {
|
try {
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
m_height_compare.last_tag_value = std::stof(data.substr(h_start + 1, (h_end != data.npos) ? h_end - h_start - 1 : h_end));
|
m_height_compare.last_tag_value = std::stof(data.substr(h_start + 1, (h_end != data.npos) ? h_end - h_start - 1 : h_end));
|
||||||
|
|
||||||
// m_height = std::stof(data.substr(h_start + 1, (h_end != data.npos) ? h_end - h_start - 1 : h_end));
|
|
||||||
//#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
|
||||||
// m_height_compare.last_tag_value = m_height;
|
|
||||||
//#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
}
|
}
|
||||||
catch (...) {
|
catch (...) {
|
||||||
BOOST_LOG_TRIVIAL(error) << "GCodeProcessor encountered an invalid value for Height (" << comment << ").";
|
BOOST_LOG_TRIVIAL(error) << "GCodeProcessor encountered an invalid value for Height (" << comment << ").";
|
||||||
|
@ -1211,14 +1161,7 @@ bool GCodeProcessor::process_simplify3d_tags(const std::string& comment)
|
||||||
}
|
}
|
||||||
if (w_start != data.npos) {
|
if (w_start != data.npos) {
|
||||||
try {
|
try {
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
m_width_compare.last_tag_value = std::stof(data.substr(w_start + 1, (w_end != data.npos) ? w_end - w_start - 1 : w_end));
|
m_width_compare.last_tag_value = std::stof(data.substr(w_start + 1, (w_end != data.npos) ? w_end - w_start - 1 : w_end));
|
||||||
|
|
||||||
// m_width = std::stof(data.substr(w_start + 1, (w_end != data.npos) ? w_end - w_start - 1 : w_end));
|
|
||||||
//#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
|
||||||
// m_width_compare.last_tag_value = m_width;
|
|
||||||
//#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
}
|
}
|
||||||
catch (...) {
|
catch (...) {
|
||||||
BOOST_LOG_TRIVIAL(error) << "GCodeProcessor encountered an invalid value for Width (" << comment << ").";
|
BOOST_LOG_TRIVIAL(error) << "GCodeProcessor encountered an invalid value for Width (" << comment << ").";
|
||||||
|
@ -1227,11 +1170,8 @@ bool GCodeProcessor::process_simplify3d_tags(const std::string& comment)
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
|
|
||||||
// std::cout << comment << "\n";
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1303,24 +1243,15 @@ bool GCodeProcessor::process_ideamaker_tags(const std::string& comment)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
// geometry
|
// geometry
|
||||||
|
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
// width
|
// width
|
||||||
tag = "WIDTH:";
|
tag = "WIDTH:";
|
||||||
pos = comment.find(tag);
|
pos = comment.find(tag);
|
||||||
if (pos != comment.npos) {
|
if (pos != comment.npos) {
|
||||||
try {
|
try {
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
m_width_compare.last_tag_value = std::stof(comment.substr(pos + tag.length()));
|
m_width_compare.last_tag_value = std::stof(comment.substr(pos + tag.length()));
|
||||||
|
|
||||||
// m_width = std::stof(comment.substr(pos + tag.length()));
|
|
||||||
//#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
|
||||||
// m_width_compare.last_tag_value = m_width;
|
|
||||||
//#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
}
|
}
|
||||||
catch (...) {
|
catch (...) {
|
||||||
BOOST_LOG_TRIVIAL(error) << "GCodeProcessor encountered an invalid value for Width (" << comment << ").";
|
BOOST_LOG_TRIVIAL(error) << "GCodeProcessor encountered an invalid value for Width (" << comment << ").";
|
||||||
|
@ -1333,23 +1264,14 @@ bool GCodeProcessor::process_ideamaker_tags(const std::string& comment)
|
||||||
pos = comment.find(tag);
|
pos = comment.find(tag);
|
||||||
if (pos != comment.npos) {
|
if (pos != comment.npos) {
|
||||||
try {
|
try {
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
m_height_compare.last_tag_value = std::stof(comment.substr(pos + tag.length()));
|
m_height_compare.last_tag_value = std::stof(comment.substr(pos + tag.length()));
|
||||||
|
|
||||||
// m_height = std::stof(comment.substr(pos + tag.length()));
|
|
||||||
//#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
|
||||||
// m_height_compare.last_tag_value = m_height;
|
|
||||||
//#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
}
|
}
|
||||||
catch (...) {
|
catch (...) {
|
||||||
BOOST_LOG_TRIVIAL(error) << "GCodeProcessor encountered an invalid value for Height (" << comment << ").";
|
BOOST_LOG_TRIVIAL(error) << "GCodeProcessor encountered an invalid value for Height (" << comment << ").";
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,9 +67,6 @@ namespace Slic3r {
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static const std::string Extrusion_Role_Tag;
|
static const std::string Extrusion_Role_Tag;
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
// static const std::string Width_Tag;
|
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
static const std::string Height_Tag;
|
static const std::string Height_Tag;
|
||||||
static const std::string Color_Change_Tag;
|
static const std::string Color_Change_Tag;
|
||||||
static const std::string Pause_Print_Tag;
|
static const std::string Pause_Print_Tag;
|
||||||
|
@ -79,9 +76,7 @@ namespace Slic3r {
|
||||||
static const std::string Estimated_Printing_Time_Placeholder_Tag;
|
static const std::string Estimated_Printing_Time_Placeholder_Tag;
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
static const std::string Width_Tag;
|
static const std::string Width_Tag;
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
static const std::string Mm3_Per_Mm_Tag;
|
static const std::string Mm3_Per_Mm_Tag;
|
||||||
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
|
|
||||||
|
|
|
@ -51,13 +51,9 @@ public:
|
||||||
m_extrusion_flow(0.f),
|
m_extrusion_flow(0.f),
|
||||||
m_preview_suppressed(false),
|
m_preview_suppressed(false),
|
||||||
m_elapsed_time(0.f),
|
m_elapsed_time(0.f),
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
#if !ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#if !ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
m_default_analyzer_line_width(line_width),
|
m_default_analyzer_line_width(line_width),
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#endif // !ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
m_gcode_flavor(flavor),
|
m_gcode_flavor(flavor),
|
||||||
m_filpar(filament_parameters)
|
m_filpar(filament_parameters)
|
||||||
{
|
{
|
||||||
|
@ -65,26 +61,20 @@ public:
|
||||||
char buf[64];
|
char buf[64];
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
sprintf(buf, ";%s%f\n", GCodeProcessor::Height_Tag.c_str(), m_layer_height); // don't rely on GCodeAnalyzer knowing the layer height - it knows nothing at priming
|
sprintf(buf, ";%s%f\n", GCodeProcessor::Height_Tag.c_str(), m_layer_height); // don't rely on GCodeAnalyzer knowing the layer height - it knows nothing at priming
|
||||||
|
m_gcode += buf;
|
||||||
|
sprintf(buf, ";%s%s\n", GCodeProcessor::Extrusion_Role_Tag.c_str(), ExtrusionEntity::role_to_string(erWipeTower).c_str());
|
||||||
|
m_gcode += buf;
|
||||||
#else
|
#else
|
||||||
sprintf(buf, ";%s%f\n", GCodeAnalyzer::Height_Tag.c_str(), m_layer_height); // don't rely on GCodeAnalyzer knowing the layer height - it knows nothing at priming
|
sprintf(buf, ";%s%f\n", GCodeAnalyzer::Height_Tag.c_str(), m_layer_height); // don't rely on GCodeAnalyzer knowing the layer height - it knows nothing at priming
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
m_gcode += buf;
|
m_gcode += buf;
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
sprintf(buf, ";%s%s\n", GCodeProcessor::Extrusion_Role_Tag.c_str(), ExtrusionEntity::role_to_string(erWipeTower).c_str());
|
|
||||||
#else
|
|
||||||
sprintf(buf, ";%s%d\n", GCodeAnalyzer::Extrusion_Role_Tag.c_str(), erWipeTower);
|
sprintf(buf, ";%s%d\n", GCodeAnalyzer::Extrusion_Role_Tag.c_str(), erWipeTower);
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
m_gcode += buf;
|
m_gcode += buf;
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
#endif // ENABLE_GCODE_VIEWER
|
||||||
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
change_analyzer_line_width(line_width);
|
change_analyzer_line_width(line_width);
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
WipeTowerWriter& change_analyzer_line_width(float line_width) {
|
WipeTowerWriter& change_analyzer_line_width(float line_width) {
|
||||||
// adds tag for analyzer:
|
// adds tag for analyzer:
|
||||||
|
@ -93,32 +83,7 @@ public:
|
||||||
m_gcode += buf;
|
m_gcode += buf;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
#if !ENABLE_GCODE_VIEWER
|
|
||||||
WipeTowerWriter& change_analyzer_line_width(float line_width) {
|
|
||||||
// adds tag for analyzer:
|
|
||||||
char buf[64];
|
|
||||||
sprintf(buf, ";%s%f\n", GCodeAnalyzer::Width_Tag.c_str(), line_width);
|
|
||||||
m_gcode += buf;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER
|
|
||||||
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
|
||||||
|
|
||||||
// WipeTowerWriter& change_analyzer_line_width(float line_width) {
|
|
||||||
// // adds tag for analyzer:
|
|
||||||
// char buf[64];
|
|
||||||
//#if ENABLE_GCODE_VIEWER
|
|
||||||
// sprintf(buf, ";%s%f\n", GCodeProcessor::Width_Tag.c_str(), line_width);
|
|
||||||
//#else
|
|
||||||
// sprintf(buf, ";%s%f\n", GCodeAnalyzer::Width_Tag.c_str(), line_width);
|
|
||||||
//#endif // ENABLE_GCODE_VIEWER
|
|
||||||
// m_gcode += buf;
|
|
||||||
// return *this;
|
|
||||||
// }
|
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
|
||||||
WipeTowerWriter& change_analyzer_mm3_per_mm(float len, float e) {
|
WipeTowerWriter& change_analyzer_mm3_per_mm(float len, float e) {
|
||||||
static const float area = float(M_PI) * 1.75f * 1.75f / 4.f;
|
static const float area = float(M_PI) * 1.75f * 1.75f / 4.f;
|
||||||
float mm3_per_mm = (len == 0.f ? 0.f : area * e / len);
|
float mm3_per_mm = (len == 0.f ? 0.f : area * e / len);
|
||||||
|
@ -130,6 +95,14 @@ public:
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#if !ENABLE_GCODE_VIEWER
|
#if !ENABLE_GCODE_VIEWER
|
||||||
|
WipeTowerWriter& change_analyzer_line_width(float line_width) {
|
||||||
|
// adds tag for analyzer:
|
||||||
|
char buf[64];
|
||||||
|
sprintf(buf, ";%s%f\n", GCodeAnalyzer::Width_Tag.c_str(), line_width);
|
||||||
|
m_gcode += buf;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
WipeTowerWriter& change_analyzer_mm3_per_mm(float len, float e) {
|
WipeTowerWriter& change_analyzer_mm3_per_mm(float len, float e) {
|
||||||
static const float area = float(M_PI) * 1.75f * 1.75f / 4.f;
|
static const float area = float(M_PI) * 1.75f * 1.75f / 4.f;
|
||||||
float mm3_per_mm = (len == 0.f ? 0.f : area * e / len);
|
float mm3_per_mm = (len == 0.f ? 0.f : area * e / len);
|
||||||
|
@ -175,17 +148,13 @@ public:
|
||||||
// Suppress / resume G-code preview in Slic3r. Slic3r will have difficulty to differentiate the various
|
// Suppress / resume G-code preview in Slic3r. Slic3r will have difficulty to differentiate the various
|
||||||
// filament loading and cooling moves from normal extrusion moves. Therefore the writer
|
// filament loading and cooling moves from normal extrusion moves. Therefore the writer
|
||||||
// is asked to suppres output of some lines, which look like extrusions.
|
// is asked to suppres output of some lines, which look like extrusions.
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
WipeTowerWriter& suppress_preview() { change_analyzer_line_width(0.f); m_preview_suppressed = true; return *this; }
|
WipeTowerWriter& suppress_preview() { change_analyzer_line_width(0.f); m_preview_suppressed = true; return *this; }
|
||||||
WipeTowerWriter& resume_preview() { change_analyzer_line_width(m_default_analyzer_line_width); m_preview_suppressed = false; return *this; }
|
WipeTowerWriter& resume_preview() { change_analyzer_line_width(m_default_analyzer_line_width); m_preview_suppressed = false; return *this; }
|
||||||
#else
|
#else
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
WipeTowerWriter& suppress_preview() { m_preview_suppressed = true; return *this; }
|
WipeTowerWriter& suppress_preview() { m_preview_suppressed = true; return *this; }
|
||||||
WipeTowerWriter& resume_preview() { m_preview_suppressed = false; return *this; }
|
WipeTowerWriter& resume_preview() { m_preview_suppressed = false; return *this; }
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
|
|
||||||
WipeTowerWriter& feedrate(float f)
|
WipeTowerWriter& feedrate(float f)
|
||||||
{
|
{
|
||||||
|
@ -490,13 +459,9 @@ private:
|
||||||
float m_wipe_tower_depth = 0.f;
|
float m_wipe_tower_depth = 0.f;
|
||||||
unsigned m_last_fan_speed = 0;
|
unsigned m_last_fan_speed = 0;
|
||||||
int current_temp = -1;
|
int current_temp = -1;
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
#if !ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#if !ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
const float m_default_analyzer_line_width;
|
const float m_default_analyzer_line_width;
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
#endif // !ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#endif // !ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
float m_used_filament_length = 0.f;
|
float m_used_filament_length = 0.f;
|
||||||
GCodeFlavor m_gcode_flavor;
|
GCodeFlavor m_gcode_flavor;
|
||||||
const std::vector<WipeTower::FilamentParameters>& m_filpar;
|
const std::vector<WipeTower::FilamentParameters>& m_filpar;
|
||||||
|
@ -937,16 +902,12 @@ void WipeTower::toolchange_Unload(
|
||||||
const float line_width = m_perimeter_width * m_filpar[m_current_tool].ramming_line_width_multiplicator; // desired ramming line thickness
|
const float line_width = m_perimeter_width * m_filpar[m_current_tool].ramming_line_width_multiplicator; // desired ramming line thickness
|
||||||
const float y_step = line_width * m_filpar[m_current_tool].ramming_step_multiplicator * m_extra_spacing; // spacing between lines in mm
|
const float y_step = line_width * m_filpar[m_current_tool].ramming_step_multiplicator * m_extra_spacing; // spacing between lines in mm
|
||||||
|
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
writer.append("; CP TOOLCHANGE UNLOAD\n")
|
writer.append("; CP TOOLCHANGE UNLOAD\n")
|
||||||
.change_analyzer_line_width(line_width);
|
.change_analyzer_line_width(line_width);
|
||||||
#else
|
#else
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
writer.append("; CP TOOLCHANGE UNLOAD\n");
|
writer.append("; CP TOOLCHANGE UNLOAD\n");
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
|
|
||||||
unsigned i = 0; // iterates through ramming_speed
|
unsigned i = 0; // iterates through ramming_speed
|
||||||
m_left_to_right = true; // current direction of ramming
|
m_left_to_right = true; // current direction of ramming
|
||||||
|
@ -1023,13 +984,9 @@ void WipeTower::toolchange_Unload(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Vec2f end_of_ramming(writer.x(),writer.y());
|
Vec2f end_of_ramming(writer.x(),writer.y());
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
writer.change_analyzer_line_width(m_perimeter_width); // so the next lines are not affected by ramming_line_width_multiplier
|
writer.change_analyzer_line_width(m_perimeter_width); // so the next lines are not affected by ramming_line_width_multiplier
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
|
|
||||||
// Retraction:
|
// Retraction:
|
||||||
float old_x = writer.x();
|
float old_x = writer.x();
|
||||||
|
|
|
@ -385,10 +385,10 @@ void GCodeViewer::refresh(const GCodeProcessor::Result& gcode_result, const std:
|
||||||
{
|
{
|
||||||
case EMoveType::Extrude:
|
case EMoveType::Extrude:
|
||||||
{
|
{
|
||||||
m_extrusions.ranges.height.update_from(curr.height);
|
m_extrusions.ranges.height.update_from(round_to_nearest(curr.height, 2));
|
||||||
m_extrusions.ranges.width.update_from(curr.width);
|
m_extrusions.ranges.width.update_from(round_to_nearest(curr.width, 2));
|
||||||
m_extrusions.ranges.fan_speed.update_from(curr.fan_speed);
|
m_extrusions.ranges.fan_speed.update_from(curr.fan_speed);
|
||||||
m_extrusions.ranges.volumetric_rate.update_from(curr.volumetric_rate());
|
m_extrusions.ranges.volumetric_rate.update_from(round_to_nearest(curr.volumetric_rate(), 2));
|
||||||
[[fallthrough]];
|
[[fallthrough]];
|
||||||
}
|
}
|
||||||
case EMoveType::Travel:
|
case EMoveType::Travel:
|
||||||
|
|
Loading…
Reference in a new issue