Files
eUi/include/eui_tools/simpleTools/lightSource.hpp
T
RCiRoot e3f7733316 V20260829-2.6.1
完成框架目录和模块重构;新增核心、单例、工具、加密及框架 SDK;统一任务、相机和 RPC 接口,并增加离线检测、相机标定、备份恢复、版本管理、崩溃守护和心跳监控功能。
2026-09-20 16:01:09 +08:00

41 lines
911 B
C++

#pragma once
#include <qserialport.h>
#include <qthread.h>
#include <memory>
#include <string>
#include <unordered_map>
enum lightSourceChannel
{
AChannel, BChannel, CChannel, DChannel
};
class lightSource
{
public:
QSerialPort* serialPort = new QSerialPort();
lightSource(std::string comName, int baudRate, std::string initStr);
~lightSource();
lightSource(const lightSource&) = delete;
lightSource& operator=(const lightSource&) = delete;
void setValue(lightSourceChannel channelIn, unsigned char value);
};
class lightSourceManager : public QThread
{
public:
lightSourceManager();
~lightSourceManager() override;
void run() override;
void init();
void insertLightSource(std::string comName, int baudRate, std::string initStr);
lightSource* getLightSourcePtr(std::string comName);
std::unordered_map<std::string, lightSource*> lightSources;
};