diff --git a/Software/PC_Application/LibreVNA-GUI/Device/virtualdevice.cpp b/Software/PC_Application/LibreVNA-GUI/Device/virtualdevice.cpp index 03ac944..8a4e2dc 100644 --- a/Software/PC_Application/LibreVNA-GUI/Device/virtualdevice.cpp +++ b/Software/PC_Application/LibreVNA-GUI/Device/virtualdevice.cpp @@ -246,6 +246,15 @@ QStringList VirtualDevice::availableVNAMeasurements() ret.push_back("S"+QString::number(i)+QString::number(j)); } } + auto &pref = Preferences::getInstance(); + if(pref.Debug.makeRawReceiverValuesAvailable) { + for(unsigned int i=1;i<=info.ports;i++) { + for(unsigned int j=0;j *res) { Q_UNUSED(dev) + auto &pref = Preferences::getInstance(); VNAMeasurement m; m.pointNum = res->pointNum; m.Z0 = 50.0; @@ -567,13 +577,19 @@ void VirtualDevice::singleDatapointReceived(Device *dev, Protocol::VNADatapoint< // map.first is the port (starts at zero) // map.second is the stage at which this port had the stimulus (starts at zero) complex ref = res->getValue(map.second, map.first, true); - for(int i=0;i<2;i++) { + for(int i=0;i input = res->getValue(map.second, i, false); if(!std::isnan(ref.real()) && !std::isnan(input.real())) { // got both required measurements QString name = "S"+QString::number(i+1)+QString::number(map.first+1); m.measurements[name] = input / ref; } + if(pref.Debug.makeRawReceiverValuesAvailable) { + QString name = "RawPort"+QString::number(i+1)+"Stage"+QString::number(map.first); + m.measurements[name] = input; + name = "RawPort"+QString::number(i+1)+"Stage"+QString::number(map.first)+"Ref"; + m.measurements[name] = res->getValue(map.second, i, true); + } } } delete res; diff --git a/Software/PC_Application/LibreVNA-GUI/Traces/trace.cpp b/Software/PC_Application/LibreVNA-GUI/Traces/trace.cpp index 07ce3df..e9fdcae 100644 --- a/Software/PC_Application/LibreVNA-GUI/Traces/trace.cpp +++ b/Software/PC_Application/LibreVNA-GUI/Traces/trace.cpp @@ -651,7 +651,15 @@ bool Trace::isSAParameter(QString param) bool Trace::isVNAParameter(QString param) { - return param.length() == 3 && param[0] == 'S' && param[1].isDigit() && param[2].isDigit(); + if(param.length() == 3 && param[0] == 'S' && param[1].isDigit() && param[2].isDigit()) { + // normal S parameter + return true; + } + if(param.startsWith("RawPort")) { + // raw receiver value + return true; + } + return false; } double Trace::velocityFactor() diff --git a/Software/PC_Application/LibreVNA-GUI/preferences.cpp b/Software/PC_Application/LibreVNA-GUI/preferences.cpp index fbd8c71..1ce12b6 100644 --- a/Software/PC_Application/LibreVNA-GUI/preferences.cpp +++ b/Software/PC_Application/LibreVNA-GUI/preferences.cpp @@ -389,6 +389,7 @@ void PreferencesDialog::setInitialGUIState() ui->DebugMaxUSBlogSize->setValue(p->Debug.USBlogSizeLimit); ui->DebugSaveTraceData->setChecked(p->Debug.saveTraceData); + ui->DebugCaptureRawReceiverValues->setChecked(p->Debug.makeRawReceiverValuesAvailable); for(auto cd : p->compoundDevices) { ui->compoundList->addItem(cd->getDesription()); @@ -493,6 +494,7 @@ void PreferencesDialog::updateFromGUI() p->Debug.USBlogSizeLimit = ui->DebugMaxUSBlogSize->value(); p->Debug.saveTraceData = ui->DebugSaveTraceData->isChecked(); + p->Debug.makeRawReceiverValuesAvailable = ui->DebugCaptureRawReceiverValues->isChecked(); p->nonTrivialWriting(); } diff --git a/Software/PC_Application/LibreVNA-GUI/preferences.h b/Software/PC_Application/LibreVNA-GUI/preferences.h index 3a04717..331ccf6 100644 --- a/Software/PC_Application/LibreVNA-GUI/preferences.h +++ b/Software/PC_Application/LibreVNA-GUI/preferences.h @@ -163,6 +163,7 @@ public: struct { double USBlogSizeLimit; bool saveTraceData; + bool makeRawReceiverValuesAvailable; } Debug; bool TCPoverride; // in case of manual port specification via command line @@ -270,6 +271,7 @@ private: {&SCPIServer.port, "SCPIServer.port", 19542}, {&Debug.USBlogSizeLimit, "Debug.USBlogSizeLimit", 10000000.0}, {&Debug.saveTraceData, "Debug.saveTraceData", false}, + {&Debug.makeRawReceiverValuesAvailable, "Debug.makeRawReceiverValuesAvailable", false}, {&compoundDeviceJSON, "compoundDeviceJSON", "[]"}, }}; }; diff --git a/Software/PC_Application/LibreVNA-GUI/preferencesdialog.ui b/Software/PC_Application/LibreVNA-GUI/preferencesdialog.ui index 28f7393..5cfd6c7 100644 --- a/Software/PC_Application/LibreVNA-GUI/preferencesdialog.ui +++ b/Software/PC_Application/LibreVNA-GUI/preferencesdialog.ui @@ -1977,6 +1977,22 @@ + + + + Acquisition + + + + + + Capture raw receiver values + + + + + +