projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Switch segment storage from single vector to vector of arrays
[pulseview.git]
/
pv
/
view
/
trace.hpp
diff --git
a/pv/view/trace.hpp
b/pv/view/trace.hpp
index 7d5158c3a0d36d237e3e2c9596ea87d399083483..11f80ccbeb6426b0d163eecd7a2b8f36d20a7a7a 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>
@@
-29,7
+28,9
@@
#include <stdint.h>
#include <stdint.h>
-#include "rowitem.hpp"
+#include "tracetreeitem.hpp"
+
+#include "pv/data/signalbase.hpp"
class QFormLayout;
class QFormLayout;
@@
-39,9
+40,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
+51,27
@@
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(
std::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);
/**
- *
G
et the colour of the signal.
+ *
S
et the colour of the signal.
*/
*/
-
QColor colour() const
;
+
virtual void set_colour(QColor colour)
;
/**
/**
- *
Set the colour of the signal
.
+ *
Enables or disables the coloured background for this trace
.
*/
*/
- void set_colour
(QColor colour
);
+ void set_colour
ed_bg(bool state
);
/**
* Paints the signal label.
/**
* Paints the signal label.
@@
-93,13
+93,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, const 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, const
Vie
wItemPaintParams &pp, int y);
void add_colour_option(QWidget *parent, QFormLayout *form);
void add_colour_option(QWidget *parent, QFormLayout *form);
@@
-107,23
+114,29
@@
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 nam
e_;
-
QColor colour
_;
+
std::shared_ptr<data::SignalBase> bas
e_;
+
bool coloured_bg_, coloured_bg_state
_;
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