diff --git a/Common/Cpp/Options/BatchOption.cpp b/Common/Cpp/Options/BatchOption.cpp index a3747e0ad6..d9c309a9a9 100644 --- a/Common/Cpp/Options/BatchOption.cpp +++ b/Common/Cpp/Options/BatchOption.cpp @@ -95,6 +95,9 @@ FixedLimitVector BatchOption::options() const{ } return ret; } +const std::vector>& keyed_options(const BatchOption& batch){ + return batch.m_data->m_options; +} diff --git a/Common/Cpp/Options/BatchOption.h b/Common/Cpp/Options/BatchOption.h index c8ac257570..ec9b21a131 100644 --- a/Common/Cpp/Options/BatchOption.h +++ b/Common/Cpp/Options/BatchOption.h @@ -7,6 +7,9 @@ #ifndef PokemonAutomation_Options_BatchOption_H #define PokemonAutomation_Options_BatchOption_H +#include +#include +#include #include "Common/Cpp/Containers/Pimpl.h" #include "Common/Cpp/Containers/FixedLimitVector.h" #include "ConfigOption.h" @@ -42,6 +45,8 @@ class BatchOption : public UiState{ bool horizontal() const; FixedLimitVector options() const; + friend const std::vector>& keyed_options(const BatchOption& batch); + private: struct Data; @@ -51,5 +56,11 @@ class BatchOption : public UiState{ +// Each option of `batch` with the key it is saved under in to_json(), in the +// order they were added. Static options have an empty key. +const std::vector>& keyed_options(const BatchOption& batch); + + + } #endif diff --git a/SerialPrograms/Source/CommonFramework/Windows/Lab.md b/SerialPrograms/Source/CommonFramework/Windows/Lab.md index d64089d611..3a0bda6b0b 100644 --- a/SerialPrograms/Source/CommonFramework/Windows/Lab.md +++ b/SerialPrograms/Source/CommonFramework/Windows/Lab.md @@ -112,6 +112,7 @@ program. | `start [SECONDS]` | What clicking Start Program does. Refused unless the program is `STOPPED`. First waits up to `SECONDS` (default 30) for `controller=ready`, and refuses with `controller not connected` if it never is, instead of starting a program that would fail with "Incompatible Controller". | | `stop` | What clicking Stop Program does. Refused unless the program is `RUNNING`. The request goes on; the program stops in the background. | | `state` | Prints the state file's lines into the journal. (In the Command File Runner program, `state [image]` prints the detectors that fire instead; from the channel use `detect` per detector.) | +| `describe_program` | Prints the selected program's id and the static contract of its options as one line, `describe_program `; see [Describe program](#describe-program). Reads only: needs no owner token and no console. Refused when the selected panel is not a program. | | `snapshot LABEL [TIMEOUT_MS]` | Saves the first video frame newer than this line as `_