29#ifdef _USE_SYSTEM_JSONLIB
30#include <nlohmann/json.hpp>
75 explicit Communication(
const std::string &name,
int port) : m_DeviceName(name), m_PortFD(port) {}
78 return m_DeviceName.c_str();
84 T *response =
nullptr);
94 template <
typename T =
int32_t>
bool get(
NodeType type,
const std::string ¶meter, T &value);
124 std::string m_DeviceName;
128 static constexpr const int DRIVER_LEN {4096};
129 static const char DRIVER_STOP_CHAR { 0xD };
130 static const char DRIVER_TIMEOUT { 5 };
139 Focuser(
const std::string &name,
int port);
248 bool moveIn(uint32_t steps);
261 Esatto(
const std::string &name,
int port);
280 explicit Arco(
const std::string &name,
int port);
312 std::unique_ptr<Communication> m_Communication;
323 explicit GIOTTO(
const std::string &name,
int port);
336 std::unique_ptr<Communication> m_Communication;
347 explicit ALTO(
const std::string &name,
int port);
363 bool close(
bool fast =
false);
364 bool open(
bool fast =
false);
370 std::unique_ptr<Communication> m_Communication;
bool close(bool fast=false)
bool storeClosedPosition()
bool getPosition(uint8_t &value)
bool getModel(std::string &model)
bool setPosition(uint8_t value)
bool open(bool fast=false)
bool getStatus(json &status)
bool setEnabled(bool enabled)
bool getModel(std::string &model)
bool getStatus(json &status)
bool getMotorInfo(json &info)
bool moveAbsolutePoition(Units unit, double value)
bool sync(Units unit, double value)
bool getSerialNumber(std::string &response)
bool getAbsolutePosition(Units unit, double &value)
bool reverse(bool enabled)
bool getFirmwareVersion(std::string &response)
bool command(NodeType type, const json &jsonCommand)
bool genericRequest(const std::string &node, const std::string &type, const json &command, T *response=nullptr)
bool sendRequest(const json &command, json *response=nullptr)
const char * getDeviceName()
bool getStringAsDouble(NodeType type, const std::string ¶meter, double &value)
getStringAsDouble Same as get, but it receives a string and scan it for double.
bool get(NodeType type, const std::string ¶meter, T &value)
Communication(const std::string &name, int port)
bool set(NodeType type, const json &value)
bool setBacklash(uint32_t steps)
bool getBacklash(uint32_t &steps)
bool getVoltageUSB(double &value)
bool getModel(std::string &model)
bool getVoltage12v(double &value)
std::unique_ptr< Communication > m_Communication
bool getAbsolutePosition(uint32_t &position)
bool getExternalTemp(double &value)
bool isHallSensorDetected(bool &isDetected)
bool getSerialNumber(std::string &response)
bool getFirmwareVersion(std::string &response)
bool setBacklash(uint32_t steps)
bool getCurrentSpeed(uint32_t &speed)
bool getModel(std::string &model)
bool getMotorTemp(double &value)
bool getMaxPosition(uint32_t &position)
bool getStatus(json &status)
bool getBacklash(uint32_t &steps)
bool goAbsolutePosition(uint32_t position)
bool getMaxBrightness(uint16_t &value)
bool getModel(std::string &model)
bool setLightEnabled(bool enabled)
bool getBrightness(uint16_t &value)
bool setBrightness(uint16_t value)
bool getMotorSettings(struct MotorRates &rates, struct MotorCurrents ¤ts, bool &motorHoldActive)
bool setMotorCurrents(const MotorCurrents ¤ts)
bool setMotorHold(bool hold)
const char * getDeviceName()
bool applyMotorPreset(const std::string &name)
bool setMotorUserPreset(uint32_t index, const MotorRates &rates, const MotorCurrents ¤ts)
bool storeAsMaxPosition()
bool storeAsMinPosition()
bool getModel(std::string &model)
bool setMotorRates(const MotorRates &rates)
bool storeAsMinPosition()
bool moveOut(uint32_t steps)
bool getModel(std::string &model)
bool setRecoveryDelay(int32_t delay)
bool setMotorRates(const MotorRates &rates)
bool getSubModel(std::string &submodel)
bool moveIn(uint32_t steps)
bool storeAsMaxPosition()
bool applyMotorPreset(const std::string &name)
bool initCalibrationSemiAuto()
bool goAbsolutePosition(uint32_t position)
bool getMotorSettings(MotorRates &rates, MotorCurrents ¤ts, bool &motorHoldActive)
bool setMotorHold(bool hold)
bool getRecoveryDelay(int32_t &delay)
bool getAbsolutePosition(uint32_t &position)
const char * getDeviceName()
bool startAutoCalibration()
bool setMotorCurrents(const MotorCurrents ¤ts)
a class to store JSON values
basic_json<> json
default specialization