diff options
author | David Crocker <dcrocker@eschertech.com> | 2020-01-22 23:46:13 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2020-01-22 23:46:13 +0300 |
commit | f11710c9cb9f16901437f39b5e07326f3d1ad6bf (patch) | |
tree | 27b6c95c661a56e3a5c3d24b85e934616697cf6b /src/Movement/Kinematics/FiveBarScaraKinematics.cpp | |
parent | ee1ccb5074a1824175c29e3e28fc47d888c15091 (diff) |
Bug fix and more Object Model fields
Fixed bad JSON in M408 reports when no fans are configured
Added more object model fields: kinematics, machine coordinates
Refactored code that generates M408 responses
Diffstat (limited to 'src/Movement/Kinematics/FiveBarScaraKinematics.cpp')
-rw-r--r-- | src/Movement/Kinematics/FiveBarScaraKinematics.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/Movement/Kinematics/FiveBarScaraKinematics.cpp b/src/Movement/Kinematics/FiveBarScaraKinematics.cpp index b35fd3b3..735b88e8 100644 --- a/src/Movement/Kinematics/FiveBarScaraKinematics.cpp +++ b/src/Movement/Kinematics/FiveBarScaraKinematics.cpp @@ -18,6 +18,28 @@ //#define debugPrintf if(0) debugPrintf +#if SUPPORT_OBJECT_MODEL + +// Object model table and functions +// Note: if using GCC version 7.3.1 20180622 and lambda functions are used in this table, you must compile this file with option -std=gnu++17. +// Otherwise the table will be allocated in RAM instead of flash, which wastes too much RAM. + +// Macro to build a standard lambda function that includes the necessary type conversions +#define OBJECT_MODEL_FUNC(...) OBJECT_MODEL_FUNC_BODY(FiveBarScaraKinematics, __VA_ARGS__) + +constexpr ObjectModelTableEntry FiveBarScaraKinematics::objectModelTable[] = +{ + // Within each group, these entries must be in alphabetical order + // 0. kinematics members + { "name", OBJECT_MODEL_FUNC(self->GetName(false)), ObjectModelEntryFlags::none }, +}; + +constexpr uint8_t FiveBarScaraKinematics::objectModelTableDescriptor[] = { 1, 1 }; + +DEFINE_GET_OBJECT_MODEL_TABLE(FiveBarScaraKinematics) + +#endif + FiveBarScaraKinematics::FiveBarScaraKinematics() noexcept : ZLeadscrewKinematics(KinematicsType::scara, DefaultSegmentsPerSecond, DefaultMinSegmentSize, true) { |