removing TODOs

This commit is contained in:
Jan Käberich 2023-02-12 19:19:01 +01:00
parent d02efdb146
commit 06912584b0
6 changed files with 42 additions and 38 deletions

View File

@ -70,7 +70,7 @@ std::set<QString> LibreVNATCPDriver::GetAvailableDevices()
s->writeDatagram(data.data(), SSDPaddress, SSDPport); s->writeDatagram(data.data(), SSDPaddress, SSDPport);
} }
// TODO need delay here while still processing events // need delay here while still processing events
SynSleep::sleep(100); SynSleep::sleep(100);
std::set<QString> serials; std::set<QString> serials;

View File

@ -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 // 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 // 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 // because the correction value is still valid but the missing values look weird in the GUI
// TODO change this?
point.amplitudePort1 = std::numeric_limits<double>::quiet_NaN(); point.amplitudePort1 = std::numeric_limits<double>::quiet_NaN();
point.amplitudePort2 = std::numeric_limits<double>::quiet_NaN(); point.amplitudePort2 = std::numeric_limits<double>::quiet_NaN();
point.port1set = true; point.port1set = true;

View File

@ -35,6 +35,11 @@ void DeviceUSBLog::addPacket(Protocol::PacketInfo &p, QString serial)
e.type = LogEntry::Type::Packet; e.type = LogEntry::Type::Packet;
e.p = new Protocol::PacketInfo; e.p = new Protocol::PacketInfo;
*e.p = p; *e.p = p;
if(p.type == Protocol::PacketType::VNADatapoint) {
e.datapoint = new Protocol::VNADatapoint<32>(*p.VNAdatapoint);
} else {
e.datapoint = nullptr;
}
addEntry(e); addEntry(e);
} }

View File

@ -50,6 +50,7 @@ public:
QString serial; QString serial;
std::vector<uint8_t> bytes; std::vector<uint8_t> bytes;
Protocol::PacketInfo *p; Protocol::PacketInfo *p;
Protocol::VNADatapoint<32> *datapoint;
unsigned int storageSize() const { unsigned int storageSize() const {
unsigned long size = sizeof(type) + sizeof(timestamp) + serial.size(); unsigned long size = sizeof(type) + sizeof(timestamp) + serial.size();
switch(type) { switch(type) {

View File

@ -237,40 +237,39 @@ void DeviceUSBLogView::addEntry(const DeviceUSBLog::LogEntry &e)
} }
break; break;
case Protocol::PacketType::VNADatapoint: { case Protocol::PacketType::VNADatapoint: {
// TODO VNAdatapoint will already be deleted. Create deep copy when creating the log entry? Protocol::VNADatapoint<32>* s = e.datapoint;
// Protocol::VNADatapoint<32>* s = e.p->VNAdatapoint; addInteger(item, "Point number", s->pointNum);
// addInteger(item, "Point number", s->pointNum); addDouble(item, "Frequency/time", s->frequency, "Hz");
// addDouble(item, "Frequency/time", s->frequency, "Hz"); addDouble(item, "Power", (double) s->cdBm / 100.0, "dBm");
// addDouble(item, "Power", (double) s->cdBm / 100.0, "dBm"); for(unsigned int i=0;i<s->getNumValues();i++) {
// for(unsigned int i=0;i<s->getNumValues();i++) { auto v = s->getValue(i);
// auto v = s->getValue(i); vector<int> ports;
// vector<int> ports; if(v.flags & 0x01) {
// if(v.flags & 0x01) { ports.push_back(1);
// ports.push_back(1); }
// } if(v.flags & 0x02) {
// if(v.flags & 0x02) { ports.push_back(2);
// ports.push_back(2); }
// } if(v.flags & 0x04) {
// if(v.flags & 0x04) { ports.push_back(3);
// ports.push_back(3); }
// } if(v.flags & 0x08) {
// if(v.flags & 0x08) { ports.push_back(4);
// ports.push_back(4); }
// } bool reference = v.flags & 0x10;
// bool reference = v.flags & 0x10; int stage = v.flags >> 5;
// int stage = v.flags >> 5; auto vitem = new QTreeWidgetItem;
// auto vitem = new QTreeWidgetItem; vitem->setData(2, Qt::DisplayRole, "Measurement "+QString::number(i+1));
// 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()));
// vitem->setData(3, Qt::DisplayRole, "Real: "+QString::number(v.value.real())+" Imag: "+QString::number(v.value.imag())); addInteger(vitem, "Stage", stage);
// addInteger(vitem, "Stage", stage); addBool(vitem, "Reference", reference);
// addBool(vitem, "Reference", reference); QString sports = QString::number(ports.front());
// QString sports = QString::number(ports.front()); for(unsigned int j=1;j<ports.size();j++) {
// for(unsigned int j=1;j<ports.size();j++) { sports += ","+QString::number(ports[j]);
// sports += ","+QString::number(ports[j]); }
// } addString(vitem, "Ports", sports);
// addString(vitem, "Ports", sports); item->addChild(vitem);
// item->addChild(vitem); }
// }
} }
break; break;
case Protocol::PacketType::SpectrumAnalyzerResult: { case Protocol::PacketType::SpectrumAnalyzerResult: {

View File

@ -255,9 +255,9 @@ void ImpedanceMatchDialog::calculateMatch()
} else if(X < 0 && B < 0) { } else if(X < 0 && B < 0) {
ui->Image->setPixmap(QPixmap(":/icons/sCpL_small.png")); ui->Image->setPixmap(QPixmap(":/icons/sCpL_small.png"));
} else if(X >= 0 && B < 0) { } 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 { } else {
ui->Image->setPixmap(QPixmap(":/icons/sLpL_small.png")); // TODO check ui->Image->setPixmap(QPixmap(":/icons/sLpL_small.png"));
} }
} else { } else {
if(X >= 0 && B >= 0) { if(X >= 0 && B >= 0) {