]>
git.zerfleddert.de Git - proxmark3-svn/blob - client/proxguiqt.h
8ea4d312a2dda96455091e811b2bfb1ce942eca9
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 void setMaxAndStart(int *buffer
, int len
, QRect plotRect
);
39 QColor
getColor(int graphNum
);
41 Plot(QWidget
*parent
= 0);
44 void paintEvent(QPaintEvent
*event
);
45 void closeEvent(QCloseEvent
*event
);
46 void mouseMoveEvent(QMouseEvent
*event
);
47 void mousePressEvent(QMouseEvent
*event
) { mouseMoveEvent(event
); }
48 void keyPressEvent(QKeyEvent
*event
);
54 * The window with plot and controls
56 class ProxWidget
: public QWidget
58 Q_OBJECT
; //needed for slot/signal classes
63 Ui::Form
*opsController
;
64 QWidget
* controlWidget
;
67 ProxWidget(QWidget
*parent
= 0, ProxGuiQT
*master
= NULL
);
72 // void paintEvent(QPaintEvent *event);
73 void closeEvent(QCloseEvent
*event
);
74 void showEvent(QShowEvent
*event
);
75 void hideEvent(QHideEvent
*event
);
76 // void mouseMoveEvent(QMouseEvent *event);
77 // void mousePressEvent(QMouseEvent *event) { mouseMoveEvent(event); }
78 // void keyPressEvent(QKeyEvent *event);
80 void applyOperation();
81 void stickOperation();
82 void vchange_autocorr(int v
);
83 void vchange_askedge(int v
);
84 void vchange_dthr_up(int v
);
85 void vchange_dthr_down(int v
);
88 class ProxGuiQT
: public QObject
93 QApplication
*plotapp
;
94 ProxWidget
*plotwidget
;
97 void (*main_func
)(void);
100 ProxGuiQT(int argc
, char **argv
);
102 void ShowGraphWindow(void);
103 void RepaintGraphWindow(void);
104 void HideGraphWindow(void);
108 void _ShowGraphWindow(void);
109 void _RepaintGraphWindow(void);
110 void _HideGraphWindow(void);
113 void ShowGraphWindowSignal(void);
114 void RepaintGraphWindowSignal(void);
115 void HideGraphWindowSignal(void);
116 void ExitSignal(void);