]>
git.zerfleddert.de Git - proxmark3-svn/blob - client/proxguiqt.h
794db2d7a673b0ce6f5107514660c07bdbf0d730
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_dthr_up(int v
);
75 void vchange_dthr_down(int v
);
78 class ProxGuiQT
: public QObject
83 QApplication
*plotapp
;
84 ProxWidget
*plotwidget
;
87 void (*main_func
)(void);
90 ProxGuiQT(int argc
, char **argv
);
92 void ShowGraphWindow(void);
93 void RepaintGraphWindow(void);
94 void HideGraphWindow(void);
98 void _ShowGraphWindow(void);
99 void _RepaintGraphWindow(void);
100 void _HideGraphWindow(void);
103 void ShowGraphWindowSignal(void);
104 void RepaintGraphWindowSignal(void);
105 void HideGraphWindowSignal(void);