/**
 * @file conveyor.h
 * @brief 传送带
 * @copyright Copyright (C) 2026 ROKAE (Beijing) Technology Co., LTD. All Rights Reserved.
 * Information in this file is the intellectual property of Rokae Technology Co., Ltd,
 * And may contains trade secrets that must be stored and viewed confidentially.
 */

#ifndef XCORESDK_INCLUDE_ROKAE_CONVEYOR_HPP_
#define XCORESDK_INCLUDE_ROKAE_CONVEYOR_HPP_


#if defined(_MSC_VER) && (_MSC_VER >= 1200)
#pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)

#include "base.h"
#include "data_types.h"

namespace rokae {

// forward declarations
 class BaseRobot;
 class XService;

 /**
 * @brief 传送带状态
 */
 struct ConveyorState {
   std::string name; ///< 传送带名称
   bool photoelectric_state; ///< 光电状态
   int encoder_value; ///< 编码器值
   long long encoder_correction_value; ///< 编码器修正值
   double speed; ///< 传送带速度, mm/s
   double wobj_position; ///< 工件位置, mm
 };

/**
 * @class ConveyorBase
 * @brief 传送带控制类
 */
 class XCORE_API BaseConveyor : public Base<BaseConveyor> {
  public:
   explicit BaseConveyor(std::shared_ptr<XService> rpc);
   virtual ~BaseConveyor();

   /**
    * @brief 读取传送带监控数据
    * @param[out] ec 错误码, 功能不支持等
    * @return 传送带监控数据，未创建传送带返回空数组
    */
   std::vector<ConveyorState> getConveyorState(error_code &ec) noexcept;

  XCORESDK_DECLARE_IMPL
 };
}

#endif //XCORESDK_INCLUDE_ROKAE_CONVEYOR_HPP_
