mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-07-31 10:52:03 +08:00
Moved regular expression definitions to header (for reuse)
This commit is contained in:
parent
eb4e727f74
commit
a66ae6ac26
@ -110,8 +110,6 @@ PrintGCode::output()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// set bed temperature
|
// set bed temperature
|
||||||
auto bed_temp_regex { std::regex("M(?:190|140)", std::regex_constants::icase)};
|
|
||||||
auto ex_temp_regex { std::regex("M(?:109|104)", std::regex_constants::icase)};
|
|
||||||
auto temp{config.first_layer_bed_temperature.getFloat()};
|
auto temp{config.first_layer_bed_temperature.getFloat()};
|
||||||
if (config.has_heatbed && temp > 0 && std::regex_search(config.start_gcode.getString(), bed_temp_regex)) {
|
if (config.has_heatbed && temp > 0 && std::regex_search(config.start_gcode.getString(), bed_temp_regex)) {
|
||||||
fh << gcodegen.writer.set_bed_temperature(temp, 1);
|
fh << gcodegen.writer.set_bed_temperature(temp, 1);
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <regex>
|
||||||
|
|
||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
|
|
||||||
@ -66,6 +67,11 @@ private:
|
|||||||
|
|
||||||
// Chain the paths hierarchically by a greedy algorithm to minimize a travel distance.
|
// Chain the paths hierarchically by a greedy algorithm to minimize a travel distance.
|
||||||
std::string _extrude_infill(std::map<size_t,ExtrusionEntityCollection> &by_region);
|
std::string _extrude_infill(std::map<size_t,ExtrusionEntityCollection> &by_region);
|
||||||
|
|
||||||
|
/// regular expression to match heater gcodes
|
||||||
|
std::regex bed_temp_regex { std::regex("M(?:190|140)", std::regex_constants::icase)};
|
||||||
|
/// regular expression to match heater gcodes
|
||||||
|
std::regex ex_temp_regex { std::regex("M(?:109|104)", std::regex_constants::icase)};
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Slic3r
|
} // namespace Slic3r
|
||||||
|
Loading…
x
Reference in New Issue
Block a user