12#include "radioinfo.hh"
13#include "radiointerface.hh"
15#include "userdatabase.hh"
16#include "callsigndb.hh"
17#include "errorstack.hh"
48 explicit Radio(QObject *parent =
nullptr);
53 virtual const QString &
name()
const = 0;
Controls the selection of callsigns from the UserDatabase to be encoded into the callsign db.
Definition callsigndb.hh:22
Abstract base class of all callsign database implementations.
Definition callsigndb.hh:16
Certain flags passed to CodePlug::encode to control the transfer and encoding of the codeplug.
Definition codeplug.hh:24
This class defines the interface all device-specific code-plugs must implement.
Definition codeplug.hh:18
The config class, representing the codeplug configuration.
Definition config.hh:70
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition errorstack.hh:43
Provides some information about a radio model.
Definition radioinfo.hh:16
Represents the limits or the entire codeplug.
Definition radiolimits.hh:712
Base class for all Radio objects.
Definition radio.hh:32
virtual bool startDownload(const TransferFlags &flags, const ErrorStack &err=ErrorStack())=0
Starts the download of the codeplug.
void uploadProgress(int percent)
Gets emitted on upload progress (e.g., for progress bars).
virtual Codeplug & codeplug()=0
Returns the codeplug instance.
Status status() const
Returns the current status.
Definition radio.cc:206
void uploadError(Radio *radio)
Gets emitted if there was an error during the upload.
void uploadComplete(Radio *radio)
Gets emitted once the codeplug upload has been completed successfully.
virtual const QString & name() const =0
Returns the name of the radio (e.g., device identifier).
virtual bool startUploadCallsignDB(UserDatabase *db, const CallsignDB::Flags &selection=CallsignDB::Flags(), const ErrorStack &err=ErrorStack())=0
Assembles the callsign DB from the given one and uploads it to the device.
static Radio * detect(const USBDeviceDescriptor &descr, const RadioInfo &force=RadioInfo(), const ErrorStack &err=ErrorStack())
Tries to detect the radio connected to the specified interface or constructs the specified radio usin...
Definition radio.cc:55
const ErrorStack & errorStack() const
Returns the error stack, passed to startDownload, startUpload or startUploadCallsignDB.
Definition radio.cc:211
void downloadError(Radio *radio)
Gets emitted if there was an error during the codeplug download.
void uploadStarted()
Gets emitted once the codeplug upload has been started.
virtual bool startUploadSatelliteConfig(SatelliteDatabase *db, const TransferFlags &flags, const ErrorStack &err=ErrorStack())=0
Assembles the satellite config and writes it to the device.
virtual const Codeplug & codeplug() const =0
Returns the codeplug instance.
void downloadFinished(Radio *radio, Codeplug *codeplug)
Gets emitted once the codeplug download has been finished.
void downloadStarted()
Gets emitted once the codeplug download has been started.
Status
Possible states of the radio object.
Definition radio.hh:37
@ StatusError
An error occurred.
Definition radio.hh:43
@ StatusDownload
Downloading codeplug.
Definition radio.hh:39
@ StatusIdle
Idle, nothing to do.
Definition radio.hh:38
@ StatusUpload
Uploading codeplug.
Definition radio.hh:40
@ StatusUploadSatellites
Uploading satellite config.
Definition radio.hh:42
@ StatusUploadCallsigns
Uploading codeplug.
Definition radio.hh:41
Status _task
The current state/task.
Definition radio.hh:127
Radio(QObject *parent=nullptr)
Default constructor.
Definition radio.cc:33
ErrorStack _errorStack
The error stack.
Definition radio.hh:129
virtual bool startUpload(Config *config, const Codeplug::Flags &flags=Codeplug::Flags(), const ErrorStack &err=ErrorStack())=0
Derives the device-specific codeplug from the generic configuration and uploads that codeplug to the ...
void downloadProgress(int percent)
Gets emitted on download progress (e.g., for progress bars).
virtual const CallsignDB * callsignDB() const
Returns the call-sign DB instance.
Definition radio.cc:44
virtual const RadioLimits & limits() const =0
Returns the limits for this radio.
A table holding all known satellites.
Definition satellitedatabase.hh:108
Controls the transfer of codeplugs, callsign DBs etc to the device.
Definition transferflags.hh:7
Base class for all radio interface descriptors representing a unique interface to a connected radio.
Definition usbdevice.hh:197
Auto-updating DMR user database.
Definition userdatabase.hh:24