#include "lidar_manager.h"
#include <X11/Xlib.h>
// 避免和Eigen冲突
// #ifdef Success 
// #undef Success
// #endif

int main(int argc, char **argv) {
    XInitThreads();
    std::string command;
    if (argc < 2) {
        command = "-help";
    } else {
        command = argv[1];
    }

    if (command == "-s") {
        // 执行程序1
        ZX::InitGlog("DataToCloud-s", ETC_PATH"DataToCloud/DataToCloud-sLog/");
        CloudDataManager::sendClient();
    } else if (command == "-r") {
        // 执行程序2
        ZX::InitGlog("DataToCloud-r", ETC_PATH"DataToCloud/DataToCloud-rLog/");
        CloudDataManager::receiveClient();
    } else if (command == "-t") {
        // 执行程序3
        ZX::InitGlog("DataToCloud-t", ETC_PATH"DataToCloud/DataToCloud-tLog/");
        CloudDataManager::sendClient();
    } else if (command == "-lidar") {
        // 执行程序3
        ZX::InitGlog("DataToCloud-lidar", ETC_PATH"DataToCloud/DataToCloud-lidarLog/");
        CloudDataManager::testRslidar();
    } else {
        std::cerr << "-s 发送雷达数据到客户端" << std::endl;
        std::cerr << "-r 接收雷达数据并展示" << std::endl;
        std::cerr << "-t 测试mqtt网络延时" << std::endl;
        std::cerr << "-lidar 测试雷达数据接收能力" << std::endl;
        return 1;
    }

    return 0;
}
