Fix of #2082 -> Added lines M73 P100 and M73 Q100 to gcode to signal that print is finished
This commit is contained in:
parent
7e32f2df71
commit
ea3d30bff1
3 changed files with 21 additions and 0 deletions
|
@ -1034,6 +1034,15 @@ void GCode::_do_export(Print &print, FILE *file)
|
||||||
}
|
}
|
||||||
_write(file, m_writer.update_progress(m_layer_count, m_layer_count, true)); // 100%
|
_write(file, m_writer.update_progress(m_layer_count, m_layer_count, true)); // 100%
|
||||||
_write(file, m_writer.postamble());
|
_write(file, m_writer.postamble());
|
||||||
|
|
||||||
|
// adds tags for time estimators
|
||||||
|
if (print.config().remaining_times.value)
|
||||||
|
{
|
||||||
|
_writeln(file, GCodeTimeEstimator::Normal_Last_M73_Output_Placeholder_Tag);
|
||||||
|
if (m_silent_time_estimator_enabled)
|
||||||
|
_writeln(file, GCodeTimeEstimator::Silent_Last_M73_Output_Placeholder_Tag);
|
||||||
|
}
|
||||||
|
|
||||||
print.throw_if_canceled();
|
print.throw_if_canceled();
|
||||||
|
|
||||||
// calculates estimated printing time
|
// calculates estimated printing time
|
||||||
|
|
|
@ -171,6 +171,8 @@ namespace Slic3r {
|
||||||
|
|
||||||
const std::string GCodeTimeEstimator::Normal_First_M73_Output_Placeholder_Tag = "; NORMAL_FIRST_M73_OUTPUT_PLACEHOLDER";
|
const std::string GCodeTimeEstimator::Normal_First_M73_Output_Placeholder_Tag = "; NORMAL_FIRST_M73_OUTPUT_PLACEHOLDER";
|
||||||
const std::string GCodeTimeEstimator::Silent_First_M73_Output_Placeholder_Tag = "; SILENT_FIRST_M73_OUTPUT_PLACEHOLDER";
|
const std::string GCodeTimeEstimator::Silent_First_M73_Output_Placeholder_Tag = "; SILENT_FIRST_M73_OUTPUT_PLACEHOLDER";
|
||||||
|
const std::string GCodeTimeEstimator::Normal_Last_M73_Output_Placeholder_Tag = "; NORMAL_LAST_M73_OUTPUT_PLACEHOLDER";
|
||||||
|
const std::string GCodeTimeEstimator::Silent_Last_M73_Output_Placeholder_Tag = "; SILENT_LAST_M73_OUTPUT_PLACEHOLDER";
|
||||||
|
|
||||||
GCodeTimeEstimator::GCodeTimeEstimator(EMode mode)
|
GCodeTimeEstimator::GCodeTimeEstimator(EMode mode)
|
||||||
: _mode(mode)
|
: _mode(mode)
|
||||||
|
@ -306,9 +308,17 @@ namespace Slic3r {
|
||||||
sprintf(time_line, time_mask.c_str(), "0", _get_time_minutes(_time).c_str());
|
sprintf(time_line, time_mask.c_str(), "0", _get_time_minutes(_time).c_str());
|
||||||
gcode_line = time_line;
|
gcode_line = time_line;
|
||||||
}
|
}
|
||||||
|
// replaces placeholders for final line M73 with the real lines
|
||||||
|
else if (((_mode == Normal) && (gcode_line == Normal_Last_M73_Output_Placeholder_Tag)) ||
|
||||||
|
((_mode == Silent) && (gcode_line == Silent_Last_M73_Output_Placeholder_Tag)))
|
||||||
|
{
|
||||||
|
sprintf(time_line, time_mask.c_str(), "100", "0");
|
||||||
|
gcode_line = time_line;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
gcode_line += "\n";
|
gcode_line += "\n";
|
||||||
|
|
||||||
|
|
||||||
// add remaining time lines where needed
|
// add remaining time lines where needed
|
||||||
_parser.parse_line(gcode_line,
|
_parser.parse_line(gcode_line,
|
||||||
[this, &it_line_id, &g1_lines_count, &last_recorded_time, &time_line, &gcode_line, time_mask, interval](GCodeReader& reader, const GCodeReader::GCodeLine& line)
|
[this, &it_line_id, &g1_lines_count, &last_recorded_time, &time_line, &gcode_line, time_mask, interval](GCodeReader& reader, const GCodeReader::GCodeLine& line)
|
||||||
|
|
|
@ -19,6 +19,8 @@ namespace Slic3r {
|
||||||
public:
|
public:
|
||||||
static const std::string Normal_First_M73_Output_Placeholder_Tag;
|
static const std::string Normal_First_M73_Output_Placeholder_Tag;
|
||||||
static const std::string Silent_First_M73_Output_Placeholder_Tag;
|
static const std::string Silent_First_M73_Output_Placeholder_Tag;
|
||||||
|
static const std::string Normal_Last_M73_Output_Placeholder_Tag;
|
||||||
|
static const std::string Silent_Last_M73_Output_Placeholder_Tag;
|
||||||
|
|
||||||
enum EMode : unsigned char
|
enum EMode : unsigned char
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue