diff --git a/Software/PC_Application/LibreVNA-GUI/Calibration/calibrationviewdialog.cpp b/Software/PC_Application/LibreVNA-GUI/Calibration/calibrationviewdialog.cpp index fed8c53..b79f58f 100644 --- a/Software/PC_Application/LibreVNA-GUI/Calibration/calibrationviewdialog.cpp +++ b/Software/PC_Application/LibreVNA-GUI/Calibration/calibrationviewdialog.cpp @@ -254,6 +254,61 @@ void CalibrationViewDialog::populateScene() drawText(marginLeft - portSize/2, marginTop + i*portHeight - portHeight/2 + portReverseYOffset, "b"+QString::number(i), colorF, Qt::AlignRight, Qt::AlignCenter); } - // create the ports of the VNA - + // Fill the measurement correction table + ui->table->clear(); + ui->table->setRowCount(ports*ports); + ui->table->setColumnCount(2); + ui->table->setHorizontalHeaderLabels({"Parameter", "Calibration Status"}); + for(unsigned int i=1;i<=ports;i++) { + for(unsigned int j=1;j<=ports;j++) { + auto row = (i-1)*ports+j-1; + // add parameter + ui->table->setItem(row, 0, new QTableWidgetItem("S"+QString::number(j)+QString::number(i))); + // check the calibration status + QString status = "Uncalibrated"; + if(i == j) { + // check reflection parameters + if(cal->hasSourceMatch(i) && cal->hasDirectivity(i) && cal->hasReflectionTracking(i)) { + // we are calibrated + status = "Calibrated"; + // check if we have enhanced responses + QList enhanced; + for(unsigned int k=1;k<=ports;k++) { + if(k==i) { + continue; + } + if(cal->hasReceiverMatch(i, k)) { + enhanced.append(k); + } + } + if(enhanced.size() == 1) { + status += " with enhanced response from port "+QString::number(enhanced[0]); + } else if(enhanced.size() > 1) { + status += " with enhanced response from ports "; + for(unsigned int k=0;k 0) { + status += ", "; + } + status += QString::number(enhanced[k]); + } + } + } + } else { + // check transmission calibration + if(cal->hasTransmissionTracking(i, j)) { + // we are calibrated + status = "Calibrated"; + // check if we have isolation terms + if(cal->hasIsolation(i, j)) { + status += " with isolation measurement"; + } + } + } + // add calibration status + ui->table->setItem(row, 1, new QTableWidgetItem(status)); + } + } + ui->table->resizeColumnsToContents(); } diff --git a/Software/PC_Application/LibreVNA-GUI/Calibration/calibrationviewdialog.ui b/Software/PC_Application/LibreVNA-GUI/Calibration/calibrationviewdialog.ui index de23638..89a2e78 100644 --- a/Software/PC_Application/LibreVNA-GUI/Calibration/calibrationviewdialog.ui +++ b/Software/PC_Application/LibreVNA-GUI/Calibration/calibrationviewdialog.ui @@ -6,70 +6,111 @@ 0 0 - 818 - 623 + 1106 + 665 Calibration Error Term Model - + - - - - - View error term model when stimulus is at port - - - - - - - 1 - - - 8 - - - - - - - Qt::Orientation::Horizontal - - - - 40 - 20 - - - - - - - - - - <html><head/><body><p><span style='color: darkgreen;'>Green</span> error terms have been calculated from calibration measurements.</p><p><span style='color: darkred;'>Red</span> error terms are at their default values (either 1 or 0).</p></body></html> - - - - - - - QGraphicsView::DragMode::ScrollHandDrag - - - - - - - <html><head/><body><p>D: Directivity, R: Reflection tracking, S: Source match, L: Receiver match, T: Transmission tracking, I: Isolation</p></body></html> - - - true + + + Qt::Orientation::Horizontal + + + + + + + + View error term model when stimulus is at port + + + + + + + 1 + + + 8 + + + + + + + Qt::Orientation::Horizontal + + + + 40 + 20 + + + + + + + + + + <html><head/><body><p><span style='color: darkgreen;'>Green</span> error terms have been calculated from calibration measurements.</p><p><span style='color: darkred;'>Red</span> error terms are at their default values (either 1 or 0).</p></body></html> + + + + + + + QGraphicsView::DragMode::ScrollHandDrag + + + + + + + <html><head/><body><p>D: Directivity, R: Reflection tracking, S: Source match, L: Receiver match, T: Transmission tracking, I: Isolation</p></body></html> + + + true + + + + + + + + + + + Which measurements are being corrected? + + + true + + + + + + + QAbstractItemView::EditTrigger::NoEditTriggers + + + QAbstractItemView::SelectionMode::NoSelection + + + true + + + false + + + + +