update to latest version

This commit is contained in:
QIDI TECH
2023-06-27 11:07:34 +08:00
parent afe5c54367
commit dd0d4c8c4a
80 changed files with 1931 additions and 599 deletions

View File

@@ -243,9 +243,10 @@ bool GCodeReader::GCodeLine::has_value(char axis, float &value) const
if (c == nullptr)
return false;
// Try to parse the numeric value.
char *pend = nullptr;
double v = strtod(++ c, &pend);
if (pend != nullptr && is_end_of_word(*pend)) {
double v = 0.;
const char* end = m_raw.c_str() + m_raw.size();
auto [pend, ec] = fast_float::from_chars(++c, end, v);
if (pend != c && is_end_of_word(*pend)) {
// The axis value has been parsed correctly.
value = float(v);
return true;