UI updates

This commit is contained in:
Ayzen
2026-04-01 20:21:16 +03:00
parent 4abc95c372
commit 669205d8f8
43 changed files with 2055 additions and 973 deletions
@@ -16,8 +16,6 @@ enum class HistoryCommand {
struct ProcessingLiveConfig {
std::string processor_mode = "pass_through";
float gain_db = 0.0F;
float phase_deg = 0.0F;
std::string pass_through_channel = "s21";
bool pass_through_fixed_y_enabled = false;
float pass_through_y_min_db = -100.0F;
@@ -96,18 +96,6 @@ using Json = nlohmann::json;
}
config.processor_mode = found->get<std::string>();
}
if (const auto found = root.find("gain_db"); found != root.end()) {
if (!found->is_number()) {
throw std::runtime_error("processing.gain_db must be number");
}
config.gain_db = static_cast<float>(found->get<double>());
}
if (const auto found = root.find("phase_deg"); found != root.end()) {
if (!found->is_number()) {
throw std::runtime_error("processing.phase_deg must be number");
}
config.phase_deg = static_cast<float>(found->get<double>());
}
if (const auto found = root.find("pass_through_channel"); found != root.end()) {
if (!found->is_string()) {
throw std::runtime_error("processing.pass_through_channel must be string");
@@ -1,13 +1,6 @@
#include "passthrough_processor.hpp"
#include <cmath>
namespace radar::processing {
namespace {
constexpr float kPi = 3.14159265358979323846F;
} // namespace
auto PassThroughProcessor::name() const -> std::string {
return "pass_through";
@@ -35,18 +28,6 @@ auto PassThroughProcessor::process_collection(
payload.trace = trace.s21;
}
const float linear_gain = std::pow(10.0F, live_config.gain_db / 20.0F);
const float phase_rad = live_config.phase_deg * (kPi / 180.0F);
const float cos_phase = std::cos(phase_rad);
const float sin_phase = std::sin(phase_rad);
for (auto& sample : payload.trace) {
const float re = sample.re;
const float im = sample.im;
sample.re = linear_gain * ((re * cos_phase) - (im * sin_phase));
sample.im = linear_gain * ((re * sin_phase) + (im * cos_phase));
}
ipc::ResultBlock block{};
block.combo = trace.combo;
block.payloads.push_back(std::move(payload));