2014-04-07 23:42:29 +00:00
|
|
|
#include "Extruder.hpp"
|
|
|
|
|
|
|
|
namespace Slic3r {
|
|
|
|
|
2014-04-26 21:28:32 +00:00
|
|
|
Extruder::Extruder(int id, PrintConfig *config)
|
2014-04-07 23:42:29 +00:00
|
|
|
: id(id),
|
2014-04-27 21:03:22 +00:00
|
|
|
config(config)
|
2014-04-07 23:42:29 +00:00
|
|
|
{
|
|
|
|
reset();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Extruder::reset()
|
|
|
|
{
|
|
|
|
this->E = 0;
|
|
|
|
this->absolute_E = 0;
|
|
|
|
this->retracted = 0;
|
|
|
|
this->restart_extra = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
double
|
|
|
|
Extruder::extrude(double dE)
|
|
|
|
{
|
2014-04-28 20:02:34 +00:00
|
|
|
if (this->config->use_relative_e_distances) {
|
2014-04-07 23:42:29 +00:00
|
|
|
this->E = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
this->E += dE;
|
|
|
|
this->absolute_E += dE;
|
|
|
|
return this->E;
|
|
|
|
}
|
|
|
|
|
2014-04-27 21:49:05 +00:00
|
|
|
Pointf
|
|
|
|
Extruder::extruder_offset() const
|
|
|
|
{
|
2014-04-28 20:02:34 +00:00
|
|
|
return this->config->extruder_offset.get_at(this->id);
|
2014-04-27 21:49:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
double
|
|
|
|
Extruder::nozzle_diameter() const
|
|
|
|
{
|
2014-04-28 20:02:34 +00:00
|
|
|
return this->config->nozzle_diameter.get_at(this->id);
|
2014-04-27 21:49:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
double
|
|
|
|
Extruder::filament_diameter() const
|
|
|
|
{
|
2014-04-28 20:02:34 +00:00
|
|
|
return this->config->filament_diameter.get_at(this->id);
|
2014-04-27 21:49:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
double
|
|
|
|
Extruder::extrusion_multiplier() const
|
|
|
|
{
|
2014-04-28 20:02:34 +00:00
|
|
|
return this->config->extrusion_multiplier.get_at(this->id);
|
2014-04-27 21:49:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
Extruder::temperature() const
|
|
|
|
{
|
2014-04-28 20:02:34 +00:00
|
|
|
return this->config->temperature.get_at(this->id);
|
2014-04-27 21:49:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
Extruder::first_layer_temperature() const
|
|
|
|
{
|
2014-04-28 20:02:34 +00:00
|
|
|
return this->config->first_layer_temperature.get_at(this->id);
|
2014-04-27 21:49:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
double
|
|
|
|
Extruder::retract_length() const
|
|
|
|
{
|
2014-04-28 20:02:34 +00:00
|
|
|
return this->config->retract_length.get_at(this->id);
|
2014-04-27 21:49:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
double
|
|
|
|
Extruder::retract_lift() const
|
|
|
|
{
|
2014-04-28 20:02:34 +00:00
|
|
|
return this->config->retract_lift.get_at(this->id);
|
2014-04-27 21:49:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
Extruder::retract_speed() const
|
|
|
|
{
|
2014-04-28 20:02:34 +00:00
|
|
|
return this->config->retract_speed.get_at(this->id);
|
2014-04-27 21:49:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
double
|
|
|
|
Extruder::retract_restart_extra() const
|
|
|
|
{
|
2014-04-28 20:02:34 +00:00
|
|
|
return this->config->retract_restart_extra.get_at(this->id);
|
2014-04-27 21:49:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
double
|
|
|
|
Extruder::retract_before_travel() const
|
|
|
|
{
|
2014-04-28 20:02:34 +00:00
|
|
|
return this->config->retract_before_travel.get_at(this->id);
|
2014-04-27 21:49:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
Extruder::retract_layer_change() const
|
|
|
|
{
|
2014-04-28 20:02:34 +00:00
|
|
|
return this->config->retract_layer_change.get_at(this->id);
|
2014-04-27 21:49:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
double
|
|
|
|
Extruder::retract_length_toolchange() const
|
|
|
|
{
|
2014-04-28 20:02:34 +00:00
|
|
|
return this->config->retract_length_toolchange.get_at(this->id);
|
2014-04-27 21:49:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
double
|
|
|
|
Extruder::retract_restart_extra_toolchange() const
|
|
|
|
{
|
2014-04-28 20:02:34 +00:00
|
|
|
return this->config->retract_restart_extra_toolchange.get_at(this->id);
|
2014-04-27 21:49:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
Extruder::wipe() const
|
|
|
|
{
|
2014-04-28 20:02:34 +00:00
|
|
|
return this->config->wipe.get_at(this->id);
|
2014-04-27 21:49:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-04-27 20:44:10 +00:00
|
|
|
#ifdef SLIC3RXS
|
|
|
|
REGISTER_CLASS(Extruder, "Extruder");
|
|
|
|
#endif
|
|
|
|
|
2014-04-07 23:42:29 +00:00
|
|
|
}
|