rpc正常使用版本备份

This commit is contained in:
2025-07-25 00:29:52 +08:00
parent c971fe971e
commit 3d17218dad
56 changed files with 2226 additions and 692 deletions
+24 -12
View File
@@ -1,14 +1,11 @@
#ifndef __BASECLASS_H__
#define __BASECLASS_H__
#pragma once
#include <iostream>
#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <generalJsonParsing.hpp>
#include <QByteArray>
class subModuleBase
#include <QObject>
class dsModuleBase
{
public:
bool init_flag; //是否初始化,false,true
@@ -17,13 +14,28 @@ public:
cv::Mat m_mat; //传输图片
std::string moduleName; //模块名称
public:
subModuleBase() {}
virtual ~subModuleBase() {}
virtual bool readData(std::vector<cv::Mat>&,QByteArray&, nlohmann::json&json = nlohmann::json()){return true;}
virtual bool writeData(std::vector<cv::Mat>&,QByteArray&, nlohmann::json& json = nlohmann::json()){return true;}
virtual bool initParas(QByteArray&, nlohmann::json& json = nlohmann::json()){return true;}
dsModuleBase() {}
virtual ~dsModuleBase() {}
virtual bool readData(std::vector<cv::Mat>&,QByteArray&){return true;}
virtual bool writeData(std::vector<cv::Mat>&,QByteArray&){return true;}
virtual bool initParas(QByteArray&){return true;}
virtual bool run() {return true;}
};
class rpcModuleBase : public QObject
{
public:
bool init_flag; //是否初始化,false,true
bool status = true; //相机状态(判断相机是否断开连接)
std::string paras; //传输数据
cv::Mat m_mat; //传输图片
std::string moduleName; //模块名称
public:
rpcModuleBase() {}
virtual ~rpcModuleBase() {}
virtual bool readData(std::vector<cv::Mat>&, QByteArray&) { return true; }
virtual bool writeData(std::vector<cv::Mat>&, QByteArray&) { return true; }
virtual bool initParas(QByteArray&) { return true; }
virtual bool run() { return true; }
};
#endif