2016-12-21 22:09:58 +00:00
|
|
|
#ifndef slic3r_CoolingBuffer_hpp_
|
|
|
|
#define slic3r_CoolingBuffer_hpp_
|
|
|
|
|
|
|
|
#include "libslic3r.h"
|
|
|
|
#include <map>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace Slic3r {
|
|
|
|
|
2017-06-22 10:59:23 +00:00
|
|
|
struct ElapsedTime;
|
2017-05-03 16:28:22 +00:00
|
|
|
class GCode;
|
|
|
|
class Layer;
|
|
|
|
|
2016-12-21 22:09:58 +00:00
|
|
|
/*
|
|
|
|
A standalone G-code filter, to control cooling of the print.
|
|
|
|
The G-code is processed per layer. Once a layer is collected, fan start / stop commands are edited
|
|
|
|
and the print is modified to stretch over a minimum layer time.
|
|
|
|
*/
|
|
|
|
|
|
|
|
class CoolingBuffer {
|
2017-05-03 16:28:22 +00:00
|
|
|
public:
|
2017-06-22 10:59:23 +00:00
|
|
|
CoolingBuffer(GCode &gcodegen);
|
|
|
|
~CoolingBuffer();
|
2017-05-03 16:28:22 +00:00
|
|
|
std::string append(const std::string &gcode, size_t object_id, size_t layer_id, bool is_support);
|
2016-12-21 22:09:58 +00:00
|
|
|
std::string flush();
|
2017-05-03 16:28:22 +00:00
|
|
|
GCode* gcodegen() { return &m_gcodegen; };
|
2016-12-21 22:09:58 +00:00
|
|
|
|
2017-05-03 16:28:22 +00:00
|
|
|
private:
|
|
|
|
CoolingBuffer& operator=(const CoolingBuffer&);
|
|
|
|
|
|
|
|
GCode& m_gcodegen;
|
|
|
|
std::string m_gcode;
|
2017-06-22 10:59:23 +00:00
|
|
|
ElapsedTime *m_elapsed_time;
|
2017-05-03 16:28:22 +00:00
|
|
|
size_t m_layer_id;
|
|
|
|
std::set<size_t> m_object_ids_visited;
|
2016-12-21 22:09:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|