6#include <nlohmann/json_fwd.hpp>
52 std::function<std::expected<ProcedureBody, std::string>(
const nlohmann::json& request)>
makeBody;
86 std::string_view
name);
94 uint16_t devicePosition,
95 std::string_view
name,
96 const nlohmann::json& request);
107 uint16_t devicePosition, std::string_view
name);
Owns the fieldbus driver and node collection, and drives PDO exchange.
Definition device_manager.h:287
Represents a single node on the fieldbus.
Definition device.h:116
Runs off-RT command-and-wait procedures and remembers how each one went.
Definition procedure_manager.h:121
std::string name
Catalogue name, e.g. "sm2".
Definition eni_request.cc:37
Definition bus_health_source.h:7
std::expected< ProcedureSnapshot, ProcedureError > procedureSnapshot(DeviceManager &deviceManager, ProcedureManager &procedureManager, uint16_t devicePosition, std::string_view name)
The current or last-run state of one procedure on one device.
Definition procedure_catalogue.cc:1117
std::expected< ProcedureSnapshot, ProcedureError > startProcedure(DeviceManager &deviceManager, ProcedureManager &procedureManager, uint16_t devicePosition, std::string_view name, const nlohmann::json &request)
Starts name on devicePosition with request as its parameters.
Definition procedure_catalogue.cc:1127
std::expected< void, ProcedureError > cancelProcedure(DeviceManager &deviceManager, ProcedureManager &procedureManager, uint16_t devicePosition, std::string_view name)
Asks the running name on devicePosition to stop.
Definition procedure_catalogue.cc:1150
void to_json(nlohmann::json &j, const Cia402Status &s)
Serialises a Cia402Status. Emits state/modeName as human-readable strings alongside the numeric statu...
Definition cia402_drive.cc:13
std::expected< std::vector< ProcedureListing >, ProcedureError > listProcedures(DeviceManager &deviceManager, ProcedureManager &procedureManager, uint16_t devicePosition)
Every procedure devicePosition supports, each with its current or last-run snapshot.
Definition procedure_catalogue.cc:1101
const std::vector< ProcedureCatalogueEntry > & procedureCatalogue()
Every procedure the server knows, in the order a client should present them.
Definition procedure_catalogue.cc:1089
One procedure, as the catalogue knows it: what it is, who has it, and how to run it.
Definition procedure_catalogue.h:33
std::function< bool(Device &device)> applies
Whether device supports this procedure.
Definition procedure_catalogue.h:41
ProcedureDescriptor descriptor
What a client is told about it.
Definition procedure_catalogue.h:34
std::function< std::expected< ProcedureBody, std::string >(const nlohmann::json &request)> makeBody
Turns a client's request into the body that will run.
Definition procedure_catalogue.h:52
What a procedure is, independent of any run — the half of the catalogue a client needs to render a co...
Definition procedure.h:298
Why a procedure operation could not be performed. A caller must branch on this — an HTTP handler maps...
Definition procedure_manager.h:69
One procedure paired with how its last run on a device went — an entry of GET /api/devices/:pos/proce...
Definition procedure_catalogue.h:67
ProcedureSnapshot snapshot
Definition procedure_catalogue.h:69
ProcedureDescriptor descriptor
Definition procedure_catalogue.h:68
The complete state of a procedure on one device — everything a client polling GET /api/devices/:pos/p...
Definition procedure.h:111