-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvna_serial.h
37 lines (33 loc) · 841 Bytes
/
vna_serial.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
#include "vna.h"
#if QT_VERSION >= 0x050000
#include <QSerialPort>
#else
#include <serialport.h>
#include <serialport-global.h>
#endif
#include <QMainWindow>
#if QT_VERSION < 0x050000
QT_BEGIN_NAMESPACE_SERIALPORT
class SerialPort;
QT_END_NAMESPACE_SERIALPORT
QT_USE_NAMESPACE_SERIALPORT
#else
QT_USE_NAMESPACE
#endif
class VnaSerial: public virtual Vna
{
public:
VnaSerial();
virtual ~VnaSerial();
int initVna(int port, QString device);
void initMeasure(unsigned int start, unsigned int step, int points, int mode);
void setFrequency(unsigned int n);
void getData(int n, int *amplitude, int *phase, int *gain1, int *gain2, int *gain3);
void closePort();
int getError();
private:
int openSerialPort();
void closeSerialPort();
void SendParam(unsigned int x);
unsigned int getTwoBytes();
};