cmake库改造前

This commit is contained in:
2026-08-05 14:37:55 +08:00
parent 587c1d6d01
commit cf17c454a9
29 changed files with 1034 additions and 415 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
#include "Dll_Global.h"
#include "Core/Base/JSON.h"
#include "Core/Base/SM_RingBuffer.h"
#include "Psc_Cpp_Core/Base/JSON.h"
#include "Psc_Cpp_Core/Base/SM_RingBuffer.h"
Dll_Global* dg = new Dll_Global();
std::string Dll_Global::get_config_path() {
return get_exe_dir() + "/" + "data_progress_config.json";
+50 -60
View File
@@ -1,6 +1,5 @@
#ifndef PLANTSUNCAT_DLL_GLOBAL_H
#define PLANTSUNCAT_DLL_GLOBAL_H
#include "main.h"
#include <chrono>
#include <csignal>
#include <cstring>
@@ -13,77 +12,68 @@
#include <string>
#include <thread>
#include <vector>
#include "main.h"
#include "../Local_Server/DSP/global.h"
#include "Core/Base/JSON.h"
#include "Core/Base/ThreadManager.h"
#include "Core/Base/global_include.h"
#include "Core/Shared_Memory/Shared_Memory.h"
#include "Core/spdlog/export.h"
#include "Core/system/export.h"
#include "Psc_Cpp_Core/Base/JSON.h"
#include "Psc_Cpp_Core/Base/ThreadManager.h"
#include "Psc_Cpp_Core/Base/global_include.h"
#include "Psc_Cpp_Core/Shared_Memory/Shared_Memory.h"
#include "Psc_Cpp_Core/spdlog/export.h"
#include "Psc_Cpp_Core/system/export.h"
namespace Psc {
class SM_RingBuffer;
}
using namespace Psc;
struct Memory_Buffer {
std::vector<std::string *> get_all() {
std::lock_guard lock(m);
std::swap(cache, data_list);
return data_list;
}
void push(void *pdata, uint64_t length) {
auto buf = pool.get();
buf->resize(length);
std::memcpy(buf->data(), pdata, length);
{
std::lock_guard lock(m);
cache.push_back(buf);
std::vector<std::string*> get_all() {
std::lock_guard lock(m);
std::swap(cache, data_list);
return data_list;
}
}
String_Pool pool = String_Pool(2112, 8 * 1024);
void push(void* pdata, uint64_t length) {
auto buf = pool.get();
buf->resize(length);
std::memcpy(buf->data(), pdata, length);
{
std::lock_guard lock(m);
cache.push_back(buf);
}
}
String_Pool pool = String_Pool(2112, 8 * 1024);
protected:
std::vector<std::string *> data;
std::vector<std::string *> cache;
std::vector<std::string *> data_list;
Psc::Spin_Lock m;
std::vector<std::string*> data;
std::vector<std::string*> cache;
std::vector<std::string*> data_list;
Psc::Spin_Lock m;
};
struct BB : Base_DSP {
BB() {}
BB() {
}
};
#define freq 0.1
struct Dll_Global : BB, public Singleton<Dll_Global> {
SM_RingBuffer *rb{};
SM_RingBuffer *json_func_call{};
SM_RingBuffer *mode_acs{};
// Pure_Share_Memory psm = Pure_Share_Memory("fft_data", 65536);
std::uint8_t *psm;
Memory_Buffer iq_memory_buffer;
Detach_Thread_Manager dtm;
adsb_set_iq_cbk_t set_iq_cbk;
adsb_set_less_30Mhz_ddc_param_t set_less_30Mhz_ddc_param;
adsb_set_less_30Mhz_fft_param_t set_less_30Mhz_fft_param;
static std::string get_config_path();
void init_when_exe();
void init_when_dll();
Dll_Global();
~Dll_Global();
void save();
void handle_json_call();
iq_cbk_t recv_cbk{};
void *puser{};
void give_call_back(std::uint8_t *data, size_t len);
void handle_2112(void *data);
void handle_2112_pure(void *data);
void handle_2112_test(void *data);
SM_RingBuffer* rb{};
SM_RingBuffer* json_func_call{};
SM_RingBuffer* mode_acs{};
// Pure_Share_Memory psm = Pure_Share_Memory("fft_data", 65536);
std::uint8_t* psm;
Memory_Buffer iq_memory_buffer;
Detach_Thread_Manager dtm;
adsb_set_iq_cbk_t set_iq_cbk;
adsb_set_less_30Mhz_ddc_param_t set_less_30Mhz_ddc_param;
adsb_set_less_30Mhz_fft_param_t set_less_30Mhz_fft_param;
static std::string get_config_path();
void init_when_exe();
void init_when_dll();
Dll_Global();
~Dll_Global();
void save();
void handle_json_call();
iq_cbk_t recv_cbk{};
void* puser{};
void give_call_back(std::uint8_t* data, size_t len);
void handle_2112(void* data);
void handle_2112_pure(void* data);
void handle_2112_test(void* data);
};
#endif
+7 -7
View File
@@ -13,13 +13,13 @@
#include <vector>
#include <iostream>
#include <optional>
#include "Core/Base/JSON.h"
#include "Core/Base/ThreadManager.h"
#include "Core/Base/global_include.h"
#include "Core/Shared_Memory/Shared_Memory.h"
#include "Core/system/export.h"
#include "Core/spdlog/export.h"
#include "Core/Base/SM_RingBuffer.h"
#include "Psc_Cpp_Core/Base/JSON.h"
#include "Psc_Cpp_Core/Base/ThreadManager.h"
#include "Psc_Cpp_Core/Base/global_include.h"
#include "Psc_Cpp_Core/Shared_Memory/Shared_Memory.h"
#include "Psc_Cpp_Core/system/export.h"
#include "Psc_Cpp_Core/spdlog/export.h"
#include "Psc_Cpp_Core/Base/SM_RingBuffer.h"
#include "Dll_Global.h"
#include <string_view>
#ifndef ECAP_ADSB_PLAYBACK_SPEED_RATE