]>
git.zerfleddert.de Git - proxmark3-svn/blob - client/proxguiqt.h
aa3b5b355e55ee03caeca0f4c84bc377b5a7d244
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 //-----------------------------------------------------------------------------
14 #include <QApplication>
15 #include <QPushButton>
21 #include "ui/ui_overlays.h"
23 * @brief The actual plot, black area were we paint the graph
25 class Plot
: public QWidget
29 double GraphPixelsPerPoint
;
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
);
40 Plot(QWidget
*parent
= 0);
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
);
53 * The window with plot and controls
55 class ProxWidget
: public QWidget
57 Q_OBJECT
; //needed for slot/signal classes
62 Ui::Form
*opsController
;
63 QWidget
* controlWidget
;
66 ProxWidget(QWidget
*parent
= 0, ProxGuiQT
*master
= NULL
);
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);
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
);
87 class ProxGuiQT
: public QObject
92 QApplication
*plotapp
;
93 ProxWidget
*plotwidget
;
96 void (*main_func
)(void);
99 ProxGuiQT(int argc
, char **argv
);
101 void ShowGraphWindow(void);
102 void RepaintGraphWindow(void);
103 void HideGraphWindow(void);
107 void _ShowGraphWindow(void);
108 void _RepaintGraphWindow(void);
109 void _HideGraphWindow(void);
112 void ShowGraphWindowSignal(void);
113 void RepaintGraphWindowSignal(void);
114 void HideGraphWindowSignal(void);
115 void ExitSignal(void);