diff options
author | David Crocker <dcrocker@eschertech.com> | 2020-01-05 20:27:13 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2020-01-05 20:27:13 +0300 |
commit | 1d61e272e01727afa810f8aa5acedc051206772d (patch) | |
tree | abd0044c1ea8c1ada382fddf5f5723799bb7eb86 /src/RepRap.cpp | |
parent | 4f1c0947b1a0680679d8e8468f3e2e47be2bfc44 (diff) |
Refactored object model to allow multiple tables per class
Diffstat (limited to 'src/RepRap.cpp')
-rw-r--r-- | src/RepRap.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/RepRap.cpp b/src/RepRap.cpp index 13b2b8ea..33539c26 100644 --- a/src/RepRap.cpp +++ b/src/RepRap.cpp @@ -127,18 +127,20 @@ extern "C" void hsmciIdle(uint32_t stBits, uint32_t dmaBits) noexcept // Macro to build a standard lambda function that includes the necessary type conversions #define OBJECT_MODEL_FUNC(_ret) OBJECT_MODEL_FUNC_BODY(RepRap, _ret) -const ObjectModelTableEntry RepRap::objectModelTable[] = +constexpr ObjectModelTableEntry RepRap::objectModelTable[] = { // These entries are temporary pending design of the object model //TODO design the object model - { "gcodes", OBJECT_MODEL_FUNC(&(self->GetGCodes())), TYPE_OF(ObjectModel), ObjectModelTableEntry::none }, - { "heat", OBJECT_MODEL_FUNC(&(self->GetHeat())), TYPE_OF(ObjectModel), ObjectModelTableEntry::none }, - { "meshProbe", OBJECT_MODEL_FUNC(&(self->GetMove().GetGrid())), TYPE_OF(ObjectModel), ObjectModelTableEntry::none }, - { "move", OBJECT_MODEL_FUNC(&(self->GetMove())), TYPE_OF(ObjectModel), ObjectModelTableEntry::none }, - { "network", OBJECT_MODEL_FUNC(&(self->GetNetwork())), TYPE_OF(ObjectModel), ObjectModelTableEntry::none }, - { "randomProbe", OBJECT_MODEL_FUNC(&(self->GetMove().GetProbePoints())), TYPE_OF(ObjectModel), ObjectModelTableEntry::none }, + { "gcodes", OBJECT_MODEL_FUNC(&(self->GetGCodes())), TYPE_OF(ObjectModel), 0, ObjectModelEntryFlags::none }, + { "heat", OBJECT_MODEL_FUNC(&(self->GetHeat())), TYPE_OF(ObjectModel), 0, ObjectModelEntryFlags::none }, + { "meshProbe", OBJECT_MODEL_FUNC(&(self->GetMove().GetGrid())), TYPE_OF(ObjectModel), 0, ObjectModelEntryFlags::none }, + { "move", OBJECT_MODEL_FUNC(&(self->GetMove())), TYPE_OF(ObjectModel), 0, ObjectModelEntryFlags::none }, + { "network", OBJECT_MODEL_FUNC(&(self->GetNetwork())), TYPE_OF(ObjectModel), 0, ObjectModelEntryFlags::none }, + { "randomProbe", OBJECT_MODEL_FUNC(&(self->GetMove().GetProbePoints())), TYPE_OF(ObjectModel), 0, ObjectModelEntryFlags::none }, }; +constexpr uint8_t RepRap::objectModelTableDescriptor[] = { 1, 6 }; + DEFINE_GET_OBJECT_MODEL_TABLE(RepRap) #endif |