Markers adjusted for time domain math + distance mode fixed

This commit is contained in:
Jan Käberich 2020-12-02 22:15:34 +01:00
parent b8ccca5ebc
commit b91f431473
11 changed files with 375 additions and 229 deletions

View file

@ -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;