mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-04 23:14:47 -04:00
Massive UI revamping (v7): devices basic
This commit is contained in:
@@ -55,7 +55,10 @@ FileInputGUI::FileInputGUI(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
m_enableNavTime(false),
|
||||
m_lastEngineState(DeviceAPI::StNotStarted)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
ui->setupUi(getContents());
|
||||
getContents()->setStyleSheet("#FileInputGUI { border: 1px solid #C06900 }");
|
||||
m_helpURL = "plugins/samplesource/fileinput/readme.md";
|
||||
ui->crcLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }");
|
||||
|
||||
connect(&(m_deviceUISet->m_deviceAPI->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick()));
|
||||
@@ -75,11 +78,15 @@ FileInputGUI::FileInputGUI(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
|
||||
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
|
||||
m_sampleSource->setMessageQueueToGUI(&m_inputMessageQueue);
|
||||
|
||||
makeUIConnections();
|
||||
}
|
||||
|
||||
FileInputGUI::~FileInputGUI()
|
||||
{
|
||||
qDebug("FileInputGUI::~FileInputGUI");
|
||||
delete ui;
|
||||
qDebug("FileInputGUI::~FileInputGUI: end");
|
||||
}
|
||||
|
||||
void FileInputGUI::destroy()
|
||||
@@ -444,3 +451,13 @@ void FileInputGUI::openDeviceSettingsDialog(const QPoint& p)
|
||||
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void FileInputGUI::makeUIConnections()
|
||||
{
|
||||
QObject::connect(ui->startStop, &ButtonSwitch::toggled, this, &FileInputGUI::on_startStop_toggled);
|
||||
QObject::connect(ui->playLoop, &ButtonSwitch::toggled, this, &FileInputGUI::on_playLoop_toggled);
|
||||
QObject::connect(ui->play, &ButtonSwitch::toggled, this, &FileInputGUI::on_play_toggled);
|
||||
QObject::connect(ui->navTimeSlider, &QSlider::valueChanged, this, &FileInputGUI::on_navTimeSlider_valueChanged);
|
||||
QObject::connect(ui->showFileDialog, &QPushButton::clicked, this, &FileInputGUI::on_showFileDialog_clicked);
|
||||
QObject::connect(ui->acceleration, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &FileInputGUI::on_acceleration_currentIndexChanged);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ class FileInputGUI : public DeviceGUI {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit FileInputGUI(DeviceUISet *deviceUISet, QWidget* parent = 0);
|
||||
explicit FileInputGUI(DeviceUISet *deviceUISet, QWidget* parent = nullptr);
|
||||
virtual ~FileInputGUI();
|
||||
virtual void destroy();
|
||||
|
||||
@@ -46,6 +46,10 @@ public:
|
||||
bool deserialize(const QByteArray& data);
|
||||
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
|
||||
virtual bool handleMessage(const Message& message);
|
||||
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = 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; }
|
||||
|
||||
private:
|
||||
Ui::FileInputGUI* ui;
|
||||
@@ -81,6 +85,7 @@ private:
|
||||
void updateWithStreamTime();
|
||||
void setAccelerationCombo();
|
||||
void setNumberStr(int n, QString& s);
|
||||
void makeUIConnections();
|
||||
|
||||
private slots:
|
||||
void handleInputMessages();
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>377</width>
|
||||
<height>190</height>
|
||||
<width>360</width>
|
||||
<height>202</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@@ -18,8 +18,8 @@
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>246</width>
|
||||
<height>190</height>
|
||||
<width>360</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
@@ -592,23 +592,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="padLayout">
|
||||
<item>
|
||||
<spacer name="verticaPadlSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
|
||||
@@ -36,6 +36,7 @@ void FileInputSettings::resetToDefaults()
|
||||
m_reverseAPIAddress = "127.0.0.1";
|
||||
m_reverseAPIPort = 8888;
|
||||
m_reverseAPIDeviceIndex = 0;
|
||||
m_workspaceIndex = 0;
|
||||
}
|
||||
|
||||
QByteArray FileInputSettings::serialize() const
|
||||
@@ -48,6 +49,8 @@ QByteArray FileInputSettings::serialize() const
|
||||
s.writeString(5, m_reverseAPIAddress);
|
||||
s.writeU32(6, m_reverseAPIPort);
|
||||
s.writeU32(7, m_reverseAPIDeviceIndex);
|
||||
s.writeS32(8, m_workspaceIndex);
|
||||
s.writeBlob(9, m_geometryBytes);
|
||||
|
||||
return s.final();
|
||||
}
|
||||
@@ -80,6 +83,8 @@ bool FileInputSettings::deserialize(const QByteArray& data)
|
||||
|
||||
d.readU32(7, &uintval, 0);
|
||||
m_reverseAPIDeviceIndex = uintval > 99 ? 99 : uintval;
|
||||
d.readS32(8, &m_workspaceIndex, 0);
|
||||
d.readBlob(9, &m_geometryBytes);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,8 @@ struct FileInputSettings {
|
||||
QString m_reverseAPIAddress;
|
||||
uint16_t m_reverseAPIPort;
|
||||
uint16_t m_reverseAPIDeviceIndex;
|
||||
int m_workspaceIndex;
|
||||
QByteArray m_geometryBytes;
|
||||
|
||||
static const unsigned int m_accelerationMaxScale; //!< Max power of 10 multiplier to 2,5,10 base ex: 2 -> 2,5,10,20,50,100,200,500,1000
|
||||
|
||||
|
||||
Reference in New Issue
Block a user