-
Notifications
You must be signed in to change notification settings - Fork 5
/
sweepcurvewidget.h
248 lines (209 loc) · 6.03 KB
/
sweepcurvewidget.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
/***************************************************************************
sweepcurvewidget.cpp
widgetwobbeln.cpp - description
----------------------------------------------------
begin : 2003
copyright : (C) 2003 by Andreas Lindenau
email : [email protected]
widgetwobbeln.cpp have been refactored to sweepcurvewidget.cpp QT5
----------------------------------------------------
begin : 2013
copyright : (C) 2013 by Andrey Sobol
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 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef WIDGETWOBBWELN_H
#define WIDGETWOBBWELN_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <QWidget>
#include <QPainter>
#include <QPixmap>
#include <QString>
#include <QLineEdit>
#include <QObject>
#include <QSpinBox>
#include <QCheckBox>
#include <QPushButton>
#include <QDialog>
//#include <QtPrintSupport>
#include <QPrinter>
#include <QLabel>
#include <QGroupBox>
#include <QVector>
/*#include <Q3PaintDeviceMetrics>*/
//#include <Q3PopupMenu>
#include <QMouseEvent>
#include <QtGui>
#include "constdef.h"
class SaveCurveDlg : public QDialog
{
Q_OBJECT
public:
SaveCurveDlg(QWidget* parent=0, Qt::WindowFlags f=0);
~SaveCurveDlg();
public slots:
void setBildinfo(TBildinfo);
private slots:
void changefont(int);
void changexpos(int);
void changeypos(int);
void changesetboxinfo();
private:
TBildinfo bbildinfo;
QGroupBox *ginfo;
QSpinBox *spfontsize;
QSpinBox *spxpos;
QSpinBox *spypos;
QLabel *labelfontsize;
QLabel *labelxpos;
QLabel *labelypos;
QPushButton *buttonok;
QPushButton *buttoncancel;
QPushButton *fontcolor;
QCheckBox *checkboxinfo;
signals:
void pixauffrischen(const TBildinfo &);
};
class SweepCurveWidget : public QWidget
{
Q_OBJECT
private:
QVector<QPoint> kurve;
QVector<QPoint> kurveb;
public:
/** construtor */
SweepCurveWidget(QWidget* parent=0);
/** destructor */
~SweepCurveWidget();
void setSweepData(TSweep);
TSweep getSweepData();
double getCallibrateWorthK1(double afrequenz);
double getCallibrateWorthK2(double afrequenz);
double getSWRCallibrateWorthK1(double afrequenz);
double getSWRCallibrateWorthK2(double afrequenz);
public slots:
void setWCursorNr(int);
void setMouseCursorCenter();
void newBuildWidthInfo(const TBildinfo &);
protected:
void closeEvent(QCloseEvent *event);
virtual void paintEvent(QPaintEvent*);
virtual void resizeEvent(QResizeEvent*);
virtual void mouseMoveEvent(QMouseEvent *e);
virtual void mousePressEvent(QMouseEvent *e);
virtual void keyPressEvent( QKeyEvent *event );
private:
QAction *akursor_clr;
QAction *akursor_clr_all;
QAction *akurve_clr;
QAction *afrequenzanfang;
QAction *afrequenzende;
QAction *akabellaenge;
QAction *akabeldaten;
QAction *aberechnen;
// Q3PopupMenu *menmouse;
QMenu *popupmenu;
QPixmap pix, pix1;
TSweep sweepData;
TSweep kurve1;
TSweep kurve2;
TSweep kurve3;
TSweep kurve4;
TSweep kurve5;
TSweep kurve6;
double dbreitealt;
double dbreite;
int upperBorder;
int widthBorder;
int mouseposx[5];
int mouseposx1[5];
int mouseposy[5];
int kxm1[5];
int kxm2[5];
int cursorix;
bool bnomove;
bool banfang;
bool bende;
bool bberechnung;
bool blupeplus;
bool blupeminus;
double mousefrequenz;
TFrqMarkers wfmarken;
int hoehe; //Hoehe der Wobbeldarstellung
int breite; //Breite der wobbeldarstellung
int durchmesser; //Durchmesser Antennendiagramm
int yswrteilung; //SWR Anzeige Aufloesung
//double yswraufloesung; //ADC Aufloesung
double xSchritt; //Schrittweite Y
double ySchritt; //Schrittweite X
double xAnfang; //absoluter Anfang normal bei 0.0
double xEnde; //absolutes Ende normal Wobbelfensterbreite
bool bresize;
//obere Anzeige der LOG_Y-Achse
double ymax;//dB
//obere Anzeige der LOG_Y-Achse
double ymin;//dB
//obere Anzeige der LOG_Y-Achse
double ydisplayteilung_log;
QStringList qusl;
QString fname;
QString squdaten;
bool speichern;
int qunr;
QStringList infolist;
TBildinfo wbildinfo;
QString kursorsavstr(double);
double getSavCalWorth(double afrequenz);
void resetMouseCursor();
void drawGrid(QPainter *p);
void drawCurve(QPainter *p);
void refreshPixmap();
void refreshCurve();
void setParameterPixmap();
double korrsavpegel(double);
void CreateQuarzFile();
void WriteToQuarzDatei(const QString &);
void CloseQuarzFile();
private slots:
void setCurve(TSweep);
void deleteCursor();
void deleteCurve();
void wSetFrqBegin();
void wSetFrqEnd();
void setCalculation();
void CableLen();
void CableData();
void deleteAllCursor();
void SweepDataReceipt(const TSweep&);
void SweepDataCurve(const TMessure&);
void printDiagramm(const QFont &, const QStringList &);
void printDiagramPdf(const QFont &, const QStringList &);
void bildspeichern(const TBildinfo &, const QStringList &);
void empfangfrqmarken(const TFrqMarkers &);
signals:
void multiEditDelete();
void multiEditInsert(const QString &);
void writeYWorth(int);
void writeBegin(double);
void writeEnd(double);
void writeCalculation(double);
void setCursorFrequency(double);
void resetCursor(int);
void MagnifyPlus();
void MagnifyMinus();
void MagnifyEqual();
void SweepOnce();
void SweepTimes();
void SweepStop();
void wCurveDelete();
};
#endif