diff --git a/Software/PC_Application/LibreVNA-GUI/Device/LibreVNA/Compound/compounddriver.cpp b/Software/PC_Application/LibreVNA-GUI/Device/LibreVNA/Compound/compounddriver.cpp index 9e69c47..48083d9 100644 --- a/Software/PC_Application/LibreVNA-GUI/Device/LibreVNA/Compound/compounddriver.cpp +++ b/Software/PC_Application/LibreVNA-GUI/Device/LibreVNA/Compound/compounddriver.cpp @@ -31,6 +31,7 @@ CompoundDriver::CompoundDriver() specificSettings.push_back(Savable::SettingDescription(&compoundJSONString, "compoundDriver.compoundDeviceJSON", "")); specificSettings.push_back(Savable::SettingDescription(&captureRawReceiverValues, "compoundDriver.captureRawReceiverValues", false)); + specificSettings.push_back(Savable::SettingDescription(&preservePhase, "compoundDriver.preservePhase", false)); } CompoundDriver::~CompoundDriver() @@ -212,11 +213,15 @@ QWidget *CompoundDriver::createSettingsWidget() // Set initial values ui->CaptureRawReceiverValues->setChecked(captureRawReceiverValues); + ui->PreservePhase->setChecked(preservePhase); // make connections connect(ui->CaptureRawReceiverValues, &QCheckBox::toggled, this, [=](){ captureRawReceiverValues = ui->CaptureRawReceiverValues->isChecked(); }); + connect(ui->PreservePhase, &QCheckBox::toggled, this, [=](){ + preservePhase = ui->PreservePhase->isChecked(); + }); connect(ui->compoundList, &QListWidget::doubleClicked, [=](){ auto index = ui->compoundList->currentRow(); @@ -680,7 +685,7 @@ void CompoundDriver::datapointReceivecd(LibreVNADriver *dev, Protocol::VNADatapo // got both required measurements QString name = "S"+QString::number(i+1)+QString::number(map.first); auto S = input / ref; - if(inputDevice != stimulusDev) { + if(!preservePhase && (inputDevice != stimulusDev)) { // can't use phase information when measuring across devices S = abs(S); } diff --git a/Software/PC_Application/LibreVNA-GUI/Device/LibreVNA/Compound/compounddriver.h b/Software/PC_Application/LibreVNA-GUI/Device/LibreVNA/Compound/compounddriver.h index 8439df0..f21498f 100644 --- a/Software/PC_Application/LibreVNA-GUI/Device/LibreVNA/Compound/compounddriver.h +++ b/Software/PC_Application/LibreVNA-GUI/Device/LibreVNA/Compound/compounddriver.h @@ -203,6 +203,7 @@ private: // Driver specific settings bool captureRawReceiverValues; + bool preservePhase; QString compoundJSONString; // Buffers for storing individual device answers diff --git a/Software/PC_Application/LibreVNA-GUI/Device/LibreVNA/Compound/compounddriversettingswidget.ui b/Software/PC_Application/LibreVNA-GUI/Device/LibreVNA/Compound/compounddriversettingswidget.ui index f71cf08..7393ff4 100644 --- a/Software/PC_Application/LibreVNA-GUI/Device/LibreVNA/Compound/compounddriversettingswidget.ui +++ b/Software/PC_Application/LibreVNA-GUI/Device/LibreVNA/Compound/compounddriversettingswidget.ui @@ -75,6 +75,13 @@ + + + + Preserve phase for measurements between devices + + +