Motion Master 6.0.0-alpha.86
Next-generation motion control software
Loading...
Searching...
No Matches
status.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <nlohmann/json.hpp>
5#include <string>
6
9
10namespace mm::auto_tuning {
11
22struct Status {
24 bool enabled = false;
26 std::string binaryPath;
28 bool installed = false;
30 bool started = false;
33 std::string version;
35 std::uint16_t port = 0;
37 std::string error;
38};
39
41inline void to_json(nlohmann::json& j, const Status& status) {
42 j = nlohmann::json{{"enabled", status.enabled}, {"binaryPath", status.binaryPath},
43 {"installed", status.installed}, {"started", status.started},
44 {"version", status.version}, {"port", status.port},
45 {"error", status.error}};
46}
47
48} // namespace mm::auto_tuning
Definition client.cc:5
void to_json(nlohmann::json &j, const Status &status)
Serialises a Status. Free function found by ADL, as nlohmann expects.
Definition status.h:41
The state of the auto-tuning process, reported by GET /api/auto-tuning.
Definition status.h:22
bool enabled
autoTuning.enabled from the configuration.
Definition status.h:24
std::string version
Definition status.h:33
std::string binaryPath
The executable Motion Master looked for, resolved to an absolute path.
Definition status.h:26
bool installed
Whether a file exists at that path.
Definition status.h:28
bool started
Whether the process started and answered its health endpoint.
Definition status.h:30
std::uint16_t port
The loopback port it was told to serve on.
Definition status.h:35
std::string error
Why it is not running, when it is not. Empty when it is.
Definition status.h:37