assert(_probe_index >= 0);
}
-void LogicSignal::paint(QGLWidget &widget, const QRect &rect)
+void LogicSignal::paint(QGLWidget &widget, const QRect &rect,
+ uint64_t scale, int64_t offset)
{
glColor3f(1,0,0);
glBegin(GL_POLYGON);
LogicSignal(QString name, boost::shared_ptr<SignalData> data,
int probe_index);
- void paint(QGLWidget &widget, const QRect &rect);
+ /**
+ * Paints the signal into a QGLWidget.
+ * @param widget the QGLWidget to paint into.
+ * @param rect the rectangular area to draw the trace into.
+ * @param scale the scale in femtoseconds per pixel.
+ * @param offset the time to show at the left hand edge of
+ * the view in femtoseconds.
+ **/
+ void paint(QGLWidget &widget, const QRect &rect, uint64_t scale,
+ int64_t offset);
private:
int _probe_index;
public:
QString get_name() const;
- virtual void paint(QGLWidget &widget, const QRect &rect) = 0;
+ /**
+ * Paints the signal into a QGLWidget.
+ * @param widget the QGLWidget to paint into.
+ * @param rect the rectangular area to draw the trace into.
+ * @param scale the scale in femtoseconds per pixel.
+ * @param offset the time to show at the left hand edge of
+ * the view in femtoseconds.
+ **/
+ virtual void paint(QGLWidget &widget, const QRect &rect,
+ uint64_t scale, int64_t offset) = 0;
protected:
QString _name;
SigView::SigView(SigSession &session, QWidget *parent) :
QGLWidget(parent),
- _session(session)
+ _session(session),
+ _scale(1000000000ULL),
+ _offset(0)
{
connect(&_session, SIGNAL(dataUpdated()),
this, SLOT(dataUpdated()));
BOOST_FOREACH(const shared_ptr<Signal> s, sigs)
{
assert(s);
- s->paint(*this, rect);
+ s->paint(*this, rect, _scale, _offset);
rect.translate(0, SignalHeight);
}
}
private:
SigSession &_session;
+
+ uint64_t _scale;
+ int64_t _offset;
};
#endif // SIGVIEW_H