10 #include <unordered_map>
11 #include <unordered_set>
14 #include <json/json.h>
15 #include <tbb/mutex.h>
53 const std::string& commandType,
const std::string& objectName =
"");
93 std::shared_ptr<DtCommandSpecJobBuilder>
commandSpecJobFromRwFactory(
const std::string& commandType,
const std::string& objectName)
const;
Definition: scenarioManager.h:40
std::unordered_map< std::string, Json::Value > myCommandSpecOverrides
Definition: commandSpecBuilder.h:112
int level
Definition: commandSpecBuilder.h:101
DtRemoteControlScriptedTaskManager & myScriptedTaskManager
Definition: commandSpecBuilder.h:118
std::string commandType
Definition: commandSpecBuilder.h:99
std::unordered_map< std::string, size_t > myCatalogIndex
Fast lookup from commandType string to index in myCatalog.
Definition: commandSpecBuilder.h:110
static DtCatalogEntry combineCatalogEntries(const DtCatalogEntry &a, const DtCatalogEntry &b)
Combines two catalog entries into one, preferring non-empty fields from the first entry and falling b...
std::unordered_set< std::string > myRwCommandTypes
Set of all RW task/set type strings registered in the VRF factory at construction time...
Definition: commandSpecBuilder.h:124
~DtCommandSpecBuilder()=default
DtCommandSpecBuilder(DtScenarioManager &mgr, const std::string &configFilePath="")
configFilePath — path to an optional JSON file that may override or supplement the built-in command c...
Central registry mapping wire-type strings to async DtCommandSpecParamBuilder factories.
Definition: customParamBuilderRegistry.h:46
std::string myCommandSpecsFilePath
Path passed to the constructor; used for write-back by updateCommandSpecEntry.
Definition: commandSpecBuilder.h:133
Definition: commandSpecBuilder.h:97
Json::Value buildRwCommandSpecsConfig() const
Returns a JSON array of all registered RW command types merged with any existing configuration from c...
static constexpr int theSpecTimeoutMs
Timeout used when waiting for async command spec data.
Definition: commandSpecBuilder.h:145
std::unordered_set< std::string > myVisibleRwCommands
Command types explicitly allowed by commandSpecs.json ("hidden" absent or false). Only populated when...
Definition: commandSpecBuilder.h:128
DtCommandSpecJobHandle buildCommandSpec(const std::string &commandType, const std::string &objectName="")
Returns the full parameter spec for a single command type as a job handle. If objectName is non-empty...
DtScriptedTaskParamSpecBuilder myParamSpecBuilder
Definition: commandSpecBuilder.h:116
std::string displayName
Definition: commandSpecBuilder.h:100
std::shared_ptr< DtCommandSpecJob > DtCommandSpecJobHandle
Shared-ownership handle to a DtCommandSpecJob.
Definition: commandSpecJob.h:57
DtRwCommandSpecBuilder.
Definition: rwCommandSpecBuilder.h:33
Awaitable result handle for asynchronous command spec building.
static std::string groupFromMetaData(const DtScriptedTaskMetaData &metaData)
Returns the group string extracted from the first menu location in metaData. The group is the text th...
Registry of custom command spec parameter builders, keyed on wire type string.
std::vector< DtCatalogEntry > myCatalog
Ordered catalog of all known command types and their display metadata.
Definition: commandSpecBuilder.h:108
Translates catalog JSON parameter descriptors into DtCommandSpecParamBuilder instances.
Definition: catalogParamSpecBuilder.h:24
bool magic
Definition: commandSpecBuilder.h:104
IMGUI_API void Value(const char *prefix, bool b)
bool isHiddenRwCommand(const std::string &commandType) const
Returns true if commandSpecs.json was loaded and the commandType is not listed there (or is listed wi...
Definition: remoteControlScriptedTaskManager.h:29
bool myCommandSpecFileWasLoaded
True once a commandSpecs.json file has been successfully parsed.
Definition: commandSpecBuilder.h:130
std::vector< std::weak_ptr< DtCommandSpecJobBuilder > > myPendingJobBuilders
Weak references to in-progress job builders. Only jobs that were not yet complete at creation time ar...
Definition: commandSpecBuilder.h:168
bool isHiddenCommand(const std::string &commandType) const
Returns true if commandType should be suppressed from the AvailableCommands list sent to web clients...
std::shared_ptr< DtCommandSpecJobBuilder > commandSpecJobFromRwFactory(const std::string &commandType, const std::string &objectName) const
Json::Value myRawFileRoot
Entire parsed commandSpecs.json root. Pre-initialised to {"commands":[]} so that updateCommandSpecEnt...
Definition: commandSpecBuilder.h:137
DtRwCommandSpecBuilder myRwCommandSpecBuilder
Definition: commandSpecBuilder.h:117
void tick()
Advances all pending DtCommandSpecJobBuilder instances: removes expired or completed jobs...
std::string icon
Definition: commandSpecBuilder.h:103
std::string group
Definition: commandSpecBuilder.h:102
std::shared_ptr< DtCommandSpecJobBuilder > commandSpecFromScriptedTaskMetaData(const std::string &commandType, const std::string &objectName) const
DtScriptedTaskParamSpecBuilder.
Definition: scriptedTaskParamSpecBuilder.h:32
Json::Value buildCommandSummaries(const std::vector< std::string > &filter={}) const
Returns a JSON array of lightweight command summaries. If filter is non-empty, only entries whose com...
std::shared_ptr< DtCommandSpecJobBuilder > commandSpecJobFromOverrideFile(const std::string &commandType, const std::string &objectName) const
DtScenarioManager & myScenarioManager
Definition: commandSpecBuilder.h:119
DtCatalogParamSpecBuilder myCatalogParamSpecBuilder
Definition: commandSpecBuilder.h:115
tbb::mutex myWriteMutex
Serialises concurrent configure writes and the config read endpoint.
Definition: commandSpecBuilder.h:139
Translates JSON catalog parameter descriptors into DtCommandSpecParamBuilder instances.
void loadCommandSpecFile(const std::string &filePath)
DtCustomParamBuilderRegistry myCustomParamRegistry
Definition: commandSpecBuilder.h:114
Definition: commandSpecBuilder.h:27
bool updateCommandSpecEntry(const std::string &commandType, const Json::Value &entry)
Upserts the entry for commandType in the in-memory raw config and writes the updated commandSpecs...
static DtCatalogEntry catalogEntryFromScriptedTaskMetaData(const DtScriptedTaskMetaData &metaData)
Extracts the summary catalog fields (CommandType, DisplayName, Group, Icon, Level) from scripted task...