HAL  v4.5.0-83-g30c8f0afc
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
wave_transform.cpp
Go to the documentation of this file.
3 #include "math.h"
4 
5 namespace hal {
6  double WaveTransform::vPos(double t) const
7  {
8  if (t < mTmin) return 0;
9  return mMag*(t-mTmin);
10  }
11 
12  double WaveTransform::tPos(quint64 v) const
13  {
14  return v/mMag + mTmin;
15  }
16 
17  //-------------------------------------------------------
18 
20  : mScale(0), mTleft(0), mWidth(0)
21  {
22  if (!trans || !sbar) return;
23  mScale = trans->scale();
24  mTleft = sbar->tLeftI();
25  mWidth = sbar->viewportWidth();
26  }
27 
28  bool WaveZoomShift::sameHistory(const WaveZoomShift& other)const
29  {
30  if (isNull() || other.isNull())
31  return false;
32 
33  return (mScale == other.mScale && mTleft == other.mTleft);
34  }
35 
36  bool WaveZoomShift::operator==(const WaveZoomShift& other) const
37  {
38  if (isNull() || other.isNull())
39  return false;
40 
41  return (mScale == other.mScale && mTleft == other.mTleft && mWidth == other.mWidth);
42  }
43 
44  bool WaveZoomShift::isNull() const
45  {
46  return (mWidth == 0 || mScale <= 0);
47  }
48 
50  {
51  return QString("<sc:%1|l:%2|w:%3>").arg(mScale,0,'f',8).arg(mTleft).arg(mWidth);
52  }
53 }
quint64 tLeftI() const
int viewportWidth() const
double scale() const
double tPos(quint64 v) const
double vPos(double t) const
WaveZoomShift(double sc, quint64 tl, int w)
bool operator==(const WaveZoomShift &other) const
bool sameHistory(const WaveZoomShift &other) const
QString dumpString() const
Definition: defines.h:45
QString arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const const