Skip to content

Commit

Permalink
Updated API docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
hmatuschek committed Jan 10, 2025
1 parent 909054f commit 0dd3210
Show file tree
Hide file tree
Showing 17 changed files with 191 additions and 19 deletions.
1 change: 1 addition & 0 deletions lib/anytone_extension.hh
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ public:
/** Holds the APRS PTT mode. That his, if and when the APRS information is send via the
* associated APRS system. */
APRSPTT aprsPTT() const;
/** Sets the APRS PTT mode. */
void setAPRSPTT(APRSPTT mode);

protected:
Expand Down
2 changes: 1 addition & 1 deletion lib/c7000device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ C7000Device::Packet::payloadSize() const {

QByteArray
C7000Device::Packet::payload() const {
return _encoded.mid(8,payloadSize());
return _encoded.mid(8, payloadSize());
}

const QByteArray &
Expand Down
6 changes: 6 additions & 0 deletions lib/c7000device.hh
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,17 @@ public:
/** Returns @c true, if the packet is valid. */
bool isValid() const;

/** Returns the flags field. */
uint8_t flags() const;
/** Returns the command field. */
uint8_t command() const;
/** Returns the sub-command field. */
uint8_t subcommand() const;
/** Returns the payload size. */
uint16_t payloadSize() const;
/** Returns the payload field. */
QByteArray payload() const;
/** Returns the encoded packet. */
const QByteArray &encoded() const;

protected:
Expand Down
1 change: 1 addition & 0 deletions lib/configmergevisitor.hh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public:
/** Constructor of the merge visitor.
* @param destination Specifies the destination configuration, the additional configurations are
* merged into.
* @param translation Specifies the translation table to fill of objects being replaced.
* @param itemStrategy Specifies the item merge strategy.
* @param setStrategy Specifies the set merge strategy. */
ConfigMergeVisitor(Config *destination, QHash<ConfigObject *, ConfigObject *> &translation,
Expand Down
3 changes: 1 addition & 2 deletions lib/d878uv_codeplug.hh
Original file line number Diff line number Diff line change
Expand Up @@ -1176,8 +1176,7 @@ public:
};


/** Implements some storage to hold the names for the FM APRS frequencies.
* @verbinclude d878uv_fm_aprs_frequency_names.txt */
/** Implements some storage to hold the names for the FM APRS frequencies. */
class FMAPRSFrequencyNamesElement: public Element
{
protected:
Expand Down
2 changes: 1 addition & 1 deletion lib/dmr6x2uv_codeplug.hh
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ public:
public:
/** Some limits of this element. */
struct Limit {
// Maximum number of scan list indices.
/// Maximum number of scan list indices.
static constexpr unsigned int scanListIndices() { return 8; }
};

Expand Down
1 change: 1 addition & 0 deletions lib/encryptionextension.hh
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ public:

int add(ConfigObject *obj, int row=-1, bool unique=true);

/** Returns the key the given index. */
EncryptionKey *key(int index) const;

ConfigItem *allocateChild(const YAML::Node &node, ConfigItem::Context &ctx, const ErrorStack &err=ErrorStack());
Expand Down
5 changes: 5 additions & 0 deletions lib/gd73_codeplug.hh
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,12 @@ public:
/** Possible programmable key function. */
struct KeyFunction {
public:
/** Encodes the given function. */
static uint8_t encode(RadioddityButtonSettingsExtension::Function func);
/** Decodes the given function code. */
static RadioddityButtonSettingsExtension::Function decode(uint8_t code);
protected:
/** Possible function codes. */
enum Code {
None=0, RadioEnable=1, RadioCheck=2, RadioDisable=3, PowerLevel=4,
Monitor=5, EmergencyOn=6, EmergencyOff=7, ZoneSwitch=8, ToggleScan=9, ToggleVOX=10,
Expand Down Expand Up @@ -1275,7 +1278,9 @@ public:
/** Sets the key size in bits. */
void setKeySize(unsigned int size);

/** Decodes the encryption key. */
BasicEncryptionKey *createEncryptionKey(const ErrorStack &err=ErrorStack()) const;
/** Encodes the encryption key. */
bool encodeEncryptionKey(BasicEncryptionKey *key, const ErrorStack &err=ErrorStack());

protected:
Expand Down
1 change: 1 addition & 0 deletions lib/opengd77_interface.hh
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ public:
/** The Flash memory bank. */
static const uint32_t FLASH = 1;

/** Specifies the detected model variant. */
enum class Variant {
GD77, UV380
};
Expand Down
19 changes: 15 additions & 4 deletions lib/opengd77base_codeplug.hh
Original file line number Diff line number Diff line change
Expand Up @@ -460,10 +460,12 @@ public:
class APRSSettingsElement: public Element
{
public:
/** Possible APRS baud rates. */
enum class BaudRate {
Baud300 = 1, Baud1200 = 0
};

/** Possible position precisions. */
enum class PositionPrecision {
Max = 0,
Mask1_8sec = 1,
Expand Down Expand Up @@ -564,14 +566,17 @@ public:
public:
/** Some limits. */
struct Limit: public Element::Limit {
/** The maximum name length in chars. */
static constexpr unsigned int nameLength() { return 8; }
/** The maximum comment length in chars. */
static constexpr unsigned int commentLength() { return 23; }
};

protected:
/// @cond DO_NOT_DOCUMENT
/** Some internal offsets within the element. */
struct Offset: public Element::Offset
{
/// @cond DO_NOT_DOCUMENT
static constexpr unsigned int name() { return 0x0000; }
static constexpr unsigned int sourceSSID() { return 0x0008; }
static constexpr unsigned int latitude() { return 0x0009; }
Expand All @@ -586,8 +591,8 @@ public:
static constexpr Bit positionPrecision() { return { 0x003d, 4}; }
static constexpr Bit useFixedPosition() { return { 0x003d, 1}; }
static constexpr Bit baudRate() { return { 0x003d, 0}; }
/// @endcond
};
/// @endcond
};


Expand Down Expand Up @@ -909,6 +914,7 @@ public:
};


/** Encodes an orbital element of OpenGD77 devices. */
class OrbitalElement: public Element
{
protected:
Expand Down Expand Up @@ -1068,8 +1074,11 @@ public:
class ContactElement: public Element
{
public:
/** Possible modes of time slot override. */
enum class TimeSlotOverride {
None, TS1, TS2
None, ///< Do not override time slot.
TS1, ///< Override with time slot 1.
TS2 ///< Override with time slot 2.
};

protected:
Expand Down Expand Up @@ -1294,9 +1303,11 @@ public:
};


public:
protected:
/** Default hidden constructor. */
explicit OpenGD77BaseCodeplug(QObject *parent = nullptr);

public:
/** Clears and resets the complete codeplug to some default values. */
virtual void clear();

Expand Down
45 changes: 45 additions & 0 deletions lib/orbitalelementsdatabase.hh
Original file line number Diff line number Diff line change
@@ -1,20 +1,34 @@
/** @defgroup sat Satellite tracking settings.
* @ingroup conf */

#ifndef ORBITALELEMENTSDATABASE_HH
#define ORBITALELEMENTSDATABASE_HH

#include <QAbstractTableModel>
#include <QNetworkAccessManager>


/** Defines a single orbital element, enabling the tracking of a single satellite. This dataset
* does not contain any transponder information.
* @ingroup sat */
class OrbitalElement
{
public:
/** Represents a Julien day epoch since a specified year. */
struct Epoch {
/** The year of the epoch. */
unsigned int year;
/** The month. */
unsigned int month;
/** The day. */
unsigned int day;
/** The hour. */
unsigned int hour;
/** The minute. */
unsigned int minute;
/** The second. */
unsigned int second;
/** The microsecond. */
unsigned int microsecond;

/** Default constructor. */
Expand All @@ -27,8 +41,11 @@ public:
/** Copy assignment. */
Epoch &operator =(const Epoch &other) = default;

/** Parses a date-time string into the epoch. */
static Epoch parse(const QString &datetime);
/** Computes the decimal epoch as the day of year a */
double toEpoch() const;
/** Encodes the Epoch as YYYY-MM-DDThh:mm:ss.uuuuuu. */
QString toString() const;
};

Expand Down Expand Up @@ -69,41 +86,68 @@ public:
unsigned int revolutionNumber() const;

public:
/** Constructs a orbital element from a CelesTrak JSON object. */
static OrbitalElement fromCelesTrak(const QJsonObject &obj);

protected:
/** NORAD id of the satellite. */
unsigned int _id;
/** Desriptive name of the satellite. */
QString _name;
/** The epoch. */
Epoch _epoch;
/** Mean motion. */
double _meanMotion;
/** First derivative of the mean motion. */
double _meanMotionDerivative;
/** Inclination. */
double _inclination;
/** Right ascension of the ascending node. */
double _ascension;
/** Eccentricity. */
double _eccentricity;
/** Argument of perigee. */
double _perigee;
/** Mean anomaly. */
double _meanAnomaly;
/** The revolution number. */
unsigned int _revolutionNumber;
};



/** Downloads and updates a database of orbital elements from CelesTrak.
* @ingroup sat */
class OrbitalElementsDatabase: public QAbstractTableModel
{
Q_OBJECT

public:
/** Constructs a orbital element database.
* @param autoLoad [in] If @c true, the database gets downloaded and loaded automatically.
* @param updatePeriodDays [in] Specifies the max age of the local database cache in days.
* @param parent [in] Specifies the QObject parent. */
explicit OrbitalElementsDatabase(bool autoLoad, unsigned int updatePeriodDays=7, QObject *parent=nullptr);

/** @c returns @c true if the database contains a satellite with the given NORAD id. */
bool contains(unsigned int id) const;
/** Retunrs the orbital elements for the satellite with the given NORAD id. */
OrbitalElement getById(unsigned int id) const;
/** Returns the i-th orbital element. */
const OrbitalElement &getAt(unsigned int idx) const;
/** Returns the i-th orbital element. */
OrbitalElement &getAt(unsigned int idx);

/** Returns the current age of the cache. */
unsigned int dbAge() const;
/** If needed, downloads the database and loads all received orbital elements. */
void load();

/** Returns the number of elements in the database. */
int rowCount(const QModelIndex &parent = QModelIndex()) const;
/** Returns the number of columns of the database table. */
int columnCount(const QModelIndex &parent = QModelIndex()) const;
/** Returns a single cell of the database table. */
QVariant data(const QModelIndex &index, int role) const;

signals:
Expand All @@ -121,6 +165,7 @@ private slots:
void downloadFinished(QNetworkReply *reply);

protected:
/** Loads a database from the given filename. */
bool load(const QString &filename);

private:
Expand Down
1 change: 1 addition & 0 deletions lib/radioddity_extensions.hh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public:
Q_ENUM(Function)

public:
/** Default constructor. */
explicit RadioddityButtonSettingsExtension(QObject *parent=nullptr);

ConfigItem *clone() const;
Expand Down
3 changes: 2 additions & 1 deletion lib/satellitedatabase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Satellite::Satellite()
}

Satellite::Satellite(const OrbitalElement &orbit)
: OrbitalElement(orbit), _name(orbit.name()),
: OrbitalElement(orbit), _name(),
_fmUplink(), _fmDownlink(), _fmUplinkTone(), _fmDownlinkTone(),
_aprsUplink(), _aprsDownlink(), _aprsUplinkTone(), _aprsDownlinkTone(), _beacon()
{
Expand All @@ -43,6 +43,7 @@ Satellite::setName(const QString &name) {
_name = name.simplified();
}


const Frequency &
Satellite::fmUplink() const {
return _fmUplink;
Expand Down
Loading

0 comments on commit 0dd3210

Please sign in to comment.