12#include "radioinfo.hh"
13#include "radiointerface.hh"
15#include "userdatabase.hh"
16#include "callsigndb.hh"
17#include "errorstack.hh"
47 explicit Radio(QObject *parent =
nullptr);
52 virtual const QString &
name()
const = 0;
92 Config *config,
bool blocking=
false,
Controls the selection of callsigns from the UserDatabase to be encoded into the callsign db.
Definition callsigndb.hh:20
Abstract base class of all callsign database implementations.
Definition callsigndb.hh:14
Certain flags passed to CodePlug::encode to control the transfer and encoding of the codeplug.
Definition codeplug.hh:26
This class defines the interface all device-specific code-plugs must implement.
Definition codeplug.hh:20
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:41
Provides some information about a radio model.
Definition radioinfo.hh:16
Represents the limits or the entire codeplug.
Definition radiolimits.hh:684
Base class for all Radio objects.
Definition radio.hh:32
virtual bool startUploadCallsignDB(UserDatabase *db, bool blocking=false, const CallsignDB::Selection &selection=CallsignDB::Selection(), const ErrorStack &err=ErrorStack())=0
Assembles the callsign DB from the given one and uploads it to the device.
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:188
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).
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:57
const ErrorStack & errorStack() const
Returns the error stack, passed to startDownload, startUpload or startUploadCallsignDB.
Definition radio.cc:193
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 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:42
@ StatusDownload
Downloading codeplug.
Definition radio.hh:39
@ StatusIdle
Idle, nothing to do.
Definition radio.hh:38
@ StatusUpload
Uploading codeplug.
Definition radio.hh:40
@ StatusUploadCallsigns
Uploading codeplug.
Definition radio.hh:41
virtual bool startUpload(Config *config, bool blocking=false, 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 ...
Status _task
The current state/task.
Definition radio.hh:121
Radio(QObject *parent=nullptr)
Default constructor.
Definition radio.cc:35
ErrorStack _errorStack
The error stack.
Definition radio.hh:123
void downloadProgress(int percent)
Gets emitted on download progress (e.g., for progress bars).
virtual bool startDownload(bool blocking=false, const ErrorStack &err=ErrorStack())=0
Starts the download of the codeplug.
virtual const CallsignDB * callsignDB() const
Returns the call-sign DB instance.
Definition radio.cc:46
virtual const RadioLimits & limits() const =0
Returns the limits for this radio.
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:23