1#ifndef OPENGD77BASE_SATELLITECONFIG_HH
2#define OPENGD77BASE_SATELLITECONFIG_HH
4#include <orbitalelementsdatabase.hh>
5#include <satelliteconfig.hh>
8#include <satellitedatabase.hh>
36 static constexpr unsigned int size() {
return 0x0064; }
41 virtual void setName(
const QString &name);
44 virtual void setEpoch(const ::OrbitalElement::Epoch &epoch);
91 void writeFixedPoint(
const Offset::Bit &offset,
double value,
bool sign,
unsigned int dec,
unsigned int frac);
99 void writeFractional(
const Offset::Bit &offset,
double value,
bool sign,
unsigned int frac);
101 void writeInteger(
const Offset::Bit &offset,
int value,
bool sign,
unsigned dec);
103 void writeDigit(
const Offset::Bit &offset, uint8_t digit);
107 struct Limit:
public Element::Limit {
118 static constexpr unsigned int name() {
return 0x0000; }
119 static constexpr Bit epochYear() {
return {0x0008, 4}; }
120 static constexpr Bit epochJulienDay() {
return {0x0009, 4}; }
121 static constexpr Bit meanMotionDerivative() {
return {0x000f, 4}; }
122 static constexpr Bit inclination() {
return {0x0014, 4}; }
123 static constexpr Bit ascension() {
return {0x0018, 4}; }
124 static constexpr Bit eccentricity() {
return {0x001c, 4}; }
125 static constexpr Bit perigee() {
return {0x001f, 0}; }
126 static constexpr Bit meanAnomaly() {
return {0x0023, 0}; }
127 static constexpr Bit meanMotion() {
return {0x0027, 0}; }
128 static constexpr Bit revolutionNumber() {
return {0x002d, 4}; }
129 static constexpr unsigned int fmDownlink() {
return 0x0030; }
130 static constexpr unsigned int fmUplink() {
return 0x0034; }
131 static constexpr unsigned int ctcss() {
return 0x0038; }
132 static constexpr unsigned int aprsDownlink() {
return 0x003c; }
133 static constexpr unsigned int aprsUplink() {
return 0x0040; }
134 static constexpr unsigned int beacon() {
return 0x0044; }
135 static constexpr unsigned int aprsPath() {
return 0x004c; }
153 static constexpr unsigned int size() {
return 0x09d8; }
173 static constexpr unsigned int label() {
return 0x0000; }
174 static constexpr unsigned int unknownInteger0() {
return 0x0008; }
175 static constexpr unsigned int unknownInteger1() {
return 0x000c; }
176 static constexpr unsigned int segmentSize() {
return 0x0010; }
177 static constexpr unsigned int satellites() {
return 0x0014; }
Represents the abstract base class of all codeplug elements.
Definition codeplug.hh:52
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition errorstack.hh:41
SatelliteBankElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition opengd77base_satelliteconfig.cc:231
bool encode(SatelliteDatabase *db, const ErrorStack &err=ErrorStack())
Encodes the given satellite database.
Definition opengd77base_satelliteconfig.cc:260
void clear()
Abstract method to reset the element within the codeplug.
Definition opengd77base_satelliteconfig.cc:245
static constexpr unsigned int size()
The size of the element.
Definition opengd77base_satelliteconfig.hh:153
SatelliteElement satellite(unsigned int idx)
Returns the i-th satellite.
Definition opengd77base_satelliteconfig.cc:255
Encodes a satellite for the OpenGD77 devices.
Definition opengd77base_satelliteconfig.hh:26
virtual void setEccentricity(double ecc)
Sets eccentricity.
Definition opengd77base_satelliteconfig.cc:130
void setFMUplink(const Frequency &f)
Sets the uplink frequency.
Definition opengd77base_satelliteconfig.cc:161
void setFMDownlink(const Frequency &f)
Sets the downlink frequency.
Definition opengd77base_satelliteconfig.cc:156
void writeFractional(const Offset::Bit &offset, double value, bool sign, unsigned int frac)
Writes a fixed point value as a BCD number.
Definition opengd77base_satelliteconfig.cc:63
virtual void setPerigee(double arg)
Sets argument of perigee.
Definition opengd77base_satelliteconfig.cc:135
void writeFixedPoint(const Offset::Bit &offset, double value, bool sign, unsigned int dec, unsigned int frac)
Writes a fixed point value as a BCD number.
Definition opengd77base_satelliteconfig.cc:89
static constexpr unsigned int size()
The size of the element.
Definition opengd77base_satelliteconfig.hh:36
void clear()
Abstract method to reset the element within the codeplug.
Definition opengd77base_satelliteconfig.cc:22
virtual void setMeanMotionDerivative(double dmm)
Sets the first derivative of mean motion.
Definition opengd77base_satelliteconfig.cc:115
virtual void setName(const QString &name)
Sets the name of the element.
Definition opengd77base_satelliteconfig.cc:104
virtual bool encode(const Satellite &sat, const ErrorStack &err=ErrorStack())
Encodes a satellite.
Definition opengd77base_satelliteconfig.cc:196
virtual void setInclination(double incl)
Sets the inclination.
Definition opengd77base_satelliteconfig.cc:120
void writeInteger(const Offset::Bit &offset, int value, bool sign, unsigned dec)
Write a fixed digit integer value.
Definition opengd77base_satelliteconfig.cc:41
virtual void setAscension(double asc)
Right ascension of the ascending node.
Definition opengd77base_satelliteconfig.cc:125
void setBeacon(const Frequency &f)
Sets the beacon frequency.
Definition opengd77base_satelliteconfig.cc:184
void setAPRSPath(const QString &path)
Sets the APRS path.
Definition opengd77base_satelliteconfig.cc:190
virtual void setMeanMotion(double mm)
Sets the first derivative of mean motion.
Definition opengd77base_satelliteconfig.cc:145
void setAPRSDownlink(const Frequency &f)
Sets the APRS downlink frequency.
Definition opengd77base_satelliteconfig.cc:173
void setCTCSS(const SelectiveCall &call)
Sets the CTCSS tone.
Definition opengd77base_satelliteconfig.cc:166
void setAPRSUplink(const Frequency &f)
Sets the APRS uplink frequency.
Definition opengd77base_satelliteconfig.cc:178
virtual void setMeanAnomaly(double ma)
Set the mean anomaly.
Definition opengd77base_satelliteconfig.cc:140
SatelliteElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition opengd77base_satelliteconfig.cc:8
void writeDigit(const Offset::Bit &offset, uint8_t digit)
Writes a single digit at the given offset.
Definition opengd77base_satelliteconfig.cc:28
virtual void setRevolutionNumber(unsigned int num)
Sets the revolution number at epoch.
Definition opengd77base_satelliteconfig.cc:150
virtual void setEpoch(const ::OrbitalElement::Epoch &epoch)
Sets the epoch.
Definition opengd77base_satelliteconfig.cc:109
ImageType
Possible image types.
Definition opengd77base_satelliteconfig.hh:20
OpenGD77BaseSatelliteConfig(QObject *parent=nullptr)
Default constructor.
Definition opengd77base_satelliteconfig.cc:287
virtual bool encode(SatelliteDatabase *db, const ErrorStack &err=ErrorStack())=0
Encodes the given satellite database.
SatelliteConfig(QObject *parent=nullptr)
Hidden constructor.
Definition satelliteconfig.cc:3
A table holding all known satellites.
Definition satellitedatabase.hh:108
Extends the OrbitalElement to include transponder information for a satellite.
Definition satellitedatabase.hh:18
Helper type to encode frequencies without any rounding error.
Definition frequency.hh:11
Some limits for the satellite config.
Definition opengd77base_satelliteconfig.hh:164
static constexpr unsigned int satellites()
The maximum number of satellites.
Definition opengd77base_satelliteconfig.hh:166
Some internal offsets.
Definition opengd77base_satelliteconfig.hh:171
Some limits for the zone bank.
Definition opengd77base_satelliteconfig.hh:107
static constexpr unsigned int nameLength()
The maximum name length.
Definition opengd77base_satelliteconfig.hh:109
static constexpr unsigned int pathLength()
Maximum length of the APRS path.
Definition opengd77base_satelliteconfig.hh:111
Some internal offsets within the element.
Definition opengd77base_satelliteconfig.hh:116
Encodes a selective call.
Definition signaling.hh:13