29 #include <logger/Logger.hpp>
31 #include "Exception.hpp"
33 using namespace logger;
35 static const std::string s_loggerCat{
"motionlib:axis"};
39 using namespace units;
41 Axis::Axis(
const std::string &address) : DeviceBase{address} {}
45 return DeviceBase::DeviceType::AXIS;
48 std::future<void> Axis::pause()
const
50 throw Exception(ErrorCode::NotSupported,
51 "pause operation not supported on " + uid());
54 std::future<void> Axis::resume()
const
56 throw Exception(ErrorCode::NotSupported,
57 "resume operation not supported on " + uid());
60 std::future<void> Axis::setActualPosition(
const units::Value &)
const
62 throw Exception(ErrorCode::NotSupported,
63 "setActualPosition operation not supported on " + uid());
66 std::future<void> Axis::takeReference(
const std::chrono::milliseconds &)
const
68 throw Exception(ErrorCode::NotSupported,
69 "takeReference operation not supported on " + uid());
72 static const std::map<Axis::State, std::string> s_stateToString{
73 {Axis::State::IDLE,
"idle"},
74 {Axis::State::RUNNING,
"run"},
75 {Axis::State::ERROR,
"error"},
76 {Axis::State::UNKNOWN,
"unknown"}};
80 auto it = s_stateToString.find(state);
82 return (it != s_stateToString.end()) ?
84 s_stateToString.at(Axis::State::UNKNOWN);
const std::string & to_string(Axis::State state)
convert State to string
DeviceType
List of possible device types supported.
main motion-lib namespace