Ported the G-code generator from Perl to C++.

Removed GCode.pm
Removed the Perl bindigns for AvoidCrossingPerimeters, OozePrevention, SpiralVase, Wipe
Changed the std::set of extruder IDs to vector of IDs.
Removed some MSVC compiler warnings, removed obnoxious compiler warnings when compiling the Perl bindings.
This commit is contained in:
bubnikv 2017-05-03 18:28:22 +02:00
parent 72ae3585e4
commit e90279c513
52 changed files with 1362 additions and 1632 deletions

View file

@ -2,12 +2,14 @@
#define slic3r_CoolingBuffer_hpp_
#include "libslic3r.h"
#include "GCode.hpp"
#include <map>
#include <string>
namespace Slic3r {
class GCode;
class Layer;
/*
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
@ -15,23 +17,20 @@ and the print is modified to stretch over a minimum layer time.
*/
class CoolingBuffer {
public:
CoolingBuffer(GCode &gcodegen)
: _gcodegen(&gcodegen), _elapsed_time(0.), _layer_id(0)
{
this->_min_print_speed = this->_gcodegen->config.min_print_speed * 60;
};
std::string append(const std::string &gcode, std::string obj_id, size_t layer_id, float print_z);
public:
CoolingBuffer(GCode &gcodegen) : m_gcodegen(gcodegen), m_elapsed_time(0.), m_layer_id(0) {}
std::string append(const std::string &gcode, size_t object_id, size_t layer_id, bool is_support);
std::string flush();
GCode* gcodegen() { return this->_gcodegen; };
GCode* gcodegen() { return &m_gcodegen; };
private:
GCode* _gcodegen;
std::string _gcode;
float _elapsed_time;
size_t _layer_id;
std::map<std::string,float> _last_z;
float _min_print_speed;
private:
CoolingBuffer& operator=(const CoolingBuffer&);
GCode& m_gcodegen;
std::string m_gcode;
float m_elapsed_time;
size_t m_layer_id;
std::set<size_t> m_object_ids_visited;
};
}