diff options
author | David Crocker <dcrocker@eschertech.com> | 2020-02-16 17:10:43 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2020-02-16 17:10:43 +0300 |
commit | 315f4f47613fe09e613b6c639a7ddc37af3516d2 (patch) | |
tree | 45133ce063bf3bb2c40f522471f0074038168149 /src/Endstops/EndstopsManager.cpp | |
parent | 9885ed7cc55cb19fde1be14c8adfd11dfa7f86cf (diff) |
Replaced HeaterProtection instances by HeaterMonitors
Diffstat (limited to 'src/Endstops/EndstopsManager.cpp')
-rw-r--r-- | src/Endstops/EndstopsManager.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/Endstops/EndstopsManager.cpp b/src/Endstops/EndstopsManager.cpp index b618c25f..052dbd3e 100644 --- a/src/Endstops/EndstopsManager.cpp +++ b/src/Endstops/EndstopsManager.cpp @@ -21,6 +21,7 @@ #include "GCodes/GCodes.h" #include "Movement/Move.h" #include <OutputMemory.h> +#include <Heating/Heat.h> #if SUPPORT_CAN_EXPANSION # include "CanMessageBuffer.h" @@ -38,6 +39,13 @@ ReadWriteLock EndstopsManager::zProbesLock; // Macro to build a standard lambda function that includes the necessary type conversions #define OBJECT_MODEL_FUNC(...) OBJECT_MODEL_FUNC_BODY(EndstopsManager, __VA_ARGS__) +constexpr ObjectModelArrayDescriptor EndstopsManager::sensorsArrayDescriptor = +{ + &Heat::sensorsLock, + [] (const ObjectModel *self, const ObjectExplorationContext&) noexcept -> size_t { return ((const Heat*)self)->GetNumSensorsToReport(); }, + [] (const ObjectModel *self, ObjectExplorationContext& context) noexcept -> ExpressionValue { return ExpressionValue(((const Heat*)self)->FindSensor(context.GetLastIndex()).Ptr()); } +}; + constexpr ObjectModelArrayDescriptor EndstopsManager::endstopsArrayDescriptor = { &endstopsLock, @@ -55,7 +63,7 @@ constexpr ObjectModelArrayDescriptor EndstopsManager::filamentMonitorsArrayDescr constexpr ObjectModelArrayDescriptor EndstopsManager::inputsArrayDescriptor = { - &endstopsLock, + nullptr, [] (const ObjectModel *self, const ObjectExplorationContext&) noexcept -> size_t { return reprap.GetPlatform().GetNumInputsToReport(); }, [] (const ObjectModel *self, ObjectExplorationContext& context) noexcept -> ExpressionValue { return ExpressionValue(&reprap.GetPlatform().GetGpInPort(context.GetLastIndex())); } @@ -73,13 +81,14 @@ constexpr ObjectModelTableEntry EndstopsManager::objectModelTable[] = { // Within each group, these entries must be in alphabetical order // 0. sensors members + { "analog", OBJECT_MODEL_FUNC_NOSELF(&sensorsArrayDescriptor), ObjectModelEntryFlags::live }, { "endstops", OBJECT_MODEL_FUNC_NOSELF(&endstopsArrayDescriptor), ObjectModelEntryFlags::live }, { "filamentMonitors", OBJECT_MODEL_FUNC_NOSELF(&filamentMonitorsArrayDescriptor), ObjectModelEntryFlags::live }, { "inputs", OBJECT_MODEL_FUNC_NOSELF(&inputsArrayDescriptor), ObjectModelEntryFlags::live }, { "probes", OBJECT_MODEL_FUNC_NOSELF(&probesArrayDescriptor), ObjectModelEntryFlags::live }, }; -constexpr uint8_t EndstopsManager::objectModelTableDescriptor[] = { 1, 4 }; +constexpr uint8_t EndstopsManager::objectModelTableDescriptor[] = { 1, 5 }; DEFINE_GET_OBJECT_MODEL_TABLE(EndstopsManager) |