diff options
author | FormerLurker <hochgebe@gmail.com> | 2021-07-03 21:42:58 +0300 |
---|---|---|
committer | FormerLurker <hochgebe@gmail.com> | 2021-07-03 21:42:58 +0300 |
commit | 9a838679c1ae3cdbfd0a3eedade6bf94ebb79409 (patch) | |
tree | 64b56c401ebd429f4f8b30cdef903328f1abc7ed /GcodeProcessorLib | |
parent | 18d1e992d3773485d2b7b05ffaec1ea00b16c777 (diff) |
Alpha travel move conversion support.
Diffstat (limited to 'GcodeProcessorLib')
-rw-r--r-- | GcodeProcessorLib/position.h | 2 | ||||
-rw-r--r-- | GcodeProcessorLib/utilities.cpp | 9 | ||||
-rw-r--r-- | GcodeProcessorLib/utilities.h | 3 |
3 files changed, 9 insertions, 5 deletions
diff --git a/GcodeProcessorLib/position.h b/GcodeProcessorLib/position.h index 5059d5f..7470ae9 100644 --- a/GcodeProcessorLib/position.h +++ b/GcodeProcessorLib/position.h @@ -102,6 +102,6 @@ struct position void set_e_axis_mode(const std::string& e_axis_default_mode); void set_units_default(const std::string& units_default); bool can_take_snapshot(); - bool is_travel() + bool is_travel(); }; #endif
\ No newline at end of file diff --git a/GcodeProcessorLib/utilities.cpp b/GcodeProcessorLib/utilities.cpp index b5a09a6..a723cdf 100644 --- a/GcodeProcessorLib/utilities.cpp +++ b/GcodeProcessorLib/utilities.cpp @@ -176,7 +176,7 @@ double utilities::get_percent_change(double v1, double v2) { if (v1 != 0) { - return ((v2 - v1) / v1) * 100.0; + return ((v2 - v1) / v1); } return 0; } @@ -322,7 +322,7 @@ std::string utilities::dtos(double x, unsigned char precision) */ return buffer; } - +/* bool utilities::case_insensitive_compare_char(char& c1, char& c2) { if (c1 == c2) @@ -331,10 +331,13 @@ bool utilities::case_insensitive_compare_char(char& c1, char& c2) return true; return false; } + /* * Case Insensitive String Comparision - */ + bool utilities::case_insensitive_compare(std::string& str1, std::string& str2) { return ((str1.size() == str2.size()) && std::equal(str1.begin(), str1.end(), str2.begin(), &utilities::case_insensitive_compare_char)); } + +*/
\ No newline at end of file diff --git a/GcodeProcessorLib/utilities.h b/GcodeProcessorLib/utilities.h index 33afd51..acbea6c 100644 --- a/GcodeProcessorLib/utilities.h +++ b/GcodeProcessorLib/utilities.h @@ -41,9 +41,10 @@ public: static double get_cartesian_distance(double x1, double y1, double x2, double y2); static double get_cartesian_distance(double x1, double y1, double z1, double x2, double y2, double z2); - + /* Todo: Implement for gcode comment processor static bool case_insensitive_compare_char(char& c1, char& c2); static bool case_insensitive_compare(std::string& str1, std::string& str2); + */ static std::string to_string(double value); static std::string to_string(int value); static std::string ltrim(const std::string& s); |