DATV: Display MER

pull/788/head
f4exb 2021-02-22 19:29:16 +01:00
rodzic 42815a0664
commit 0dc554b30b
8 zmienionych plików z 167 dodań i 7 usunięć

Wyświetl plik

@ -66,6 +66,7 @@ public:
}
void SetTVScreen(TVScreen *objScreen) { m_basebandSink->setTVScreen(objScreen); }
void setMERLabel(QLabel *merLabel) { m_basebandSink->setMERLabel(merLabel); }
DATVideostream *SetVideoRender(DATVideoRender *objScreen) { return m_basebandSink->SetVideoRender(objScreen); }
bool audioActive() { return m_basebandSink->audioActive(); }
bool audioDecodeOK() { return m_basebandSink->audioDecodeOK(); }

Wyświetl plik

@ -86,6 +86,7 @@ public:
int getChannelSampleRate() const;
double getMagSq() const { return m_sink.getMagSq(); }
void setTVScreen(TVScreen *tvScreen) { m_sink.setTVScreen(tvScreen); }
void setMERLabel(QLabel *merLabel) { m_sink.setMERLabel(merLabel); }
void setMessageQueueToGUI(MessageQueue *messageQueue) { m_sink.setMessageQueueToGUI(messageQueue); }
void setBasebandSampleRate(int sampleRate); //!< To be used when supporting thread is stopped
DATVideostream *SetVideoRender(DATVideoRender *objScreen) { return m_sink.SetVideoRender(objScreen); }
@ -115,4 +116,4 @@ private slots:
void handleData(); //!< Handle data when samples have to be processed
};
#endif // INCLUDE_CHANNELANALYZERBASEBAND_H
#endif // INCLUDE_CHANNELANALYZERBASEBAND_H

Wyświetl plik

@ -195,6 +195,7 @@ DATVDemodGUI::DATVDemodGUI(PluginAPI* objPluginAPI, DeviceUISet *deviceUISet, Ba
m_objDATVDemod->setMessageQueueToGUI(getInputMessageQueue());
m_objDATVDemod->SetTVScreen(ui->screenTV);
m_objDATVDemod->setMERLabel(ui->merText);
connect(m_objDATVDemod->SetVideoRender(ui->screenTV_2), &DATVideostream::onDataPackets, this, &DATVDemodGUI::on_StreamDataAvailable);
connect(ui->screenTV_2, &DATVideoRender::onMetaDataChanged, this, &DATVDemodGUI::on_StreamMetaDataChanged);

Wyświetl plik

@ -738,7 +738,7 @@
<x>10</x>
<y>260</y>
<width>481</width>
<height>25</height>
<height>33</height>
</rect>
</property>
<layout class="QHBoxLayout" name="udpLayout">
@ -825,6 +825,77 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="horizontalLayoutWidget_2">
<property name="geometry">
<rect>
<x>10</x>
<y>300</y>
<width>481</width>
<height>31</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="merLabel">
<property name="text">
<string>MER</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="merText">
<property name="minimumSize">
<size>
<width>28</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>00.0</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="cnrLabel">
<property name="text">
<string>CNR</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="cnrText">
<property name="minimumSize">
<size>
<width>28</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>00.0</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
<widget class="QWidget" name="videoTab">
<attribute name="title">

Wyświetl plik

@ -32,11 +32,12 @@ const unsigned int DATVDemodSink::m_rfFilterFftLength = 1024;
DATVDemodSink::DATVDemodSink() :
m_blnNeedConfigUpdate(false),
m_objRegisteredTVScreen(0),
m_objRegisteredVideoRender(0),
m_objRegisteredTVScreen(nullptr),
m_objRegisteredVideoRender(nullptr),
m_objVideoStream(nullptr),
m_udpStream(leansdr::tspacket::SIZE),
m_objRenderThread(nullptr),
m_merLabel(nullptr),
m_audioFifo(48000),
m_blnRenderingVideo(false),
m_blnStartStopVideo(false),
@ -86,6 +87,11 @@ bool DATVDemodSink::setTVScreen(TVScreen *objScreen)
return true;
}
void DATVDemodSink::setMERLabel(QLabel *merLabel)
{
m_merLabel = merLabel;
}
DATVideostream *DATVDemodSink::SetVideoRender(DATVideoRender *objScreen)
{
m_objRegisteredVideoRender = objScreen;
@ -341,6 +347,9 @@ void DATVDemodSink::CleanUpDATVFramework(bool blnRelease)
if (r_scope_symbols != nullptr) {
delete r_scope_symbols;
}
if (r_merGauge != nullptr) {
delete r_merGauge;
}
// INPUT
//if(p_rawiq!=nullptr) delete p_rawiq;
@ -494,6 +503,7 @@ void DATVDemodSink::CleanUpDATVFramework(bool blnRelease)
//CONSTELLATION
r_scope_symbols = nullptr;
r_merGauge = nullptr;
//DVB-S2
p_slots_dvbs2 = nullptr;
@ -765,6 +775,10 @@ void DATVDemodSink::InitDATVFramework()
r_scope_symbols->calculate_cstln_points();
}
if (m_merLabel) {
r_merGauge = new leansdr::datvgaugelabel(m_objScheduler, *p_mer, m_merLabel);
}
// DECONVOLUTION AND SYNCHRONIZATION
p_bytes = new leansdr::pipebuf<leansdr::u8>(m_objScheduler, "bytes", BUF_BYTES);
@ -1027,7 +1041,7 @@ void DATVDemodSink::InitDATVS2Framework()
*(leansdr::pipebuf< leansdr::plslot<leansdr::llr_ss> > *) p_slots_dvbs2,
/* p_freq */ nullptr,
/* p_ss */ nullptr,
/* p_mer */ nullptr,
p_mer,
p_cstln,
/* p_cstln_pls */ nullptr,
/*p_iqsymbols*/ nullptr,
@ -1069,6 +1083,10 @@ void DATVDemodSink::InitDATVS2Framework()
r_scope_symbols_dvbs2->calculate_cstln_points();
}
if (m_merLabel) {
r_merGauge = new leansdr::datvgaugelabel(m_objScheduler, *p_mer, m_merLabel);
}
// Bit-flipping mode.
// Deinterleave into hard bits.

