2021-06-22 12:14:47 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "imgui/imgui.h"
|
2022-11-29 00:01:26 +01:00
|
|
|
#include <mutex>
|
2025-05-25 14:30:24 +02:00
|
|
|
#include "image/image.h"
|
2024-05-09 01:16:08 +02:00
|
|
|
#include <string>
|
2021-06-22 12:14:47 +02:00
|
|
|
|
|
|
|
|
namespace widgets
|
|
|
|
|
{
|
|
|
|
|
class FFTPlot
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
float *values;
|
|
|
|
|
int values_size;
|
2022-11-29 00:01:26 +01:00
|
|
|
std::mutex work_mutex;
|
2021-06-22 12:14:47 +02:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
float scale_min, scale_max;
|
2021-08-15 16:47:44 +02:00
|
|
|
float scale_resolution;
|
2021-06-22 12:14:47 +02:00
|
|
|
|
2023-07-28 13:55:21 +02:00
|
|
|
double bandwidth = 0;
|
|
|
|
|
double frequency = 0;
|
|
|
|
|
|
2023-07-28 20:38:23 +02:00
|
|
|
bool enable_freq_scale = true;
|
|
|
|
|
|
2023-07-29 19:50:28 +02:00
|
|
|
double actual_sdr_freq = -1;
|
|
|
|
|
|
2021-06-22 12:14:47 +02:00
|
|
|
public:
|
2021-08-15 16:47:44 +02:00
|
|
|
FFTPlot(float *v, int size, float min, float max, float scale_res = 20);
|
2023-12-16 19:58:45 +01:00
|
|
|
|
2021-06-22 12:14:47 +02:00
|
|
|
void draw(ImVec2 size);
|
2024-05-09 01:16:08 +02:00
|
|
|
image::Image drawImg(int size_x, int size_y);
|
2022-11-29 00:01:26 +01:00
|
|
|
|
|
|
|
|
void set_size(int size)
|
|
|
|
|
{
|
|
|
|
|
work_mutex.lock();
|
|
|
|
|
values_size = size;
|
|
|
|
|
work_mutex.unlock();
|
|
|
|
|
}
|
2024-01-19 00:29:42 +01:00
|
|
|
|
|
|
|
|
std::vector<std::pair<std::string, double>> vfo_freqs;
|
2021-06-22 12:14:47 +02:00
|
|
|
};
|
|
|
|
|
}
|