mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-10-06 12:06:30 +08:00
70 lines
1.7 KiB
C++
70 lines
1.7 KiB
C++
#ifndef SLIC3RXS
|
|
#ifndef slic3r_PrintGCode_hpp
|
|
#define slic3r_PrintGCode_hpp
|
|
|
|
#include "GCode.hpp"
|
|
#include "GCode/CoolingBuffer.hpp"
|
|
#include "GCode/SpiralVase.hpp"
|
|
#include "Geometry.hpp"
|
|
#include "Flow.hpp"
|
|
#include "ExtrusionEntity.hpp"
|
|
#include "libslic3r.h"
|
|
|
|
#include <string>
|
|
#include <iostream>
|
|
|
|
namespace Slic3r {
|
|
|
|
class PrintGCode {
|
|
public:
|
|
/// Constructor.
|
|
PrintGCode(Slic3r::Print& print, std::ostream& _fh);
|
|
|
|
/// Perform the export. export is a reserved name in C++, so changed to output
|
|
void output();
|
|
|
|
/// Process an individual output for export. Writes to the ostream.
|
|
void process_layer(size_t idx, const Layer* layer, const Points& copies);
|
|
|
|
void flush_filters() { fh << this->filter(this->_cooling_buffer.flush(), true); }
|
|
|
|
/// Applies various filters, if enabled.
|
|
std::string filter(const std::string& in, bool wait = false);
|
|
|
|
private:
|
|
|
|
Slic3r::Print& _print;
|
|
const Slic3r::PrintConfig& config;
|
|
|
|
Slic3r::GCode _gcodegen;
|
|
|
|
const PrintObjectPtrs& objects;
|
|
|
|
std::ostream& fh;
|
|
|
|
Slic3r::CoolingBuffer _cooling_buffer;
|
|
Slic3r::SpiralVase _spiral_vase;
|
|
// Slic3r::VibrationLimit _vibration_limit;
|
|
// Slic3r::ArcFitting _arc_fitting;
|
|
// Slic3r::PressureRegulator _pressure_regulator;
|
|
|
|
size_t _skirt_done {0};
|
|
bool _brim_done {false};
|
|
bool _second_layer_things_done {false};
|
|
std::string _last_obj_copy {""};
|
|
bool _autospeed {false};
|
|
|
|
void _print_first_layer_temperature(bool wait);
|
|
void _print_off_temperature(bool wait);
|
|
|
|
/// Utility function to print config options as gcode comments
|
|
void _print_config(const ConfigBase& config);
|
|
|
|
|
|
};
|
|
|
|
} // namespace Slic3r
|
|
|
|
#endif // slic3r_PrintGCode_hpp
|
|
#endif // SLIC3RXS
|