2014-05-18 11:52:39 -04:00
|
|
|
#ifndef INCLUDE_CHANNELMARKER_H
|
|
|
|
#define INCLUDE_CHANNELMARKER_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QColor>
|
2017-08-26 03:58:07 -04:00
|
|
|
#include <QByteArray>
|
|
|
|
|
2017-10-01 10:52:23 -04:00
|
|
|
#include "settings/serializable.h"
|
2018-03-20 08:49:21 -04:00
|
|
|
#include "export.h"
|
2014-05-18 11:52:39 -04:00
|
|
|
|
2018-03-03 14:23:38 -05:00
|
|
|
class SDRBASE_API ChannelMarker : public QObject, public Serializable {
|
2014-05-18 11:52:39 -04:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2015-05-10 21:27:31 -04:00
|
|
|
typedef enum sidebands_e
|
|
|
|
{
|
|
|
|
dsb,
|
|
|
|
lsb,
|
2017-03-16 06:49:14 -04:00
|
|
|
usb,
|
|
|
|
vusb, //!< USB with vestigial LSB
|
|
|
|
vlsb //!< LSB with vestigial USB
|
2015-05-10 21:27:31 -04:00
|
|
|
} sidebands_t;
|
|
|
|
|
2017-08-26 00:38:28 -04:00
|
|
|
typedef enum frequencyScaleDisplay_e
|
|
|
|
{
|
|
|
|
FScaleDisplay_freq,
|
|
|
|
FScaleDisplay_title,
|
|
|
|
FScaleDisplay_addressSend,
|
|
|
|
FScaleDisplay_addressReceive,
|
2017-08-26 03:58:07 -04:00
|
|
|
FScaleDisplay_none
|
2017-08-26 00:38:28 -04:00
|
|
|
} frequencyScaleDisplay_t;
|
|
|
|
|
2014-05-18 11:52:39 -04:00
|
|
|
ChannelMarker(QObject* parent = NULL);
|
|
|
|
|
2017-11-13 18:06:42 -05:00
|
|
|
void emitChangedByAPI();
|
|
|
|
|
2014-05-18 11:52:39 -04:00
|
|
|
void setTitle(const QString& title);
|
|
|
|
const QString& getTitle() const { return m_title; }
|
|
|
|
|
|
|
|
void setCenterFrequency(int centerFrequency);
|
2017-11-13 18:06:42 -05:00
|
|
|
void setCenterFrequencyByCursor(int centerFrequency);
|
2014-05-18 11:52:39 -04:00
|
|
|
int getCenterFrequency() const { return m_centerFrequency; }
|
|
|
|
|
|
|
|
void setBandwidth(int bandwidth);
|
|
|
|
int getBandwidth() const { return m_bandwidth; }
|
|
|
|
|
2017-03-16 06:49:14 -04:00
|
|
|
void setOppositeBandwidth(int bandwidth);
|
|
|
|
int getOppositeBandwidth() const { return m_oppositeBandwidth; }
|
|
|
|
|
2015-05-12 15:50:02 -04:00
|
|
|
void setLowCutoff(int lowCutoff);
|
|
|
|
int getLowCutoff() const { return m_lowCutoff; }
|
|
|
|
|
2015-05-10 21:27:31 -04:00
|
|
|
void setSidebands(sidebands_t sidebands);
|
|
|
|
sidebands_t getSidebands() const { return m_sidebands; }
|
|
|
|
|
2014-05-18 11:52:39 -04:00
|
|
|
void setVisible(bool visible);
|
|
|
|
bool getVisible() const { return m_visible; }
|
|
|
|
|
2015-05-11 05:03:01 -04:00
|
|
|
void setHighlighted(bool highlighted);
|
2017-11-13 18:06:42 -05:00
|
|
|
void setHighlightedByCursor(bool highlighted);
|
2015-05-11 05:03:01 -04:00
|
|
|
bool getHighlighted() const { return m_highlighted; }
|
|
|
|
|
2014-05-18 11:52:39 -04:00
|
|
|
void setColor(const QColor& color);
|
|
|
|
const QColor& getColor() const { return m_color; }
|
|
|
|
|
2017-03-15 19:39:49 -04:00
|
|
|
void setMovable(bool movable) { m_movable = movable; }
|
|
|
|
bool getMovable() const { return m_movable; }
|
|
|
|
|
2017-08-23 17:43:11 -04:00
|
|
|
void setUDPAddress(const QString& udpAddress);
|
|
|
|
const QString& getUDPAddress() const { return m_udpAddress; }
|
|
|
|
|
2017-08-23 20:26:47 -04:00
|
|
|
void setUDPReceivePort(quint16 port);
|
|
|
|
quint16 getUDPReceivePort() const { return m_udpReceivePort; }
|
|
|
|
|
|
|
|
void setUDPSendPort(quint16 port);
|
|
|
|
quint16 getUDPSendPort() const { return m_udpSendPort; }
|
2017-08-23 17:43:11 -04:00
|
|
|
|
2017-08-26 00:38:28 -04:00
|
|
|
void setFrequencyScaleDisplayType(frequencyScaleDisplay_t type) { m_fScaleDisplayType = type; }
|
|
|
|
frequencyScaleDisplay_t getFrequencyScaleDisplayType() const { return m_fScaleDisplayType; }
|
|
|
|
|
|
|
|
const QString& getDisplayAddressSend() const { return m_displayAddressSend; }
|
|
|
|
const QString& getDisplayAddressReceive() const { return m_displayAddressReceive; }
|
2017-08-23 17:43:11 -04:00
|
|
|
|
2017-10-01 10:52:23 -04:00
|
|
|
virtual QByteArray serialize() const;
|
|
|
|
virtual bool deserialize(const QByteArray& data);
|
2017-08-26 03:58:07 -04:00
|
|
|
|
2014-05-18 11:52:39 -04:00
|
|
|
protected:
|
|
|
|
static QRgb m_colorTable[];
|
|
|
|
static int m_nextColor;
|
|
|
|
|
|
|
|
QString m_title;
|
2017-08-26 00:38:28 -04:00
|
|
|
QString m_displayAddressSend;
|
|
|
|
QString m_displayAddressReceive;
|
2014-05-18 11:52:39 -04:00
|
|
|
int m_centerFrequency;
|
|
|
|
int m_bandwidth;
|
2017-03-16 06:49:14 -04:00
|
|
|
int m_oppositeBandwidth;
|
2015-05-12 15:50:02 -04:00
|
|
|
int m_lowCutoff;
|
2015-05-10 21:27:31 -04:00
|
|
|
sidebands_t m_sidebands;
|
2014-05-18 11:52:39 -04:00
|
|
|
bool m_visible;
|
2015-05-11 05:03:01 -04:00
|
|
|
bool m_highlighted;
|
2014-05-18 11:52:39 -04:00
|
|
|
QColor m_color;
|
2017-03-15 19:39:49 -04:00
|
|
|
bool m_movable;
|
2017-08-23 17:43:11 -04:00
|
|
|
QString m_udpAddress;
|
2017-08-23 20:26:47 -04:00
|
|
|
quint16 m_udpReceivePort;
|
|
|
|
quint16 m_udpSendPort;
|
2017-08-26 00:38:28 -04:00
|
|
|
frequencyScaleDisplay_t m_fScaleDisplayType;
|
2014-05-18 11:52:39 -04:00
|
|
|
|
2017-08-26 03:58:07 -04:00
|
|
|
void resetToDefaults();
|
|
|
|
|
2014-05-18 11:52:39 -04:00
|
|
|
signals:
|
2017-11-13 18:06:42 -05:00
|
|
|
void changedByAPI();
|
|
|
|
void changedByCursor();
|
|
|
|
void highlightedByCursor();
|
2014-05-18 11:52:39 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INCLUDE_CHANNELMARKER_H
|