SoDaRadio-5.0.3-master:8901fb5
Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
GUISoDa::Listener Class Reference

#include <soda_listener.hpp>

Inheritance diagram for GUISoDa::Listener:

Public Slots

void setRXFreq (double freq)
 
void setTXFreq (double freq)
 
void setModulation (int mod_id)
 
void setAFFilter (int id)
 
void setRXGain (int gain)
 
void setTXGain (int gain)
 
void setAFGain (int gain)
 
void setAFSidetoneGain (int gain)
 
void setRXAnt (const QString &antname)
 
void setTXAnt (const QString &antname)
 
double getRXFreq ()
 
double getTXFreq ()
 
void setSpectrumCenter (double freq)
 
void setSpectrumAvgWindow (int window)
 
void setSpectrumUpdateRate (int rate)
 
void setCWSpeed (int speed)
 
void setSidetoneVolume (int vol)
 
void setTXPower (int vol)
 
void setPTT (bool on)
 
void sendCW (const QString &txt)
 
void clearCWBuffer ()
 
void closeRadio ()
 

Signals

void updateData (double cfreq, float *y)
 
void configureSpectrum (double cfreq, double span, long buckets)
 
void addModulation (QString modtype, int mod_id)
 
void addFilterWidth (double lo, double hi)
 
void addFilterName (QString filter_name, int filt_id)
 
void repMarkerOffset (double lo, double hi)
 
void addRXAntName (const QString &ant_name)
 
void addTXAntName (const QString &ant_name)
 
void repFilterEdges (double lo, double hi)
 
void repGPSLatLon (double lat, double lon)
 
void repGPSTime (int hh, int mm, int ss)
 
void repGPSLock (bool is_locked)
 
void repSDRVersion (const QString &version)
 
void repHWMBVersion (const QString &version)
 
void repPTT (bool on)
 
void initSetupComplete ()
 
void fatalError (const QString &error_string)
 

Public Member Functions

 Listener (QObject *parent=0, const QString &socket_basename="tmp")
 
 ~Listener ()
 
bool init ()
 connect to radio server sockets and initialize listener state More...
 
void start ()
 initiate transfers on the socket. More...
 

Protected Slots

void processCmd ()
 
void cmdErrorHandler (QLocalSocket::LocalSocketError err)
 
void processSpectrum ()
 

Protected Member Functions

int get (char *buf, int maxlen)
 
bool get (SoDa::Command &cmd)
 
int put (const char *buf, int len)
 
bool put (const SoDa::Command &cmd)
 
bool handleREP (const SoDa::Command &cmd)
 
bool handleSET (const SoDa::Command &cmd)
 
bool handleGET (const SoDa::Command &cmd)
 

Protected Attributes

double current_rx_freq
 
double current_tx_freq
 

Private Member Functions

void setupSpectrumBuffer (double cfreq, double span, long buflen)
 

Private Attributes

long spect_buffer_len
 
float * spect_buffer
 
double spect_center_freq
 
QString socket_basename
 
QLocalSocket * cmd_socket
 
QLocalSocket * spect_socket
 
bool quit
 

Detailed Description

Definition at line 40 of file soda_listener.hpp.

Constructor & Destructor Documentation

◆ Listener()

GUISoDa::Listener::Listener ( QObject *  parent = 0,
const QString &  socket_basename = "tmp" 
)

Definition at line 31 of file soda_listener.cpp.

References quit, and socket_basename.

◆ ~Listener()

GUISoDa::Listener::~Listener ( )
inline

Member Function Documentation

◆ addFilterName

void GUISoDa::Listener::addFilterName ( QString  filter_name,
int  filt_id 
)
signal

Referenced by handleREP(), and ~Listener().

◆ addFilterWidth

void GUISoDa::Listener::addFilterWidth ( double  lo,
double  hi 
)
signal

Referenced by ~Listener().

◆ addModulation

void GUISoDa::Listener::addModulation ( QString  modtype,
int  mod_id 
)
signal

