1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 17:58:43 -05:00
sdrangel/plugins/feature/antennatools/antennatoolsgui.h

115 lines
4.8 KiB
C
Raw Normal View History

2021-05-20 12:15:14 -04:00
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2012 maintech GmbH, Otto-Hahn-Str. 15, 97204 Hoechberg, Germany //
// written by Christian Daniel //
// Copyright (C) 2015-2020, 2022 Edouard Griffiths, F4EXB <f4exb06@gmail.com> //
// Copyright (C) 2015 John Greb <hexameron@spam.no> //
// Copyright (C) 2020-2022 Jon Beniston, M7RCE <jon@beniston.com> //
2021-05-20 12:15:14 -04:00
// //
// 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/>. //
///////////////////////////////////////////////////////////////////////////////////
#ifndef INCLUDE_FEATURE_ANTENNATOOLSGUI_H_
#define INCLUDE_FEATURE_ANTENNATOOLSGUI_H_
#include <QTimer>
#include <QAbstractListModel>
#include "feature/featuregui.h"
#include "util/messagequeue.h"
#include "settings/rollupstate.h"
2021-05-20 12:15:14 -04:00
#include "antennatoolssettings.h"
class PluginAPI;
class FeatureUISet;
class AntennaTools;
namespace Ui {
class AntennaToolsGUI;
}
class AntennaToolsGUI : public FeatureGUI {
Q_OBJECT
public:
static AntennaToolsGUI* create(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *feature);
virtual void destroy();
void resetToDefaults();
QByteArray serialize() const;
bool deserialize(const QByteArray& data);
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
virtual void setWorkspaceIndex(int index);
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; }
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; }
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; }
2021-05-20 12:15:14 -04:00
private:
Ui::AntennaToolsGUI* ui;
PluginAPI* m_pluginAPI;
FeatureUISet* m_featureUISet;
AntennaToolsSettings m_settings;
QList<QString> m_settingsKeys;
RollupState m_rollupState;
2021-05-20 12:15:14 -04:00
bool m_doApplySettings;
AntennaTools* m_antennatools;
MessageQueue m_inputMessageQueue;
QTimer m_statusTimer;
unsigned int m_deviceSets;
2021-05-20 12:15:14 -04:00
explicit AntennaToolsGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *feature, QWidget* parent = nullptr);
virtual ~AntennaToolsGUI();
void blockApplySettings(bool block);
void applySettings(bool force = false);
void displaySettings();
bool handleMessage(const Message& message);
2022-04-04 04:23:52 -04:00
void makeUIConnections();
2021-05-20 12:15:14 -04:00
void calcDipoleLength();
double calcDipoleFrequency(double totalLength);
void calcDishFocalLength();
void calcDishBeamwidth();
void calcDishGain();
void calcDishEffectiveArea();
2021-05-20 12:15:14 -04:00
double dishLambda() const;
double dishLengthMetres(double length) const;
double dishMetresToLength(double m) const;
2021-05-20 12:15:14 -04:00
double dishDiameterMetres() const;
double dishDepthMetres() const;
double dishSurfaceErrorMetres() const;
2021-05-20 12:15:14 -04:00
double getDeviceSetFrequencyMHz(int index);
private slots:
void on_dipoleFrequency_valueChanged(double value);
void on_dipoleFrequencySelect_currentIndexChanged(int index);
void on_dipoleEndEffectFactor_valueChanged(double value);
void on_dipoleLengthUnits_currentIndexChanged(int index);
void on_dipoleLength_valueChanged(double value);
void on_dipoleElementLength_valueChanged(double value);
void on_dishFrequency_valueChanged(double value);
void on_dishFrequencySelect_currentIndexChanged(int index);
void on_dishDiameter_valueChanged(double value);
void on_dishLengthUnits_currentIndexChanged(int index);
void on_dishDepth_valueChanged(double value);
void on_dishEfficiency_valueChanged(int value);
void on_dishSurfaceError_valueChanged(double value);
2021-05-20 12:15:14 -04:00
void onMenuDialogCalled(const QPoint &p);
void onWidgetRolled(QWidget* widget, bool rollDown);
void handleInputMessages();
void updateStatus();
};
#endif // INCLUDE_FEATURE_ANTENNATOOLSGUI_H_