This commit is contained in:
bubnikv 2019-08-29 10:43:38 +02:00
commit 3fc3a8e2c3
4 changed files with 25 additions and 16 deletions

View File

@ -947,11 +947,16 @@ void WipeTower::toolchange_Unload(
.travel(old_x, writer.y()) // in case previous move was shortened to limit feedrate*/
.resume_preview();
}
if (new_temperature != 0 && (new_temperature != m_old_temperature || m_is_first_layer) ) { // Set the extruder temperature, but don't wait.
// If the required temperature is the same as last time, don't emit the M104 again (if user adjusted the value, it would be reset)
// However, always change temperatures on the first layer (this is to avoid issues with priming lines turned off).
writer.set_extruder_temp(new_temperature, false);
m_old_temperature = new_temperature;
// Wipe tower should only change temperature with single extruder MM. Otherwise, all temperatures should
// be already set and there is no need to change anything. Also, the temperature could be changed
// for wrong extruder.
if (m_semm) {
if (new_temperature != 0 && (new_temperature != m_old_temperature || m_is_first_layer) ) { // Set the extruder temperature, but don't wait.
// If the required temperature is the same as last time, don't emit the M104 again (if user adjusted the value, it would be reset)
// However, always change temperatures on the first layer (this is to avoid issues with priming lines turned off).
writer.set_extruder_temp(new_temperature, false);
m_old_temperature = new_temperature;
}
}
// Cooling:
@ -1002,6 +1007,10 @@ void WipeTower::toolchange_Change(
writer.append("[end_filament_gcode]\n");
writer.append("[toolchange_gcode]\n");
// Travel to where we assume we are. Custom toolchange or some special T code handling (parking extruder etc)
// gcode could have left the extruder somewhere, we cannot just start extruding.
writer.append(std::string("G1 X") + std::to_string(writer.x()) + " Y" + std::to_string(writer.y()) + "\n");
// The toolchange Tn command will be inserted later, only in case that the user does
// not provide a custom toolchange gcode.
writer.set_tool(new_tool); // This outputs nothing, the writer just needs to know the tool has changed.

View File

@ -1189,6 +1189,8 @@ std::string Print::validate() const
return L("The Wipe Tower is currently only supported for the Marlin, RepRap/Sprinter and Repetier G-code flavors.");
if (! m_config.use_relative_e_distances)
return L("The Wipe Tower is currently only supported with the relative extruder addressing (use_relative_e_distances=1).");
if (m_config.ooze_prevention)
return L("Ooze prevention is currently not supported with the wipe tower enabled.");
if (m_objects.size() > 1) {
bool has_custom_layering = false;

View File

@ -454,9 +454,9 @@ SLAPrint::ApplyStatus SLAPrint::apply(const Model &model, DynamicPrintConfig con
}
if(m_objects.empty()) {
m_printer.release();
m_printer_input.clear();
m_print_statistics.clear();
m_printer.reset();
m_printer_input = {};
m_print_statistics = {};
}
#ifdef _DEBUG
@ -1397,13 +1397,14 @@ void SLAPrint::process()
{ // create a raster printer for the current print parameters
double layerh = m_default_object_config.layer_height.getFloat();
m_printer.reset(new SLAPrinter(m_printer_config,
m_material_config,
layerh));
m_printer.reset(new sla::SLARasterWriter(m_printer_config,
m_material_config,
layerh));
}
// Allocate space for all the layers
SLAPrinter& printer = *m_printer;
sla::SLARasterWriter &printer = *m_printer;
auto lvlcnt = unsigned(m_printer_input.size());
printer.layers(lvlcnt);

View File

@ -422,9 +422,6 @@ public:
const std::vector<PrintLayer>& print_layers() const { return m_printer_input; }
private:
using SLAPrinter = sla::SLARasterWriter;
using SLAPrinterPtr = std::unique_ptr<SLAPrinter>;
// Implement same logic as in SLAPrintObject
bool invalidate_step(SLAPrintStep st);
@ -443,7 +440,7 @@ private:
std::vector<PrintLayer> m_printer_input;
// The printer itself
SLAPrinterPtr m_printer;
std::unique_ptr<sla::SLARasterWriter> m_printer;
// Estimated print time, material consumed.
SLAPrintStatistics m_print_statistics;