]>
git.zerfleddert.de Git - proxmark3-svn/blob - client/proxguiqt.h
e43311ee2ff1af0ed65387079d7d53c50e181953
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 //-----------------------------------------------------------------------------
17 #include <QApplication>
18 #include <QPushButton>
24 #include "ui/ui_overlays.h"
26 * @brief The actual plot, black area were we paint the graph
28 class Plot
: public QWidget
33 double GraphPixelsPerPoint
;
36 void PlotGraph(int *buffer
, int len
, QRect r
,QRect r2
, QPainter
* painter
, int graphNum
);
37 void PlotDemod(uint8_t *buffer
, size_t len
, QRect r
,QRect r2
, QPainter
* painter
, int graphNum
, int plotOffset
);
38 void plotGridLines(QPainter
* painter
,QRect r
);
39 int xCoordOf(int i
, QRect r
);
40 int yCoordOf(int v
, QRect r
, int maxVal
);
41 int valueOf_yCoord(int y
, QRect r
, int maxVal
);
42 void setMaxAndStart(int *buffer
, int len
, QRect plotRect
);
43 QColor
getColor(int graphNum
);
45 Plot(QWidget
*parent
= 0);
48 void paintEvent(QPaintEvent
*event
);
49 void closeEvent(QCloseEvent
*event
);
50 void mouseMoveEvent(QMouseEvent
*event
);
51 void mousePressEvent(QMouseEvent
*event
) { mouseMoveEvent(event
); }
52 void keyPressEvent(QKeyEvent
*event
);
58 * The window with plot and controls
60 class ProxWidget
: public QWidget
62 Q_OBJECT
; //needed for slot/signal classes
67 Ui::Form
*opsController
;
68 QWidget
* controlWidget
;
71 ProxWidget(QWidget
*parent
= 0, ProxGuiQT
*master
= NULL
);
76 // void paintEvent(QPaintEvent *event);
77 void closeEvent(QCloseEvent
*event
);
78 void showEvent(QShowEvent
*event
);
79 void hideEvent(QHideEvent
*event
);
80 // void mouseMoveEvent(QMouseEvent *event);
81 // void mousePressEvent(QMouseEvent *event) { mouseMoveEvent(event); }
82 // void keyPressEvent(QKeyEvent *event);
84 void applyOperation();
85 void stickOperation();
86 void vchange_autocorr(int v
);
87 void vchange_askedge(int v
);
88 void vchange_dthr_up(int v
);
89 void vchange_dthr_down(int v
);
92 class WorkerThread
: public QThread
{
95 WorkerThread(char*, char*, bool);
99 char *script_cmds_file
= NULL
;
100 char *script_cmd
= NULL
;
104 class ProxGuiQT
: public QObject
109 QApplication
*plotapp
;
110 ProxWidget
*plotwidget
;
113 void (*main_func
)(void);
114 WorkerThread
*proxmarkThread
;
117 ProxGuiQT(int argc
, char **argv
, WorkerThread
*wthread
);
119 void ShowGraphWindow(void);
120 void RepaintGraphWindow(void);
121 void HideGraphWindow(void);
125 void _ShowGraphWindow(void);
126 void _RepaintGraphWindow(void);
127 void _HideGraphWindow(void);
129 void _StartProxmarkThread(void);
131 void ShowGraphWindowSignal(void);
132 void RepaintGraphWindowSignal(void);
133 void HideGraphWindowSignal(void);
134 void ExitSignal(void);