#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/GCodeReader.hpp>
|
| static bool | has_value (std::string_view axis_pos, float &value) |
| static bool | cmd_is (const std::string &gcode_line, const char *cmd_test) |
| static bool | cmd_starts_with (const std::string &gcode_line, const char *cmd_test) |
| static std::string | extract_cmd (const std::string &gcode_line) |
◆ GCodeLine()
| Slic3r::GCodeReader::GCodeLine::GCodeLine |
( |
| ) |
|
|
inline |
◆ axis_pos()
| std::string_view Slic3r::GCodeReader::GCodeLine::axis_pos |
( |
char | axis | ) |
const |
◆ clear()
| void Slic3r::GCodeReader::GCodeLine::clear |
( |
| ) |
|
|
inline |
◆ cmd()
| const std::string_view Slic3r::GCodeReader::GCodeLine::cmd |
( |
| ) |
const |
|
inline |
27 {
30 }
const std::string_view cmd() const
Definition GCodeReader.hpp:27
static const char * skip_word(const char *c)
Definition GCodeReader.hpp:198
static const char * skip_whitespaces(const char *c)
Definition GCodeReader.hpp:193
References cmd(), m_raw, Slic3r::GCodeReader::skip_whitespaces(), and Slic3r::GCodeReader::skip_word().
Referenced by Slic3r::FanMover::_process_gcode_line(), cmd(), cmd_is(), Slic3r::custom_gcode_motion_state_changes(), extract_cmd(), Slic3r::GCodeProcessor::process_G28(), Slic3r::GCodeProcessor::process_gcode_line(), and Slic3r::GCodeProcessor::process_T().
◆ cmd_is() [1/2]
| bool Slic3r::GCodeReader::GCodeLine::cmd_is |
( |
const char * | cmd_test | ) |
const |
|
inline |
◆ cmd_is() [2/2]
| bool Slic3r::GCodeReader::GCodeLine::cmd_is |
( |
const std::string & | gcode_line, |
|
|
const char * | cmd_test ) |
|
inlinestatic |
◆ cmd_starts_with()
| bool Slic3r::GCodeReader::GCodeLine::cmd_starts_with |
( |
const std::string & | gcode_line, |
|
|
const char * | cmd_test ) |
|
inlinestatic |
◆ comment()
| const std::string_view Slic3r::GCodeReader::GCodeLine::comment |
( |
| ) |
const |
|
inline |
32 {
size_t pos =
m_raw.find(
';');
return (pos == std::string::npos) ? std::string_view() : std::string_view(
m_raw).substr(
pos + 1); }
Vec3d pos(const Pt &p)
Definition ReprojectPointsOnMesh.hpp:16
References m_raw.
◆ dist_E()
| float Slic3r::GCodeReader::GCodeLine::dist_E |
( |
const GCodeReader & | reader | ) |
const |
|
inline |
◆ dist_X()
| float Slic3r::GCodeReader::GCodeLine::dist_X |
( |
const GCodeReader & | reader | ) |
const |
|
inline |
◆ dist_XY()
| float Slic3r::GCodeReader::GCodeLine::dist_XY |
( |
const GCodeReader & | reader | ) |
const |
|
inline |
◆ dist_Y()
| float Slic3r::GCodeReader::GCodeLine::dist_Y |
( |
const GCodeReader & | reader | ) |
const |
|
inline |
◆ dist_Z()
| float Slic3r::GCodeReader::GCodeLine::dist_Z |
( |
const GCodeReader & | reader | ) |
const |
|
inline |
◆ e()
| float Slic3r::GCodeReader::GCodeLine::e |
( |
| ) |
const |
|
inline |
double m_axis[NUM_AXES]
Definition GCodeReader.hpp:104
References Slic3r::E, and m_axis.
Referenced by Slic3r::FanMover::_process_gcode_line(), dist_E(), new_E(), Slic3r::GCodeProcessor::process_G1(), Slic3r::GCodeProcessor::process_G92(), Slic3r::SpiralVase::process_layer(), Slic3r::GCodeProcessor::process_M201(), Slic3r::GCodeProcessor::process_M203(), Slic3r::GCodeProcessor::process_M205(), and Slic3r::GCodeProcessor::process_M566().
◆ extract_cmd()
| std::string Slic3r::GCodeReader::GCodeLine::extract_cmd |
( |
const std::string & | gcode_line | ) |
|
|
inlinestatic |
◆ extruding()
| bool Slic3r::GCodeReader::GCodeLine::extruding |
( |
const GCodeReader & | reader | ) |
const |
|
inline |
◆ f()
| float Slic3r::GCodeReader::GCodeLine::f |
( |
| ) |
const |
|
inline |
◆ has() [1/2]
| bool Slic3r::GCodeReader::GCodeLine::has |
( |
Axis | axis | ) |
const |
|
inline |
37{
return (
m_mask & (1 <<
int(axis))) != 0; }
uint32_t m_mask
Definition GCodeReader.hpp:105
References m_mask.
Referenced by Slic3r::FanMover::_process_gcode_line(), dist_E(), dist_X(), dist_XY(), dist_Y(), dist_Z(), Slic3r::GCodeProcessor::extract_absolute_position_on_axis(), has_e(), has_f(), has_i(), has_j(), has_p(), has_unknown_axis(), has_x(), has_y(), has_z(), new_E(), new_F(), new_X(), new_Y(), new_Z(), Slic3r::GCodeReader::parse_line_internal(), Slic3r::GCodeProcessor::process_G1(), Slic3r::GCodeProcessor::process_G2_G3(), Slic3r::SpiralVase::process_layer(), Slic3r::GCodeProcessor::process_M106(), Slic3r::GCodeProcessor::process_M132(), Slic3r::GCodeProcessor::process_M402(), Slic3r::GCodeProcessor::process_M702(), set(), travel(), Slic3r::GCodeReader::update_coordinates(), and Slic3r::GCodeProcessor::update_position_known_from_move().
◆ has() [2/2]
| bool Slic3r::GCodeReader::GCodeLine::has |
( |
char | axis | ) |
const |
◆ has_e()
| bool Slic3r::GCodeReader::GCodeLine::has_e |
( |
| ) |
const |
|
inline |
◆ has_f()
| bool Slic3r::GCodeReader::GCodeLine::has_f |
( |
| ) |
const |
|
inline |
◆ has_i()
| bool Slic3r::GCodeReader::GCodeLine::has_i |
( |
| ) |
const |
|
inline |
◆ has_j()
| bool Slic3r::GCodeReader::GCodeLine::has_j |
( |
| ) |
const |
|
inline |
◆ has_p()
| bool Slic3r::GCodeReader::GCodeLine::has_p |
( |
| ) |
const |
|
inline |
◆ has_unknown_axis()
| bool Slic3r::GCodeReader::GCodeLine::has_unknown_axis |
( |
| ) |
const |
|
inline |
◆ has_value() [1/2]
| bool Slic3r::GCodeReader::GCodeLine::has_value |
( |
char | axis, |
|
|
float & | value ) const |
317{
319 const char *c =
m_raw.c_str();
320
322
324
326
329 break;
330
331 if (*c == axis) {
332
333 char *pend = nullptr;
334 double v = strtod(++ c, &pend);
336
338 return true;
339 }
340 }
341
343 }
344 return false;
345}
float value(Axis axis) const
Definition GCodeReader.hpp:38
bool is_decimal_separator_point()
Definition LocalesUtils.cpp:78
References Slic3r::is_decimal_separator_point(), Slic3r::GCodeReader::is_end_of_gcode_line(), Slic3r::GCodeReader::is_end_of_word(), m_raw, Slic3r::GCodeReader::skip_whitespaces(), Slic3r::GCodeReader::skip_word(), and value().
Referenced by Slic3r::anonymous_namespace{ElegooGCodeProcessorHelper.cpp}::get_clamped_param(), Slic3r::GCodeProcessor::process_elegoo_M6211(), Slic3r::GCodeProcessor::process_G2_G3(), Slic3r::GCodeProcessor::process_G4(), Slic3r::GCodeProcessor::process_M1020(), Slic3r::GCodeProcessor::process_M104(), Slic3r::GCodeProcessor::process_M106(), Slic3r::GCodeProcessor::process_M109(), Slic3r::GCodeProcessor::process_M140(), Slic3r::GCodeProcessor::process_M190(), Slic3r::GCodeProcessor::process_M191(), Slic3r::GCodeProcessor::process_M204(), Slic3r::GCodeProcessor::process_M205(), Slic3r::GCodeProcessor::process_M221(), Slic3r::GCodeProcessor::process_M400(), Slic3r::GCodeProcessor::process_M402(), Slic3r::GCodeProcessor::process_M572(), Slic3r::GCodeProcessor::process_M622(), Slic3r::GCodeProcessor::process_M900(), Slic3r::GCodeProcessor::process_SYNC(), Slic3r::GCodeProcessor::process_T(), and Slic3r::GCodeProcessor::run_post_process().
◆ has_value() [2/2]
| bool Slic3r::GCodeReader::GCodeLine::has_value |
( |
std::string_view | axis_pos, |
|
|
float & | value ) |
|
static |
301{
302 if (
const char *c =
axis_pos.data(); c) {
303
304 double v = 0.;
306 auto [pend, ec] = fast_float::from_chars(++ c, end, v);
308
310 return true;
311 }
312 }
313 return false;
314}
std::string_view axis_pos(char axis) const
Definition GCodeReader.cpp:293
T * end(Slic3r::Mat< N, M, T > &mat)
Definition Point.hpp:841
References axis_pos(), Slic3r::GCodeReader::is_end_of_word(), and value().
◆ has_x()
| bool Slic3r::GCodeReader::GCodeLine::has_x |
( |
| ) |
const |
|
inline |
◆ has_y()
| bool Slic3r::GCodeReader::GCodeLine::has_y |
( |
| ) |
const |
|
inline |
◆ has_z()
| bool Slic3r::GCodeReader::GCodeLine::has_z |
( |
| ) |
const |
|
inline |
◆ i()
| float Slic3r::GCodeReader::GCodeLine::i |
( |
| ) |
const |
|
inline |
◆ j()
| float Slic3r::GCodeReader::GCodeLine::j |
( |
| ) |
const |
|
inline |
◆ new_E()
| float Slic3r::GCodeReader::GCodeLine::new_E |
( |
const GCodeReader & | reader | ) |
const |
|
inline |
◆ new_F()
| float Slic3r::GCodeReader::GCodeLine::new_F |
( |
const GCodeReader & | reader | ) |
const |
|
inline |
◆ new_X()
| float Slic3r::GCodeReader::GCodeLine::new_X |
( |
const GCodeReader & | reader | ) |
const |
|
inline |
◆ new_Y()
| float Slic3r::GCodeReader::GCodeLine::new_Y |
( |
const GCodeReader & | reader | ) |
const |
|
inline |
◆ new_Z()
| float Slic3r::GCodeReader::GCodeLine::new_Z |
( |
const GCodeReader & | reader | ) |
const |
|
inline |
◆ p()
| float Slic3r::GCodeReader::GCodeLine::p |
( |
| ) |
const |
|
inline |
◆ precise_value()
| double Slic3r::GCodeReader::GCodeLine::precise_value |
( |
Axis | axis | ) |
const |
|
inline |
◆ raw()
| const std::string & Slic3r::GCodeReader::GCodeLine::raw |
( |
| ) |
const |
|
inline |
References m_raw.
Referenced by Slic3r::FanMover::_process_gcode_line(), axis_pos(), Slic3r::GCodeProcessor::contains_reserved_tag(), Slic3r::GCodeProcessor::contains_reserved_tags(), Slic3r::custom_gcode_motion_state_changes(), Slic3r::g28_homed_axes(), Slic3r::GCodeProcessor::process_gcode_line(), Slic3r::SpiralVase::process_layer(), Slic3r::GCodeProcessor::process_M1020(), Slic3r::GCodeProcessor::process_M108(), Slic3r::GCodeProcessor::process_M135(), Slic3r::GCodeProcessor::process_SET_PRESSURE_ADVANCE(), Slic3r::GCodeProcessor::process_SET_VELOCITY_LIMIT(), and Slic3r::GCodeProcessor::run_post_process().
◆ reset()
| void Slic3r::GCodeReader::GCodeLine::reset |
( |
| ) |
|
|
inline |
◆ retracting()
| bool Slic3r::GCodeReader::GCodeLine::retracting |
( |
const GCodeReader & | reader | ) |
const |
|
inline |
◆ set()
| void Slic3r::GCodeReader::GCodeLine::set |
( |
const Axis | axis, |
|
|
const float | new_value, |
|
|
const int | decimal_digits = 3 ) |
348{
349 std::ostringstream ss;
350 ss << std::fixed << std::setprecision(decimal_digits) << new_value;
351
352 char match[3] = " X";
353 if (int(axis) < 3)
354 match[1] += int(axis);
356 match[1] = 'F';
357
359 match[1] = 'I';
361 match[1] = 'J';
362 else {
364 match[1] = 'E';
365 }
366
367 if (this->
has(axis)) {
369 size_t end =
m_raw.find(
' ', pos+1);
370 m_raw =
m_raw.replace(pos, end-pos, ss.str());
371 } else {
373 if (pos == std::string::npos)
374 m_raw += std::string(match) + ss.str();
375 else
376 m_raw =
m_raw.replace(pos, 0, std::string(match) + ss.str());
377 }
380}
References Slic3r::E, Slic3r::F, has(), Slic3r::I, Slic3r::J, m_axis, m_mask, and m_raw.
Referenced by Slic3r::GCodeProcessor::process_G10(), Slic3r::GCodeProcessor::process_G11(), and Slic3r::SpiralVase::process_layer().
◆ travel()
| bool Slic3r::GCodeReader::GCodeLine::travel |
( |
| ) |
const |
|
inline |
◆ value()
| float Slic3r::GCodeReader::GCodeLine::value |
( |
Axis | axis | ) |
const |
|
inline |
◆ x()
| float Slic3r::GCodeReader::GCodeLine::x |
( |
| ) |
const |
|
inline |
References m_axis, and Slic3r::X.
Referenced by dist_X(), dist_XY(), Slic3r::anonymous_namespace{GCode.cpp}::emitted_xy_after_gcode(), new_X(), Slic3r::GCodeProcessor::process_G1(), Slic3r::GCodeProcessor::process_G92(), Slic3r::SpiralVase::process_layer(), Slic3r::GCodeProcessor::process_M201(), Slic3r::GCodeProcessor::process_M203(), Slic3r::GCodeProcessor::process_M205(), and Slic3r::GCodeProcessor::process_M566().
◆ y()
| float Slic3r::GCodeReader::GCodeLine::y |
( |
| ) |
const |
|
inline |
References m_axis, and Slic3r::Y.
Referenced by dist_XY(), dist_Y(), Slic3r::anonymous_namespace{GCode.cpp}::emitted_xy_after_gcode(), new_Y(), Slic3r::GCodeProcessor::process_G1(), Slic3r::GCodeProcessor::process_G92(), Slic3r::SpiralVase::process_layer(), Slic3r::GCodeProcessor::process_M201(), Slic3r::GCodeProcessor::process_M203(), Slic3r::GCodeProcessor::process_M205(), and Slic3r::GCodeProcessor::process_M566().
◆ z()
| float Slic3r::GCodeReader::GCodeLine::z |
( |
| ) |
const |
|
inline |
◆ GCodeReader
References GCodeReader.
Referenced by dist_E(), dist_X(), dist_XY(), dist_Y(), dist_Z(), extruding(), GCodeReader, new_E(), new_F(), new_X(), new_Y(), new_Z(), and retracting().
◆ m_axis
| double Slic3r::GCodeReader::GCodeLine::m_axis[NUM_AXES] |
|
private |
Referenced by e(), f(), i(), j(), p(), Slic3r::GCodeReader::parse_line_internal(), precise_value(), reset(), set(), value(), x(), y(), and z().
◆ m_mask
| uint32_t Slic3r::GCodeReader::GCodeLine::m_mask |
|
private |
◆ m_raw
| std::string Slic3r::GCodeReader::GCodeLine::m_raw |
|
private |
Referenced by clear(), cmd(), cmd_is(), comment(), extract_cmd(), has(), has_value(), Slic3r::GCodeReader::parse_line_internal(), raw(), reset(), and set().
The documentation for this class was generated from the following files: