Moved regular expression definitions to header (for reuse)

This commit is contained in:
Joseph Lenox 2018-07-26 22:58:43 -05:00
parent eb4e727f74
commit a66ae6ac26
2 changed files with 6 additions and 2 deletions

View File

@ -110,8 +110,6 @@ PrintGCode::output()
}
// 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()};
if (config.has_heatbed && temp > 0 && std::regex_search(config.start_gcode.getString(), bed_temp_regex)) {
fh << gcodegen.writer.set_bed_temperature(temp, 1);

View File

@ -12,6 +12,7 @@
#include <string>
#include <iostream>
#include <regex>
namespace Slic3r {
@ -66,6 +67,11 @@ private:
// Chain the paths hierarchically by a greedy algorithm to minimize a travel distance.
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