Referenced by handleREP(), and ~Listener().

◆ addRXAntName

void GUISoDa::Listener::addRXAntName ( const QString &  ant_name)
signal

◆ addTXAntName

void GUISoDa::Listener::addTXAntName ( const QString &  ant_name)
signal

◆ clearCWBuffer

void GUISoDa::Listener::clearCWBuffer ( )
slot

Definition at line 365 of file soda_listener.cpp.

References put(), SoDa::Command::SET, and SoDa::Command::TX_CW_FLUSHTEXT.

Referenced by getTXFreq().

◆ closeRadio

void GUISoDa::Listener::closeRadio ( )
slot

Definition at line 420 of file soda_listener.cpp.

References put(), SoDa::Command::SET, and SoDa::Command::STOP.

Referenced by getTXFreq().

◆ cmdErrorHandler

void GUISoDa::Listener::cmdErrorHandler ( QLocalSocket::LocalSocketError  err)
inlineprotectedslot

Definition at line 147 of file soda_listener.hpp.

References processSpectrum().

Referenced by init().

◆ configureSpectrum

void GUISoDa::Listener::configureSpectrum ( double  cfreq,
double  span,
long  buckets 
)
signal

Referenced by handleREP(), and ~Listener().

◆ fatalError

void GUISoDa::Listener::fatalError ( const QString &  error_string)
signal

Referenced by init(), and ~Listener().

◆ get() [1/2]

int GUISoDa::Listener::get ( char *  buf,
int  maxlen 
)
protected

Definition at line 109 of file soda_listener.cpp.

References cmd_socket.

◆ get() [2/2]

bool GUISoDa::Listener::get ( SoDa::Command cmd)
protected

Definition at line 133 of file soda_listener.cpp.

◆ getRXFreq

double GUISoDa::Listener::getRXFreq ( )
inlineslot

Definition at line 108 of file soda_listener.hpp.

References current_rx_freq.

◆ getTXFreq

double GUISoDa::Listener::getTXFreq ( )
inlineslot

◆ handleGET()

bool GUISoDa::Listener::handleGET ( const SoDa::Command cmd)
protected

Definition at line 411 of file soda_listener.cpp.

References SoDa::Command::target.

Referenced by processCmd().

◆ handleREP()

bool GUISoDa::Listener::handleREP ( const SoDa::Command cmd)
protected

◆ handleSET()

bool GUISoDa::Listener::handleSET ( const SoDa::Command cmd)
protected

Definition at line 401 of file soda_listener.cpp.

References SoDa::Command::target.

Referenced by processCmd().

◆ init()

bool GUISoDa::Listener::init ( )

connect to radio server sockets and initialize listener state

Returns
true on success, false on some fatal problem.

Definition at line 36 of file soda_listener.cpp.

References cmd_socket, cmdErrorHandler(), fatalError(), processCmd(), processSpectrum(), socket_basename, spect_buffer_len, and spect_socket.

Referenced by MainWindow::MainWindow(), and ~Listener().

◆ initSetupComplete

void GUISoDa::Listener::initSetupComplete ( )
signal

Referenced by handleREP(), and ~Listener().

◆ processCmd

void GUISoDa::Listener::processCmd ( )
protectedslot

◆ processSpectrum

void GUISoDa::Listener::processSpectrum ( )
protectedslot

Definition at line 154 of file soda_listener.cpp.

References spect_buffer, spect_buffer_len, spect_center_freq, spect_socket, and updateData().

Referenced by cmdErrorHandler(), and init().

◆ put() [1/2]

int GUISoDa::Listener::put ( const char *  buf,
int  len 
)
protected

◆ put() [2/2]

bool GUISoDa::Listener::put ( const SoDa::Command cmd)
protected

Definition at line 186 of file soda_listener.cpp.

References put().

◆ repFilterEdges

void GUISoDa::Listener::repFilterEdges ( double  lo,
double  hi 
)
signal

Referenced by ~Listener().

