added json save button and remove history button. Added logging to save process

This commit is contained in:
Ayzen
2026-03-05 15:53:56 +03:00
parent fd4618b20d
commit 9c745f304e
8 changed files with 505 additions and 19 deletions
@@ -17,6 +17,7 @@ namespace detail = radar::drivers::librevna::detail;
namespace {
constexpr std::uint32_t kNativeAcquireMaxAttempts = 3U;
constexpr auto kNativeSweepResponseTimeout = std::chrono::milliseconds(1500);
[[nodiscard]] auto is_retryable_native_acquire_error(std::string_view message) -> bool {
constexpr std::array<std::string_view, 5> kRetryableSubstrings = {
@@ -151,13 +152,7 @@ auto LibreVnaMinimalDriver::acquire_native() -> SweepTrace {
std::vector<std::uint8_t> received(settings_.sweep.points, 0U);
std::uint32_t received_count = 0;
const auto ifbw_hz = std::max(settings_.sweep.if_bandwidth_hz, 1.0F);
const auto estimated_sweep_ms = static_cast<std::uint64_t>(
std::ceil((1'000.0 * static_cast<double>(settings_.sweep.points)) / static_cast<double>(ifbw_hz))
);
// Keep generous timeout margin on slower hosts.
const auto timeout_ms = std::max<std::uint64_t>(20'000ULL, estimated_sweep_ms * 8ULL + 1'000ULL);
const auto deadline = std::chrono::steady_clock::now() + std::chrono::milliseconds(timeout_ms);
const auto deadline = std::chrono::steady_clock::now() + kNativeSweepResponseTimeout;
while (received_count < settings_.sweep.points) {
NativePacket packet{};