diff options
author | Christian Hammacher <bmasterc@gmail.com> | 2020-03-11 17:54:12 +0300 |
---|---|---|
committer | Christian Hammacher <bmasterc@gmail.com> | 2020-03-11 17:54:12 +0300 |
commit | ab57b7730c34b5d16502b072ecbfebb55dbeaa43 (patch) | |
tree | 2b506ce7fbcf9723f88cd475786a13be7b2cd6de | |
parent | 226c386479345204aecbc2f340bb3a126311260d (diff) |
Added some more missing OM fields
-rw-r--r-- | src/Endstops/ZProbe.cpp | 2 | ||||
-rw-r--r-- | src/FilamentMonitors/LaserFilamentMonitor.cpp | 2 | ||||
-rw-r--r-- | src/GCodes/GCodeBuffer/GCodeBuffer.cpp | 3 | ||||
-rw-r--r-- | src/GPIO/GpioPorts.cpp | 3 | ||||
-rw-r--r-- | src/Heating/Heater.cpp | 4 | ||||
-rw-r--r-- | src/Heating/Sensors/TemperatureSensor.cpp | 3 | ||||
-rw-r--r-- | src/Heating/Sensors/TmcDriverTemperatureSensor.cpp | 2 | ||||
-rw-r--r-- | src/Heating/Sensors/TmcDriverTemperatureSensor.h | 1 | ||||
-rw-r--r-- | src/Networking/HttpResponder.cpp | 2 | ||||
-rw-r--r-- | src/Networking/HttpResponder.h | 4 | ||||
-rw-r--r-- | src/Networking/Network.cpp | 2 | ||||
-rw-r--r-- | src/Platform.cpp | 20 | ||||
-rw-r--r-- | src/PrintMonitor.cpp | 10 | ||||
-rw-r--r-- | src/PrintMonitor.h | 4 | ||||
-rw-r--r-- | src/RepRap.cpp | 12 |
15 files changed, 43 insertions, 31 deletions
diff --git a/src/Endstops/ZProbe.cpp b/src/Endstops/ZProbe.cpp index ae1e97f9..5f2856d9 100644 --- a/src/Endstops/ZProbe.cpp +++ b/src/Endstops/ZProbe.cpp @@ -80,7 +80,7 @@ ZProbe::ZProbe(unsigned int num, ZProbeType p_type) noexcept : EndstopOrZProbe() void ZProbe::SetDefaults() noexcept { adcValue = DefaultZProbeADValue; - xOffset= yOffset = 0.0; + xOffset = yOffset = 0.0; triggerHeight = DefaultZProbeTriggerHeight; calibTemperature = DefaultZProbeTemperature; temperatureCoefficient = 0.0; diff --git a/src/FilamentMonitors/LaserFilamentMonitor.cpp b/src/FilamentMonitors/LaserFilamentMonitor.cpp index 0af69841..498c8ecd 100644 --- a/src/FilamentMonitors/LaserFilamentMonitor.cpp +++ b/src/FilamentMonitors/LaserFilamentMonitor.cpp @@ -45,7 +45,7 @@ constexpr ObjectModelTableEntry LaserFilamentMonitor::objectModelTable[] = // 2. LaserFilamentMonitor.configured members { "percentMax", OBJECT_MODEL_FUNC(ConvertToPercent(self->maxMovementAllowed)), ObjectModelEntryFlags::none }, { "percentMin", OBJECT_MODEL_FUNC(ConvertToPercent(self->minMovementAllowed)), ObjectModelEntryFlags::none }, - { "sampleDistance", OBJECT_MODEL_FUNC(self->minimumExtrusionCheckLength, 1), ObjectModelEntryFlags::none }, + { "sampleDistance", OBJECT_MODEL_FUNC(self->minimumExtrusionCheckLength, 1), ObjectModelEntryFlags::none }, }; constexpr uint8_t LaserFilamentMonitor::objectModelTableDescriptor[] = { 3, 5, 4, 3 }; diff --git a/src/GCodes/GCodeBuffer/GCodeBuffer.cpp b/src/GCodes/GCodeBuffer/GCodeBuffer.cpp index c118e3bc..e84a0058 100644 --- a/src/GCodes/GCodeBuffer/GCodeBuffer.cpp +++ b/src/GCodes/GCodeBuffer/GCodeBuffer.cpp @@ -55,10 +55,11 @@ constexpr ObjectModelTableEntry GCodeBuffer::objectModelTable[] = { "name", OBJECT_MODEL_FUNC(self->codeChannel.ToString()), ObjectModelEntryFlags::none }, { "stackDepth", OBJECT_MODEL_FUNC((int32_t)self->GetStackDepth()), ObjectModelEntryFlags::none }, { "state", OBJECT_MODEL_FUNC(self->GetStateText()), ObjectModelEntryFlags::live }, + { "toolNumberAdjust", OBJECT_MODEL_FUNC((int32_t)self->GetToolNumberAdjust()), ObjectModelEntryFlags::live }, { "volumetric", OBJECT_MODEL_FUNC((bool)self->machineState->volumetricExtrusion), ObjectModelEntryFlags::none }, }; -constexpr uint8_t GCodeBuffer::objectModelTableDescriptor[] = { 1, 11 }; +constexpr uint8_t GCodeBuffer::objectModelTableDescriptor[] = { 1, 12 }; DEFINE_GET_OBJECT_MODEL_TABLE(GCodeBuffer) diff --git a/src/GPIO/GpioPorts.cpp b/src/GPIO/GpioPorts.cpp index 89440a23..e4940741 100644 --- a/src/GPIO/GpioPorts.cpp +++ b/src/GPIO/GpioPorts.cpp @@ -23,13 +23,14 @@ // Macro to build a standard lambda function that includes the necessary type conversions #define OBJECT_MODEL_FUNC(...) OBJECT_MODEL_FUNC_BODY(GpInputPort, __VA_ARGS__) +#define OBJECT_MODEL_FUNC_IF(_condition,...) OBJECT_MODEL_FUNC_IF_BODY(GpInputPort, _condition,__VA_ARGS__) constexpr ObjectModelTableEntry GpInputPort::objectModelTable[] = { // Within each group, these entries must be in alphabetical order // 0. sensors members { "configured", OBJECT_MODEL_FUNC(!self->IsUnused()), ObjectModelEntryFlags::none }, - { "value", OBJECT_MODEL_FUNC(self->GetState()), ObjectModelEntryFlags::live }, + { "value", OBJECT_MODEL_FUNC_IF(!self->IsUnused(), self->GetState()), ObjectModelEntryFlags::live }, }; constexpr uint8_t GpInputPort::objectModelTableDescriptor[] = { 1, 2 }; diff --git a/src/Heating/Heater.cpp b/src/Heating/Heater.cpp index 5e509801..7479fba9 100644 --- a/src/Heating/Heater.cpp +++ b/src/Heating/Heater.cpp @@ -36,12 +36,14 @@ constexpr ObjectModelTableEntry Heater::objectModelTable[] = { // Within each group, these entries must be in alphabetical order // 0. Heater members + { "active", OBJECT_MODEL_FUNC(self->GetActiveTemperature(), 1), ObjectModelEntryFlags::live }, { "current", OBJECT_MODEL_FUNC(self->GetTemperature(), 1), ObjectModelEntryFlags::live }, { "max", OBJECT_MODEL_FUNC(self->GetHighestTemperatureLimit(), 1), ObjectModelEntryFlags::none }, { "min", OBJECT_MODEL_FUNC(self->GetLowestTemperatureLimit(), 1), ObjectModelEntryFlags::none }, { "model", OBJECT_MODEL_FUNC((const FopDt *)&self->GetModel()), ObjectModelEntryFlags::verbose }, { "monitors", OBJECT_MODEL_FUNC_NOSELF(&monitorsArrayDescriptor), ObjectModelEntryFlags::none }, { "sensor", OBJECT_MODEL_FUNC((int32_t)self->GetSensorNumber()), ObjectModelEntryFlags::none }, + { "standby", OBJECT_MODEL_FUNC(self->GetStandbyTemperature(), 1), ObjectModelEntryFlags::live }, { "state", OBJECT_MODEL_FUNC(self->GetStatus().ToString()), ObjectModelEntryFlags::live }, // 1. Heater.monitors[] members @@ -52,7 +54,7 @@ constexpr ObjectModelTableEntry Heater::objectModelTable[] = self->monitors[context.GetLastIndex()].GetTemperatureLimit(), 1), ObjectModelEntryFlags::none }, }; -constexpr uint8_t Heater::objectModelTableDescriptor[] = { 2, 7, 3 }; +constexpr uint8_t Heater::objectModelTableDescriptor[] = { 2, 9, 3 }; DEFINE_GET_OBJECT_MODEL_TABLE(Heater) diff --git a/src/Heating/Sensors/TemperatureSensor.cpp b/src/Heating/Sensors/TemperatureSensor.cpp index aea51e8f..d4dc7aba 100644 --- a/src/Heating/Sensors/TemperatureSensor.cpp +++ b/src/Heating/Sensors/TemperatureSensor.cpp @@ -39,10 +39,11 @@ constexpr ObjectModelTableEntry TemperatureSensor::objectModelTable[] = // 0. TemperatureSensor members { "lastReading", OBJECT_MODEL_FUNC(self->lastTemperature, 1), ObjectModelEntryFlags::live }, { "name", OBJECT_MODEL_FUNC(self->sensorName), ObjectModelEntryFlags::none }, + { "number", OBJECT_MODEL_FUNC((int32_t)self->sensorNumber), ObjectModelEntryFlags::none }, { "type", OBJECT_MODEL_FUNC(self->GetShortSensorType()), ObjectModelEntryFlags::none }, }; -constexpr uint8_t TemperatureSensor::objectModelTableDescriptor[] = { 1, 3 }; +constexpr uint8_t TemperatureSensor::objectModelTableDescriptor[] = { 1, 4 }; DEFINE_GET_OBJECT_MODEL_TABLE(TemperatureSensor) diff --git a/src/Heating/Sensors/TmcDriverTemperatureSensor.cpp b/src/Heating/Sensors/TmcDriverTemperatureSensor.cpp index 4d387c7f..d9612ea0 100644 --- a/src/Heating/Sensors/TmcDriverTemperatureSensor.cpp +++ b/src/Heating/Sensors/TmcDriverTemperatureSensor.cpp @@ -19,7 +19,7 @@ TmcDriverTemperatureSensor::TmcDriverTemperatureSensor(unsigned int sensorNum, u const char *TmcDriverTemperatureSensor::GetShortSensorType() const noexcept { #ifdef DUET_NG - return (channel == 1) ? DuexTypeName : PrimaryTypeName; + return (channel == 1) ? DuexTypeShortName : PrimaryTypeName; #else return PrimaryTypeName; #endif diff --git a/src/Heating/Sensors/TmcDriverTemperatureSensor.h b/src/Heating/Sensors/TmcDriverTemperatureSensor.h index a7d842cc..ca89cc44 100644 --- a/src/Heating/Sensors/TmcDriverTemperatureSensor.h +++ b/src/Heating/Sensors/TmcDriverTemperatureSensor.h @@ -24,6 +24,7 @@ public: static constexpr const char *PrimaryTypeName = "drivers"; #ifdef DUET_NG static constexpr const char *DuexTypeName = "drivers-duex"; + static constexpr const char *DuexTypeShortName = "driversduex"; #endif private: diff --git a/src/Networking/HttpResponder.cpp b/src/Networking/HttpResponder.cpp index 1c757514..bc0f1def 100644 --- a/src/Networking/HttpResponder.cpp +++ b/src/Networking/HttpResponder.cpp @@ -1515,7 +1515,7 @@ HttpResponder::HttpSession HttpResponder::sessions[MaxHttpSessions]; unsigned int HttpResponder::numSessions = 0; unsigned int HttpResponder::clientsServed = 0; -volatile uint32_t HttpResponder::seq = 0; +volatile uint16_t HttpResponder::seq = 0; volatile OutputStack HttpResponder::gcodeReply; Mutex HttpResponder::gcodeReplyMutex; diff --git a/src/Networking/HttpResponder.h b/src/Networking/HttpResponder.h index d1f37106..c329210a 100644 --- a/src/Networking/HttpResponder.h +++ b/src/Networking/HttpResponder.h @@ -23,7 +23,7 @@ public: static void Disable() noexcept; static void HandleGCodeReply(const char *reply) noexcept; static void HandleGCodeReply(OutputBuffer *reply) noexcept; - static uint32_t GetReplySeq() noexcept { return seq; } + static uint16_t GetReplySeq() noexcept { return seq; } static void CheckSessions() noexcept; static void CommonDiagnostics(MessageType mtype) noexcept; @@ -126,7 +126,7 @@ private: static unsigned int clientsServed; // Responses from GCodes class - static volatile uint32_t seq; // Sequence number for G-Code replies + static volatile uint16_t seq; // Sequence number for G-Code replies static volatile OutputStack gcodeReply; static Mutex gcodeReplyMutex; }; diff --git a/src/Networking/Network.cpp b/src/Networking/Network.cpp index 734eb850..5053da6e 100644 --- a/src/Networking/Network.cpp +++ b/src/Networking/Network.cpp @@ -41,7 +41,7 @@ #ifdef __LPC17xx__ constexpr size_t NetworkStackWords = 375; #else -constexpr size_t NetworkStackWords = 550; // need to be enough to support rr_model +constexpr size_t NetworkStackWords = 575; // need to be enough to support rr_model #endif static Task<NetworkStackWords> networkTask; diff --git a/src/Platform.cpp b/src/Platform.cpp index fe2130d9..dd5f50fa 100644 --- a/src/Platform.cpp +++ b/src/Platform.cpp @@ -222,7 +222,9 @@ constexpr ObjectModelTableEntry Platform::objectModelTable[] = #if SUPPORT_CAN_EXPANSION { "canAddress", OBJECT_MODEL_FUNC_NOSELF((int32_t)0), ObjectModelEntryFlags::none }, #endif + { "firmwareDate", OBJECT_MODEL_FUNC_NOSELF(DATE), ObjectModelEntryFlags::none }, { "firmwareFileName", OBJECT_MODEL_FUNC_NOSELF(IAP_FIRMWARE_FILE), ObjectModelEntryFlags::none }, + { "firmwareName", OBJECT_MODEL_FUNC_NOSELF(FIRMWARE_NAME), ObjectModelEntryFlags::none }, { "firmwareVersion", OBJECT_MODEL_FUNC_NOSELF(VERSION), ObjectModelEntryFlags::none }, #if HAS_LINUX_INTERFACE { "iapFileNameSBC", OBJECT_MODEL_FUNC_NOSELF(IAP_UPDATE_FILE_SBC), ObjectModelEntryFlags::none }, @@ -238,6 +240,7 @@ constexpr ObjectModelTableEntry Platform::objectModelTable[] = { "name", OBJECT_MODEL_FUNC_NOSELF(BOARD_NAME), ObjectModelEntryFlags::none }, { "shortName", OBJECT_MODEL_FUNC_NOSELF(BOARD_SHORT_NAME), ObjectModelEntryFlags::none }, # endif + { "supports12864", OBJECT_MODEL_FUNC_NOSELF(SUPPORT_12864_LCD ? true : false), ObjectModelEntryFlags::none }, #if HAS_12V_MONITOR { "v12", OBJECT_MODEL_FUNC(self, 7), ObjectModelEntryFlags::live }, #endif @@ -256,6 +259,7 @@ constexpr ObjectModelTableEntry Platform::objectModelTable[] = // 3. move.axes[] members { "acceleration", OBJECT_MODEL_FUNC(self->Acceleration(context.GetLastIndex()), 1), ObjectModelEntryFlags::none }, { "babystep", OBJECT_MODEL_FUNC_NOSELF(reprap.GetGCodes().GetTotalBabyStepOffset(context.GetLastIndex()), 3), ObjectModelEntryFlags::none }, + { "current", OBJECT_MODEL_FUNC(self->GetMotorCurrent(context.GetLastIndex(), 906), 3), ObjectModelEntryFlags::none }, { "drivers", OBJECT_MODEL_FUNC_NOSELF(&axisDriversArrayDescriptor), ObjectModelEntryFlags::none }, { "homed", OBJECT_MODEL_FUNC_NOSELF(reprap.GetGCodes().IsAxisHomed(context.GetLastIndex())), ObjectModelEntryFlags::live }, { "jerk", OBJECT_MODEL_FUNC(MinutesToSeconds * self->GetInstantDv(context.GetLastIndex()), 1), ObjectModelEntryFlags::none }, @@ -271,13 +275,19 @@ constexpr ObjectModelTableEntry Platform::objectModelTable[] = { "workplaceOffsets", OBJECT_MODEL_FUNC_NOSELF(&workplaceOffsetsArrayDescriptor), ObjectModelEntryFlags::none }, // 4. move.extruders[] members + { "acceleration", OBJECT_MODEL_FUNC(self->Acceleration(ExtruderToLogicalDrive(context.GetLastIndex())), 1), ObjectModelEntryFlags::none }, + { "current", OBJECT_MODEL_FUNC(self->GetMotorCurrent(ExtruderToLogicalDrive(context.GetLastIndex()), 906), 3), ObjectModelEntryFlags::none }, { "driver", OBJECT_MODEL_FUNC(self->extruderDrivers[context.GetLastIndex()]), ObjectModelEntryFlags::none }, { "factor", OBJECT_MODEL_FUNC_NOSELF(reprap.GetGCodes().GetExtrusionFactor(context.GetLastIndex()), 1), ObjectModelEntryFlags::none }, { "filament", OBJECT_MODEL_FUNC_NOSELF(GetFilamentName(context.GetLastIndex())), ObjectModelEntryFlags::none }, + { "jerk", OBJECT_MODEL_FUNC(MinutesToSeconds * self->GetInstantDv(ExtruderToLogicalDrive(context.GetLastIndex())), 1), ObjectModelEntryFlags::none }, { "nonlinear", OBJECT_MODEL_FUNC(self, 5), ObjectModelEntryFlags::none }, + { "position", OBJECT_MODEL_FUNC_NOSELF(ExpressionValue(reprap.GetMove().LiveCoordinate(ExtruderToLogicalDrive(context.GetLastIndex()), reprap.GetCurrentTool()), 1)), ObjectModelEntryFlags::live }, { "pressureAdvance", OBJECT_MODEL_FUNC(self->GetPressureAdvance(context.GetLastIndex()), 2), ObjectModelEntryFlags::none }, + { "rawPosition", OBJECT_MODEL_FUNC_NOSELF(ExpressionValue(reprap.GetGCodes().GetRawExtruderTotalByDrive(context.GetLastIndex()), 1)), ObjectModelEntryFlags::live }, + { "speed", OBJECT_MODEL_FUNC(MinutesToSeconds * self->MaxFeedrate(ExtruderToLogicalDrive(context.GetLastIndex())), 1), ObjectModelEntryFlags::none }, - // 5. move.extruders[].nonlinear members + // 5. move.extruders[].pressureAdvance members { "a", OBJECT_MODEL_FUNC(self->nonlinearExtrusionA[context.GetLastIndex()], 3), ObjectModelEntryFlags::none }, { "b", OBJECT_MODEL_FUNC(self->nonlinearExtrusionB[context.GetLastIndex()], 3), ObjectModelEntryFlags::none }, { "upperLimit", OBJECT_MODEL_FUNC(self->nonlinearExtrusionLimit[context.GetLastIndex()], 2), ObjectModelEntryFlags::none }, @@ -294,12 +304,12 @@ constexpr ObjectModelTableEntry Platform::objectModelTable[] = constexpr uint8_t Platform::objectModelTableDescriptor[] = { 6 + HAS_12V_MONITOR, // number of sections - 9 + HAS_LINUX_INTERFACE + HAS_12V_MONITOR + SUPPORT_CAN_EXPANSION, // section 0: boards[] + 12 + HAS_LINUX_INTERFACE + HAS_12V_MONITOR + SUPPORT_CAN_EXPANSION, // section 0: boards[] 3, // section 1: mcuTemp 3, // section 2: vIn - 15, // section 3: move.axes[] - 5, // section 4: move.extruders[] - 3, // section 5: move.extruders[].nonlinear + 16, // section 3: move.axes[] + 11, // section 4: move.extruders[] + 3, // section 5: move.extruders[].pressureAdvance #if HAS_12V_MONITOR 3 // section 7: v12 #endif diff --git a/src/PrintMonitor.cpp b/src/PrintMonitor.cpp index 5c911b27..3bcb678b 100644 --- a/src/PrintMonitor.cpp +++ b/src/PrintMonitor.cpp @@ -44,19 +44,11 @@ const ObjectModelArrayDescriptor PrintMonitor::filamentArrayDescriptor = { return ExpressionValue(((const PrintMonitor*)self)->printingFileInfo.filamentNeeded[context.GetIndex(0)], 1); } }; -const ObjectModelArrayDescriptor PrintMonitor::extrudedRawArrayDescriptor = -{ - nullptr, // no lock needed - [] (const ObjectModel *self, const ObjectExplorationContext&) noexcept -> size_t { return reprap.GetGCodes().GetNumExtruders(); }, - [] (const ObjectModel *self, ObjectExplorationContext& context) noexcept -> ExpressionValue { return ExpressionValue(reprap.GetGCodes().GetRawExtruderTotalByDrive(context.GetIndex(0)), 1); } -}; - constexpr ObjectModelTableEntry PrintMonitor::objectModelTable[] = { // Within each group, these entries must be in alphabetical order // 0. PrintMonitor members { "duration", OBJECT_MODEL_FUNC_IF(self->IsPrinting(), self->GetPrintDuration(), 1), ObjectModelEntryFlags::live }, - { "extrudedRaw", OBJECT_MODEL_FUNC_NOSELF(&extrudedRawArrayDescriptor), ObjectModelEntryFlags::live }, { "file", OBJECT_MODEL_FUNC(self, 1), ObjectModelEntryFlags::none }, { "filePosition", OBJECT_MODEL_FUNC_NOSELF(reprap.GetGCodes().GetFilePosition(), 0), ObjectModelEntryFlags::live }, { "lastFileName", OBJECT_MODEL_FUNC_IF(!self->filenameBeingPrinted.IsEmpty(), self->filenameBeingPrinted.c_str()), ObjectModelEntryFlags::none }, @@ -85,7 +77,7 @@ constexpr ObjectModelTableEntry PrintMonitor::objectModelTable[] = { "layer", OBJECT_MODEL_FUNC(self->EstimateTimeLeftAsExpression(layerBased)), ObjectModelEntryFlags::live }, }; -constexpr uint8_t PrintMonitor::objectModelTableDescriptor[] = { 3, 9, 11, 3 }; +constexpr uint8_t PrintMonitor::objectModelTableDescriptor[] = { 3, 8, 11, 3 }; DEFINE_GET_OBJECT_MODEL_TABLE(PrintMonitor) diff --git a/src/PrintMonitor.h b/src/PrintMonitor.h index b6c4263b..eaa89b40 100644 --- a/src/PrintMonitor.h +++ b/src/PrintMonitor.h @@ -73,9 +73,7 @@ public: protected: DECLARE_OBJECT_MODEL - - static const ObjectModelArrayDescriptor filamentArrayDescriptor; - static const ObjectModelArrayDescriptor extrudedRawArrayDescriptor; + OBJECT_MODEL_ARRAY(filament) private: Platform& platform; diff --git a/src/RepRap.cpp b/src/RepRap.cpp index 24bec8c0..4cc68277 100644 --- a/src/RepRap.cpp +++ b/src/RepRap.cpp @@ -7,6 +7,9 @@ #include "Heating/Heat.h" #include "Heating/Sensors/TemperatureSensor.h" #include "Network.h" +#if HAS_NETWORKING +# include "Networking/HttpResponder.h" +#endif #include "Platform.h" #include "Scanner.h" #include "PrintMonitor.h" @@ -251,7 +254,7 @@ constexpr ObjectModelTableEntry RepRap::objectModelTable[] = { "atxPower", OBJECT_MODEL_FUNC_IF(self->gCodes->AtxPowerControlled(), self->platform->AtxPower()), ObjectModelEntryFlags::live }, { "beep", OBJECT_MODEL_FUNC(self, 4), ObjectModelEntryFlags::live }, { "currentTool", OBJECT_MODEL_FUNC((int32_t)self->GetCurrentToolNumber()), ObjectModelEntryFlags::live }, - { "displayMessage", OBJECT_MODEL_FUNC(&self->message), ObjectModelEntryFlags::live }, + { "displayMessage", OBJECT_MODEL_FUNC(self->message.c_str()), ObjectModelEntryFlags::live }, { "laserPwm", OBJECT_MODEL_FUNC(self->platform->GetLaserPwm(), 2), ObjectModelEntryFlags::live }, #if HAS_MASS_STORAGE { "logFile", OBJECT_MODEL_FUNC(self->platform->GetLogFileName()), ObjectModelEntryFlags::none }, @@ -259,6 +262,7 @@ constexpr ObjectModelTableEntry RepRap::objectModelTable[] = { "logFile", OBJECT_MODEL_FUNC(nullptr), ObjectModelEntryFlags::none }, #endif { "machineMode", OBJECT_MODEL_FUNC(self->gCodes->GetMachineModeString()), ObjectModelEntryFlags::none }, + { "messageBox", OBJECT_MODEL_FUNC_IF(self->mbox.active, self, 5), ObjectModelEntryFlags::live }, { "previousTool", OBJECT_MODEL_FUNC((int32_t)self->previousToolNumber), ObjectModelEntryFlags::live }, { "status", OBJECT_MODEL_FUNC(self->GetStatusString()), ObjectModelEntryFlags::live }, { "upTime", OBJECT_MODEL_FUNC_NOSELF((int32_t)((millis64()/1000u) & 0x7FFFFFFF)), ObjectModelEntryFlags::live }, @@ -285,16 +289,18 @@ constexpr ObjectModelTableEntry RepRap::objectModelTable[] = // no need for 'limits' because it never changes { "move", OBJECT_MODEL_FUNC((int32_t)self->moveSeq), ObjectModelEntryFlags::live }, { "network", OBJECT_MODEL_FUNC((int32_t)self->networkSeq), ObjectModelEntryFlags::live }, +#if HAS_NETWORKING + { "reply", OBJECT_MODEL_FUNC_NOSELF((int32_t)HttpResponder::GetReplySeq()), ObjectModelEntryFlags::live }, +#endif { "scanner", OBJECT_MODEL_FUNC((int32_t)self->scannerSeq), ObjectModelEntryFlags::live }, { "sensors", OBJECT_MODEL_FUNC((int32_t)self->sensorsSeq), ObjectModelEntryFlags::live }, { "spindles", OBJECT_MODEL_FUNC((int32_t)self->spindlesSeq), ObjectModelEntryFlags::live }, { "state", OBJECT_MODEL_FUNC((int32_t)self->stateSeq), ObjectModelEntryFlags::live }, // TODO Add storages here { "tools", OBJECT_MODEL_FUNC((int32_t)self->toolsSeq), ObjectModelEntryFlags::live }, - }; -constexpr uint8_t RepRap::objectModelTableDescriptor[] = { 7, 15, 7, 22, 10, 2, 6, 13 }; +constexpr uint8_t RepRap::objectModelTableDescriptor[] = { 7, 15, 7, 22, 11, 2, 6, 13 + HAS_NETWORKING }; DEFINE_GET_OBJECT_MODEL_TABLE(RepRap) |