2017-10-21 06:11:49 +01:00
|
|
|
#ifndef FUNCTIONGENCONTROL_H
|
|
|
|
#define FUNCTIONGENCONTROL_H
|
|
|
|
|
2019-03-04 09:02:19 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2017-10-21 06:11:49 +01:00
|
|
|
#include <QWidget>
|
|
|
|
#include <QLabel>
|
|
|
|
#include <QDebug>
|
|
|
|
#include <QDir>
|
|
|
|
#include <QFile>
|
|
|
|
#include "xmega.h"
|
|
|
|
#include <QCoreApplication>
|
|
|
|
|
|
|
|
//functionGenControl is a centralised object to control all of the high-level function gen commands for both channels.
|
|
|
|
|
|
|
|
class functionGenControl : public QLabel
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2019-03-04 09:02:19 +00:00
|
|
|
struct ChannelData
|
|
|
|
{
|
|
|
|
std::vector<uint8_t> samples;
|
|
|
|
int divisibility;
|
|
|
|
double freq = 1000.0;
|
|
|
|
double amplitude = 0.0;
|
|
|
|
double offset = 0.0;
|
|
|
|
};
|
|
|
|
|
2019-03-07 08:58:52 +00:00
|
|
|
enum class ChannelID
|
|
|
|
{
|
|
|
|
CH1 = 0,
|
|
|
|
CH2 = 1
|
|
|
|
};
|
|
|
|
|
2017-10-21 06:11:49 +01:00
|
|
|
explicit functionGenControl(QWidget *parent = 0);
|
2019-03-04 09:02:19 +00:00
|
|
|
|
|
|
|
ChannelData channels[2];
|
|
|
|
|
2019-03-07 08:58:52 +00:00
|
|
|
public:
|
2019-03-04 09:02:19 +00:00
|
|
|
|
2019-03-07 08:58:52 +00:00
|
|
|
ChannelData& getChannelData(ChannelID channelID);
|
2019-03-04 09:02:19 +00:00
|
|
|
|
2017-10-21 06:11:49 +01:00
|
|
|
signals:
|
2019-03-07 08:58:52 +00:00
|
|
|
void functionGenToUpdate(ChannelID channel, functionGenControl *fGenControl);
|
2017-10-21 06:11:49 +01:00
|
|
|
void setMaxFreq_CH1(double maxFreq);
|
|
|
|
void setMinFreq_CH1(double minFreq);
|
|
|
|
void setMaxFreq_CH2(double maxFreq);
|
|
|
|
void setMinFreq_CH2(double minFreq);
|
2019-03-07 08:58:52 +00:00
|
|
|
|
2017-10-21 06:11:49 +01:00
|
|
|
public slots:
|
2019-03-07 08:58:52 +00:00
|
|
|
void waveformName(ChannelID channelId, QString newName);
|
|
|
|
void freqUpdate(ChannelID channelId, double newFreq);
|
|
|
|
void amplitudeUpdate(ChannelID channelId, double newAmplitude);
|
|
|
|
void offsetUpdate(ChannelID channelId, double newOffset);
|
|
|
|
|
2017-10-21 06:11:49 +01:00
|
|
|
void waveformName_CH1(QString newName);
|
|
|
|
void freqUpdate_CH1(double newFreq);
|
|
|
|
void amplitudeUpdate_CH1(double newAmplitude);
|
|
|
|
void offsetUpdate_CH1(double newOffset);
|
|
|
|
void waveformName_CH2(QString newName);
|
|
|
|
void freqUpdate_CH2(double newFreq);
|
|
|
|
void amplitudeUpdate_CH2(double newAmplitude);
|
|
|
|
void offsetUpdate_CH2(double newOffset);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // FUNCTIONGENCONTROL_H
|