mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-13 19:25:54 +08:00
Fixed verification
Also started stubbing out process_layer (applying configs, etc)
This commit is contained in:
parent
080c930a3a
commit
e6203c0f0a
@ -38,8 +38,10 @@ SCENARIO( "PrintGCode basic functionality", "[!mayfail]") {
|
|||||||
REQUIRE(exported.find("G21 ; set units to millimeters") != std::string::npos);
|
REQUIRE(exported.find("G21 ; set units to millimeters") != std::string::npos);
|
||||||
}
|
}
|
||||||
|
|
||||||
THEN("Config options emitted.") {
|
THEN("Config options emitted for print config, default region config, default object config") {
|
||||||
|
REQUIRE(exported.find("; first_layer_temperature") != std::string::npos);
|
||||||
REQUIRE(exported.find("; layer_height") != std::string::npos);
|
REQUIRE(exported.find("; layer_height") != std::string::npos);
|
||||||
|
REQUIRE(exported.find("; fill_density") != std::string::npos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WHEN("the output is executed with support material") {
|
WHEN("the output is executed with support material") {
|
||||||
|
@ -231,7 +231,6 @@ Slic3r::Test::Print init_print(std::tuple<int,int,int> cube, config_ptr _config)
|
|||||||
|
|
||||||
void gcode(std::stringstream& gcode, Slic3r::Test::Print& _print) {
|
void gcode(std::stringstream& gcode, Slic3r::Test::Print& _print) {
|
||||||
Slic3r::Print& print {_print.print()};
|
Slic3r::Print& print {_print.print()};
|
||||||
print.process();
|
|
||||||
print.export_gcode(gcode, true);
|
print.export_gcode(gcode, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,8 +99,8 @@ Print::process()
|
|||||||
{
|
{
|
||||||
if (this->status_cb != nullptr)
|
if (this->status_cb != nullptr)
|
||||||
this->status_cb(70, "Infilling layers");
|
this->status_cb(70, "Infilling layers");
|
||||||
for(auto obj : this->objects) { obj->_infill(); }
|
for(auto& obj : this->objects) { obj->_infill(); }
|
||||||
for(auto obj : this->objects) { obj->generate_support_material(); }
|
for(auto& obj : this->objects) { obj->generate_support_material(); }
|
||||||
|
|
||||||
this->make_skirt();
|
this->make_skirt();
|
||||||
this->make_brim(); // must follow make_skirt
|
this->make_brim(); // must follow make_skirt
|
||||||
|
@ -273,8 +273,8 @@ PrintGCode::output()
|
|||||||
|
|
||||||
// print config
|
// print config
|
||||||
_print_config(print.config);
|
_print_config(print.config);
|
||||||
// _print_config(print.default_object_config);
|
_print_config(print.default_object_config);
|
||||||
// _print_config(print.default_region_config);
|
_print_config(print.default_region_config);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
@ -286,6 +286,15 @@ PrintGCode::filter(const std::string& in, bool wait)
|
|||||||
void
|
void
|
||||||
PrintGCode::process_layer(size_t idx, const Layer* layer, const Points& copies)
|
PrintGCode::process_layer(size_t idx, const Layer* layer, const Points& copies)
|
||||||
{
|
{
|
||||||
|
std::string gcode {""};
|
||||||
|
auto& gcodegen {this->_gcodegen};
|
||||||
|
|
||||||
|
const auto& obj {*(layer->object())};
|
||||||
|
gcodegen.config.apply(obj.config, true);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
fh << this->filter(gcode);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -313,6 +322,7 @@ PrintGCode::_print_config(const ConfigBase& config)
|
|||||||
fh << "; " << key << " = " << config.serialize(key) << "\n";
|
fh << "; " << key << " = " << config.serialize(key) << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintGCode::PrintGCode(Slic3r::Print& print, std::ostream& _fh) :
|
PrintGCode::PrintGCode(Slic3r::Print& print, std::ostream& _fh) :
|
||||||
_print(print),
|
_print(print),
|
||||||
config(print.config),
|
config(print.config),
|
||||||
|
@ -26,10 +26,10 @@ public:
|
|||||||
/// Process an individual output for export. Writes to the ostream.
|
/// Process an individual output for export. Writes to the ostream.
|
||||||
void process_layer(size_t idx, const Layer* layer, const Points& copies);
|
void process_layer(size_t idx, const Layer* layer, const Points& copies);
|
||||||
|
|
||||||
void flush_filters() { fh << this->filter(this->_cooling_buffer.flush(), 1); }
|
void flush_filters() { fh << this->filter(this->_cooling_buffer.flush(), true); }
|
||||||
|
|
||||||
/// Applies various filters, if enabled.
|
/// Applies various filters, if enabled.
|
||||||
std::string filter(const std::string& in, bool wait);
|
std::string filter(const std::string& in, bool wait = false);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@ -57,6 +57,7 @@ private:
|
|||||||
void _print_first_layer_temperature(bool wait);
|
void _print_first_layer_temperature(bool wait);
|
||||||
void _print_off_temperature(bool wait);
|
void _print_off_temperature(bool wait);
|
||||||
|
|
||||||
|
/// Utility function to print config options as gcode comments
|
||||||
void _print_config(const ConfigBase& config);
|
void _print_config(const ConfigBase& config);
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user