2014-04-07 23:42:29 +00:00
|
|
|
#ifndef slic3r_Extruder_hpp_
|
|
|
|
#define slic3r_Extruder_hpp_
|
|
|
|
|
2015-12-07 23:39:54 +00:00
|
|
|
#include "libslic3r.h"
|
2014-04-07 23:42:29 +00:00
|
|
|
#include "Point.hpp"
|
2014-04-26 21:28:32 +00:00
|
|
|
#include "PrintConfig.hpp"
|
2014-04-07 23:42:29 +00:00
|
|
|
|
|
|
|
namespace Slic3r {
|
|
|
|
|
|
|
|
class Extruder
|
|
|
|
{
|
2017-05-03 16:28:22 +00:00
|
|
|
public:
|
2015-11-04 19:48:44 +00:00
|
|
|
unsigned int id;
|
2014-10-25 08:42:07 +00:00
|
|
|
double E;
|
|
|
|
double absolute_E;
|
|
|
|
double retracted;
|
|
|
|
double restart_extra;
|
|
|
|
double e_per_mm3;
|
2017-05-03 16:28:22 +00:00
|
|
|
|
2015-11-04 19:48:44 +00:00
|
|
|
Extruder(unsigned int id, GCodeConfig *config);
|
2014-04-07 23:42:29 +00:00
|
|
|
virtual ~Extruder() {}
|
2017-05-03 16:28:22 +00:00
|
|
|
|
2017-05-19 17:24:21 +00:00
|
|
|
void reset() {
|
|
|
|
this->E = 0;
|
|
|
|
this->absolute_E = 0;
|
|
|
|
this->retracted = 0;
|
|
|
|
this->restart_extra = 0;
|
|
|
|
}
|
|
|
|
|
2014-04-07 23:42:29 +00:00
|
|
|
double extrude(double dE);
|
2014-10-21 18:16:45 +00:00
|
|
|
double retract(double length, double restart_extra);
|
|
|
|
double unretract();
|
2014-10-21 18:36:52 +00:00
|
|
|
double e_per_mm(double mm3_per_mm) const;
|
|
|
|
double extruded_volume() const;
|
|
|
|
double used_filament() const;
|
2014-04-28 20:02:34 +00:00
|
|
|
|
2014-04-27 21:49:05 +00:00
|
|
|
double filament_diameter() const;
|
2017-01-16 05:56:01 +00:00
|
|
|
double filament_density() const;
|
|
|
|
double filament_cost() const;
|
2014-04-27 21:49:05 +00:00
|
|
|
double extrusion_multiplier() const;
|
2017-05-19 17:24:21 +00:00
|
|
|
double retract_before_wipe() const;
|
2014-04-27 21:49:05 +00:00
|
|
|
double retract_length() const;
|
|
|
|
double retract_lift() const;
|
2017-05-03 16:28:22 +00:00
|
|
|
int retract_speed() const;
|
2017-05-19 17:24:21 +00:00
|
|
|
int deretract_speed() const;
|
2014-04-27 21:49:05 +00:00
|
|
|
double retract_restart_extra() const;
|
|
|
|
double retract_length_toolchange() const;
|
|
|
|
double retract_restart_extra_toolchange() const;
|
2017-05-03 16:28:22 +00:00
|
|
|
|
|
|
|
static Extruder key(unsigned int id) { return Extruder(id); }
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Private constructor to create a key for a search in std::set.
|
|
|
|
Extruder(unsigned int id) : id(id) {}
|
|
|
|
|
|
|
|
GCodeConfig *m_config;
|
2014-04-07 23:42:29 +00:00
|
|
|
};
|
|
|
|
|
2017-05-03 16:28:22 +00:00
|
|
|
// Sort Extruder objects by the extruder id by default.
|
|
|
|
inline bool operator==(const Extruder &e1, const Extruder &e2) { return e1.id == e2.id; }
|
|
|
|
inline bool operator!=(const Extruder &e1, const Extruder &e2) { return e1.id != e2.id; }
|
|
|
|
inline bool operator< (const Extruder &e1, const Extruder &e2) { return e1.id < e2.id; }
|
|
|
|
inline bool operator> (const Extruder &e1, const Extruder &e2) { return e1.id > e2.id; }
|
|
|
|
|
2014-04-07 23:42:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|