◆ repGPSLatLon

void GUISoDa::Listener::repGPSLatLon ( double  lat,
double  lon 
)
signal

Referenced by handleREP(), and ~Listener().

◆ repGPSLock

void GUISoDa::Listener::repGPSLock ( bool  is_locked)
signal

Referenced by ~Listener().

◆ repGPSTime

void GUISoDa::Listener::repGPSTime ( int  hh,
int  mm,
int  ss 
)
signal

Referenced by handleREP(), and ~Listener().

◆ repHWMBVersion

void GUISoDa::Listener::repHWMBVersion ( const QString &  version)
signal

◆ repMarkerOffset

void GUISoDa::Listener::repMarkerOffset ( double  lo,
double  hi 
)
signal

Referenced by handleREP(), and ~Listener().

◆ repPTT

void GUISoDa::Listener::repPTT ( bool  on)
signal

◆ repSDRVersion

void GUISoDa::Listener::repSDRVersion ( const QString &  version)
signal

Referenced by handleREP(), and ~Listener().

◆ sendCW

void GUISoDa::Listener::sendCW ( const QString &  txt)
slot

◆ setAFFilter

void GUISoDa::Listener::setAFFilter ( int  id)
slot

Definition at line 248 of file soda_listener.cpp.

References put(), SoDa::Command::RX_AF_FILTER, and SoDa::Command::SET.

Referenced by ~Listener().

◆ setAFGain

void GUISoDa::Listener::setAFGain ( int  gain)
slot

Definition at line 220 of file soda_listener.cpp.

References put(), SoDa::Command::RX_AF_GAIN, and SoDa::Command::SET.

Referenced by ~Listener().

◆ setAFSidetoneGain

void GUISoDa::Listener::setAFSidetoneGain ( int  gain)
slot

Definition at line 229 of file soda_listener.cpp.

References put(), SoDa::Command::RX_AF_SIDETONE_GAIN, and SoDa::Command::SET.

Referenced by ~Listener().

◆ setCWSpeed

void GUISoDa::Listener::setCWSpeed ( int  speed)
slot

Definition at line 336 of file soda_listener.cpp.

References put(), SoDa::Command::SET, and SoDa::Command::TX_CW_SPEED.

Referenced by getTXFreq().

◆ setModulation

void GUISoDa::Listener::setModulation ( int  mod_id)
slot

Definition at line 237 of file soda_listener.cpp.

References put(), SoDa::Command::RX_MODE, SoDa::Command::SET, and SoDa::Command::TX_MODE.

Referenced by ~Listener().

◆ setPTT

void GUISoDa::Listener::setPTT ( bool  on)
slot

Definition at line 357 of file soda_listener.cpp.

References put(), SoDa::Command::SET, and SoDa::Command::TX_STATE.

Referenced by getTXFreq().

◆ setRXAnt

void GUISoDa::Listener::setRXAnt ( const QString &  antname)
slot

Definition at line 301 of file soda_listener.cpp.

References put(), SoDa::Command::RX_ANT, and SoDa::Command::SET.

Referenced by ~Listener().

◆ setRXFreq

void GUISoDa::Listener::setRXFreq ( double  freq)
slot

◆ setRXGain

void GUISoDa::Listener::setRXGain ( int  gain)
slot

Definition at line 206 of file soda_listener.cpp.

References put(), SoDa::Command::RX_RF_GAIN, and SoDa::Command::SET.

Referenced by ~Listener().

◆ setSidetoneVolume

void GUISoDa::Listener::setSidetoneVolume ( int  vol)
slot

Definition at line 343 of file soda_listener.cpp.

References put(), SoDa::Command::RX_AF_SIDETONE_GAIN, and SoDa::Command::SET.

Referenced by getTXFreq().

◆ setSpectrumAvgWindow

void GUISoDa::Listener::setSpectrumAvgWindow ( int  window)
slot

Definition at line 329 of file soda_listener.cpp.

