]> cvs.zerfleddert.de Git - proxmark3-svn/blob - client/proxguiqt.h
finish FSK graph index changes
[proxmark3-svn] / client / proxguiqt.h
1 //-----------------------------------------------------------------------------
2 // Copyright (C) 2009 Michael Gernoth <michael at gernoth.net>
3 //
4 // This code is licensed to you under the terms of the GNU GPL, version 2 or,
5 // at your option, any later version. See the LICENSE.txt file for the text of
6 // the license.
7 //-----------------------------------------------------------------------------
8 // GUI (QT)
9 //-----------------------------------------------------------------------------
10
11 #ifndef PROXGUI_QT
12 #define PROXGUI_QT
13
14 #include <QApplication>
15 #include <QPushButton>
16 #include <QObject>
17 #include <QWidget>
18 #include <QPainter>
19 #include <QtGui>
20
21 #include "ui/ui_overlays.h"
22 /**
23 * @brief The actual plot, black area were we paint the graph
24 */
25 class Plot: public QWidget
26 {
27 private:
28 int GraphStart;
29 double GraphPixelsPerPoint;
30 int CursorAPos;
31 int CursorBPos;
32 void PlotGraph(int *buffer, int len, QRect r,QRect r2, QPainter* painter, int graphNum);
33 void PlotDemod(uint8_t *buffer, size_t len, QRect r,QRect r2, QPainter* painter, int graphNum, int plotOffset);
34 void plotGridLines(QPainter* painter,QRect r);
35 int xCoordOf(int i, QRect r );
36 int yCoordOf(int v, QRect r, int maxVal);
37 int valueOf_yCoord(int y, QRect r, int maxVal);
38 QColor getColor(int graphNum);
39 public:
40 Plot(QWidget *parent = 0);
41
42 protected:
43 void paintEvent(QPaintEvent *event);
44 void closeEvent(QCloseEvent *event);
45 void mouseMoveEvent(QMouseEvent *event);
46 void mousePressEvent(QMouseEvent *event) { mouseMoveEvent(event); }
47 void keyPressEvent(QKeyEvent *event);
48
49 };
50 class ProxGuiQT;
51
52 /**
53 * The window with plot and controls
54 */
55 class ProxWidget : public QWidget
56 {
57 Q_OBJECT; //needed for slot/signal classes
58
59 private:
60 ProxGuiQT *master;
61 Plot *plot;
62 Ui::Form *opsController;
63 QWidget* controlWidget;
64
65 public:
66 ProxWidget(QWidget *parent = 0, ProxGuiQT *master = NULL);
67 ~ProxWidget(void);
68 //OpsShow(void);
69
70 protected:
71 // void paintEvent(QPaintEvent *event);
72 void closeEvent(QCloseEvent *event);
73 void showEvent(QShowEvent *event);
74 void hideEvent(QHideEvent *event);
75 // void mouseMoveEvent(QMouseEvent *event);
76 // void mousePressEvent(QMouseEvent *event) { mouseMoveEvent(event); }
77 // void keyPressEvent(QKeyEvent *event);
78 public slots:
79 void applyOperation();
80 void stickOperation();
81 void vchange_autocorr(int v);
82 void vchange_askedge(int v);
83 void vchange_dthr_up(int v);
84 void vchange_dthr_down(int v);
85 };
86
87 class ProxGuiQT : public QObject
88 {
89 Q_OBJECT;
90
91 private:
92 QApplication *plotapp;
93 ProxWidget *plotwidget;
94 int argc;
95 char **argv;
96 void (*main_func)(void);
97
98 public:
99 ProxGuiQT(int argc, char **argv);
100 ~ProxGuiQT(void);
101 void ShowGraphWindow(void);
102 void RepaintGraphWindow(void);
103 void HideGraphWindow(void);
104 void MainLoop(void);
105 void Exit(void);
106 private slots:
107 void _ShowGraphWindow(void);
108 void _RepaintGraphWindow(void);
109 void _HideGraphWindow(void);
110 void _Exit(void);
111 signals:
112 void ShowGraphWindowSignal(void);
113 void RepaintGraphWindowSignal(void);
114 void HideGraphWindowSignal(void);
115 void ExitSignal(void);
116 };
117 #endif // PROXGUI_QT
Impressum, Datenschutz