2019-09-08 18:58:26 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) 2015-2019 Edouard Griffiths, F4EXB //
|
|
|
|
// //
|
|
|
|
// This program is free software; you can redistribute it and/or modify //
|
|
|
|
// it under the terms of the GNU General Public License as published by //
|
|
|
|
// the Free Software Foundation as version 3 of the License, or //
|
|
|
|
// (at your option) any later version. //
|
|
|
|
// //
|
|
|
|
// This program is distributed in the hope that it will be useful, //
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
|
|
|
// GNU General Public License V3 for more details. //
|
|
|
|
// //
|
|
|
|
// You should have received a copy of the GNU General Public License //
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
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-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
|
|
|
|
2019-05-30 12:38:10 -04:00
|
|
|
void setSourceOrSinkStream(bool sourceOrSinkStream) { m_sourceOrSinkStream = sourceOrSinkStream; }
|
|
|
|
bool getSourceOrSinkStream() const { return m_sourceOrSinkStream; }
|
2019-09-08 18:58:26 -04:00
|
|
|
void addStreamIndex(int streamIndex);
|
|
|
|
void removeStreamIndex(int streamIndex);
|
|
|
|
void clearStreamIndexes();
|
|
|
|
|
|
|
|
bool streamIndexApplies(int streamIndex) const {
|
|
|
|
return m_enabledStreamsBits & (1<<streamIndex);
|
|
|
|
}
|
2019-05-30 12:38:10 -04:00
|
|
|
|
2017-10-01 10:52:23 -04:00
|
|
|
virtual QByteArray serialize() const;
|
|
|
|
virtual bool deserialize(const QByteArray& data);
|
2021-11-30 18:20:14 -05:00
|
|
|
virtual void formatTo(SWGSDRangel::SWGObject *swgObject) const;
|
|
|
|
virtual void updateFrom(const QStringList& keys, const SWGSDRangel::SWGObject *swgObject);
|
2021-12-02 17:54:39 -05:00
|
|
|
void updateSettings(const ChannelMarker *channelMarker);
|
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-26 00:38:28 -04:00
|
|
|
frequencyScaleDisplay_t m_fScaleDisplayType;
|
2019-05-30 12:38:10 -04:00
|
|
|
bool m_sourceOrSinkStream;
|
2019-09-08 18:58:26 -04:00
|
|
|
uint32_t m_enabledStreamsBits;
|
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
|