Do not emit M1 gcode for firmwares other than Marlin (after MM priming)
The M1 gcode is apparently only supported on Marlin, others do not support it or use it for something else This should fix #5441
This commit is contained in:
parent
26755eb1d1
commit
a5d363a9f4
1 changed files with 24 additions and 15 deletions
|
@ -413,14 +413,11 @@ namespace Slic3r {
|
|||
|
||||
std::string WipeTowerIntegration::prime(GCode& gcodegen)
|
||||
{
|
||||
assert(m_layer_idx == 0);
|
||||
std::string gcode;
|
||||
|
||||
for (const WipeTower::ToolChangeResult& tcr : m_priming) {
|
||||
if (! tcr.extrusions.empty())
|
||||
gcode += append_tcr(gcodegen, tcr, tcr.new_tool);
|
||||
}
|
||||
|
||||
return gcode;
|
||||
}
|
||||
|
||||
|
@ -1243,18 +1240,30 @@ void GCode::_do_export(Print& print, FILE* file, ThumbnailsGeneratorCallback thu
|
|||
bbox_print.merge(get_wipe_tower_extrusions_extents(print, twolayers_printz));
|
||||
BoundingBoxf bbox_prime(get_wipe_tower_priming_extrusions_extents(print));
|
||||
bbox_prime.offset(0.5f);
|
||||
// Beep for 500ms, tone 800Hz. Yet better, play some Morse.
|
||||
_write(file, this->retract());
|
||||
_write(file, "M300 S800 P500\n");
|
||||
if (bbox_prime.overlap(bbox_print)) {
|
||||
// Wait for the user to remove the priming extrusions, otherwise they would
|
||||
// get covered by the print.
|
||||
_write(file, "M1 Remove priming towers and click button.\n");
|
||||
}
|
||||
else {
|
||||
// Just wait for a bit to let the user check, that the priming succeeded.
|
||||
//TODO Add a message explaining what the printer is waiting for. This needs a firmware fix.
|
||||
_write(file, "M1 S10\n");
|
||||
bool overlap = bbox_prime.overlap(bbox_print);
|
||||
|
||||
if (print.config().gcode_flavor == gcfMarlin) {
|
||||
_write(file, this->retract());
|
||||
_write(file, "M300 S800 P500\n"); // Beep for 500ms, tone 800Hz.
|
||||
if (overlap) {
|
||||
// Wait for the user to remove the priming extrusions.
|
||||
_write(file, "M1 Remove priming towers and click button.\n");
|
||||
} else {
|
||||
// Just wait for a bit to let the user check, that the priming succeeded.
|
||||
//TODO Add a message explaining what the printer is waiting for. This needs a firmware fix.
|
||||
_write(file, "M1 S10\n");
|
||||
}
|
||||
} else {
|
||||
// This is not Marlin, M1 command is probably not supported.
|
||||
// (See https://github.com/prusa3d/PrusaSlicer/issues/5441.)
|
||||
if (overlap) {
|
||||
print.active_step_add_warning(PrintStateBase::WarningLevel::CRITICAL,
|
||||
L("Your print is very close to the priming regions. "
|
||||
"Make sure there is no collision."));
|
||||
} else {
|
||||
// Just continue printing, no action necessary.
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
print.throw_if_canceled();
|
||||
|
|
Loading…
Reference in a new issue