summaryrefslogtreecommitdiff
path: root/DSLogic-gui/pv/view/dsldial.h
diff options
context:
space:
mode:
authorSven Wegener <sven.wegener@stealer.net>2014-06-30 09:38:31 +0200
committerSven Wegener <sven.wegener@stealer.net>2014-06-30 09:38:31 +0200
commit79de83205964ee0182940ef7cec86b46896ed0e6 (patch)
treeccf532205a550ac926e52069649a1cc41aa555a6 /DSLogic-gui/pv/view/dsldial.h
parent3de7dbb24c71c0d894dbd734ddf9258683d9e2e1 (diff)
Update from DSLogic-v0.3.tar.gzHEADmaster
Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
Diffstat (limited to 'DSLogic-gui/pv/view/dsldial.h')
-rw-r--r--DSLogic-gui/pv/view/dsldial.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/DSLogic-gui/pv/view/dsldial.h b/DSLogic-gui/pv/view/dsldial.h
new file mode 100644
index 0000000..6925309
--- /dev/null
+++ b/DSLogic-gui/pv/view/dsldial.h
@@ -0,0 +1,48 @@
+#ifndef DSLOGIC_PV_VIEW_DSLDIAL_H
+#define DSLOGIC_PV_VIEW_DSLDIAL_H
+
+#include <QRect>
+#include <QPainter>
+
+namespace pv {
+namespace view {
+
+class dslDial
+{
+public:
+ dslDial(quint64 div, quint64 step,
+ QVector<quint64> value, QVector<QString> unit);
+ virtual ~dslDial();
+
+public:
+ /**
+ * Paints the dial with a QPainter
+ * @param p the QPainter to paint into.
+ * @param dialRect the rectangle to draw the dial at.
+ **/
+ void paint(QPainter &p, QRectF dialRect, QColor dialColor);
+
+ // set/get current select
+ void set_sel(quint64 sel);
+ quint64 get_sel();
+
+ // boundary detection
+ bool isMin();
+ bool isMax();
+
+ // get current value
+ quint64 get_value();
+ bool set_value(quint64 value);
+
+private:
+ quint64 _div;
+ quint64 _step;
+ QVector<quint64> _value;
+ QVector<QString> _unit;
+ quint64 _sel;
+};
+
+} // namespace view
+} // namespace pv
+
+#endif // DSLOGIC_PV_VIEW_DSLDIAL_H