From 0c3046b9c7510d89ad24902de8a86a4be3d765d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20K=C3=A4berich?= Date: Tue, 13 Dec 2022 11:32:21 +0100 Subject: [PATCH 1/2] Prevent error message when connecting to compound device on Windows --- Software/PC_Application/LibreVNA-GUI/Device/device.cpp | 4 ++-- Software/PC_Application/LibreVNA-GUI/Device/device.h | 2 +- Software/PC_Application/LibreVNA-GUI/Device/virtualdevice.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Software/PC_Application/LibreVNA-GUI/Device/device.cpp b/Software/PC_Application/LibreVNA-GUI/Device/device.cpp index b7790a9..dc47e54 100644 --- a/Software/PC_Application/LibreVNA-GUI/Device/device.cpp +++ b/Software/PC_Application/LibreVNA-GUI/Device/device.cpp @@ -174,7 +174,7 @@ static constexpr Protocol::DeviceStatusV1 defaultStatusV1 = { .temp_MCU = 0, }; -Device::Device(QString serial) +Device::Device(QString serial, bool ignoreOpenError) { info = defaultInfo; status = {}; @@ -197,7 +197,7 @@ Device::Device(QString serial) // not the requested device, continue search return true; } - }, m_context, false); + }, m_context, ignoreOpenError); if(!m_handle) { QString message = "No device found"; diff --git a/Software/PC_Application/LibreVNA-GUI/Device/device.h b/Software/PC_Application/LibreVNA-GUI/Device/device.h index f59b8f8..2e29bc9 100644 --- a/Software/PC_Application/LibreVNA-GUI/Device/device.h +++ b/Software/PC_Application/LibreVNA-GUI/Device/device.h @@ -58,7 +58,7 @@ public: Q_ENUM(TransmissionResult) // connect to a VNA device. If serial is specified only connecting to this device, otherwise to the first one found - Device(QString serial = QString()); + Device(QString serial = QString(), bool ignoreOpenError = false); ~Device(); static void RegisterTypes(); diff --git a/Software/PC_Application/LibreVNA-GUI/Device/virtualdevice.cpp b/Software/PC_Application/LibreVNA-GUI/Device/virtualdevice.cpp index 8a4e2dc..9dea9ac 100644 --- a/Software/PC_Application/LibreVNA-GUI/Device/virtualdevice.cpp +++ b/Software/PC_Application/LibreVNA-GUI/Device/virtualdevice.cpp @@ -138,7 +138,7 @@ VirtualDevice::VirtualDevice(QString serial) } else { // Connect to the actual devices for(auto devSerial : cdev->deviceSerials) { - auto dev = new Device(devSerial); + auto dev = new Device(devSerial, true); devices.push_back(dev); // Create device connections connect(dev, &Device::ConnectionLost, this, &VirtualDevice::ConnectionLost, Qt::QueuedConnection); From 2c62fe71a303fafe34ab5281a3b30cacceb5ffc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20K=C3=A4berich?= Date: Tue, 13 Dec 2022 11:32:49 +0100 Subject: [PATCH 2/2] Prevent updating trace widget for every added de-embedding point --- Software/PC_Application/LibreVNA-GUI/Traces/trace.cpp | 6 ++++-- .../LibreVNA-GUI/usersjanappdatalocaltemptmpqaohp7 | 0 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 Software/PC_Application/LibreVNA-GUI/usersjanappdatalocaltemptmpqaohp7 diff --git a/Software/PC_Application/LibreVNA-GUI/Traces/trace.cpp b/Software/PC_Application/LibreVNA-GUI/Traces/trace.cpp index b82b250..dbdcaa2 100644 --- a/Software/PC_Application/LibreVNA-GUI/Traces/trace.cpp +++ b/Software/PC_Application/LibreVNA-GUI/Traces/trace.cpp @@ -152,6 +152,7 @@ void Trace::addData(const Trace::Data &d, const VirtualDevice::SASettings &s, in void Trace::addDeembeddingData(const Trace::Data &d, int index) { + bool wasAvailable = deembeddingAvailable(); if(index >= 0) { // index position specified if(deembeddingData.size() <= (unsigned int) index) { @@ -180,7 +181,9 @@ void Trace::addDeembeddingData(const Trace::Data &d, int index) if(deembeddingActive) { emit outputSamplesChanged(index, index + 1); } - emit deembeddingChanged(); + if(!wasAvailable) { + emit deembeddingChanged(); + } } void Trace::setName(QString name) { @@ -1317,7 +1320,6 @@ void Trace::setDeembeddingActive(bool active) void Trace::clearDeembedding() { - setDeembeddingActive(false); deembeddingData.clear(); deembeddingChanged(); } diff --git a/Software/PC_Application/LibreVNA-GUI/usersjanappdatalocaltemptmpqaohp7 b/Software/PC_Application/LibreVNA-GUI/usersjanappdatalocaltemptmpqaohp7 new file mode 100644 index 0000000..e69de29