LibreVNA/Software/PC_Application/LibreVNA-GUI/Traces/Math/tdr.h

69 lines
1.2 KiB
C
Raw Normal View History

2022-10-01 23:10:44 +08:00
#ifndef TDRLOWPASS_H
#define TDRLOWPASS_H
#include "tracemath.h"
#include "windowfunction.h"
#include <QThread>
#include <QSemaphore>
namespace Math {
class TDR;
class TDRThread : public QThread
{
Q_OBJECT
public:
TDRThread(TDR &tdr);
2022-10-19 23:31:14 +08:00
~TDRThread(){}
2022-10-01 23:10:44 +08:00
private:
void run() override;
TDR &tdr;
};
class TDR : public TraceMath
{
friend class TDRThread;
Q_OBJECT
public:
TDR();
~TDR();
DataType outputType(DataType inputType) override;
QString description() override;
void edit() override;
static QWidget* createExplanationWidget();
virtual nlohmann::json toJSON() override;
virtual void fromJSON(nlohmann::json j) override;
2022-10-19 23:31:14 +08:00
Type getType() override {return Type::TDR;}
2022-10-01 23:10:44 +08:00
enum class Mode {
Lowpass,
Bandpass,
};
void setMode(Mode m);
Mode getMode() const;
const WindowFunction& getWindow() const;
public slots:
void inputSamplesChanged(unsigned int begin, unsigned int end) override;
private:
void updateTDR();
Mode mode;
WindowFunction window;
bool stepResponse;
bool automaticDC;
std::complex<double> manualDC;
TDRThread *thread;
bool destructing;
QSemaphore semphr;
};
}
#endif // TDRBANDPASS_H