#pragma once
#include "../../dll_source/main.h"
#include "Core/spdlog/export.h"
#include "Core/Base/JSON.h"

struct Base_DSP {
    std::string   library_path;
    std::uint64_t center_freq{};
    std::uint64_t band_width{};
    std::uint64_t sample_rate{};
    std::atomic<std::uint64_t> fft_point_number = 1024;
    int           fft_period_ms;
    UHD_FFTWin    fft_win_type;
    [[nodiscard]] Psc::JSON to_json() const {
        Psc::JSON ret = Psc::JSON::object();
        Ret_J(library_path);
        Ret_J(center_freq);
        Ret_J(band_width);
        Ret_J(sample_rate);
        Ret_J(fft_point_number);
        Ret_J(fft_period_ms);
        Ret_J(fft_win_type);
        return ret;
    }
    void load(Psc::JSON* that_json) {
        Get_J(library_path);
        Get_J(center_freq);
        Get_J(band_width);
        Get_J(sample_rate);
        Get_J(fft_point_number);
        Get_J(fft_period_ms);
        Get_J(fft_win_type);
    }
};
