sdrangel/sdrgui/gui/deviceuserargsdialog.h

83 wiersze
3.2 KiB
C
Czysty Zwykły widok Historia

2019-06-12 06:39:25 +00:00
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2012 maintech GmbH, Otto-Hahn-Str. 15, 97204 Hoechberg, Germany //
// written by Christian Daniel //
// Copyright (C) 2015-2020 Edouard Griffiths, F4EXB <f4exb06@gmail.com> //
// Copyright (C) 2015 John Greb <hexameron@spam.no> //
2019-06-12 06:39:25 +00: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/>. //
///////////////////////////////////////////////////////////////////////////////////
2019-06-12 16:50:53 +00:00
#ifndef SDRGUI_GUI_DEVICEUSERARGSDIALOG_H
#define SDRGUI_GUI_DEVICEUSERARGSDIALOG_H
2019-06-12 06:39:25 +00:00
#include <QDialog>
2019-06-12 16:50:53 +00:00
#include <QSet>
2019-06-12 06:39:25 +00:00
2019-06-12 16:50:53 +00:00
#include "plugin/plugininterface.h"
2019-06-13 15:28:21 +00:00
#include "device/deviceuserargs.h"
2019-06-12 06:39:25 +00:00
#include "export.h"
class QTreeWidgetItem;
class DeviceEnumerator;
namespace Ui {
2019-06-12 16:50:53 +00:00
class DeviceUserArgsDialog;
2019-06-12 06:39:25 +00:00
}
2019-06-12 16:50:53 +00:00
class SDRGUI_API DeviceUserArgsDialog : public QDialog {
2019-06-12 06:39:25 +00:00
Q_OBJECT
public:
2019-06-12 16:50:53 +00:00
explicit DeviceUserArgsDialog(
DeviceEnumerator* deviceEnumerator,
DeviceUserArgs& hardwareDeviceUserArgs,
QWidget* parent = 0);
~DeviceUserArgsDialog();
2019-06-12 06:39:25 +00:00
private:
2019-06-12 16:50:53 +00:00
struct HWDeviceReference {
QString m_hardwareId;
int m_sequence;
QString m_description;
bool operator==(const HWDeviceReference& rhs) {
return (m_hardwareId == rhs.m_hardwareId) && (m_sequence == rhs.m_sequence);
}
};
Ui::DeviceUserArgsDialog* ui;
2019-06-12 06:39:25 +00:00
DeviceEnumerator* m_deviceEnumerator;
2019-06-12 16:50:53 +00:00
DeviceUserArgs& m_hardwareDeviceUserArgs;
std::vector<HWDeviceReference> m_availableHWDevices;
2019-06-13 15:28:21 +00:00
DeviceUserArgs m_deviceUserArgsCopy;
QString m_xDeviceHardwareId;
unsigned int m_xDeviceSequence;
2019-06-12 16:50:53 +00:00
void pushHWDeviceReference(const PluginInterface::SamplingDevice *samplingDevice);
2019-06-12 23:23:05 +00:00
void displayArgsByDevice();
2019-06-12 06:39:25 +00:00
private slots:
void accept();
void reject();
2020-11-14 10:13:32 +00:00
void on_importDevice_clicked();
void on_deleteArgs_clicked();
2019-06-13 15:28:21 +00:00
void on_argsTree_currentItemChanged(QTreeWidgetItem* currentItem, QTreeWidgetItem* previousItem);
void on_argStringEdit_editingFinished();
void on_addDeviceHwIDEdit_editingFinished();
void on_addDeviceSeqEdit_editingFinished();
2020-11-14 10:13:32 +00:00
void on_addDevice_clicked();
2019-06-12 06:39:25 +00:00
};
2020-11-14 10:13:32 +00:00
#endif // SDRGUI_GUI_DEVICEUSERARGSDIALOG_H