diff --git a/Software/PC_Application/LibreVNA-GUI/Device/LibreVNA/librevnatcpdriver.cpp b/Software/PC_Application/LibreVNA-GUI/Device/LibreVNA/librevnatcpdriver.cpp index c018699..d105213 100644 --- a/Software/PC_Application/LibreVNA-GUI/Device/LibreVNA/librevnatcpdriver.cpp +++ b/Software/PC_Application/LibreVNA-GUI/Device/LibreVNA/librevnatcpdriver.cpp @@ -70,7 +70,7 @@ std::set LibreVNATCPDriver::GetAvailableDevices() s->writeDatagram(data.data(), SSDPaddress, SSDPport); } - // TODO need delay here while still processing events + // need delay here while still processing events SynSleep::sleep(100); std::set serials; diff --git a/Software/PC_Application/LibreVNA-GUI/Device/LibreVNA/receivercaldialog.cpp b/Software/PC_Application/LibreVNA-GUI/Device/LibreVNA/receivercaldialog.cpp index 2f6a46f..b3da3ac 100644 --- a/Software/PC_Application/LibreVNA-GUI/Device/LibreVNA/receivercaldialog.cpp +++ b/Software/PC_Application/LibreVNA-GUI/Device/LibreVNA/receivercaldialog.cpp @@ -44,7 +44,6 @@ void ReceiverCalDialog::UpdateAmplitude(AmplitudeCalDialog::CorrectionPoint &poi // This point was just received from the device, it is not possible to know the actual amplitude because the // applied power level during the calibration is not saved (only the correction value). This is not a problem // because the correction value is still valid but the missing values look weird in the GUI - // TODO change this? point.amplitudePort1 = std::numeric_limits::quiet_NaN(); point.amplitudePort2 = std::numeric_limits::quiet_NaN(); point.port1set = true; diff --git a/Software/PC_Application/LibreVNA-GUI/Device/deviceusblog.cpp b/Software/PC_Application/LibreVNA-GUI/Device/deviceusblog.cpp index dcb4fa1..3bf15a3 100644 --- a/Software/PC_Application/LibreVNA-GUI/Device/deviceusblog.cpp +++ b/Software/PC_Application/LibreVNA-GUI/Device/deviceusblog.cpp @@ -35,6 +35,11 @@ void DeviceUSBLog::addPacket(Protocol::PacketInfo &p, QString serial) e.type = LogEntry::Type::Packet; e.p = new Protocol::PacketInfo; *e.p = p; + if(p.type == Protocol::PacketType::VNADatapoint) { + e.datapoint = new Protocol::VNADatapoint<32>(*p.VNAdatapoint); + } else { + e.datapoint = nullptr; + } addEntry(e); } diff --git a/Software/PC_Application/LibreVNA-GUI/Device/deviceusblog.h b/Software/PC_Application/LibreVNA-GUI/Device/deviceusblog.h index b56d4c6..4316c1d 100644 --- a/Software/PC_Application/LibreVNA-GUI/Device/deviceusblog.h +++ b/Software/PC_Application/LibreVNA-GUI/Device/deviceusblog.h @@ -50,6 +50,7 @@ public: QString serial; std::vector bytes; Protocol::PacketInfo *p; + Protocol::VNADatapoint<32> *datapoint; unsigned int storageSize() const { unsigned long size = sizeof(type) + sizeof(timestamp) + serial.size(); switch(type) { diff --git a/Software/PC_Application/LibreVNA-GUI/Device/deviceusblogview.cpp b/Software/PC_Application/LibreVNA-GUI/Device/deviceusblogview.cpp index b1bff6d..cd15987 100644 --- a/Software/PC_Application/LibreVNA-GUI/Device/deviceusblogview.cpp +++ b/Software/PC_Application/LibreVNA-GUI/Device/deviceusblogview.cpp @@ -237,40 +237,39 @@ void DeviceUSBLogView::addEntry(const DeviceUSBLog::LogEntry &e) } break; case Protocol::PacketType::VNADatapoint: { - // TODO VNAdatapoint will already be deleted. Create deep copy when creating the log entry? -// Protocol::VNADatapoint<32>* s = e.p->VNAdatapoint; -// addInteger(item, "Point number", s->pointNum); -// addDouble(item, "Frequency/time", s->frequency, "Hz"); -// addDouble(item, "Power", (double) s->cdBm / 100.0, "dBm"); -// for(unsigned int i=0;igetNumValues();i++) { -// auto v = s->getValue(i); -// vector ports; -// if(v.flags & 0x01) { -// ports.push_back(1); -// } -// if(v.flags & 0x02) { -// ports.push_back(2); -// } -// if(v.flags & 0x04) { -// ports.push_back(3); -// } -// if(v.flags & 0x08) { -// ports.push_back(4); -// } -// bool reference = v.flags & 0x10; -// int stage = v.flags >> 5; -// auto vitem = new QTreeWidgetItem; -// vitem->setData(2, Qt::DisplayRole, "Measurement "+QString::number(i+1)); -// vitem->setData(3, Qt::DisplayRole, "Real: "+QString::number(v.value.real())+" Imag: "+QString::number(v.value.imag())); -// addInteger(vitem, "Stage", stage); -// addBool(vitem, "Reference", reference); -// QString sports = QString::number(ports.front()); -// for(unsigned int j=1;jaddChild(vitem); -// } + Protocol::VNADatapoint<32>* s = e.datapoint; + addInteger(item, "Point number", s->pointNum); + addDouble(item, "Frequency/time", s->frequency, "Hz"); + addDouble(item, "Power", (double) s->cdBm / 100.0, "dBm"); + for(unsigned int i=0;igetNumValues();i++) { + auto v = s->getValue(i); + vector ports; + if(v.flags & 0x01) { + ports.push_back(1); + } + if(v.flags & 0x02) { + ports.push_back(2); + } + if(v.flags & 0x04) { + ports.push_back(3); + } + if(v.flags & 0x08) { + ports.push_back(4); + } + bool reference = v.flags & 0x10; + int stage = v.flags >> 5; + auto vitem = new QTreeWidgetItem; + vitem->setData(2, Qt::DisplayRole, "Measurement "+QString::number(i+1)); + vitem->setData(3, Qt::DisplayRole, "Real: "+QString::number(v.value.real())+" Imag: "+QString::number(v.value.imag())); + addInteger(vitem, "Stage", stage); + addBool(vitem, "Reference", reference); + QString sports = QString::number(ports.front()); + for(unsigned int j=1;jaddChild(vitem); + } } break; case Protocol::PacketType::SpectrumAnalyzerResult: { diff --git a/Software/PC_Application/LibreVNA-GUI/Tools/impedancematchdialog.cpp b/Software/PC_Application/LibreVNA-GUI/Tools/impedancematchdialog.cpp index eb06da6..3e4ac85 100644 --- a/Software/PC_Application/LibreVNA-GUI/Tools/impedancematchdialog.cpp +++ b/Software/PC_Application/LibreVNA-GUI/Tools/impedancematchdialog.cpp @@ -255,9 +255,9 @@ void ImpedanceMatchDialog::calculateMatch() } else if(X < 0 && B < 0) { ui->Image->setPixmap(QPixmap(":/icons/sCpL_small.png")); } else if(X >= 0 && B < 0) { - ui->Image->setPixmap(QPixmap(":/icons/sCpC_small.png")); // TODO check + ui->Image->setPixmap(QPixmap(":/icons/sCpC_small.png")); } else { - ui->Image->setPixmap(QPixmap(":/icons/sLpL_small.png")); // TODO check + ui->Image->setPixmap(QPixmap(":/icons/sLpL_small.png")); } } else { if(X >= 0 && B >= 0) {