Files
handleaiuinew/HanddleAI/HandleAiUi-new/back/backStruct.h
T
2024-05-22 16:47:14 +08:00

58 lines
1.8 KiB
C++

#include<base.h>
#include <filesystem>
typedef Base* (*CreateFunction)();
typedef void (*ReleaseFunction)(Base* animal);
struct correctionStruct
{
std::vector<double> in_X_X0Y;
std::vector<double> in_Y_X0Y;
std::vector<double> in_Z_X0Y;
std::vector<double> in_Z_X0Y_Value;
std::vector<double> in_X_X0Z;
std::vector<double> in_Y_X0Z;;
std::vector<double> in_Z_X0Z;
std::vector<double> in_Y_X0Z_Value;
std::vector<double> in_X_Y0Z;
std::vector<double> in_Y_Y0Z;
std::vector<double> in_Z_Y0Z;
std::vector<double> in_X_Y0Z_Value;
};
typedef struct {
QString m_stationKy;
QString key; // 相机名称
QString moduleName; // 模块名称
QString task_thread_index = "-1";// 存储当前算法属于那个任务线程
QByteArray m_initByte; // 传递初始化参数
Base* module_ptr = nullptr; // 存储模块指针
ReleaseFunction destory_ptr; // 释放
int showIndex;
}cameraModule;
static void createDirectoryIfNotExists(const std::string& path) {
// 检查路径是否存在
if (!std::filesystem::exists(path)) {
// 创建路径
std::filesystem::create_directories(path);
//std::cout << "已创建文件夹: " << path << std::endl;
}
else {/*
std::cout << "文件夹已存在: " << path << std::endl;*/
}
}
static std::string getCurrentDateTime() {
// 获取当前时间点
auto now = std::chrono::system_clock::now();
// 转换为字符串
auto currentTime = std::chrono::system_clock::to_time_t(now);
auto ms = std::chrono::duration_cast<std::chrono::milliseconds>(now.time_since_epoch()) % 100;
std::tm* localTime = std::localtime(&currentTime);
std::stringstream ss;
ss << std::put_time(localTime, "%H-%M-%S") << "-" << std::setfill('0') << std::setw(2) << ms.count();
return ss.str();
}
#pragma once