cmvr-es/src/devices/robot/controller/abstractcontroller.h

37 lines
818 B
C
Raw Normal View History

2025-10-24 09:51:14 +08:00
//
// Created by linbo on 2025/10/23.
//
#ifndef CMVR_ES_ABSTRACTCONTROLLER_H
#define CMVR_ES_ABSTRACTCONTROLLER_H
#include <curl/curl.h>
#include "rapidxml/xml_parser.h"
namespace cmvr::device
{
2025-10-24 14:37:17 +08:00
enum ControllerState
{
ControllerState_Idle, //默认
ControllerState_Executing, //正在执行命令
ControllerState_Switching //命令被中断,正在切换
};
2025-10-24 09:51:14 +08:00
class AbstractController
{
public:
2025-10-24 14:37:17 +08:00
explicit AbstractController(const XmlNode& cfg);
virtual ~AbstractController();
[[nodiscard]] ControllerState getState() const {return state_;}
virtual void call(std::string json) = 0;
virtual void stop() = 0;
2025-10-24 14:44:45 +08:00
protected:
2025-10-24 14:37:17 +08:00
ControllerState state_;
2025-10-24 09:51:14 +08:00
};
}
#endif //CMVR_ES_ABSTRACTCONTROLLER_H