mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-06 15:04:11 +00:00
Custom math expressions + bugfix harmonic mixing
This commit is contained in:
parent
49e0b901fd
commit
9614c9d850
97 changed files with 18173 additions and 11 deletions
|
|
@ -52,6 +52,8 @@ void Trace::addData(const Trace::Data& d) {
|
|||
auto lower = lower_bound(data.begin(), data.end(), d, [](const Data &lhs, const Data &rhs) -> bool {
|
||||
return lhs.x < rhs.x;
|
||||
});
|
||||
// calculate index now because inserting a sample into data might lead to reallocation -> arithmetic on lower not valid anymore
|
||||
auto index = lower - data.begin();
|
||||
if(lower == data.end()) {
|
||||
// highest frequency yet, add to vector
|
||||
data.push_back(d);
|
||||
|
|
@ -74,13 +76,12 @@ void Trace::addData(const Trace::Data& d) {
|
|||
}
|
||||
break;
|
||||
}
|
||||
|
||||
} else {
|
||||
// insert at this position
|
||||
data.insert(lower, d);
|
||||
}
|
||||
success();
|
||||
emit outputSamplesChanged(lower - data.begin(), lower - data.begin() + 1);
|
||||
emit outputSamplesChanged(index, index + 1);
|
||||
}
|
||||
|
||||
void Trace::addData(const Trace::Data &d, const Protocol::SweepSettings &s)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue