46 lines
872 B
C++
46 lines
872 B
C++
#ifndef WORKTHREAD_H
|
|
#define WORKTHREAD_H
|
|
|
|
#include <QThread>
|
|
#include <QMutex>
|
|
#include <QWaitCondition>
|
|
|
|
#define BUFFER_COUNT 32
|
|
|
|
typedef struct
|
|
{
|
|
short* buff_ptr;
|
|
volatile int full;
|
|
}sample_buffer_t;
|
|
|
|
class WorkThread : public QThread
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
WorkThread();
|
|
~WorkThread();
|
|
void run() override;
|
|
void transmit();
|
|
void stop();
|
|
void setGain(int g);
|
|
void setNavFilePath(QString path);
|
|
void setUmfile(QString path);
|
|
void useNmeaGGA(int use);
|
|
void useCurrentTime(int use);
|
|
private:
|
|
int read_buff_pos=0;
|
|
int write_buff_pos=0;
|
|
int iq_buff_size=260000;
|
|
bool bstop = true;
|
|
QMutex m_lock;
|
|
QWaitCondition wait_buffer_empty;
|
|
sample_buffer_t sample_buffers[BUFFER_COUNT];
|
|
QString navfile;
|
|
QString umfile;
|
|
int gain=0;
|
|
int nmeaGGA;
|
|
bool useCurTime;
|
|
};
|
|
|
|
#endif // WORKTHREAD_H
|