Wyświetl plik

@ -28,6 +28,7 @@
#include "leansdr/iess.h"
#include "datvconstellation.h"
#include "datvgaugelabel.h"
#include "datvdvbs2constellation.h"
#include "datvvideoplayer.h"
#include "datvideostream.h"
@ -47,6 +48,7 @@
class TVScreen;
class DATVideoRender;
class QLabel;
class DATVDemodSink : public ChannelSampleSink {
public:
@ -56,6 +58,7 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end);
bool setTVScreen(TVScreen *objScreen);
void setMERLabel(QLabel *merLabel);
DATVideostream * SetVideoRender(DATVideoRender *objScreen);
bool audioActive();
bool audioDecodeOK();
@ -271,6 +274,7 @@ private:
//CONSTELLATION
leansdr::datvconstellation<leansdr::f32> *r_scope_symbols;
leansdr::datvdvbs2constellation<leansdr::f32> *r_scope_symbols_dvbs2;
leansdr::datvgaugelabel *r_merGauge;
//*************** DATV PARAMETERS ***************
TVScreen *m_objRegisteredTVScreen;
@ -278,6 +282,7 @@ private:
DATVideostream *m_objVideoStream;
DATVUDPStream m_udpStream;
DATVideoRenderThread *m_objRenderThread;
QLabel *m_merLabel;
// Audio
AudioFifo m_audioFifo;
@ -305,4 +310,4 @@ private:
static const unsigned int m_rfFilterFftLength;
};
#endif // INCLUDE_DATVDEMODSINK_H
#endif // INCLUDE_DATVDEMODSINK_H

Wyświetl plik

@ -0,0 +1,58 @@
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2021 Edouard Griffiths, F4EXB //
// using LeanSDR Framework (C) 2016 F4DAV //
// //
// 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 DATVGAUGELABEL_H
#define DATVGAUGELABEL_H
#include <QLabel>
#include <QString>
#include "leansdr/framework.h"
#include "leansdr/sdr.h"
namespace leansdr {
struct datvgaugelabel: runnable
{
leansdr::pipereader<leansdr::f32> m_in;
QLabel *m_label;
datvgaugelabel(
scheduler *sch,
leansdr::pipebuf<leansdr::f32> &in,
QLabel *label = nullptr,
const char *_name = nullptr
) :
runnable(sch, _name ? _name : in.name),
m_in(in),
m_label(label)
{}
virtual void run()
{
while (m_in.readable() >= 1)
{
leansdr::f32 *p = m_in.rd();
m_label->setText(QString("%1").arg(*p, 0, 'f', 1));
m_in.read(1);
}
}
};
} // namespace leansdr
#endif // DATVGAUGELABEL_H

Wyświetl plik

@ -1155,7 +1155,12 @@ struct cstln_receiver : runnable
int max_meas = chunk_size / meas_decimation + 1;
// Large margin on output_size because mu adjustments
// can lead to more than chunk_size/min_omega symbols.
while (in.readable() >= chunk_size + sampler->readahead() && out.writable() >= chunk_size && (!freq_out || freq_out->writable() >= max_meas) && (!ss_out || ss_out->writable() >= max_meas) && (!mer_out || mer_out->writable() >= max_meas) && (!cstln_out || cstln_out->writable() >= max_meas))
while (in.readable() >= chunk_size + sampler->readahead() &&
out.writable() >= chunk_size &&
(!freq_out || freq_out->writable() >= max_meas) &&
(!ss_out || ss_out->writable() >= max_meas) &&
(!mer_out || mer_out->writable() >= max_meas) &&
(!cstln_out || cstln_out->writable() >= max_meas))
{
sampler->update_freq(freqw, chunk_size);