]>
git.zerfleddert.de Git - proxmark3-svn/blob - client/proxguiqt.h
fa1ba018d756874da56182ce6658e8c53e3798bb
1 //-----------------------------------------------------------------------------
2 // Copyright (C) 2009 Michael Gernoth <michael at gernoth.net>
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
7 //-----------------------------------------------------------------------------
9 //-----------------------------------------------------------------------------
11 #include <QApplication>
12 #include <QPushButton>
18 #include "ui/ui_overlays.h"
20 * @brief The actual plot, black area were we paint the graph
22 class Plot
: public QWidget
26 double GraphPixelsPerPoint
;
29 void PlotGraph(int *buffer
, int len
, QRect r
,QRect r2
, QPainter
* painter
, int graphNum
);
30 void PlotDemod(uint8_t *buffer
, size_t len
, QRect r
,QRect r2
, QPainter
* painter
, int graphNum
, int plotOffset
);
31 void plotGridLines(QPainter
* painter
,QRect r
);
32 int xCoordOf(int i
, QRect r
);
33 int yCoordOf(int v
, QRect r
, int maxVal
);
34 int valueOf_yCoord(int y
, QRect r
, int maxVal
);
35 QColor
getColor(int graphNum
);
37 Plot(QWidget
*parent
= 0);
40 void paintEvent(QPaintEvent
*event
);
41 void closeEvent(QCloseEvent
*event
);
42 void mouseMoveEvent(QMouseEvent
*event
);
43 void mousePressEvent(QMouseEvent
*event
) { mouseMoveEvent(event
); }
44 void keyPressEvent(QKeyEvent
*event
);
50 * The window with plot and controls
52 class ProxWidget
: public QWidget
58 Ui::Form
*opsController
;
62 ProxWidget(QWidget
*parent
= 0, ProxGuiQT
*master
= NULL
);
65 // void paintEvent(QPaintEvent *event);
66 // void closeEvent(QCloseEvent *event);
67 // void mouseMoveEvent(QMouseEvent *event);
68 // void mousePressEvent(QMouseEvent *event) { mouseMoveEvent(event); }
69 // void keyPressEvent(QKeyEvent *event);
71 void applyOperation();
72 void stickOperation();
73 void vchange_autocorr(int v
);
74 void vchange_askedge(int v
);
75 void vchange_dthr_up(int v
);
76 void vchange_dthr_down(int v
);
79 class ProxGuiQT
: public QObject
84 QApplication
*plotapp
;
85 ProxWidget
*plotwidget
;
88 void (*main_func
)(void);
91 ProxGuiQT(int argc
, char **argv
);
93 void ShowGraphWindow(void);
94 void RepaintGraphWindow(void);
95 void HideGraphWindow(void);
99 void _ShowGraphWindow(void);
100 void _RepaintGraphWindow(void);
101 void _HideGraphWindow(void);
104 void ShowGraphWindowSignal(void);
105 void RepaintGraphWindowSignal(void);
106 void HideGraphWindowSignal(void);