References put(), SoDa::Command::SET, and SoDa::Command::SPEC_AVG_WINDOW.

Referenced by getTXFreq().

◆ setSpectrumCenter

void GUISoDa::Listener::setSpectrumCenter ( double  freq)
slot

◆ setSpectrumUpdateRate

void GUISoDa::Listener::setSpectrumUpdateRate ( int  rate)
slot

Definition at line 322 of file soda_listener.cpp.

References put(), SoDa::Command::SET, and SoDa::Command::SPEC_UPDATE_RATE.

Referenced by getTXFreq().

◆ setTXAnt

void GUISoDa::Listener::setTXAnt ( const QString &  antname)
slot

Definition at line 308 of file soda_listener.cpp.

References put(), SoDa::Command::SET, and SoDa::Command::TX_ANT.

Referenced by ~Listener().

◆ setTXFreq

void GUISoDa::Listener::setTXFreq ( double  freq)
slot

◆ setTXGain

void GUISoDa::Listener::setTXGain ( int  gain)
slot

Definition at line 213 of file soda_listener.cpp.

References put(), SoDa::Command::SET, and SoDa::Command::TX_RF_GAIN.

Referenced by ~Listener().

◆ setTXPower

void GUISoDa::Listener::setTXPower ( int  vol)
slot

Definition at line 350 of file soda_listener.cpp.

References put(), SoDa::Command::SET, and SoDa::Command::TX_RF_GAIN.

Referenced by getTXFreq().

◆ setupSpectrumBuffer()

void GUISoDa::Listener::setupSpectrumBuffer ( double  cfreq,
double  span,
long  buflen 
)
private

Definition at line 139 of file soda_listener.cpp.

References spect_buffer, spect_buffer_len, and spect_center_freq.

Referenced by handleREP().

◆ start()

void GUISoDa::Listener::start ( )

initiate transfers on the socket.

Definition at line 83 of file soda_listener.cpp.

References SoDa::Command::GET, SoDa::Command::HWMB_REP, and put().

Referenced by MainWindow::MainWindow(), and ~Listener().

◆ updateData

void GUISoDa::Listener::updateData ( double  cfreq,
float *  y 
)
signal

Referenced by processSpectrum(), and ~Listener().

Member Data Documentation

◆ cmd_socket

QLocalSocket* GUISoDa::Listener::cmd_socket
private

Definition at line 155 of file soda_listener.hpp.

Referenced by get(), init(), processCmd(), and put().

◆ current_rx_freq

double GUISoDa::Listener::current_rx_freq
protected

Definition at line 128 of file soda_listener.hpp.

Referenced by getRXFreq(), and setRXFreq().

◆ current_tx_freq

double GUISoDa::Listener::current_tx_freq
protected

Definition at line 129 of file soda_listener.hpp.

Referenced by getTXFreq(), and setTXFreq().

◆ quit

bool GUISoDa::Listener::quit
private

Definition at line 157 of file soda_listener.hpp.

Referenced by Listener().

◆ socket_basename

QString GUISoDa::Listener::socket_basename
private

Definition at line 154 of file soda_listener.hpp.

Referenced by init(), and Listener().

◆ spect_buffer

float* GUISoDa::Listener::spect_buffer
private

Definition at line 142 of file soda_listener.hpp.

Referenced by processSpectrum(), and setupSpectrumBuffer().

◆ spect_buffer_len

long GUISoDa::Listener::spect_buffer_len
private

Definition at line 141 of file soda_listener.hpp.

Referenced by init(), processSpectrum(), and setupSpectrumBuffer().

◆ spect_center_freq

double GUISoDa::Listener::spect_center_freq
private

Definition at line 143 of file soda_listener.hpp.

Referenced by processSpectrum(), and setupSpectrumBuffer().

◆ spect_socket

QLocalSocket* GUISoDa::Listener::spect_socket
private

Definition at line 156 of file soda_listener.hpp.

Referenced by init(), and processSpectrum().


The documentation for this class was generated from the following files: