mirror of
https://github.com/jankae/LibreVNA.git
synced 2025-12-06 07:12:10 +01:00
Merge branch 'master' of github.com:jankae/LibreVNA
Some checks are pending
Build / PC_Application_Ubuntu (push) Waiting to run
Build / PC_Application_RPi5 (push) Waiting to run
Build / PC_Application_Windows (push) Waiting to run
Build / PC_Application_OSX (push) Waiting to run
Build / PC_Application_OSX_13 (push) Waiting to run
Build / Embedded_Firmware (push) Waiting to run
HIL_Tests / Get_Repository (push) Waiting to run
HIL_Tests / PC_Application_RPi5 (push) Blocked by required conditions
HIL_Tests / Embedded_Firmware (push) Blocked by required conditions
HIL_Tests / HIL (push) Blocked by required conditions
Unit_Tests / Tests (push) Waiting to run
Some checks are pending
Build / PC_Application_Ubuntu (push) Waiting to run
Build / PC_Application_RPi5 (push) Waiting to run
Build / PC_Application_Windows (push) Waiting to run
Build / PC_Application_OSX (push) Waiting to run
Build / PC_Application_OSX_13 (push) Waiting to run
Build / Embedded_Firmware (push) Waiting to run
HIL_Tests / Get_Repository (push) Waiting to run
HIL_Tests / PC_Application_RPi5 (push) Blocked by required conditions
HIL_Tests / Embedded_Firmware (push) Blocked by required conditions
HIL_Tests / HIL (push) Blocked by required conditions
Unit_Tests / Tests (push) Waiting to run
This commit is contained in:
commit
1b3c1c4b3b
|
|
@ -13075,7 +13075,7 @@
|
|||
(hide yes)
|
||||
)
|
||||
)
|
||||
(property "MPN" "LM3370SD-4221"
|
||||
(property "MPN" "LM3370SD-3021"
|
||||
(at 101.6 190.5 0)
|
||||
(effects
|
||||
(font
|
||||
|
|
@ -13970,7 +13970,7 @@
|
|||
(hide yes)
|
||||
)
|
||||
)
|
||||
(property "MPN" "LM3370SD-4221"
|
||||
(property "MPN" "LM3370SD-3021"
|
||||
(at 101.6 231.14 0)
|
||||
(effects
|
||||
(font
|
||||
|
|
@ -16667,7 +16667,7 @@
|
|||
(hide yes)
|
||||
)
|
||||
)
|
||||
(property "MPN" "LM3370SD-4221"
|
||||
(property "MPN" "LM3370SD-3021"
|
||||
(at 208.28 180.34 0)
|
||||
(effects
|
||||
(font
|
||||
|
|
|
|||
|
|
@ -130,6 +130,7 @@ QString Marker::formatToString(Marker::Format f)
|
|||
case Format::Inductance: return "Inductance";
|
||||
case Format::QualityFactor: return "Quality Factor";
|
||||
case Format::GroupDelay: return "Group Delay";
|
||||
case Format::NumberOfPeaks: return "Number of peaks";
|
||||
case Format::TOI: return "Third order intercept";
|
||||
case Format::AvgTone: return "Average Tone Level";
|
||||
case Format::AvgModulationProduct: return "Average Modulation Product Level";
|
||||
|
|
@ -194,8 +195,6 @@ std::vector<Marker::Format> Marker::applicableFormats()
|
|||
case Type::Delta:
|
||||
case Type::Maximum:
|
||||
case Type::Minimum:
|
||||
case Type::PeakTable:
|
||||
case Type::NegativePeakTable:
|
||||
if(Trace::isSAParameter(parentTrace->liveParameter())) {
|
||||
ret.push_back(Format::dBm);
|
||||
ret.push_back(Format::dBuV);
|
||||
|
|
@ -218,6 +217,10 @@ std::vector<Marker::Format> Marker::applicableFormats()
|
|||
}
|
||||
}
|
||||
break;
|
||||
case Type::PeakTable:
|
||||
case Type::NegativePeakTable:
|
||||
ret.push_back(Format::NumberOfPeaks);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -228,8 +231,6 @@ std::vector<Marker::Format> Marker::applicableFormats()
|
|||
case Type::Delta:
|
||||
case Type::Maximum:
|
||||
case Type::Minimum:
|
||||
case Type::PeakTable:
|
||||
case Type::NegativePeakTable:
|
||||
if(Trace::isSAParameter(parentTrace->liveParameter())) {
|
||||
ret.push_back(Format::dBm);
|
||||
ret.push_back(Format::dBuV);
|
||||
|
|
@ -253,6 +254,10 @@ std::vector<Marker::Format> Marker::applicableFormats()
|
|||
}
|
||||
}
|
||||
break;
|
||||
case Type::PeakTable:
|
||||
case Type::NegativePeakTable:
|
||||
ret.push_back(Format::NumberOfPeaks);
|
||||
break;
|
||||
case Type::Bandpass:
|
||||
ret.push_back(Format::CenterBandwidth);
|
||||
ret.push_back(Format::InsertionLoss);
|
||||
|
|
@ -451,7 +456,11 @@ QString Marker::readableData(Format f)
|
|||
switch(type) {
|
||||
case Type::PeakTable:
|
||||
case Type::NegativePeakTable:
|
||||
return "Found " + QString::number(helperMarkers.size()) + " peaks";
|
||||
switch(f) {
|
||||
case Format::NumberOfPeaks: return "Found " + QString::number(helperMarkers.size()) + " peak" + (helperMarkers.size() == 1 ? "" : "s");
|
||||
default: return "Invalid";
|
||||
}
|
||||
break;
|
||||
case Type::Delta: {
|
||||
if(!delta) {
|
||||
return "Invalid delta marker";
|
||||
|
|
@ -588,6 +597,7 @@ QString Marker::readableData(Format f)
|
|||
case Format::maxDeltaPos:
|
||||
return "max. Δ+:"+Unit::ToString(maxDeltaPos, "dB", " ", 4);
|
||||
break;
|
||||
case Format::NumberOfPeaks:
|
||||
case Format::Last:
|
||||
return "Invalid";
|
||||
}
|
||||
|
|
@ -892,10 +902,6 @@ void Marker::deltaDeleted()
|
|||
|
||||
void Marker::updateContextmenu()
|
||||
{
|
||||
if(parent) {
|
||||
// do nothing, using contextmenu from parent anyway
|
||||
return;
|
||||
}
|
||||
// check if the contextmenu or one of its submenus is currently open
|
||||
auto *activeWidget = QApplication::activePopupWidget();
|
||||
while (activeWidget) {
|
||||
|
|
@ -910,6 +916,8 @@ void Marker::updateContextmenu()
|
|||
contextmenu.clear();
|
||||
contextmenu.addSection("Marker");
|
||||
|
||||
if(!parent) {
|
||||
// type can only be changed for top level markers
|
||||
auto typemenu = contextmenu.addMenu("Type");
|
||||
auto typegroup = new QActionGroup(&contextmenu);
|
||||
for(auto t : getSupportedTypes()) {
|
||||
|
|
@ -924,6 +932,7 @@ void Marker::updateContextmenu()
|
|||
typegroup->addAction(setTypeAction);
|
||||
typemenu->addAction(setTypeAction);
|
||||
}
|
||||
}
|
||||
|
||||
auto table = contextmenu.addMenu("Data Format in Table");
|
||||
auto tablegroup = new QActionGroup(&contextmenu);
|
||||
|
|
@ -965,6 +974,8 @@ void Marker::updateContextmenu()
|
|||
}
|
||||
}
|
||||
|
||||
if(!parent) {
|
||||
// grouping and deleting is only possible for top level markers
|
||||
contextmenu.addSeparator();
|
||||
|
||||
bool needsSeparator = false;
|
||||
|
|
@ -1008,6 +1019,7 @@ void Marker::updateContextmenu()
|
|||
connect(deleteAction, &QAction::triggered, this, &Marker::deleteLater);
|
||||
contextmenu.addAction(deleteAction);
|
||||
}
|
||||
}
|
||||
|
||||
void Marker::traceTypeChanged()
|
||||
{
|
||||
|
|
@ -1231,6 +1243,7 @@ void Marker::setType(Marker::Type t)
|
|||
helper->suffix = h.suffix;
|
||||
helper->assignTrace(parentTrace);
|
||||
helper->setType(h.type);
|
||||
helper->setVisible(visible);
|
||||
helperMarkers.push_back(helper);
|
||||
}
|
||||
if(type == Type::Flatness) {
|
||||
|
|
@ -1771,12 +1784,8 @@ void Marker::setVisible(bool visible)
|
|||
}
|
||||
|
||||
QMenu *Marker::getContextMenu() {
|
||||
if(parent) {
|
||||
return parent->getContextMenu();
|
||||
} else {
|
||||
return &contextmenu;
|
||||
}
|
||||
}
|
||||
|
||||
void Marker::update()
|
||||
{
|
||||
|
|
@ -1800,20 +1809,29 @@ void Marker::update()
|
|||
break;
|
||||
case Type::PeakTable:
|
||||
case Type::NegativePeakTable: {
|
||||
deleteHelperMarkers();
|
||||
auto peaks = parentTrace->findPeakFrequencies(100, peakThreshold, 3.0, xmin, xmax, type == Type::NegativePeakTable);
|
||||
char suffix = 'a';
|
||||
for(auto p : peaks) {
|
||||
for(unsigned int i=0;i<peaks.size();i++) {
|
||||
if(helperMarkers.size() <= i) {
|
||||
// needs to create a new helper marker
|
||||
auto helper = new Marker(model, number, this);
|
||||
helper->suffix = suffix;
|
||||
helper->suffix = QChar('a' + i);
|
||||
helper->assignTrace(parentTrace);
|
||||
helper->setPosition(p);
|
||||
helper->formatTable = formatTable;
|
||||
helper->formatGraph = formatGraph;
|
||||
helper->updateContextmenu();
|
||||
suffix++;
|
||||
helper->setVisible(visible);
|
||||
helperMarkers.push_back(helper);
|
||||
}
|
||||
// update the position of the helper marker
|
||||
helperMarkers[i]->setPosition(peaks[i]);
|
||||
}
|
||||
if(helperMarkers.size() > peaks.size()) {
|
||||
// need to remove some helper markers
|
||||
emit beginRemoveHelperMarkers(this);
|
||||
for(unsigned int i = peaks.size(); i< helperMarkers.size();i++) {
|
||||
delete helperMarkers[i];
|
||||
}
|
||||
helperMarkers.resize(peaks.size());
|
||||
emit endRemoveHelperMarkers(this);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case Type::Lowpass:
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@ public:
|
|||
Inductance,
|
||||
QualityFactor,
|
||||
GroupDelay,
|
||||
// Peak table
|
||||
NumberOfPeaks,
|
||||
// Noise marker parameters
|
||||
Noise,
|
||||
PhaseNoise,
|
||||
|
|
|
|||
|
|
@ -132,11 +132,11 @@ void MarkerModel::markerDataChanged(Marker *m)
|
|||
// only update the other columns, do not override editor data
|
||||
emit dataChanged(index(row, ColIndexData), index(row, ColIndexData));
|
||||
} else {
|
||||
emit dataChanged(index(row, ColIndexNumber), index(row, ColIndexData));
|
||||
emit dataChanged(index(row, ColIndexSettings), index(row, ColIndexData));
|
||||
// also update any potential helper markers
|
||||
for(unsigned int i=0;i<m->getHelperMarkers().size();i++) {
|
||||
auto modelIndex = createIndex(i, 0, m);
|
||||
emit dataChanged(index(i, ColIndexNumber, modelIndex), index(i, ColIndexData, modelIndex));
|
||||
emit dataChanged(index(i, ColIndexSettings, modelIndex), index(i, ColIndexData, modelIndex));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -551,6 +551,10 @@ Marker *TracePlot::markerAtPosition(QPoint p, bool onlyMovable)
|
|||
}
|
||||
auto markers = t.first->getMarkers();
|
||||
for(Marker* m : markers) {
|
||||
if(!m->isVisible()) {
|
||||
// can not interact with invisible markers, pretend that there is nothing here
|
||||
continue;
|
||||
}
|
||||
if(!m->isMovable() && onlyMovable) {
|
||||
continue;
|
||||
}
|
||||
|
|
@ -563,15 +567,8 @@ Marker *TracePlot::markerAtPosition(QPoint p, bool onlyMovable)
|
|||
unsigned int distance = diff.x() * diff.x() + diff.y() * diff.y();
|
||||
if(distance < closestDistance) {
|
||||
closestDistance = distance;
|
||||
if(m->getParent()) {
|
||||
closestMarker = m->getParent();
|
||||
if(closestMarker->getType() == Marker::Type::Flatness) {
|
||||
closestMarker = m;
|
||||
}
|
||||
} else {
|
||||
closestMarker = m;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(closestDistance <= 400) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue