mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-06 15:04:11 +00:00
Markers adjusted for time domain math + distance mode fixed
This commit is contained in:
parent
b8ccca5ebc
commit
b91f431473
11 changed files with 375 additions and 229 deletions
|
|
@ -167,6 +167,32 @@ const std::vector<Trace::MathInfo>& Trace::getMathOperations() const
|
|||
return mathOps;
|
||||
}
|
||||
|
||||
double Trace::velocityFactor()
|
||||
{
|
||||
// TODO make changeable
|
||||
return 0.66;
|
||||
}
|
||||
|
||||
double Trace::timeToDistance(double time)
|
||||
{
|
||||
double c = 299792458;
|
||||
auto distance = time * c * velocityFactor();
|
||||
if(isReflection()) {
|
||||
distance /= 2.0;
|
||||
}
|
||||
return distance;
|
||||
}
|
||||
|
||||
double Trace::distanceToTime(double distance)
|
||||
{
|
||||
double c = 299792458;
|
||||
auto time = distance / (c * velocityFactor());
|
||||
if(isReflection()) {
|
||||
time *= 2.0;
|
||||
}
|
||||
return time;
|
||||
}
|
||||
|
||||
void Trace::updateLastMath(vector<MathInfo>::reverse_iterator start)
|
||||
{
|
||||
TraceMath *newLast = nullptr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue