projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
MainBar: Fix notification message
[pulseview.git]
/
pv
/
view
/
trace.hpp
diff --git
a/pv/view/trace.hpp
b/pv/view/trace.hpp
index 7d5158c3a0d36d237e3e2c9596ea87d399083483..731ed5dbd5980b38a26477b55920ddffc165069a 100644
(file)
--- a/
pv/view/trace.hpp
+++ b/
pv/view/trace.hpp
@@
-14,12
+14,11
@@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
*/
-#ifndef PULSEVIEW_PV_VIEW
_TRACE_H
-#define PULSEVIEW_PV_VIEW
_TRACE_H
+#ifndef PULSEVIEW_PV_VIEW
S_TRACEVIEW_TRACE_HPP
+#define PULSEVIEW_PV_VIEW
S_TRACEVIEW_TRACE_HPP
#include <QColor>
#include <QPainter>
#include <QColor>
#include <QPainter>
@@
-27,9
+26,13
@@
#include <QRect>
#include <QString>
#include <QRect>
#include <QString>
-#include <
stdint.h
>
+#include <
cstdint
>
-#include "rowitem.hpp"
+#include "tracetreeitem.hpp"
+
+#include "pv/data/signalbase.hpp"
+
+using std::shared_ptr;
class QFormLayout;
class QFormLayout;
@@
-39,9
+42,10
@@
namespace widgets {
class Popup;
}
class Popup;
}
-namespace view {
+namespace views {
+namespace TraceView {
-class Trace : public
Row
Item
+class Trace : public
TraceTree
Item
{
Q_OBJECT
{
Q_OBJECT
@@
-49,29
+53,22
@@
private:
static const QPen AxisPen;
static const int LabelHitPadding;
static const QPen AxisPen;
static const int LabelHitPadding;
+ static const QColor BrightGrayBGColour;
+ static const QColor DarkGrayBGColour;
+
protected:
protected:
- Trace(
QString name
);
+ Trace(
shared_ptr<data::SignalBase> channel
);
public:
public:
- /**
- * Gets the name of this signal.
- */
- QString name() const;
-
/**
* Sets the name of the signal.
*/
virtual void set_name(QString name);
/**
* Sets the name of the signal.
*/
virtual void set_name(QString name);
- /**
- * Get the colour of the signal.
- */
- QColor colour() const;
-
/**
* Set the colour of the signal.
*/
/**
* Set the colour of the signal.
*/
- void set_colour(QColor colour);
+ v
irtual v
oid set_colour(QColor colour);
/**
* Paints the signal label.
/**
* Paints the signal label.
@@
-93,13
+90,20
@@
public:
QRectF label_rect(const QRectF &rect) const;
protected:
QRectF label_rect(const QRectF &rect) const;
protected:
+ /**
+ * Paints the background layer of the signal with a QPainter.
+ * @param p The QPainter to paint into.
+ * @param pp The painting parameters object to paint with.
+ */
+ virtual void paint_back(QPainter &p, ViewItemPaintParams &pp);
+
/**
* Paints a zero axis across the viewport.
* @param p the QPainter to paint into.
* @param pp the painting parameters object to paint with.
* @param y the y-offset of the axis.
*/
/**
* Paints a zero axis across the viewport.
* @param p the QPainter to paint into.
* @param pp the painting parameters object to paint with.
* @param y the y-offset of the axis.
*/
- void paint_axis(QPainter &p,
const Ro
wItemPaintParams &pp, int y);
+ void paint_axis(QPainter &p,
Vie
wItemPaintParams &pp, int y);
void add_colour_option(QWidget *parent, QFormLayout *form);
void add_colour_option(QWidget *parent, QFormLayout *form);
@@
-107,23
+111,28
@@
protected:
virtual void populate_popup_form(QWidget *parent, QFormLayout *form);
virtual void populate_popup_form(QWidget *parent, QFormLayout *form);
-pr
ivate
Q_SLOTS:
- v
oid on_text
_changed(const QString &text);
+pr
otected
Q_SLOTS:
+ v
irtual void on_name
_changed(const QString &text);
- void on_colour_changed(const QColor &colour);
+ v
irtual v
oid on_colour_changed(const QColor &colour);
void on_popup_closed();
void on_popup_closed();
+private Q_SLOTS:
+ void on_nameedit_changed(const QString &name);
+
+ void on_colouredit_changed(const QColor &colour);
+
protected:
protected:
- QString name_;
- QColor colour_;
+ shared_ptr<data::SignalBase> base_;
private:
pv::widgets::Popup *popup_;
QFormLayout *popup_form_;
};
private:
pv::widgets::Popup *popup_;
QFormLayout *popup_form_;
};
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
} // namespace pv
-#endif // PULSEVIEW_PV_VIEW
_TRACE_H
+#endif // PULSEVIEW_PV_VIEW
S_TRACEVIEW_TRACE_HPP