From cc2b7baab661e41aa8276c60a233096368f12ae9 Mon Sep 17 00:00:00 2001 From: Mitch Bradley Date: Fri, 16 Jul 2021 18:33:43 -1000 Subject: [PATCH] $axes/x will display the subtree. --- Grbl_Esp32/src/Configuration/Generator.cpp | 2 +- Grbl_Esp32/src/Configuration/Generator.h | 2 +- Grbl_Esp32/src/Configuration/RuntimeSetting.cpp | 10 ++++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Grbl_Esp32/src/Configuration/Generator.cpp b/Grbl_Esp32/src/Configuration/Generator.cpp index 5385f157..02e9bec0 100644 --- a/Grbl_Esp32/src/Configuration/Generator.cpp +++ b/Grbl_Esp32/src/Configuration/Generator.cpp @@ -25,7 +25,7 @@ #include namespace Configuration { - Generator::Generator(SimpleOutputStream& dst) : indent_(0), dst_(dst) { + Generator::Generator(SimpleOutputStream& dst, int indent) : indent_(indent), dst_(dst) { std::atomic_thread_fence(std::memory_order::memory_order_seq_cst); } diff --git a/Grbl_Esp32/src/Configuration/Generator.h b/Grbl_Esp32/src/Configuration/Generator.h index ed94a941..d977ef90 100644 --- a/Grbl_Esp32/src/Configuration/Generator.h +++ b/Grbl_Esp32/src/Configuration/Generator.h @@ -53,7 +53,7 @@ namespace Configuration { HandlerType handlerType() override { return HandlerType::Generator; } public: - Generator(SimpleOutputStream& dst); + Generator(SimpleOutputStream& dst, int indent = 0); void item(const char* name, int& value, int32_t minValue, int32_t maxValue) override { indent(); diff --git a/Grbl_Esp32/src/Configuration/RuntimeSetting.cpp b/Grbl_Esp32/src/Configuration/RuntimeSetting.cpp index f0fa3f6b..ab3bfdc9 100644 --- a/Grbl_Esp32/src/Configuration/RuntimeSetting.cpp +++ b/Grbl_Esp32/src/Configuration/RuntimeSetting.cpp @@ -45,6 +45,16 @@ namespace Configuration { // Handle child: value->group(*this); + } else { + if (newValue_ == nullptr) { + ClientStream ss(CLIENT_ALL); + ss << setting_ << ":\n"; + Configuration::Generator generator(ss, 1); + value->group(generator); + isHandled_ = true; + } else { + log_error("Can't set a value on a section"); + } } // Restore situation: