-
Notifications
You must be signed in to change notification settings - Fork 2
/
wave_view.h
131 lines (101 loc) · 2.94 KB
/
wave_view.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/*
***************************************************************************
*
* Author: Teunis van Beelen
*
* Copyright (C) 2016 - 2020 Teunis van Beelen
*
* Email: [email protected]
*
***************************************************************************
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
***************************************************************************
*/
#ifndef WAVECURVE_H
#define WAVECURVE_H
#include <QtGlobal>
#include <QWidget>
#include <QMouseEvent>
#include <QPainter>
#include <QPainterPath>
#include <QPushButton>
#include <QPen>
#include <QString>
#include <QStringList>
#include <QFont>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "global.h"
#include "utils.h"
#include "wave_dialog.h"
class UI_wave_window;
class WaveCurve: public QWidget
{
Q_OBJECT
public:
WaveCurve(QWidget *parent=0);
QSize sizeHint() const {return minimumSizeHint(); }
QSize minimumSizeHint() const {return QSize(30,10); }
void setSignalColor1(QColor);
void setSignalColor2(QColor);
void setSignalColor3(QColor);
void setSignalColor4(QColor);
void setTraceWidth(int);
void setBackgroundColor(QColor);
void setRasterColor(QColor);
void setTextColor(QColor);
void setBorderSize(int);
void setDeviceParameters(struct device_settings *);
private slots:
private:
QColor SignalColor[MAX_CHNS],
BackgroundColor,
RasterColor,
TextColor;
QFont smallfont;
double v_sense;
int bufsize,
bordersize,
tracewidth,
w,
h,
old_w,
chan_arrow_pos[MAX_CHNS],
trig_level_arrow_pos,
trig_pos_arrow_pos,
use_move_events,
mouse_x,
mouse_y,
mouse_old_x,
mouse_old_y;
void drawArrow(QPainter *, int, int, int, QColor, char);
void drawSmallTriggerArrow(QPainter *, int, int, int, QColor);
void drawTrigCenterArrow(QPainter *, int, int);
void drawTopLabels(QPainter *);
void drawChanLabel(QPainter *, int, int, int);
void paintLabel(QPainter *, int, int, int, int, const char *, QColor);
void draw_decoder(QPainter *, int, int);
int ascii_decode_control_char(char, char *, int);
struct device_settings *devparms;
UI_wave_window *wavedialog;
protected:
void paintEvent(QPaintEvent *);
void mousePressEvent(QMouseEvent *);
void mouseReleaseEvent(QMouseEvent *);
void mouseMoveEvent(QMouseEvent *);
};
#endif