mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-25 17:28:50 -05:00
Allow replay time offset to be set by ctrl+left click in waterfall.
This commit is contained in:
parent
364dfc1fc5
commit
238a40b9e0
@ -623,6 +623,11 @@ void AirspyHFGui::on_replayLoop_toggled(bool checked)
|
|||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AirspyHFGui::setReplayTime(float time)
|
||||||
|
{
|
||||||
|
ui->replayOffset->setValue(std::ceil(time * 10.0f));
|
||||||
|
}
|
||||||
|
|
||||||
void AirspyHFGui::makeUIConnections()
|
void AirspyHFGui::makeUIConnections()
|
||||||
{
|
{
|
||||||
QObject::connect(ui->centerFrequency, &ValueDial::changed, this, &AirspyHFGui::on_centerFrequency_changed);
|
QObject::connect(ui->centerFrequency, &ValueDial::changed, this, &AirspyHFGui::on_centerFrequency_changed);
|
||||||
|
@ -46,6 +46,7 @@ public:
|
|||||||
QByteArray serialize() const;
|
QByteArray serialize() const;
|
||||||
bool deserialize(const QByteArray& data);
|
bool deserialize(const QByteArray& data);
|
||||||
virtual MessageQueue* getInputMessageQueue() { return &m_inputMessageQueue; }
|
virtual MessageQueue* getInputMessageQueue() { return &m_inputMessageQueue; }
|
||||||
|
void setReplayTime(float time) override;
|
||||||
|
|
||||||
uint32_t getDevSampleRate(unsigned int index);
|
uint32_t getDevSampleRate(unsigned int index);
|
||||||
int getDevSampleRateIndex(uint32_t sampleRate);
|
int getDevSampleRateIndex(uint32_t sampleRate);
|
||||||
|
@ -691,6 +691,11 @@ void RTLSDRGui::on_replayLoop_toggled(bool checked)
|
|||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RTLSDRGui::setReplayTime(float time)
|
||||||
|
{
|
||||||
|
ui->replayOffset->setValue(std::ceil(time * 10.0f));
|
||||||
|
}
|
||||||
|
|
||||||
void RTLSDRGui::makeUIConnections()
|
void RTLSDRGui::makeUIConnections()
|
||||||
{
|
{
|
||||||
QObject::connect(ui->centerFrequency, &ValueDial::changed, this, &RTLSDRGui::on_centerFrequency_changed);
|
QObject::connect(ui->centerFrequency, &ValueDial::changed, this, &RTLSDRGui::on_centerFrequency_changed);
|
||||||
|
@ -50,6 +50,7 @@ public:
|
|||||||
QByteArray serialize() const;
|
QByteArray serialize() const;
|
||||||
bool deserialize(const QByteArray& data);
|
bool deserialize(const QByteArray& data);
|
||||||
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
|
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
|
||||||
|
void setReplayTime(float time) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::RTLSDRGui* ui;
|
Ui::RTLSDRGui* ui;
|
||||||
|
@ -687,6 +687,11 @@ void SDRPlayV3Gui::on_replayLoop_toggled(bool checked)
|
|||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SDRPlayV3Gui::setReplayTime(float time)
|
||||||
|
{
|
||||||
|
ui->replayOffset->setValue(std::ceil(time * 10.0f));
|
||||||
|
}
|
||||||
|
|
||||||
void SDRPlayV3Gui::makeUIConnections()
|
void SDRPlayV3Gui::makeUIConnections()
|
||||||
{
|
{
|
||||||
QObject::connect(ui->centerFrequency, &ValueDial::changed, this, &SDRPlayV3Gui::on_centerFrequency_changed);
|
QObject::connect(ui->centerFrequency, &ValueDial::changed, this, &SDRPlayV3Gui::on_centerFrequency_changed);
|
||||||
|
@ -46,6 +46,7 @@ public:
|
|||||||
virtual QByteArray serialize() const;
|
virtual QByteArray serialize() const;
|
||||||
virtual bool deserialize(const QByteArray& data);
|
virtual bool deserialize(const QByteArray& data);
|
||||||
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
|
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
|
||||||
|
void setReplayTime(float time) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::SDRPlayV3Gui* ui;
|
Ui::SDRPlayV3Gui* ui;
|
||||||
|
@ -769,6 +769,11 @@ void USRPInputGUI::on_replayLoop_toggled(bool checked)
|
|||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void USRPInputGUI::setReplayTime(float time)
|
||||||
|
{
|
||||||
|
ui->replayOffset->setValue(std::ceil(time * 10.0f));
|
||||||
|
}
|
||||||
|
|
||||||
void USRPInputGUI::makeUIConnections()
|
void USRPInputGUI::makeUIConnections()
|
||||||
{
|
{
|
||||||
QObject::connect(ui->startStop, &ButtonSwitch::toggled, this, &USRPInputGUI::on_startStop_toggled);
|
QObject::connect(ui->startStop, &ButtonSwitch::toggled, this, &USRPInputGUI::on_startStop_toggled);
|
||||||
|
@ -50,6 +50,7 @@ public:
|
|||||||
QByteArray serialize() const;
|
QByteArray serialize() const;
|
||||||
bool deserialize(const QByteArray& data);
|
bool deserialize(const QByteArray& data);
|
||||||
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
|
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
|
||||||
|
void setReplayTime(float time) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::USRPInputGUI* ui;
|
Ui::USRPInputGUI* ui;
|
||||||
|
@ -875,28 +875,28 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
|
||||||
<class>ValueDial</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header>gui/valuedial.h</header>
|
|
||||||
<container>1</container>
|
|
||||||
</customwidget>
|
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>ButtonSwitch</class>
|
<class>ButtonSwitch</class>
|
||||||
<extends>QToolButton</extends>
|
<extends>QToolButton</extends>
|
||||||
<header>gui/buttonswitch.h</header>
|
<header>gui/buttonswitch.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
<customwidget>
|
|
||||||
<class>TransverterButton</class>
|
|
||||||
<extends>QPushButton</extends>
|
|
||||||
<header>gui/transverterbutton.h</header>
|
|
||||||
</customwidget>
|
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>ValueDialZ</class>
|
<class>ValueDialZ</class>
|
||||||
<extends>QWidget</extends>
|
<extends>QWidget</extends>
|
||||||
<header>gui/valuedialz.h</header>
|
<header>gui/valuedialz.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>ValueDial</class>
|
||||||
|
<extends>QWidget</extends>
|
||||||
|
<header>gui/valuedial.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>TransverterButton</class>
|
||||||
|
<extends>QPushButton</extends>
|
||||||
|
<header>gui/transverterbutton.h</header>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../../../sdrgui/resources/res.qrc"/>
|
<include location="../../../sdrgui/resources/res.qrc"/>
|
||||||
|
@ -81,6 +81,7 @@ public:
|
|||||||
void setCurrentDeviceIndex(int index) { m_currentDeviceIndex = index; } //!< index in plugins list
|
void setCurrentDeviceIndex(int index) { m_currentDeviceIndex = index; } //!< index in plugins list
|
||||||
void setChannelNames(const QStringList& channelNames) { m_channelAddDialog.addChannelNames(channelNames); }
|
void setChannelNames(const QStringList& channelNames) { m_channelAddDialog.addChannelNames(channelNames); }
|
||||||
DeviceUISet* getDeviceUISet() { return m_deviceUISet; }
|
DeviceUISet* getDeviceUISet() { return m_deviceUISet; }
|
||||||
|
virtual void setReplayTime(float time) {} //!< Not supported by all devices
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void closeEvent(QCloseEvent *event) override;
|
void closeEvent(QCloseEvent *event) override;
|
||||||
|
@ -73,6 +73,8 @@ DeviceUISet::DeviceUISet(int deviceSetIndex, DeviceSet *deviceSet)
|
|||||||
font.setFamily(QStringLiteral("Liberation Sans"));
|
font.setFamily(QStringLiteral("Liberation Sans"));
|
||||||
font.setPointSize(9);
|
font.setPointSize(9);
|
||||||
m_spectrum->setFont(font);
|
m_spectrum->setFont(font);
|
||||||
|
|
||||||
|
connect(m_mainSpectrumGUI, &MainSpectrumGUI::timeSelected, this, &DeviceUISet::onTimeSelected);
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceUISet::~DeviceUISet()
|
DeviceUISet::~DeviceUISet()
|
||||||
@ -825,3 +827,10 @@ int DeviceUISet::webapiSpectrumServerDelete(SWGSDRangel::SWGSuccessResponse& res
|
|||||||
{
|
{
|
||||||
return m_spectrumVis->webapiSpectrumServerDelete(response, errorMessage);
|
return m_spectrumVis->webapiSpectrumServerDelete(response, errorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DeviceUISet::onTimeSelected(int deviceSetIndex, float time)
|
||||||
|
{
|
||||||
|
if (m_deviceGUI) {
|
||||||
|
m_deviceGUI->setReplayTime(time);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -167,6 +167,7 @@ private:
|
|||||||
private slots:
|
private slots:
|
||||||
void handleChannelGUIClosing(ChannelGUI* channelGUI);
|
void handleChannelGUIClosing(ChannelGUI* channelGUI);
|
||||||
void handleDeleteChannel(ChannelAPI *channelAPI);
|
void handleDeleteChannel(ChannelAPI *channelAPI);
|
||||||
|
void onTimeSelected(int deviceSetIndex, float time);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -4175,6 +4175,18 @@ void GLSpectrumView::mousePressEvent(QMouseEvent* event)
|
|||||||
{
|
{
|
||||||
frequencyPan(event);
|
frequencyPan(event);
|
||||||
}
|
}
|
||||||
|
else if (event->modifiers() & Qt::ControlModifier)
|
||||||
|
{
|
||||||
|
if (!m_display3DSpectrogram && pointInWaterfallOrSpectrogram(ep))
|
||||||
|
{
|
||||||
|
QPointF pWat = ep;
|
||||||
|
pWat.rx() = (ep.x()/width() - m_waterfallRect.left()) / m_waterfallRect.width();
|
||||||
|
pWat.ry() = (ep.y()/height() - m_waterfallRect.top()) / m_waterfallRect.height();
|
||||||
|
float time = m_timeScale.getRangeMin() + pWat.y()*m_timeScale.getRange();
|
||||||
|
emit timeSelected(time);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
else if (m_display3DSpectrogram)
|
else if (m_display3DSpectrogram)
|
||||||
{
|
{
|
||||||
// Detect click and drag to rotate 3D spectrogram
|
// Detect click and drag to rotate 3D spectrogram
|
||||||
|
@ -541,6 +541,8 @@ signals:
|
|||||||
void requestCenterFrequency(qint64 frequency);
|
void requestCenterFrequency(qint64 frequency);
|
||||||
// Emitted when annotations are changed
|
// Emitted when annotations are changed
|
||||||
void updateAnnotations();
|
void updateAnnotations();
|
||||||
|
// Emitted when user ctrl-clicks on waterfall to select a time. time is in seconds.
|
||||||
|
void timeSelected(float time);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -157,6 +157,8 @@ MainSpectrumGUI::MainSpectrumGUI(GLSpectrum *spectrum, GLSpectrumGUI *spectrumGU
|
|||||||
connect(spectrum->getSpectrumView(), &GLSpectrumView::requestCenterFrequency, this, &MainSpectrumGUI::onRequestCenterFrequency);
|
connect(spectrum->getSpectrumView(), &GLSpectrumView::requestCenterFrequency, this, &MainSpectrumGUI::onRequestCenterFrequency);
|
||||||
connect(spectrumGUI, &GLSpectrumGUI::requestCenterFrequency, this, &MainSpectrumGUI::onRequestCenterFrequency);
|
connect(spectrumGUI, &GLSpectrumGUI::requestCenterFrequency, this, &MainSpectrumGUI::onRequestCenterFrequency);
|
||||||
|
|
||||||
|
connect(spectrum->getSpectrumView(), &GLSpectrumView::timeSelected, this, &MainSpectrumGUI::onTimeSelected);
|
||||||
|
|
||||||
m_resizer.enableChildMouseTracking();
|
m_resizer.enableChildMouseTracking();
|
||||||
shrinkWindow();
|
shrinkWindow();
|
||||||
}
|
}
|
||||||
@ -380,3 +382,8 @@ void MainSpectrumGUI::onRequestCenterFrequency(qint64 frequency)
|
|||||||
{
|
{
|
||||||
emit requestCenterFrequency(m_deviceSetIndex, frequency);
|
emit requestCenterFrequency(m_deviceSetIndex, frequency);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainSpectrumGUI::onTimeSelected(float time)
|
||||||
|
{
|
||||||
|
emit timeSelected(m_deviceSetIndex, time);
|
||||||
|
}
|
||||||
|
@ -113,12 +113,14 @@ private slots:
|
|||||||
void shrinkWindow();
|
void shrinkWindow();
|
||||||
void maximizeWindow();
|
void maximizeWindow();
|
||||||
void onRequestCenterFrequency(qint64 frequency);
|
void onRequestCenterFrequency(qint64 frequency);
|
||||||
|
void onTimeSelected(float time);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void closing();
|
void closing();
|
||||||
void moveToWorkspace(int workspaceIndex);
|
void moveToWorkspace(int workspaceIndex);
|
||||||
void forceShrink();
|
void forceShrink();
|
||||||
void requestCenterFrequency(int deviceSetIndex, qint64 frequency); // an action from the user to move device center frequency
|
void requestCenterFrequency(int deviceSetIndex, qint64 frequency); // an action from the user to move device center frequency
|
||||||
|
void timeSelected(int deviceSetIndex, float time); // user ctrl-clicked waterfall to set a time
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user