2017-01-29 18:51:45 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) 2017 F4EXB //
|
|
|
|
// written by Edouard Griffiths //
|
|
|
|
// //
|
|
|
|
// 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 //
|
2019-04-11 12:43:33 +00:00
|
|
|
// (at your option) any later version. //
|
2017-01-29 18:51:45 +00:00
|
|
|
// //
|
|
|
|
// 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/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef SDRBASE_GUI_GLSCOPENGGUI_H_
|
|
|
|
#define SDRBASE_GUI_GLSCOPENGGUI_H_
|
|
|
|
|
|
|
|
#include <QWidget>
|
2017-02-05 03:41:32 +00:00
|
|
|
#include <QComboBox>
|
|
|
|
|
2017-01-29 18:51:45 +00:00
|
|
|
#include "dsp/dsptypes.h"
|
2018-03-20 12:49:21 +00:00
|
|
|
#include "export.h"
|
2017-01-29 18:51:45 +00:00
|
|
|
#include "util/message.h"
|
2018-08-12 15:22:39 +00:00
|
|
|
#include "dsp/scopevis.h"
|
2021-06-08 23:02:20 +00:00
|
|
|
#include "dsp/glscopesettings.h"
|
2017-10-03 21:28:04 +00:00
|
|
|
#include "settings/serializable.h"
|
2017-01-29 18:51:45 +00:00
|
|
|
|
|
|
|
namespace Ui {
|
2018-08-12 14:42:38 +00:00
|
|
|
class GLScopeGUI;
|
2017-01-29 18:51:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
class MessageQueue;
|
2018-08-12 15:01:56 +00:00
|
|
|
class GLScope;
|
2017-01-29 18:51:45 +00:00
|
|
|
|
2018-08-12 14:48:03 +00:00
|
|
|
class SDRGUI_API GLScopeGUI : public QWidget, public Serializable {
|
2017-01-29 18:51:45 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2018-08-12 14:48:03 +00:00
|
|
|
explicit GLScopeGUI(QWidget* parent = 0);
|
|
|
|
~GLScopeGUI();
|
2017-01-29 18:51:45 +00:00
|
|
|
|
2018-08-12 15:18:58 +00:00
|
|
|
void setBuddies(MessageQueue* messageQueue, ScopeVis* scopeVis, GLScope* glScope);
|
2017-01-29 18:51:45 +00:00
|
|
|
|
|
|
|
void setSampleRate(int sampleRate);
|
|
|
|
void resetToDefaults();
|
2017-10-03 21:28:04 +00:00
|
|
|
virtual QByteArray serialize() const;
|
|
|
|
virtual bool deserialize(const QByteArray& data);
|
2021-11-30 23:20:14 +00:00
|
|
|
virtual void formatTo(SWGSDRangel::SWGObject *swgObject) const;
|
|
|
|
virtual void updateFrom(const QStringList& keys, const SWGSDRangel::SWGObject *swgObject);
|
|
|
|
void updateSettings();
|
2017-01-29 18:51:45 +00:00
|
|
|
|
|
|
|
bool handleMessage(Message* message);
|
2021-06-16 04:47:44 +00:00
|
|
|
unsigned int getNbTraces() const { return m_settings.m_tracesData.size(); }
|
|
|
|
unsigned int getNbTriggers() const { return m_settings.m_triggersData.size(); }
|
2021-06-24 20:52:20 +00:00
|
|
|
void setNbStreams(unsigned int nbStreams); //!< Set number of streams with default names (indexes)
|
|
|
|
void setStreams(const QStringList& streamNames); //!< Give streans by their names in a list
|
2017-01-29 18:51:45 +00:00
|
|
|
|
2017-03-21 10:24:03 +00:00
|
|
|
// preconfiguration methods
|
|
|
|
// global (first line):
|
2021-06-08 23:02:20 +00:00
|
|
|
void setDisplayMode(GLScopeSettings::DisplayMode displayMode);
|
2017-03-21 10:24:03 +00:00
|
|
|
void setTraceIntensity(int value);
|
|
|
|
void setGridIntensity(int value);
|
|
|
|
void setTimeBase(int step);
|
|
|
|
void setTimeOffset(int step);
|
|
|
|
void setTraceLength(int step);
|
|
|
|
void setPreTrigger(int step);
|
|
|
|
// trace (second line):
|
2021-05-28 22:55:04 +00:00
|
|
|
void changeTrace(int traceIndex, const GLScopeSettings::TraceData& traceData);
|
|
|
|
void addTrace(const GLScopeSettings::TraceData& traceData);
|
2017-03-21 10:24:03 +00:00
|
|
|
void focusOnTrace(int traceIndex);
|
|
|
|
// trigger (third line):
|
2021-05-29 10:22:43 +00:00
|
|
|
void changeTrigger(int triggerIndex, const GLScopeSettings::TriggerData& triggerData);
|
|
|
|
void addTrigger(const GLScopeSettings::TriggerData& triggerData);
|
2017-03-21 10:24:03 +00:00
|
|
|
void focusOnTrigger(int triggerIndex);
|
2019-09-12 16:19:28 +00:00
|
|
|
void traceLengthChange();
|
2017-03-21 10:24:03 +00:00
|
|
|
|
2017-01-29 18:51:45 +00:00
|
|
|
private:
|
2017-02-20 00:21:52 +00:00
|
|
|
class TrigUIBlocker
|
|
|
|
{
|
|
|
|
public:
|
2018-08-12 14:42:38 +00:00
|
|
|
TrigUIBlocker(Ui::GLScopeGUI *ui);
|
2017-02-20 00:21:52 +00:00
|
|
|
~TrigUIBlocker();
|
|
|
|
|
|
|
|
void unBlock();
|
|
|
|
|
|
|
|
private:
|
2018-08-12 14:42:38 +00:00
|
|
|
Ui::GLScopeGUI *m_ui;
|
2017-02-20 00:21:52 +00:00
|
|
|
bool m_oldStateTrigMode;
|
|
|
|
bool m_oldStateTrigCount;
|
|
|
|
bool m_oldStateTrigPos;
|
|
|
|
bool m_oldStateTrigNeg;
|
|
|
|
bool m_oldStateTrigBoth;
|
|
|
|
bool m_oldStateTrigLevelCoarse;
|
|
|
|
bool m_oldStateTrigLevelFine;
|
|
|
|
bool m_oldStateTrigDelayCoarse;
|
|
|
|
bool m_oldStateTrigDelayFine;
|
2021-08-09 00:21:12 +00:00
|
|
|
bool m_oldStateTrigColor;
|
2017-02-20 00:21:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class TraceUIBlocker
|
|
|
|
{
|
|
|
|
public:
|
2018-08-12 14:42:38 +00:00
|
|
|
TraceUIBlocker(Ui::GLScopeGUI *ui);
|
2017-02-20 00:21:52 +00:00
|
|
|
~TraceUIBlocker();
|
|
|
|
|
|
|
|
void unBlock();
|
|
|
|
|
|
|
|
private:
|
2018-08-12 14:42:38 +00:00
|
|
|
Ui::GLScopeGUI *m_ui;
|
2021-08-09 00:21:12 +00:00
|
|
|
bool m_oldStateTraceStream;
|
2017-02-20 21:19:50 +00:00
|
|
|
bool m_oldStateTrace;
|
|
|
|
bool m_oldStateTraceAdd;
|
|
|
|
bool m_oldStateTraceDel;
|
2017-02-20 00:21:52 +00:00
|
|
|
bool m_oldStateTraceMode;
|
|
|
|
bool m_oldStateAmp;
|
2021-08-09 00:21:12 +00:00
|
|
|
bool m_oldStateAmpCoarse;
|
|
|
|
bool m_oldStateAmpExp;
|
2017-02-20 00:21:52 +00:00
|
|
|
bool m_oldStateOfsCoarse;
|
|
|
|
bool m_oldStateOfsFine;
|
2021-08-09 00:21:12 +00:00
|
|
|
bool m_oldStateOfsExp;
|
2017-02-20 00:21:52 +00:00
|
|
|
bool m_oldStateTraceDelayCoarse;
|
|
|
|
bool m_oldStateTraceDelayFine;
|
|
|
|
bool m_oldStateTraceColor;
|
2021-08-09 00:21:12 +00:00
|
|
|
bool m_oldStateTraceView;
|
2017-02-20 00:21:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class MainUIBlocker
|
|
|
|
{
|
|
|
|
public:
|
2018-08-12 14:42:38 +00:00
|
|
|
MainUIBlocker(Ui::GLScopeGUI *ui);
|
2017-02-20 00:21:52 +00:00
|
|
|
~MainUIBlocker();
|
|
|
|
|
|
|
|
void unBlock();
|
|
|
|
|
|
|
|
private:
|
2018-08-12 14:42:38 +00:00
|
|
|
Ui::GLScopeGUI *m_ui;
|
2017-02-20 00:21:52 +00:00
|
|
|
bool m_oldStateOnlyX;
|
|
|
|
bool m_oldStateOnlyY;
|
|
|
|
bool m_oldStateHorizontalXY;
|
|
|
|
bool m_oldStateVerticalXY;
|
|
|
|
bool m_oldStatePolar;
|
|
|
|
// bool m_oldStateTime;
|
|
|
|
// bool m_oldStateTimeOfs;
|
|
|
|
// bool m_oldStateTraceLen;
|
|
|
|
};
|
|
|
|
|
2018-08-12 14:42:38 +00:00
|
|
|
Ui::GLScopeGUI* ui;
|
2017-01-29 18:51:45 +00:00
|
|
|
|
|
|
|
MessageQueue* m_messageQueue;
|
2018-08-12 15:18:58 +00:00
|
|
|
ScopeVis* m_scopeVis;
|
2018-08-12 15:01:56 +00:00
|
|
|
GLScope* m_glScope;
|
2021-06-08 23:02:20 +00:00
|
|
|
GLScopeSettings m_settings;
|
2017-01-29 18:51:45 +00:00
|
|
|
|
|
|
|
int m_sampleRate;
|
2017-02-05 03:41:32 +00:00
|
|
|
int m_timeBase;
|
|
|
|
int m_timeOffset;
|
2017-02-11 19:44:00 +00:00
|
|
|
QColor m_focusedTraceColor;
|
2017-02-12 01:12:06 +00:00
|
|
|
QColor m_focusedTriggerColor;
|
2021-06-08 23:02:20 +00:00
|
|
|
int m_ctlTraceIndex; //!< controlled trace index
|
|
|
|
int m_ctlTriggerIndex; //!< controlled trigger index
|
2017-02-05 03:41:32 +00:00
|
|
|
|
2021-06-08 23:02:20 +00:00
|
|
|
void applySettings(const GLScopeSettings& settings, bool force = false);
|
|
|
|
void displaySettings();
|
2017-02-06 17:40:15 +00:00
|
|
|
// First row
|
2017-02-09 17:44:20 +00:00
|
|
|
void setTraceIndexDisplay();
|
2017-02-05 03:41:32 +00:00
|
|
|
void setTimeScaleDisplay();
|
|
|
|
void setTraceLenDisplay();
|
|
|
|
void setTimeOfsDisplay();
|
2017-02-06 17:40:15 +00:00
|
|
|
// Second row
|
2017-02-05 12:26:07 +00:00
|
|
|
void setAmpScaleDisplay();
|
2017-02-06 17:40:15 +00:00
|
|
|
void setAmpOfsDisplay();
|
2017-02-17 00:54:55 +00:00
|
|
|
void setTraceDelayDisplay();
|
2017-02-06 17:40:15 +00:00
|
|
|
// Third row
|
2017-02-09 17:44:20 +00:00
|
|
|
void setTrigIndexDisplay();
|
2017-02-10 03:35:08 +00:00
|
|
|
void setTrigCountDisplay();
|
2017-02-06 17:40:15 +00:00
|
|
|
void setTrigLevelDisplay();
|
|
|
|
void setTrigDelayDisplay();
|
|
|
|
void setTrigPreDisplay();
|
2017-02-05 12:26:07 +00:00
|
|
|
|
|
|
|
void changeCurrentTrace();
|
2017-02-06 17:40:15 +00:00
|
|
|
void changeCurrentTrigger();
|
2017-02-05 03:41:32 +00:00
|
|
|
|
2021-05-28 22:55:04 +00:00
|
|
|
void fillTraceData(GLScopeSettings::TraceData& traceData);
|
2021-05-29 10:22:43 +00:00
|
|
|
void fillTriggerData(GLScopeSettings::TriggerData& triggerData);
|
|
|
|
void setTriggerUI(const GLScopeSettings::TriggerData& triggerData);
|
2021-05-28 22:55:04 +00:00
|
|
|
void setTraceUI(const GLScopeSettings::TraceData& traceData);
|
2017-02-05 03:41:32 +00:00
|
|
|
|
|
|
|
void fillProjectionCombo(QComboBox* comboBox);
|
2017-02-23 07:18:03 +00:00
|
|
|
void disableLiveMode(bool disable);
|
2017-01-29 18:51:45 +00:00
|
|
|
|
2021-06-12 08:16:33 +00:00
|
|
|
void settingsTraceAdd(const GLScopeSettings::TraceData& traceData);
|
|
|
|
void settingsTraceChange(const GLScopeSettings::TraceData& traceData, uint32_t traceIndex);
|
|
|
|
void settingsTraceDel(uint32_t traceIndex);
|
|
|
|
void settingsTraceMove(uint32_t traceIndex, bool upElseDown);
|
|
|
|
|
|
|
|
void settingsTriggerAdd(const GLScopeSettings::TriggerData& triggerData);
|
|
|
|
void settingsTriggerChange(const GLScopeSettings::TriggerData& triggerData, uint32_t triggerIndex);
|
|
|
|
void settingsTriggerDel(uint32_t triggerIndex);
|
|
|
|
void settingsTriggerMove(uint32_t triggerIndex, bool upElseDown);
|
|
|
|
|
2017-01-29 21:52:38 +00:00
|
|
|
private slots:
|
2021-06-15 22:19:17 +00:00
|
|
|
void onScopeSampleRateChanged(int value);
|
|
|
|
void onScopeTraceSizeChanged(uint32_t value);
|
|
|
|
void onScopePreTriggerChanged(uint32_t value);
|
2017-02-06 01:40:31 +00:00
|
|
|
// First row
|
2017-02-03 07:27:03 +00:00
|
|
|
void on_onlyX_toggled(bool checked);
|
|
|
|
void on_onlyY_toggled(bool checked);
|
|
|
|
void on_horizontalXY_toggled(bool checked);
|
|
|
|
void on_verticalXY_toggled(bool checked);
|
|
|
|
void on_polar_toggled(bool checked);
|
2018-05-14 22:30:01 +00:00
|
|
|
void on_polarPoints_toggled(bool checked);
|
2019-10-13 23:42:24 +00:00
|
|
|
void on_polarGrid_toggled(bool checked);
|
2017-02-03 07:27:03 +00:00
|
|
|
void on_traceIntensity_valueChanged(int value);
|
|
|
|
void on_gridIntensity_valueChanged(int value);
|
|
|
|
void on_time_valueChanged(int value);
|
|
|
|
void on_timeOfs_valueChanged(int value);
|
|
|
|
void on_traceLen_valueChanged(int value);
|
2017-02-06 01:40:31 +00:00
|
|
|
// Second row
|
2017-02-13 00:32:02 +00:00
|
|
|
void on_trace_valueChanged(int value);
|
|
|
|
void on_traceAdd_clicked(bool checked);
|
|
|
|
void on_traceDel_clicked(bool checked);
|
2017-02-26 10:26:23 +00:00
|
|
|
void on_traceUp_clicked(bool checked);
|
|
|
|
void on_traceDown_clicked(bool checked);
|
2021-06-24 20:52:20 +00:00
|
|
|
void on_traceStream_currentIndexChanged(int index);
|
2017-02-05 12:26:07 +00:00
|
|
|
void on_traceMode_currentIndexChanged(int index);
|
2021-06-27 09:42:27 +00:00
|
|
|
void on_ampReset_clicked(bool checked);
|
2017-02-05 12:26:07 +00:00
|
|
|
void on_amp_valueChanged(int value);
|
2021-06-26 23:52:42 +00:00
|
|
|
void on_ampCoarse_valueChanged(int value);
|
|
|
|
void on_ampExp_valueChanged(int value);
|
2021-06-27 09:42:27 +00:00
|
|
|
void on_ofsReset_clicked(bool checked);
|
2017-02-06 17:40:15 +00:00
|
|
|
void on_ofsCoarse_valueChanged(int value);
|
|
|
|
void on_ofsFine_valueChanged(int value);
|
2021-06-27 08:10:28 +00:00
|
|
|
void on_ofsExp_valueChanged(int value);
|
2017-02-17 00:54:55 +00:00
|
|
|
void on_traceDelayCoarse_valueChanged(int value);
|
|
|
|
void on_traceDelayFine_valueChanged(int value);
|
2017-02-26 21:27:03 +00:00
|
|
|
void on_traceView_toggled(bool checked);
|
2017-02-11 19:44:00 +00:00
|
|
|
void on_traceColor_clicked();
|
2018-10-15 00:47:26 +00:00
|
|
|
void on_memorySave_clicked(bool checked);
|
|
|
|
void on_memoryLoad_clicked(bool checked);
|
2017-02-23 07:18:03 +00:00
|
|
|
void on_mem_valueChanged(int value);
|
2017-02-06 01:40:31 +00:00
|
|
|
// Third row
|
2017-02-10 01:45:49 +00:00
|
|
|
void on_trig_valueChanged(int value);
|
|
|
|
void on_trigAdd_clicked(bool checked);
|
|
|
|
void on_trigDel_clicked(bool checked);
|
2017-02-26 18:14:27 +00:00
|
|
|
void on_trigUp_clicked(bool checked);
|
|
|
|
void on_trigDown_clicked(bool checked);
|
2021-06-24 20:52:20 +00:00
|
|
|
void on_trigStream_currentIndexChanged(int index);
|
2017-02-06 17:40:15 +00:00
|
|
|
void on_trigMode_currentIndexChanged(int index);
|
|
|
|
void on_trigCount_valueChanged(int value);
|
|
|
|
void on_trigPos_toggled(bool checked);
|
|
|
|
void on_trigNeg_toggled(bool checked);
|
|
|
|
void on_trigBoth_toggled(bool checked);
|
2018-10-27 23:38:58 +00:00
|
|
|
void on_trigHoldoff_valueChanged(int value);
|
2017-02-06 17:40:15 +00:00
|
|
|
void on_trigLevelCoarse_valueChanged(int value);
|
|
|
|
void on_trigLevelFine_valueChanged(int value);
|
2017-02-09 21:22:56 +00:00
|
|
|
void on_trigDelayCoarse_valueChanged(int value);
|
|
|
|
void on_trigDelayFine_valueChanged(int value);
|
2017-02-06 17:40:15 +00:00
|
|
|
void on_trigPre_valueChanged(int value);
|
2017-02-12 01:12:06 +00:00
|
|
|
void on_trigColor_clicked();
|
2017-02-06 17:40:15 +00:00
|
|
|
void on_trigOneShot_toggled(bool checked);
|
2017-02-06 01:40:31 +00:00
|
|
|
void on_freerun_toggled(bool checked);
|
2017-01-29 18:51:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* SDRBASE_GUI_GLSCOPENGGUI_H_ */
|