2018-11-07 23:54:03 +00:00
|
|
|
#ifndef FREQMEMORY_H
|
|
|
|
#define FREQMEMORY_H
|
|
|
|
#include <QString>
|
|
|
|
#include <QDebug>
|
|
|
|
|
|
|
|
// 0 1 2 3 4
|
|
|
|
//modes << "LSB" << "USB" << "AM" << "CW" << "RTTY";
|
|
|
|
// 5 6 7 8 9
|
|
|
|
// modes << "FM" << "CW-R" << "RTTY-R" << "LSB-D" << "USB-D";
|
|
|
|
|
|
|
|
enum mode_kind {
|
2021-02-17 06:32:05 +00:00
|
|
|
modeLSB=0x00,
|
|
|
|
modeUSB=0x01,
|
|
|
|
modeAM=0x02,
|
|
|
|
modeCW=0x03,
|
|
|
|
modeRTTY=0x04,
|
|
|
|
modeFM=0x05,
|
|
|
|
modeCW_R=0x07,
|
|
|
|
modeRTTY_R=0x08,
|
|
|
|
modeLSB_D=0x80,
|
|
|
|
modeUSB_D=0x81,
|
|
|
|
modeDV=0x17,
|
|
|
|
modeDD=0x27
|
2018-11-07 23:54:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct preset_kind {
|
2018-11-24 08:10:05 +00:00
|
|
|
// QString name;
|
|
|
|
// QString comment;
|
|
|
|
// unsigned int index; // channel number
|
2018-11-07 23:54:03 +00:00
|
|
|
double frequency;
|
|
|
|
mode_kind mode;
|
|
|
|
bool isSet;
|
|
|
|
};
|
|
|
|
|
|
|
|
class freqMemory
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
freqMemory();
|
|
|
|
void setPreset(unsigned int index, double frequency, mode_kind mode);
|
|
|
|
void setPreset(unsigned int index, double frequency, mode_kind mode, QString name);
|
|
|
|
void setPreset(unsigned int index, double frequency, mode_kind mode, QString name, QString comment);
|
2018-11-24 08:10:05 +00:00
|
|
|
void dumpMemory();
|
|
|
|
unsigned int getNumPresets();
|
2018-11-07 23:54:03 +00:00
|
|
|
preset_kind getPreset(unsigned int index);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void initializePresets();
|
2018-11-24 08:10:05 +00:00
|
|
|
unsigned int numPresets;
|
2018-11-07 23:54:03 +00:00
|
|
|
unsigned int maxIndex;
|
2018-11-24 08:10:05 +00:00
|
|
|
//QVector <preset_kind> presets;
|
|
|
|
preset_kind presets[100];
|
|
|
|
|
2018-11-07 23:54:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // FREQMEMORY_H
|