libdrmconf 0.15.0
A library to program DMR radios.
Loading...
Searching...
No Matches
opengd77base_codeplug.hh
1#ifndef OPENGD77BASE_CODEPLUG_HH
2#define OPENGD77BASE_CODEPLUG_HH
3
4#include "channel.hh"
5#include "codeplug.hh"
6#include "gpssystem.hh"
7#include "contact.hh"
8#include "zone.hh"
9#include "satellitedatabase.hh"
10#include "melody.hh"
11
12#include <QGeoCoordinate>
13
17{
18 Q_OBJECT
19
20public:
22 enum ImageType { EEPROM = 0, FLASH = 1 };
23
24public:
26 static uint32_t encodeAngle(double degee);
28 static double decodeAngle(uint32_t code);
29
31 static uint16_t encodeSelectiveCall(const SelectiveCall &call);
33 static SelectiveCall decodeSelectiveCall(uint16_t code);
34
35public:
38 {
39 public:
41 enum Mode {
44 };
45
47 enum class Alias {
48 None = 0, APRS = 1, Text = 2, Both = 3
49 };
50
52 enum class SquelchMode {
53 Global, Open, Normal, Closed
54 };
55
56 protected:
58 ChannelElement(uint8_t *ptr, size_t size);
59
60 public:
62 explicit ChannelElement(uint8_t *ptr);
64 virtual ~ChannelElement();
65
67 static constexpr unsigned int size() { return 0x0038; }
68
70 virtual void clear();
71
73 virtual QString name() const;
75 virtual void setName(const QString &n);
76
78 virtual Frequency rxFrequency() const;
80 virtual void setRXFrequency(const Frequency &freq);
82 virtual Frequency txFrequency() const;
84 virtual void setTXFrequency(const Frequency &freq);
85
87 virtual Mode mode() const;
89 virtual void setMode(Mode mode);
90
92 virtual bool globalPower() const;
94 virtual Channel::Power power() const;
96 virtual void setPower(Channel::Power pwr);
98 virtual void clearPower();
99
102 virtual Interval transmitTimeout() const;
105 virtual void setTransmitTimeout(const Interval &interval);
106
108 virtual bool fixedPositionEnabled() const;
110 virtual QGeoCoordinate fixedPosition() const;
112 virtual void setFixedPosition(const QGeoCoordinate &coordinate);
114 virtual void enableFixedPosition(bool enable);
115
117 virtual SelectiveCall rxTone() const;
119 virtual void setRXTone(const SelectiveCall &code);
121 virtual SelectiveCall txTone() const;
123 virtual void setTXTone(const SelectiveCall &code);
124
126 virtual bool isSimplex() const;
128 virtual void enableSimplex(bool enable);
129
131 virtual bool powerSave() const;
133 virtual void enablePowerSave(bool enable);
134
136 virtual bool beep() const;
138 virtual void enableBeep(bool enable);
139
141 virtual bool hasDMRId() const;
143 virtual unsigned int dmrId() const;
145 virtual void setDMRId(unsigned int id);
147 virtual void clearDMRId();
148
150 virtual bool hasGroupList() const;
152 virtual unsigned groupListIndex() const;
154 virtual void setGroupListIndex(unsigned index);
156 virtual void clearGroupListIndex();
157
159 virtual unsigned colorCode() const;
161 virtual void setColorCode(unsigned cc);
162
164 virtual bool hasAPRSIndex() const;
166 virtual unsigned int aprsIndex() const;
168 virtual void setAPRSIndex(unsigned int index);
170 virtual void clearAPRSIndex();
171
173 virtual bool hasTXContact() const;
175 virtual unsigned int txContactIndex() const;
177 virtual void setTXContactIndex(unsigned int index);
179 virtual void clearTXContact();
180
182 virtual OpenGD77ChannelExtension::TalkerAlias aliasTimeSlot1() const;
184 virtual void setAliasTimeSlot1(OpenGD77ChannelExtension::TalkerAlias alias);
186 virtual OpenGD77ChannelExtension::TalkerAlias aliasTimeSlot2() const;
188 virtual void setAliasTimeSlot2(OpenGD77ChannelExtension::TalkerAlias alias);
189
191 virtual DMRChannel::TimeSlot timeSlot() const;
193 virtual void setTimeSlot(DMRChannel::TimeSlot ts);
194
196 virtual FMChannel::Bandwidth bandwidth() const;
198 virtual void setBandwidth(FMChannel::Bandwidth bw);
199
201 virtual bool rxOnly() const;
203 virtual void enableRXOnly(bool enable);
204
206 virtual bool skipScan() const;
208 virtual void enableSkipScan(bool enable);
210 virtual bool skipZoneScan() const;
212 virtual void enableSkipZoneScan(bool enable);
213
215 virtual bool vox() const;
217 virtual void enableVOX(bool enable);
218
220 virtual SquelchMode squelchMode() const;
222 virtual unsigned int squelchLevel() const;
224 virtual void setSquelch(SquelchMode mode, unsigned int level);
225
227 virtual Channel *decode(Context &ctx, const ErrorStack &err=ErrorStack()) const;
229 virtual bool link(Channel *c, Context &ctx, const ErrorStack &err=ErrorStack()) const;
231 virtual bool encode(const Channel *c, Context &ctx, const ErrorStack &err=ErrorStack());
232
233 public:
235 struct Limit {
237 static constexpr unsigned int nameLength() { return 16; }
238 };
239
240 protected:
242 struct Offset: public Element::Offset {
244 static constexpr unsigned int name() { return 0x0000; }
245 static constexpr unsigned int rxFrequency() { return 0x0010; }
246 static constexpr unsigned int txFrequency() { return 0x0014; }
247 static constexpr unsigned int mode() { return 0x0018; }
248 static constexpr unsigned int power() { return 0x0019; }
249 static constexpr unsigned int latitude0() { return 0x001a; }
250 static constexpr unsigned int txTimeout() { return 0x001b; }
251 static constexpr unsigned int latitude1() { return 0x001c; }
252 static constexpr unsigned int latitude2() { return 0x001d; }
253 static constexpr unsigned int longitude0() { return 0x001e; }
254 static constexpr unsigned int longitude1() { return 0x001f; }
255 static constexpr unsigned int rxTone() { return 0x0020; }
256 static constexpr unsigned int txTone() { return 0x0022; }
257 static constexpr unsigned int longitude2() { return 0x0024; }
258 static constexpr Bit simplex() { return {0x0026, 2}; }
259 static constexpr Bit useFixedLocation() { return {0x0026, 3}; }
260 static constexpr Bit disablePowerSave() { return {0x0026, 5}; }
261 static constexpr Bit disableBeep() { return {0x0026, 6}; }
262 static constexpr Bit overrideDMRID() { return {0x0026, 7}; }
263 static constexpr unsigned int dmrId() { return 0x0027; }
264 static constexpr unsigned int groupList() { return 0x002b; }
265 static constexpr unsigned int colorCode() { return 0x002c; }
266 static constexpr unsigned int aprsIndex() { return 0x002d; }
267 static constexpr unsigned int txContact() { return 0x002e; }
268 static constexpr Bit aliasTimeSlot2() { return { 0x030, 2}; }
269 static constexpr Bit aliasTimeSlot1() { return { 0x030, 0}; }
270 static constexpr Bit timeSlot() { return {0x0031, 6}; }
271 static constexpr Bit bandwidth() { return {0x0033, 1}; }
272 static constexpr Bit enableMonitor() { return {0x0033, 3}; }
273 static constexpr Bit rxOnly() { return {0x0033, 2}; }
274 static constexpr Bit skipScan() { return {0x0033, 4}; }
275 static constexpr Bit skipZoneScan() { return {0x0033, 5}; }
276 static constexpr Bit vox() { return {0x0033, 6}; }
277 static constexpr unsigned int squelch() { return 0x0037; }
279 };
280 };
281
282
288 {
289 protected:
291 ChannelBankElement(uint8_t *ptr, unsigned size);
292
293 public:
295 explicit ChannelBankElement(uint8_t *ptr);
297 virtual ~ChannelBankElement();
298
300 static constexpr unsigned int size() { return 0x1c10; }
301
303 void clear();
304
306 virtual bool isEnabled(unsigned idx) const ;
308 virtual void enable(unsigned idx, bool enabled);
310 virtual uint8_t *get(unsigned idx) const;
312 ChannelElement channel(unsigned int n);
313
314 public:
316 struct Limit {
318 static constexpr unsigned int channelCount() { return 128; }
319 };
320
321 protected:
323 struct Offset {
325 static constexpr unsigned int bitmask() { return 0x0000; }
326 static constexpr unsigned int channels() { return 0x0010; }
328 };
329 };
330
331
337 {
338 public:
340 enum class OffsetMode {
341 Off = 0,
344 };
345
357
358 protected:
360 VFOChannelElement(uint8_t *ptr, unsigned size);
361
362 public:
364 explicit VFOChannelElement(uint8_t *ptr);
365
366 void clear();
367
369 QString name() const;
371 void setName(const QString &name);
372
374 virtual double stepSize() const;
376 virtual void setStepSize(double kHz);
377
379 virtual OffsetMode offsetMode() const;
381 virtual double txOffset() const;
383 virtual void setTXOffset(double f);
385 virtual void setOffsetMode(OffsetMode mode);
386
387 protected:
389 struct Offset: public ChannelElement::Offset {
390 static constexpr Bit stepSize() { return {0x0036, 4} ; }
391 static constexpr Bit offsetMode() { return {0x0036, 2} ; }
392 static constexpr unsigned int txOffset() { return 0x0034; }
393 };
395 };
396
397
400 {
401 protected:
403 GeneralSettingsElement(uint8_t *ptr, size_t size);
404
405 public:
407 GeneralSettingsElement(uint8_t *ptr);
408
410 static constexpr unsigned int size() { return 0x0090; }
411
412 void clear();
413
415 virtual Frequency uhfMinFrequency() const;
417 virtual void setUHFMinFrequency(const Frequency &f);
419 virtual Frequency uhfMaxFrequency() const;
421 virtual void setUHFMaxFrequency(const Frequency &f);
422
424 virtual Frequency vhfMinFrequency() const;
426 virtual void setVHFMinFrequency(const Frequency &f);
428 virtual Frequency vhfMaxFrequency() const;
430 virtual void setVHFMaxFrequency(const Frequency &f);
431
433 virtual QString call() const;
435 virtual void setCall(const QString &call);
436
438 virtual unsigned int radioId() const;
440 virtual void setRadioId(unsigned int id);
441
443 virtual bool encode(const Context &ctx, const ErrorStack &err = ErrorStack());
445 virtual bool decode(const Context &ctx, const ErrorStack &err = ErrorStack());
446
447 public:
449 struct Limit: public Element::Limit {
451 static constexpr unsigned int callLength() { return 8; }
452 };
453
454 protected:
456 struct Offset: public Element::Offset {
458 static constexpr unsigned int uhfMinFrequency() { return 0x0000; }
459 static constexpr unsigned int uhfMaxFrequency() { return 0x0002; }
460 static constexpr unsigned int vhfMinFrequency() { return 0x0004; }
461 static constexpr unsigned int vhfMaxFrequency() { return 0x0006; }
462 static constexpr unsigned int call() { return 0x0060; }
463 static constexpr unsigned int dmrId() { return 0x0068; }
465 };
466 };
467
468
471 {
472 public:
474 enum class BaudRate {
475 Baud300 = 1, Baud1200 = 0
476 };
477
479 enum class PositionPrecision {
480 Max = 0,
481 Mask1_8sec = 1,
482 Mask3_6sec = 2,
483 Mask18sec = 3,
484 Mask36sec = 4,
485 Mask3min = 5,
486 Mask6min = 6,
487 Mask30min = 7
488 };
489
490 public:
492 explicit APRSSettingsElement(uint8_t *ptr);
493
494 protected:
496 APRSSettingsElement(uint8_t *ptr, size_t size);
497
498 public:
500 static constexpr unsigned int size() { return 0x40; }
501
503 void clear();
504
506 virtual bool isValid() const;
507
509 virtual QString name() const;
511 virtual void setName(const QString &name);
512
514 virtual unsigned int sourceSSID() const;
516 virtual void setSourceSSID(unsigned int ssid);
517
519 virtual bool fixedPositionEnabled() const;
521 virtual QGeoCoordinate fixedPosition() const;
523 virtual void setFixedPosition(const QGeoCoordinate &coor);
525 virtual void enableFixedPosition(bool enable);
526
528 virtual PositionPrecision positionPrecision() const;
530 virtual void setPositionPrecision(PositionPrecision prec);
531
533 virtual bool hasVia1() const;
535 virtual QString via1Call() const;
537 virtual unsigned int via1SSID() const;
539 virtual void setVia1(const QString &call, unsigned int ssid);
541 virtual void clearVia1();
542
544 virtual bool hasVia2() const;
546 virtual QString via2Call() const;
548 virtual unsigned int via2SSID() const;
550 virtual void setVia2(const QString &call, unsigned int ssid);
552 virtual void clearVia2();
553
555 virtual FMAPRSSystem::Icon icon() const;
557 virtual void setIcon(FMAPRSSystem::Icon icon);
558
560 virtual QString comment() const;
562 virtual void setComment(const QString &text);
563
565 virtual BaudRate baudRate() const;
567 virtual void setBaudRate(BaudRate rate);
568
569 Frequency fmFrequency() const;
570 void setFMFrequency(Frequency f);
571
573 virtual bool encode(const FMAPRSSystem *system, const Context &ctx, const ErrorStack &err=ErrorStack());
575 virtual FMAPRSSystem *decode(const Context &ctx, const ErrorStack &err=ErrorStack()) const;
577 virtual bool link(FMAPRSSystem *system, const Context &ctx, const ErrorStack &err=ErrorStack());
578
579 public:
581 struct Limit: public Element::Limit {
583 static constexpr unsigned int nameLength() { return 8; }
585 static constexpr unsigned int commentLength() { return 23; }
586 };
587
588 protected:
590 struct Offset: public Element::Offset
591 {
593 static constexpr unsigned int name() { return 0x0000; }
594 static constexpr unsigned int sourceSSID() { return 0x0008; }
595 static constexpr unsigned int latitude() { return 0x0009; }
596 static constexpr unsigned int longitude() { return 0x000c; }
597 static constexpr unsigned int via1Call() { return 0x000f; }
598 static constexpr unsigned int via1SSID() { return 0x0015; }
599 static constexpr unsigned int via2Call() { return 0x0016; }
600 static constexpr unsigned int via2SSID() { return 0x001c; }
601 static constexpr unsigned int iconTable() { return 0x001d; }
602 static constexpr unsigned int iconIndex() { return 0x001e; }
603 static constexpr unsigned int comment() { return 0x001f; }
604 static constexpr unsigned int fmFrequency() { return 0x0037; }
605 static constexpr Bit positionPrecision() { return { 0x003d, 4}; }
606 static constexpr Bit transmitQSY() { return { 0x003d, 2}; }
607 static constexpr Bit useFixedPosition() { return { 0x003d, 1}; }
608 static constexpr Bit baudRate() { return { 0x003d, 0}; }
609 static constexpr unsigned int unknownBytes() { return 0x003e; }
611 };
612 };
613
614
617 {
618 public:
620 explicit APRSSettingsBankElement(uint8_t *ptr);
621
622 protected:
624 APRSSettingsBankElement(uint8_t *ptr, size_t size);
625
626 public:
628 static constexpr unsigned int size() { return 0x40; }
629
631 void clear();
632
634 APRSSettingsElement system(unsigned int idx) const;
635
637 virtual bool encode(Context &ctx, const ErrorStack &err=ErrorStack());
639 virtual bool decode(Context &ctx, const ErrorStack &err=ErrorStack());
641 virtual bool link(Context &ctx, const ErrorStack &err=ErrorStack());
642
643 public:
645 struct Limit: public Element::Limit {
647 static constexpr unsigned int systems() { return 8; }
648 };
649
650 public:
652 struct Offset: public Element::Offset {
653 static constexpr unsigned int systems() { return 0x0000; }
654 static constexpr unsigned int betweenSystems() { return APRSSettingsElement::size(); }
655 };
657 };
658
659
663 {
664 protected:
666 DTMFContactElement(uint8_t *ptr, size_t size);
667
668 public:
670 explicit DTMFContactElement(uint8_t *ptr);
671
673 static constexpr unsigned int size() { return 0x0020; }
674
675 void clear();
676 bool isValid() const;
677
679 virtual QString name() const;
681 virtual void setName(const QString &name);
682
684 virtual QString number() const;
686 virtual void setNumber(const QString &number);
687
689 virtual bool encode(const DTMFContact *contact, const Context &ctx, const ErrorStack &err=ErrorStack());
691 virtual DTMFContact *decode(const Context &ctx, const ErrorStack &err=ErrorStack());
692
693 public:
695 struct Limit: public Element::Limit {
697 static constexpr unsigned int nameLength() { return 16; }
699 static constexpr unsigned int numberLength() { return 16; }
700 };
701
702 protected:
704 struct Offset: public Element::Offset {
705 static constexpr unsigned int name() { return 0x0000; }
706 static constexpr unsigned int number() { return 0x0010; }
707 };
709 };
710
711
714 {
715 protected:
717 DTMFContactBankElement(uint8_t *ptr, size_t size);
718
719 public:
721 DTMFContactBankElement(uint8_t *ptr);
722
724 static constexpr unsigned int size() { return Limit::contacts()*DTMFContactElement::size(); }
725
726 void clear();
727
729 DTMFContactElement contact(unsigned int n) const;
730
732 virtual bool encode(Context &ctx, const ErrorStack &err=ErrorStack());
734 virtual bool decode(Context &ctx, const ErrorStack &err=ErrorStack());
735
736 public:
738 struct Limit: public Element::Limit {
740 static constexpr unsigned int contacts() { return 64; }
741 };
742
743 public:
745 struct Offset: public Element::Offset {
746 static constexpr unsigned int contacts() { return 0x0000; }
747 static constexpr unsigned int betweenContacts() { return DTMFContactElement::size(); }
748 };
750 };
751
752
755 {
756 protected:
758 BootSettingsElement(uint8_t *ptr, unsigned size);
759
760 public:
762 explicit BootSettingsElement(uint8_t *ptr);
764 virtual ~BootSettingsElement();
765
767 void clear();
768
770 virtual bool bootText() const;
772 virtual void enableBootText(bool enable);
773
775 virtual bool bootPasswordEnabled() const;
777 virtual unsigned bootPassword() const;
779 virtual void setBootPassword(unsigned passwd);
781 virtual void clearBootPassword();
782
784 virtual QString line1() const;
786 virtual void setLine1(const QString &text);
788 virtual QString line2() const;
790 virtual void setLine2(const QString &text);
791
793 virtual bool encode(const Context &ctx, const ErrorStack &err = ErrorStack());
795 virtual bool decode(Context &ctx, const ErrorStack &err = ErrorStack());
796
797 public:
799 struct Limit: public Element::Limit {
801 static constexpr unsigned int lineLength() { return 16; }
802 };
803
804 public:
806 struct Offset: public Element::Offset {
807 static constexpr unsigned int bootText() { return 0x0000; }
808 static constexpr unsigned int bootPasswdEnable() { return 0x0001; }
809 static constexpr unsigned int bootPasswd() { return 0x000c; }
810 static constexpr unsigned int line1() { return 0x0028; }
811 static constexpr unsigned int line2() { return 0x0038; }
812 };
814 };
815
816
818 class ZoneElement: public Element
819 {
820 protected:
822 ZoneElement(uint8_t *ptr, unsigned size);
823
824 public:
826 explicit ZoneElement(uint8_t *ptr);
827 virtual ~ZoneElement();
828
830 static constexpr unsigned int size() { return 0x00b0; }
831
833 void clear();
835 bool isValid() const;
836
838 virtual QString name() const;
840 virtual void setName(const QString &name);
841
843 virtual bool hasMember(unsigned n) const;
845 virtual unsigned member(unsigned n) const;
847 virtual void setMember(unsigned n, unsigned idx);
849 virtual void clearMember(unsigned n);
850
852 virtual bool encode(const Zone *zone, Context &ctx, const ErrorStack &err=ErrorStack());
854 virtual Zone *decode(const Context &ctx, const ErrorStack &err=ErrorStack()) const;
857 virtual bool link(Zone *zone, Context &ctx, const ErrorStack &err=ErrorStack()) const;
858
859 public:
861 struct Limit: public Element::Limit {
863 static constexpr unsigned int nameLength() { return 16; }
865 static constexpr unsigned int memberCount() { return 80; }
866 };
867
868 protected:
870 struct Offset: public Element::Offset {
872 static constexpr unsigned int name() { return 0x0000; }
873 static constexpr unsigned int channels() { return 0x0010; }
874 static constexpr unsigned int betweenChannels() { return 0x0002; }
876 };
877 };
878
879
882 {
883 protected:
885 ZoneBankElement(uint8_t *ptr, unsigned size);
886
887 public:
889 explicit ZoneBankElement(uint8_t *ptr);
892
894 static constexpr unsigned int size() {
895 return 0x0020 + Limit::zoneCount()*ZoneElement::size();
896 }
897
899 void clear();
900
902 virtual bool isEnabled(unsigned idx) const ;
904 virtual void enable(unsigned idx, bool enabled);
905
907 ZoneElement zone(unsigned int n);
908
910 virtual bool encode(Context &ctx, const ErrorStack &err=ErrorStack());
912 virtual bool decode(Context &ctx, const ErrorStack &err=ErrorStack());
914 virtual bool link(Context &ctx, const ErrorStack &err=ErrorStack());
915
916 public:
918 struct Limit: public Element::Limit {
920 static constexpr unsigned int zoneCount() { return 68; }
921 };
922
923 protected:
925 struct Offset: public Element::Offset {
927 static constexpr unsigned int bitmap() { return 0x0000; }
928 static constexpr unsigned int zones() { return 0x0020; }
929 static constexpr unsigned int betweenZones() { return ZoneElement::size(); }
931 };
932 };
933
934
937 {
938 public:
941 enum class TimeSlotOverride {
942 None = 0x01,
943 TS1 = 0x00,
944 TS2 = 0x02
945 };
946
947 protected:
949 ContactElement(uint8_t *ptr, unsigned size);
950
951 public:
953 explicit ContactElement(uint8_t *ptr);
955 virtual ~ContactElement();
956
958 static constexpr unsigned int size() { return 0x0018; }
959
961 void clear();
962
964 bool isValid() const;
965
967 virtual QString name() const;
969 virtual void setName(const QString name);
970
972 virtual unsigned number() const;
974 virtual void setNumber(unsigned id);
975
977 virtual DMRContact::Type type() const;
979 virtual void setType(DMRContact::Type type);
980
982 virtual TimeSlotOverride timeSlotOverride() const;
984 virtual void setTimeSlotOverride(TimeSlotOverride ts);
985
987 virtual DMRContact *decode(Context &ctx, const ErrorStack &err=ErrorStack()) const;
989 virtual bool encode(const DMRContact *obj, Context &ctx, const ErrorStack &err=ErrorStack());
990
991 public:
993 struct Limit {
995 static constexpr unsigned int nameLength() { return 16; }
996 };
997
998 protected:
1000 struct Offset {
1002 static constexpr unsigned int name() { return 0x0000; }
1003 static constexpr unsigned int number() { return 0x0010; }
1004 static constexpr unsigned int type() { return 0x0014; }
1005 static constexpr unsigned int timeSlotOverride() { return 0x0017; }
1007 };
1008 };
1009
1010
1013 {
1014 protected:
1016 ContactBankElement(uint8_t *ptr, size_t size);
1017
1018 public:
1020 ContactBankElement(uint8_t *ptr);
1021
1023 static constexpr unsigned int size() {
1025 }
1026
1028 void clear();
1029
1031 ContactElement contact(unsigned int idx) const;
1032
1034 virtual bool encode(Context &ctx, const ErrorStack &err = ErrorStack());
1036 virtual bool decode(Context &ctx, const ErrorStack &err = ErrorStack());
1037
1038 public:
1040 struct Limit {
1042 static constexpr unsigned int contactCount() { return 1024; }
1043 };
1044
1045 protected:
1047 struct Offset {
1049 static constexpr unsigned int contacts() { return 0x0000; }
1050 static constexpr unsigned int betweenContacts() { return ContactElement::size(); }
1051 // @endcond
1052 };
1053 };
1054
1055
1058 {
1059 protected:
1061 GroupListElement(uint8_t *ptr, size_t size);
1062
1063 public:
1065 GroupListElement(uint8_t *ptr);
1066
1068 static constexpr unsigned int size() { return 0x0050; }
1069
1071 void clear();
1072
1074 virtual QString name() const;
1076 virtual void setName(const QString &name);
1077
1079 virtual bool hasContactIndex(unsigned int i) const;
1081 virtual unsigned int contactIndex(unsigned int i) const;
1083 virtual void setContactIndex(unsigned int i, unsigned int contactIdx);
1085 virtual void clearContactIndex(unsigned int i);
1086
1088 virtual bool encode(RXGroupList *lst, Context &ctx, const ErrorStack &err=ErrorStack());
1090 virtual RXGroupList *decode(Context &ctx, const ErrorStack &err=ErrorStack()) const;
1092 virtual bool link(RXGroupList *lst, Context &ctx, const ErrorStack &err=ErrorStack()) const;
1093
1094 public:
1096 struct Limit {
1098 static constexpr unsigned int nameLength() { return 15; }
1100 static constexpr unsigned int contactCount() { return 32; }
1101 };
1102
1103 protected:
1105 struct Offset {
1107 static constexpr unsigned int name() { return 0x0000; }
1108 static constexpr unsigned int contacts() { return 0x0010; }
1109 static constexpr unsigned int betweenContacts() { return 0x0002; }
1110 // @endcond
1111 };
1112 };
1113
1114
1117 {
1118 protected:
1120 GroupListBankElement(uint8_t *ptr, size_t size);
1121
1122 public:
1124 GroupListBankElement(uint8_t *ptr);
1125
1127 static constexpr unsigned int size() { return 0x1840; }
1128
1130 void clear();
1131
1133 virtual bool hasGroupList(unsigned int i) const;
1135 virtual unsigned int groupListContactCount(unsigned int i) const;
1137 virtual void setGroupListContactCount(unsigned int i, unsigned int count);
1139 virtual GroupListElement groupList(unsigned int i) const;
1141 virtual void clearGroupList(unsigned int i);
1142
1144 virtual bool encode(Context &ctx, const ErrorStack &err = ErrorStack());
1146 virtual bool decode(Context &ctx, const ErrorStack &err = ErrorStack());
1148 virtual bool link(Context &ctx, const ErrorStack &err = ErrorStack());
1149
1150 public:
1152 struct Limit {
1154 static constexpr unsigned int groupListCount() { return 76; }
1155 };
1156
1157 protected:
1159 struct Offset {
1161 static constexpr unsigned int length() { return 0x0000; }
1162 static constexpr unsigned int groupLists() { return 0x0080; }
1163 static constexpr unsigned int betweenGroupLists() { return GroupListElement::size(); }
1164 // @endcond
1165 };
1166 };
1167
1168
1172 {
1173 protected:
1175 SatelliteElement(uint8_t *ptr, size_t size);
1176
1177 public:
1179 SatelliteElement(uint8_t *ptr);
1180
1182 static constexpr unsigned int size() { return 0x0064; }
1183
1184 void clear();
1185
1187 virtual void setName(const QString &name);
1188
1190 virtual void setEpoch(const ::OrbitalElement::Epoch &epoch);
1192 virtual void setMeanMotion(double mm);
1194 virtual void setMeanMotionDerivative(double dmm);
1196 virtual void setInclination(double incl);
1198 virtual void setAscension(double asc);
1200 virtual void setEccentricity(double ecc);
1202 virtual void setPerigee(double arg);
1204 virtual void setMeanAnomaly(double ma);
1206 virtual void setRevolutionNumber(unsigned int num);
1207
1209 void setFMDownlink(const Frequency &f);
1211 void setFMUplink(const Frequency &f);
1213 void setCTCSS(const SelectiveCall &call);
1215 void setAPRSDownlink(const Frequency &f);
1217 void setAPRSUplink(const Frequency &f);
1218
1220 void setBeacon(const Frequency &f);
1221
1223 void setAPRSPath(const QString &path);
1224
1226 virtual bool encode(const Satellite &sat, const ErrorStack &err = ErrorStack());
1227
1228 protected:
1237 void writeFixedPoint(const Offset::Bit &offset, double value, bool sign, unsigned int dec, unsigned int frac);
1245 void writeFractional(const Offset::Bit &offset, double value, bool sign, unsigned int frac);
1247 void writeInteger(const Offset::Bit &offset, int value, bool sign, unsigned dec);
1249 void writeDigit(const Offset::Bit &offset, uint8_t digit);
1250
1251 public:
1253 struct Limit: public Element::Limit {
1255 static constexpr unsigned int nameLength() { return 8; }
1257 static constexpr unsigned int pathLength() { return 24; }
1258 };
1259
1260 protected:
1262 struct Offset: public Element::Offset {
1264 static constexpr unsigned int name() { return 0x0000; }
1265 static constexpr Bit epochYear() { return {0x0008, 4}; }
1266 static constexpr Bit epochJulienDay() { return {0x0009, 4}; }
1267 static constexpr Bit meanMotionDerivative() { return {0x000f, 4}; }
1268 static constexpr Bit inclination() { return {0x0014, 4}; }
1269 static constexpr Bit ascension() { return {0x0018, 4}; }
1270 static constexpr Bit eccentricity() { return {0x001c, 4}; }
1271 static constexpr Bit perigee() { return {0x001f, 0}; }
1272 static constexpr Bit meanAnomaly() { return {0x0023, 0}; }
1273 static constexpr Bit meanMotion() { return {0x0027, 0}; }
1274 static constexpr Bit revolutionNumber() { return {0x002d, 4}; }
1275 static constexpr unsigned int fmDownlink() { return 0x0030; }
1276 static constexpr unsigned int fmUplink() { return 0x0034; }
1277 static constexpr unsigned int ctcss() { return 0x0038; }
1278 static constexpr unsigned int aprsDownlink() { return 0x003c; }
1279 static constexpr unsigned int aprsUplink() { return 0x0040; }
1280 static constexpr unsigned int beacon() { return 0x0044; }
1281 static constexpr unsigned int aprsPath() { return 0x004c; }
1283 };
1284 };
1285
1286
1289 {
1290 protected:
1292 SatelliteBankElement(uint8_t *ptr, size_t size);
1293
1294 public:
1296 SatelliteBankElement(uint8_t *ptr);
1297
1299 static constexpr unsigned int size() { return 0x09e0; }
1301 static constexpr unsigned int magic() { return 0x0003; }
1302
1303 void clear();
1304
1306 SatelliteElement satellite(unsigned int idx);
1308 bool encode(SatelliteDatabase *db, const ErrorStack &err=ErrorStack());
1309
1310 public:
1312 struct Limit {
1314 static constexpr unsigned int satellites() { return 25; }
1315 };
1316
1317 protected:
1319 struct Offset {
1321 static constexpr unsigned int blockId() { return 0x0000; }
1322 static constexpr unsigned int segmentSize() { return 0x0004; }
1323 static constexpr unsigned int satellites() { return 0x0008; }
1324 static constexpr unsigned int betweenSatellites() { return SatelliteElement::size(); }
1326 };
1327 };
1328
1329
1330 class NoteElement: public Element
1331 {
1332 public:
1333 explicit NoteElement(uint8_t *ptr);
1334
1336 static constexpr unsigned int size() { return 0x0002; }
1337
1338 void clear() override;
1339 bool isValid() const override;
1340
1342 bool isPause() const;
1344 double frequency() const;
1346 void setFrequency(double pitch);
1348 void setPause();
1349
1351 unsigned int duration() const;
1353 void setDuration(unsigned int ms);
1354
1355 protected:
1357 struct Offset: Element::Offset {
1359 static constexpr unsigned int pitch() { return 0x0000; }
1360 static constexpr unsigned int duration() { return 0x0001; }
1362 };
1363
1364 static constexpr double _lut[] = {
1365 0110.00, 0116.54, 0123.47,
1366 0130.81, 0138.59, 0146.83, 0155.56, 0164.81, 0174.61, 0185.00, 0196.00, 0207.65, 0220.00, 0233.08, 0246.94,
1367 0261.62, 0277.18, 0293.66, 0311.13, 0329.63, 0349.23, 0369.99, 0392.00, 0415.30, 0440.00, 0466.16, 0493.88,
1368 0523.25, 0554.37, 0587.33, 0622.25, 0659.25, 0698.46, 0739.99, 0783.99, 0830.61, 0880.00, 0932.33, 0987.77,
1369 1046.50, 1108.73, 1174.66, 1244.51, 1318.51, 1396.91
1370 };
1371 };
1372
1375 {
1376 public:
1378 BootMelodyElement(uint8_t *ptr);
1379
1381 static constexpr unsigned int size() { return 0x0208; }
1383 static constexpr unsigned int magic() { return 0x0002; }
1384
1385 void clear();
1386
1388 virtual bool encode(Context &ctx, const Melody *melody, const ErrorStack &err=ErrorStack());
1390 virtual bool decode(Context &ctx, Melody *melody, const ErrorStack &err=ErrorStack()) const;
1391
1392 public:
1394 struct Limit {
1396 static constexpr unsigned int notes() { return 256; }
1397 };
1398
1399 protected:
1401 struct Offset {
1403 static constexpr unsigned int blockId() { return 0x0000; }
1404 static constexpr unsigned int segmentSize() { return 0x0004; }
1405 static constexpr unsigned int notes() { return 0x0008; }
1406 static constexpr unsigned int betweenNotes() { return NoteElement::size(); }
1408 };
1409 };
1410
1411
1416 {
1417 public:
1418 enum Settings {
1419 BootImage = 1,
1420 BootMelody = 2,
1421 SatelliteOrbitals = 3,
1422 LightTheme = 4,
1423 DarkTheme = 5
1424 };
1425
1426 protected:
1428 AdditionalSettingsElement(uint8_t *ptr, size_t size);
1429
1430 public:
1432 AdditionalSettingsElement(uint8_t *ptr);
1433
1435 static constexpr unsigned int size() { return 0x11a0; }
1436
1437 bool isValid() const;
1438 void clear();
1439
1441 virtual QString magic() const;
1443 virtual unsigned int version() const;
1444
1446 virtual bool hasSettings(Settings set) const;
1448 virtual SatelliteBankElement satellites() const;
1450 virtual BootMelodyElement bootMelody() const;
1451
1452 public:
1454 struct Limit {
1456 static constexpr unsigned int magicStringLength() { return 8; }
1457 };
1458
1459 protected:
1461 struct Offset {
1463 static constexpr unsigned int magicString() { return 0x0000; }
1464 static constexpr unsigned int versionNumber() { return 0x0008; }
1465 static constexpr unsigned int blocks() { return 0x000c; }
1466 // @endcond
1467 };
1468 };
1469
1470
1471protected:
1473 explicit OpenGD77BaseCodeplug(QObject *parent = nullptr);
1474
1475public:
1477 virtual void clear();
1478
1479 bool index(Config *config, Context &ctx, const ErrorStack &err=ErrorStack()) const;
1480
1481 bool decode(Config *config, const ErrorStack &err=ErrorStack());
1482 bool postprocess(Config *config, const ErrorStack &err=ErrorStack()) const;
1483
1484 Config *preprocess(Config *config, const ErrorStack &err=ErrorStack()) const;
1485 bool encode(Config *config, const Flags &flags = Flags(), const ErrorStack &err=ErrorStack());
1486
1487public:
1490 virtual bool decodeElements(Context &ctx, const ErrorStack &err=ErrorStack());
1492 virtual bool encodeElements(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
1493
1495 virtual void clearGeneralSettings() = 0;
1497 virtual bool encodeGeneralSettings(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack()) = 0;
1499 virtual bool decodeGeneralSettings(Context &ctx, const ErrorStack &err=ErrorStack()) = 0;
1500
1502 virtual void clearDTMFSettings() = 0;
1504 virtual bool encodeDTMFSettings(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack()) = 0;
1506 virtual bool decodeDTMFSettings(Context &ctx, const ErrorStack &err=ErrorStack()) = 0;
1507
1509 virtual void clearAPRSSettings() = 0;
1511 virtual bool encodeAPRSSettings(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack()) = 0;
1513 virtual bool decodeAPRSSettings(Context &ctx, const ErrorStack &err=ErrorStack()) = 0;
1515 virtual bool linkAPRSSettings(Context &ctx, const ErrorStack &err=ErrorStack()) = 0;
1516
1518 virtual void clearDTMFContacts() = 0;
1520 virtual bool encodeDTMFContacts(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack()) = 0;
1522 virtual bool createDTMFContacts(Context &ctx, const ErrorStack &err=ErrorStack()) = 0;
1523
1525 virtual void clearChannels() = 0;
1527 virtual bool encodeChannels(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack()) = 0;
1529 virtual bool createChannels(Context &ctx, const ErrorStack &err=ErrorStack()) = 0;
1531 virtual bool linkChannels(Context &ctx, const ErrorStack &err=ErrorStack()) = 0;
1532
1534 virtual void clearBootSettings() = 0;
1536 virtual bool encodeBootSettings(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack()) = 0;
1538 virtual bool decodeBootSettings(Context &ctx, const ErrorStack &err=ErrorStack()) = 0;
1539
1541 virtual void clearVFOSettings() = 0;
1542
1544 virtual void clearZones() = 0;
1546 virtual bool encodeZones(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack()) = 0;
1548 virtual bool createZones(Context &ctx, const ErrorStack &err=ErrorStack()) = 0;
1550 virtual bool linkZones(Context &ctx, const ErrorStack &err=ErrorStack()) = 0;
1551
1553 virtual void clearContacts() = 0;
1555 virtual bool encodeContacts(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack()) = 0;
1557 virtual bool createContacts(Context &ctx, const ErrorStack &err=ErrorStack()) = 0;
1558
1560 virtual void clearGroupLists() = 0;
1562 virtual bool encodeGroupLists(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack()) = 0;
1564 virtual bool createGroupLists(Context &ctx, const ErrorStack &err=ErrorStack()) = 0;
1566 virtual bool linkGroupLists(Context &ctx, const ErrorStack &err=ErrorStack()) = 0;
1567};
1568
1569#endif // OPENGD77BASE_CODEPLUG_HH
The base class of all channels (analog and digital) of a codeplug configuration.
Definition channel.hh:38
Power
Specifies the prefix for every ID assigned to every channel during serialization.
Definition channel.hh:65
Base class for all codeplug contexts.
Definition codeplug.hh:331
Represents the abstract base class of all codeplug elements.
Definition codeplug.hh:65
Element(uint8_t *ptr, size_t size)
Hidden constructor.
Definition codeplug.cc:56
Certain flags passed to CodePlug::encode to control the transfer and encoding of the codeplug.
Definition codeplug.hh:24
Codeplug(QObject *parent=nullptr)
Hidden default constructor.
Definition codeplug.cc:872
The config class, representing the codeplug configuration.
Definition config.hh:70
uint32_t size() const
Returns the total size of the DFU file.
Definition dfufile.cc:52
TimeSlot
Possible timeslots for digital channels.
Definition channel.hh:448
Represents a digital contact, that is a DMR number.
Definition contact.hh:141
Type
Possible call types for a contact.
Definition contact.hh:155
Represents an analog contact, that is a DTMF number.
Definition contact.hh:89
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition errorstack.hh:43
Represents an APRS system within the generic config.
Definition gpssystem.hh:136
Icon
All implemented APRS icons.
Definition gpssystem.hh:166
Bandwidth
Possible bandwidth of an analog channel.
Definition channel.hh:288
Represents a time interval.
Definition interval.hh:11
A config item that encodes a melody.
Definition melody.hh:20
virtual bool link(Context &ctx, const ErrorStack &err=ErrorStack())
Links all FM APRS systems.
Definition opengd77base_codeplug.cc:1309
void clear()
Clears the bank.
Definition opengd77base_codeplug.cc:1261
APRSSettingsElement system(unsigned int idx) const
Returns the n-th APRS system.
Definition opengd77base_codeplug.cc:1268
static constexpr unsigned int size()
The size of the channel bank.
Definition opengd77base_codeplug.hh:628
virtual bool encode(Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all FM APRS systems.
Definition opengd77base_codeplug.cc:1274
virtual bool decode(Context &ctx, const ErrorStack &err=ErrorStack())
Decodes all FM APRS systems.
Definition opengd77base_codeplug.cc:1292
APRSSettingsBankElement(uint8_t *ptr)
Constructor from pointer.
Definition opengd77base_codeplug.cc:1253
APRS system for OpenGD77 devices.
Definition opengd77base_codeplug.hh:471
virtual bool isValid() const
Returns true, if the system is valid.
Definition opengd77base_codeplug.cc:995
virtual bool encode(const FMAPRSSystem *system, const Context &ctx, const ErrorStack &err=ErrorStack())
Encodes the APRS settings.
Definition opengd77base_codeplug.cc:1151
BaudRate
Possible APRS baud rates.
Definition opengd77base_codeplug.hh:474
virtual QGeoCoordinate fixedPosition() const
Returns the fixed position.
Definition opengd77base_codeplug.cc:1028
virtual FMAPRSSystem::Icon icon() const
Returns the icon.
Definition opengd77base_codeplug.cc:1112
virtual bool link(FMAPRSSystem *system, const Context &ctx, const ErrorStack &err=ErrorStack())
Links the ARPS settings.
Definition opengd77base_codeplug.cc:1214
virtual void clearVia2()
Clears the second via node.
Definition opengd77base_codeplug.cc:1106
virtual void setName(const QString &name)
Sets the name of the system.
Definition opengd77base_codeplug.cc:1006
virtual void setPositionPrecision(PositionPrecision prec)
Sets the position reporting precision in degrees.
Definition opengd77base_codeplug.cc:1052
APRSSettingsElement(uint8_t *ptr)
Constructor from pointer.
Definition opengd77base_codeplug.cc:974
virtual QString comment() const
Returns the comment text.
Definition opengd77base_codeplug.cc:1122
virtual bool hasVia1() const
Returns true, if the first via node is set.
Definition opengd77base_codeplug.cc:1058
virtual void setIcon(FMAPRSSystem::Icon icon)
Sets the icon.
Definition opengd77base_codeplug.cc:1116
PositionPrecision
Possible position precisions.
Definition opengd77base_codeplug.hh:479
virtual void setVia2(const QString &call, unsigned int ssid)
Sets the second via node.
Definition opengd77base_codeplug.cc:1100
virtual void setComment(const QString &text)
Sets the comment text.
Definition opengd77base_codeplug.cc:1126
virtual BaudRate baudRate() const
Returns the baud-rate.
Definition opengd77base_codeplug.cc:1131
virtual unsigned int sourceSSID() const
Returns the source SSID.
Definition opengd77base_codeplug.cc:1012
virtual PositionPrecision positionPrecision() const
Returns the posiiton reporting precision.
Definition opengd77base_codeplug.cc:1047
virtual FMAPRSSystem * decode(const Context &ctx, const ErrorStack &err=ErrorStack()) const
Decodes some APRS settings.
Definition opengd77base_codeplug.cc:1190
virtual bool hasVia2() const
Returns true, if the second via node is set.
Definition opengd77base_codeplug.cc:1085
virtual unsigned int via1SSID() const
Returns the first via node ssid.
Definition opengd77base_codeplug.cc:1068
void clear()
Clears the bank.
Definition opengd77base_codeplug.cc:982
virtual void setSourceSSID(unsigned int ssid)
Sets the source SSID.
Definition opengd77base_codeplug.cc:1017
static constexpr unsigned int size()
The size of the channel bank.
Definition opengd77base_codeplug.hh:500
virtual void enableFixedPosition(bool enable)
Resets the fixed position.
Definition opengd77base_codeplug.cc:1042
virtual void setBaudRate(BaudRate rate)
Sets the baud rate.
Definition opengd77base_codeplug.cc:1135
virtual unsigned int via2SSID() const
Returns the second via node ssid.
Definition opengd77base_codeplug.cc:1095
virtual bool fixedPositionEnabled() const
Returns true, if a fixed position is send.
Definition opengd77base_codeplug.cc:1023
virtual void setFixedPosition(const QGeoCoordinate &coor)
Sets the fixed position.
Definition opengd77base_codeplug.cc:1035
virtual QString via1Call() const
Returns the first via node call.
Definition opengd77base_codeplug.cc:1063
virtual void clearVia1()
Clears the first via node.
Definition opengd77base_codeplug.cc:1079
virtual QString name() const
Returns the name of the system.
Definition opengd77base_codeplug.cc:1001
virtual QString via2Call() const
Returns the second via node call.
Definition opengd77base_codeplug.cc:1090
virtual void setVia1(const QString &call, unsigned int ssid)
Sets the first via node.
Definition opengd77base_codeplug.cc:1073
virtual unsigned int version() const
Returns the version number.
Definition opengd77base_codeplug.cc:2637
bool isValid() const
Returns true if the pointer is not null.
Definition opengd77base_codeplug.cc:2620
virtual BootMelodyElement bootMelody() const
Returns boot melody settings, if present.
Definition opengd77base_codeplug.cc:2681
virtual SatelliteBankElement satellites() const
Returns statellite settings bank, if present.
Definition opengd77base_codeplug.cc:2660
AdditionalSettingsElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition opengd77base_codeplug.cc:2607
virtual bool hasSettings(Settings set) const
Returns true, if the given settings is stored.
Definition opengd77base_codeplug.cc:2642
void clear()
Abstract method to reset the element within the codeplug.
Definition opengd77base_codeplug.cc:2625
static constexpr unsigned int size()
Returns the size of the element.
Definition opengd77base_codeplug.hh:1435
virtual QString magic() const
Returns the magic string.
Definition opengd77base_codeplug.cc:2632
Encodes the boot melody.
Definition opengd77base_codeplug.hh:1375
void clear()
Abstract method to reset the element within the codeplug.
Definition opengd77base_codeplug.cc:2557
virtual bool encode(Context &ctx, const Melody *melody, const ErrorStack &err=ErrorStack())
Encodes the given melody.
Definition opengd77base_codeplug.cc:2565
static constexpr unsigned int size()
The size of the element.
Definition opengd77base_codeplug.hh:1381
virtual bool decode(Context &ctx, Melody *melody, const ErrorStack &err=ErrorStack()) const
Decodes the boot melody.
Definition opengd77base_codeplug.cc:2585
BootMelodyElement(uint8_t *ptr)
Constructor.
Definition opengd77base_codeplug.cc:2549
static constexpr unsigned int magic()
The magic number of the element.
Definition opengd77base_codeplug.hh:1383
virtual ~BootSettingsElement()
Destructor.
Definition opengd77base_codeplug.cc:1495
virtual void setLine1(const QString &text)
Sets the first line.
Definition opengd77base_codeplug.cc:1546
virtual QString line2() const
Returns the Second line.
Definition opengd77base_codeplug.cc:1551
BootSettingsElement(uint8_t *ptr, unsigned size)
Hidden constructor.
Definition opengd77base_codeplug.cc:1483
virtual QString line1() const
Returns the first line.
Definition opengd77base_codeplug.cc:1542
virtual void enableBootText(bool enable)
Enables/disables boot text.
Definition opengd77base_codeplug.cc:1514
virtual bool encode(const Context &ctx, const ErrorStack &err=ErrorStack())
Encodes boot text settings from configuration.
Definition opengd77base_codeplug.cc:1561
virtual unsigned bootPassword() const
Returns the boot password (6 digit).
Definition opengd77base_codeplug.cc:1525
virtual bool bootPasswordEnabled() const
Returns true if the boot password is enabled.
Definition opengd77base_codeplug.cc:1520
virtual void setLine2(const QString &text)
Sets the second line.
Definition opengd77base_codeplug.cc:1555
virtual void clearBootPassword()
Clear boot password.
Definition opengd77base_codeplug.cc:1536
virtual bool decode(Context &ctx, const ErrorStack &err=ErrorStack())
Updates the configuration with the boot text settings.
Definition opengd77base_codeplug.cc:1569
virtual bool bootText() const
Returns true if the text is shown on boot, other wise an image is shown.
Definition opengd77base_codeplug.cc:1509
virtual void setBootPassword(unsigned passwd)
Sets the boot password (6 digit).
Definition opengd77base_codeplug.cc:1530
void clear()
Resets the settings.
Definition opengd77base_codeplug.cc:1500
virtual ~ChannelBankElement()
Destructor.
Definition opengd77base_codeplug.cc:731
virtual uint8_t * get(unsigned idx) const
Returns a pointer to the channel at the given index.
Definition opengd77base_codeplug.cc:752
virtual bool isEnabled(unsigned idx) const
Returns true if the channel is enabled.
Definition opengd77base_codeplug.cc:741
ChannelBankElement(uint8_t *ptr, unsigned size)
Hidden constructor.
Definition opengd77base_codeplug.cc:719
ChannelElement channel(unsigned int n)
Returns the n-th channel.
Definition opengd77base_codeplug.cc:757
void clear()
Clears the bank.
Definition opengd77base_codeplug.cc:736
static constexpr unsigned int size()
The size of the channel bank.
Definition opengd77base_codeplug.hh:300
virtual void enable(unsigned idx, bool enabled)
Enable/disable a channel in the bank.
Definition opengd77base_codeplug.cc:746
Implements the base for all OpenGD77 channel encodings.
Definition opengd77base_codeplug.hh:38
virtual unsigned int dmrId() const
Returns the DMR ID for this channel.
Definition opengd77base_codeplug.cc:329
Alias
Alias to transmit.
Definition opengd77base_codeplug.hh:47
virtual void enableSimplex(bool enable)
Sets the channel to simplex.
Definition opengd77base_codeplug.cc:296
virtual void setBandwidth(FMChannel::Bandwidth bw)
Sets the bandwidth.
Definition opengd77base_codeplug.cc:480
virtual void clearPower()
Clears the power setting.
Definition opengd77base_codeplug.cc:204
virtual void setMode(Mode mode)
Sets the channel mode.
Definition opengd77base_codeplug.cc:161
ChannelElement(uint8_t *ptr, size_t size)
Constructs a channel from the given memory.
Definition opengd77base_codeplug.cc:77
virtual bool beep() const
Returns true, if the "beep" is enabled.
Definition opengd77base_codeplug.cc:313
virtual DMRChannel::TimeSlot timeSlot() const
Returns the time slot of the channel.
Definition opengd77base_codeplug.cc:466
virtual void enableRXOnly(bool enable)
Enables/disables RX only.
Definition opengd77base_codeplug.cc:489
static constexpr unsigned int size()
The size of the channel.
Definition opengd77base_codeplug.hh:67
virtual OpenGD77ChannelExtension::TalkerAlias aliasTimeSlot1() const
Returns the alias transmitted on time slot 1.
Definition opengd77base_codeplug.cc:420
virtual void setTXTone(const SelectiveCall &code)
Sets the TX subtone.
Definition opengd77base_codeplug.cc:285
virtual bool hasDMRId() const
Returns true if the global DMR ID is overridden.
Definition opengd77base_codeplug.cc:324
virtual void clear()
Resets the channel.
Definition opengd77base_codeplug.cc:94
virtual void setName(const QString &n)
Sets the name of the channel.
Definition opengd77base_codeplug.cc:129
virtual void setAliasTimeSlot2(OpenGD77ChannelExtension::TalkerAlias alias)
Sets the alias transmitted on time slot 2.
Definition opengd77base_codeplug.cc:455
virtual Interval transmitTimeout() const
Returns the transmit timeout.
Definition opengd77base_codeplug.cc:210
virtual bool fixedPositionEnabled() const
Returns true, if a fixed position is set for the channel.
Definition opengd77base_codeplug.cc:229
virtual void clearGroupListIndex()
Clears the group list index.
Definition opengd77base_codeplug.cc:362
virtual QGeoCoordinate fixedPosition() const
Returns the fixed position.
Definition opengd77base_codeplug.cc:234
virtual unsigned int squelchLevel() const
Returns the squelch level.
Definition opengd77base_codeplug.cc:532
virtual void setDMRId(unsigned int id)
Sets the DMR ID for this channel.
Definition opengd77base_codeplug.cc:334
virtual bool globalPower() const
Returns true if the power-setting is global.
Definition opengd77base_codeplug.cc:167
virtual FMChannel::Bandwidth bandwidth() const
Returns the bandwidth.
Definition opengd77base_codeplug.cc:476
virtual void enableSkipZoneScan(bool enable)
Enables/disables skipping in zone scan.
Definition opengd77base_codeplug.cc:507
virtual void setTXFrequency(const Frequency &freq)
Sets the TX frequency of the channel.
Definition opengd77base_codeplug.cc:151
virtual unsigned int aprsIndex() const
Returns the APRS system index.
Definition opengd77base_codeplug.cc:383
virtual bool powerSave() const
Returns true, if the power-save feature is enabled.
Definition opengd77base_codeplug.cc:302
SquelchMode
Possible squelch modes.
Definition opengd77base_codeplug.hh:52
virtual void clearTXContact()
Clears the TX contact index.
Definition opengd77base_codeplug.cc:414
Mode
Possible channel types.
Definition opengd77base_codeplug.hh:41
@ MODE_ANALOG
Analog channel, aka FM.
Definition opengd77base_codeplug.hh:42
@ MODE_DIGITAL
Digital channel, aka DMR.
Definition opengd77base_codeplug.hh:43
virtual void setTXContactIndex(unsigned int index)
Sets the TX contact index.
Definition opengd77base_codeplug.cc:409
virtual bool vox() const
Returns true if VOX is enabled.
Definition opengd77base_codeplug.cc:512
virtual QString name() const
Returns the name of the channel.
Definition opengd77base_codeplug.cc:124
virtual unsigned colorCode() const
Returns the color code.
Definition opengd77base_codeplug.cc:368
virtual SelectiveCall txTone() const
Returns the TX subtone.
Definition opengd77base_codeplug.cc:280
virtual SelectiveCall rxTone() const
Returns the RX subtone.
Definition opengd77base_codeplug.cc:270
virtual void setAliasTimeSlot1(OpenGD77ChannelExtension::TalkerAlias alias)
Sets the alias transmitted on time slot 1.
Definition opengd77base_codeplug.cc:432
virtual bool skipScan() const
Returns true if channel is skipped in a scan.
Definition opengd77base_codeplug.cc:494
virtual void clearDMRId()
Resets the DMR ID for this channel to the global one.
Definition opengd77base_codeplug.cc:340
virtual bool rxOnly() const
Returns true if RX only is enabled.
Definition opengd77base_codeplug.cc:485
virtual Frequency rxFrequency() const
Returns the RX frequency of the channel.
Definition opengd77base_codeplug.cc:135
virtual void enableFixedPosition(bool enable)
Resets the fixed position.
Definition opengd77base_codeplug.cc:264
virtual unsigned groupListIndex() const
Returns the group-list index.
Definition opengd77base_codeplug.cc:352
virtual bool skipZoneScan() const
Returns true if channel is skipped in zone scan.
Definition opengd77base_codeplug.cc:503
virtual Frequency txFrequency() const
Returns the TX frequency of the channel.
Definition opengd77base_codeplug.cc:146
virtual void setColorCode(unsigned cc)
Sets thecolor code.
Definition opengd77base_codeplug.cc:372
virtual ~ChannelElement()
Destructor.
Definition opengd77base_codeplug.cc:89
virtual unsigned int txContactIndex() const
Returns the TX contact index.
Definition opengd77base_codeplug.cc:404
virtual void setAPRSIndex(unsigned int index)
Sets the APRS system index.
Definition opengd77base_codeplug.cc:388
virtual bool encode(const Channel *c, Context &ctx, const ErrorStack &err=ErrorStack())
Initializes this codeplug channel from the given generic configuration.
Definition opengd77base_codeplug.cc:649
virtual void setFixedPosition(const QGeoCoordinate &coordinate)
Sets the fixed position for this channel.
Definition opengd77base_codeplug.cc:246
virtual Channel * decode(Context &ctx, const ErrorStack &err=ErrorStack()) const
Constructs a generic Channel object from the codeplug channel.
Definition opengd77base_codeplug.cc:551
virtual void setGroupListIndex(unsigned index)
Sets the group-list index.
Definition opengd77base_codeplug.cc:357
virtual void setRXFrequency(const Frequency &freq)
Sets the RX frequency of the channel.
Definition opengd77base_codeplug.cc:140
virtual void setTimeSlot(DMRChannel::TimeSlot ts)
Sets the time slot of the channel.
Definition opengd77base_codeplug.cc:470
virtual OpenGD77ChannelExtension::TalkerAlias aliasTimeSlot2() const
Returns the alias transmitted on time slot 2.
Definition opengd77base_codeplug.cc:443
virtual void enableVOX(bool enable)
Enables/disables VOX.
Definition opengd77base_codeplug.cc:516
virtual Channel::Power power() const
Returns the power setting of the channel.
Definition opengd77base_codeplug.cc:172
virtual bool hasGroupList() const
Returns true if a group list is set.
Definition opengd77base_codeplug.cc:347
virtual bool isSimplex() const
Returns true if the channel is set to simplex.
Definition opengd77base_codeplug.cc:291
virtual SquelchMode squelchMode() const
Returns the squelch mode.
Definition opengd77base_codeplug.cc:522
virtual void clearAPRSIndex()
Resets the APRS system index.
Definition opengd77base_codeplug.cc:393
virtual void enablePowerSave(bool enable)
Enables/disables power-save.
Definition opengd77base_codeplug.cc:307
virtual void setTransmitTimeout(const Interval &interval)
Sets a transmit timeout.
Definition opengd77base_codeplug.cc:217
virtual void setRXTone(const SelectiveCall &code)
Sets the RX subtone.
Definition opengd77base_codeplug.cc:275
virtual void enableBeep(bool enable)
Enables/disables "the beep".
Definition opengd77base_codeplug.cc:318
virtual void setPower(Channel::Power pwr)
Sets the power setting of the channel.
Definition opengd77base_codeplug.cc:193
virtual bool link(Channel *c, Context &ctx, const ErrorStack &err=ErrorStack()) const
Links a previously constructed channel to the rest of the configuration.
Definition opengd77base_codeplug.cc:608
virtual void enableSkipScan(bool enable)
Enables/disables skipping in scan.
Definition opengd77base_codeplug.cc:498
virtual void setSquelch(SquelchMode mode, unsigned int level)
Set the squelch level and mode.
Definition opengd77base_codeplug.cc:538
virtual bool hasTXContact() const
Returns true, if the TX contact is set.
Definition opengd77base_codeplug.cc:399
virtual Mode mode() const
Returns the channel mode.
Definition opengd77base_codeplug.cc:157
virtual bool hasAPRSIndex() const
Returns true, if the APRS system index is set.
Definition opengd77base_codeplug.cc:378
static constexpr unsigned int size()
The size of the element.
Definition opengd77base_codeplug.hh:1023
ContactBankElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition opengd77base_codeplug.cc:1943
virtual bool decode(Context &ctx, const ErrorStack &err=ErrorStack())
Decodes all DMR contacts.
Definition opengd77base_codeplug.cc:1988
void clear()
Resets the contact.
Definition opengd77base_codeplug.cc:1957
virtual bool encode(Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all DMR contacts.
Definition opengd77base_codeplug.cc:1970
ContactElement contact(unsigned int idx) const
Returns the i-th contact element.
Definition opengd77base_codeplug.cc:1964
Implements digital contacts in OpenGD77 codeplugs.
Definition opengd77base_codeplug.hh:937
static constexpr unsigned int size()
The size of the contact element.
Definition opengd77base_codeplug.hh:958
virtual void setName(const QString name)
Sets the name of the contact.
Definition opengd77base_codeplug.cc:1837
void clear()
Resets the contact.
Definition opengd77base_codeplug.cc:1817
virtual void setNumber(unsigned id)
Sets the DMR number of the contact.
Definition opengd77base_codeplug.cc:1848
virtual DMRContact::Type type() const
Returns the call type.
Definition opengd77base_codeplug.cc:1854
virtual void setTimeSlotOverride(TimeSlotOverride ts)
Sets the time slot override.
Definition opengd77base_codeplug.cc:1879
virtual bool encode(const DMRContact *obj, Context &ctx, const ErrorStack &err=ErrorStack())
Resets this codeplug contact from the given DigitalContact.
Definition opengd77base_codeplug.cc:1914
virtual unsigned number() const
Returns the DMR number of the contact.
Definition opengd77base_codeplug.cc:1843
virtual ~ContactElement()
Destructor.
Definition opengd77base_codeplug.cc:1811
bool isValid() const
Returns true if the contact is valid.
Definition opengd77base_codeplug.cc:1826
virtual void setType(DMRContact::Type type)
Sets the call type.
Definition opengd77base_codeplug.cc:1865
ContactElement(uint8_t *ptr, unsigned size)
Hidden constructor.
Definition opengd77base_codeplug.cc:1799
virtual TimeSlotOverride timeSlotOverride() const
Returns the time slot override of the contact.
Definition opengd77base_codeplug.cc:1875
TimeSlotOverride
Possible values for the time-slot override option.
Definition opengd77base_codeplug.hh:941
@ TS2
Force time-slot to TS2.
Definition opengd77base_codeplug.hh:944
@ None
Do not override time-slot of channel.
Definition opengd77base_codeplug.hh:942
@ TS1
Force time-slot to TS1.
Definition opengd77base_codeplug.hh:943
virtual QString name() const
Returns the name of the contact.
Definition opengd77base_codeplug.cc:1832
virtual DMRContact * decode(Context &ctx, const ErrorStack &err=ErrorStack()) const
Constructs a DigitalContact instance from this codeplug contact.
Definition opengd77base_codeplug.cc:1885
virtual bool decode(Context &ctx, const ErrorStack &err=ErrorStack())
Decodes all DTMF contacts.
Definition opengd77base_codeplug.cc:1462
DTMFContactBankElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition opengd77base_codeplug.cc:1418
void clear()
Abstract method to reset the element within the codeplug.
Definition opengd77base_codeplug.cc:1432
DTMFContactElement contact(unsigned int n) const
Returns the n-th DTMF contact.
Definition opengd77base_codeplug.cc:1439
virtual bool encode(Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all DTMF contacts.
Definition opengd77base_codeplug.cc:1445
static constexpr unsigned int size()
Returns the size of the element.
Definition opengd77base_codeplug.hh:724
DTMF contact element.
Definition opengd77base_codeplug.hh:663
bool isValid() const
Returns true if the pointer is not null.
Definition opengd77base_codeplug.cc:1345
static constexpr unsigned int size()
Returns the size of the element.
Definition opengd77base_codeplug.hh:673
virtual QString number() const
Returns the DTMF number.
Definition opengd77base_codeplug.cc:1369
void clear()
Abstract method to reset the element within the codeplug.
Definition opengd77base_codeplug.cc:1351
DTMFContactElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition opengd77base_codeplug.cc:1331
virtual void setNumber(const QString &number)
Sets the DTMF number.
Definition opengd77base_codeplug.cc:1379
virtual void setName(const QString &name)
Sets the name.
Definition opengd77base_codeplug.cc:1363
virtual bool encode(const DTMFContact *contact, const Context &ctx, const ErrorStack &err=ErrorStack())
Encodes a number.
Definition opengd77base_codeplug.cc:1390
virtual QString name() const
Returns the name.
Definition opengd77base_codeplug.cc:1358
virtual DTMFContact * decode(const Context &ctx, const ErrorStack &err=ErrorStack())
Decodes a number.
Definition opengd77base_codeplug.cc:1402
virtual Frequency vhfMinFrequency() const
Returns the VHF minimum frequency.
Definition opengd77base_codeplug.cc:895
virtual void setUHFMaxFrequency(const Frequency &f)
Sets the UHF maximum frequency.
Definition opengd77base_codeplug.cc:889
virtual bool encode(const Context &ctx, const ErrorStack &err=ErrorStack())
Encodes the settings.
Definition opengd77base_codeplug.cc:939
virtual bool decode(const Context &ctx, const ErrorStack &err=ErrorStack())
Decodes the settings.
Definition opengd77base_codeplug.cc:953
virtual void setVHFMinFrequency(const Frequency &f)
Sets the VHF minimum frequency.
Definition opengd77base_codeplug.cc:900
virtual Frequency uhfMinFrequency() const
Returns the UHF minimum frequency.
Definition opengd77base_codeplug.cc:874
virtual void setVHFMaxFrequency(const Frequency &f)
Sets the VHF maximum frequency.
Definition opengd77base_codeplug.cc:911
void clear()
Abstract method to reset the element within the codeplug.
Definition opengd77base_codeplug.cc:867
static constexpr unsigned int size()
Returns the size of the element.
Definition opengd77base_codeplug.hh:410
virtual unsigned int radioId() const
Returns the DMR ID.
Definition opengd77base_codeplug.cc:928
virtual void setCall(const QString &call)
Sets the radio callsign.
Definition opengd77base_codeplug.cc:922
virtual void setRadioId(unsigned int id)
Sets the DMR ID.
Definition opengd77base_codeplug.cc:933
virtual Frequency vhfMaxFrequency() const
Returns the VHF maximum frequency.
Definition opengd77base_codeplug.cc:906
GeneralSettingsElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition opengd77base_codeplug.cc:853
virtual Frequency uhfMaxFrequency() const
Returns the UHF maximum frequency.
Definition opengd77base_codeplug.cc:884
virtual void setUHFMinFrequency(const Frequency &f)
Sets the UHF minimum frequency.
Definition opengd77base_codeplug.cc:879
virtual QString call() const
Returns the radio callsign.
Definition opengd77base_codeplug.cc:917
void clear()
Clears the group list bank.
Definition opengd77base_codeplug.cc:2124
virtual void clearGroupList(unsigned int i)
Clears the i-th group list.
Definition opengd77base_codeplug.cc:2151
virtual void setGroupListContactCount(unsigned int i, unsigned int count)
Sets the number of contacts in the given group list.
Definition opengd77base_codeplug.cc:2141
GroupListBankElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition opengd77base_codeplug.cc:2110
static constexpr unsigned int size()
Returns the size of the element.
Definition opengd77base_codeplug.hh:1127
virtual bool link(Context &ctx, const ErrorStack &err=ErrorStack())
Links all group lists.
Definition opengd77base_codeplug.cc:2195
virtual bool encode(Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all group lists.
Definition opengd77base_codeplug.cc:2158
virtual bool hasGroupList(unsigned int i) const
Returns true, if the i-th group list is encoded.
Definition opengd77base_codeplug.cc:2131
virtual bool decode(Context &ctx, const ErrorStack &err=ErrorStack())
Decodes all group lists.
Definition opengd77base_codeplug.cc:2177
virtual unsigned int groupListContactCount(unsigned int i) const
Returns the number of contacts in the given group list.
Definition opengd77base_codeplug.cc:2136
virtual GroupListElement groupList(unsigned int i) const
Returns the i-th group list.
Definition opengd77base_codeplug.cc:2146
Encodes a group list for all OpenGD77 codeplugs.
Definition opengd77base_codeplug.hh:1058
virtual bool link(RXGroupList *lst, Context &ctx, const ErrorStack &err=ErrorStack()) const
Links the group list element.
Definition opengd77base_codeplug.cc:2089
void clear()
Clears the group list.
Definition opengd77base_codeplug.cc:2022
virtual QString name() const
Returns the name of the group list.
Definition opengd77base_codeplug.cc:2029
virtual void setContactIndex(unsigned int i, unsigned int contactIdx)
Sets the i-th contact index.
Definition opengd77base_codeplug.cc:2050
GroupListElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition opengd77base_codeplug.cc:2008
virtual void setName(const QString &name)
Sets the name of the group list.
Definition opengd77base_codeplug.cc:2034
virtual bool hasContactIndex(unsigned int i) const
Returns true, if the i-th contact is set.
Definition opengd77base_codeplug.cc:2040
virtual RXGroupList * decode(Context &ctx, const ErrorStack &err=ErrorStack()) const
Decodes group list element.
Definition opengd77base_codeplug.cc:2082
virtual bool encode(RXGroupList *lst, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes group list element.
Definition opengd77base_codeplug.cc:2061
virtual void clearContactIndex(unsigned int i)
Clears the i-th contact index.
Definition opengd77base_codeplug.cc:2055
virtual unsigned int contactIndex(unsigned int i) const
Returns the i-th contact index.
Definition opengd77base_codeplug.cc:2045
static constexpr unsigned int size()
Returns the size of the element.
Definition opengd77base_codeplug.hh:1068
void setPause()
Set note as pause.
Definition opengd77base_codeplug.cc:2528
bool isValid() const override
Returns true if the pointer is not null.
Definition opengd77base_codeplug.cc:2499
static constexpr unsigned int size()
Size of the element.
Definition opengd77base_codeplug.hh:1336
unsigned int duration() const
Returns the duration in ms.
Definition opengd77base_codeplug.cc:2534
double frequency() const
Returns the pitch in Hz.
Definition opengd77base_codeplug.cc:2510
void setDuration(unsigned int ms)
Sets the interval.
Definition opengd77base_codeplug.cc:2539
void clear() override
Abstract method to reset the element within the codeplug.
Definition opengd77base_codeplug.cc:2494
void setFrequency(double pitch)
Sets the pitch in Hz.
Definition opengd77base_codeplug.cc:2517
bool isPause() const
Retunrs true if the note is a pause.
Definition opengd77base_codeplug.cc:2505
Implements the satellite config bank.
Definition opengd77base_codeplug.hh:1289
SatelliteElement satellite(unsigned int idx)
Returns the i-th satellite.
Definition opengd77base_codeplug.cc:2459
static constexpr unsigned int magic()
The magic number of the element.
Definition opengd77base_codeplug.hh:1301
bool encode(SatelliteDatabase *db, const ErrorStack &err=ErrorStack())
Encodes the given satellite database.
Definition opengd77base_codeplug.cc:2464
static constexpr unsigned int size()
The size of the element.
Definition opengd77base_codeplug.hh:1299
void clear()
Abstract method to reset the element within the codeplug.
Definition opengd77base_codeplug.cc:2451
SatelliteBankElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition opengd77base_codeplug.cc:2437
Encodes a satellite for the OpenGD77 devices.
Definition opengd77base_codeplug.hh:1172
void writeDigit(const Offset::Bit &offset, uint8_t digit)
Writes a single digit at the given offset.
Definition opengd77base_codeplug.cc:2234
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_codeplug.cc:2295
virtual void setName(const QString &name)
Sets the name of the element.
Definition opengd77base_codeplug.cc:2310
virtual void setPerigee(double arg)
Sets argument of perigee.
Definition opengd77base_codeplug.cc:2341
void setAPRSPath(const QString &path)
Sets the APRS path.
Definition opengd77base_codeplug.cc:2396
void setFMDownlink(const Frequency &f)
Sets the downlink frequency.
Definition opengd77base_codeplug.cc:2362
virtual void setMeanMotionDerivative(double dmm)
Sets the first derivative of mean motion.
Definition opengd77base_codeplug.cc:2321
virtual void setEccentricity(double ecc)
Sets eccentricity.
Definition opengd77base_codeplug.cc:2336
void setFMUplink(const Frequency &f)
Sets the uplink frequency.
Definition opengd77base_codeplug.cc:2367
virtual void setRevolutionNumber(unsigned int num)
Sets the revolution number at epoch.
Definition opengd77base_codeplug.cc:2356
virtual void setEpoch(const ::OrbitalElement::Epoch &epoch)
Sets the epoch.
Definition opengd77base_codeplug.cc:2315
virtual void setInclination(double incl)
Sets the inclination.
Definition opengd77base_codeplug.cc:2326
SatelliteElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition opengd77base_codeplug.cc:2214
void clear()
Abstract method to reset the element within the codeplug.
Definition opengd77base_codeplug.cc:2228
virtual void setAscension(double asc)
Right ascension of the ascending node.
Definition opengd77base_codeplug.cc:2331
void setCTCSS(const SelectiveCall &call)
Sets the CTCSS tone.
Definition opengd77base_codeplug.cc:2372
void setAPRSDownlink(const Frequency &f)
Sets the APRS downlink frequency.
Definition opengd77base_codeplug.cc:2379
void writeFractional(const Offset::Bit &offset, double value, bool sign, unsigned int frac)
Writes a fixed point value as a BCD number.
Definition opengd77base_codeplug.cc:2269
void setBeacon(const Frequency &f)
Sets the beacon frequency.
Definition opengd77base_codeplug.cc:2390
virtual void setMeanMotion(double mm)
Sets the first derivative of mean motion.
Definition opengd77base_codeplug.cc:2351
virtual bool encode(const Satellite &sat, const ErrorStack &err=ErrorStack())
Encodes a satellite.
Definition opengd77base_codeplug.cc:2402
virtual void setMeanAnomaly(double ma)
Set the mean anomaly.
Definition opengd77base_codeplug.cc:2346
void writeInteger(const Offset::Bit &offset, int value, bool sign, unsigned dec)
Write a fixed digit integer value.
Definition opengd77base_codeplug.cc:2247
void setAPRSUplink(const Frequency &f)
Sets the APRS uplink frequency.
Definition opengd77base_codeplug.cc:2384
static constexpr unsigned int size()
The size of the element.
Definition opengd77base_codeplug.hh:1182
virtual double txOffset() const
Returns the transmit frequency offset.
Definition opengd77base_codeplug.cc:840
virtual double stepSize() const
Returns the tuning step-size in kHz.
Definition opengd77base_codeplug.cc:797
virtual OffsetMode offsetMode() const
Returns the transmit frequency offset mode.
Definition opengd77base_codeplug.cc:832
void setName(const QString &name)
The VFO channel has no name.
Definition opengd77base_codeplug.cc:791
virtual void setOffsetMode(OffsetMode mode)
Sets the transmit frequency offset mode.
Definition opengd77base_codeplug.cc:836
virtual void setStepSize(double kHz)
Sets the tuning step-size in kHz.
Definition opengd77base_codeplug.cc:812
QString name() const
The VFO channel has no name.
Definition opengd77base_codeplug.cc:787
void clear()
Resets the channel.
Definition opengd77base_codeplug.cc:779
VFOChannelElement(uint8_t *ptr, unsigned size)
Hidden constructor.
Definition opengd77base_codeplug.cc:766
StepSize
Possible tuning step sizes.
Definition opengd77base_codeplug.hh:347
@ SS5kHz
5kHz
Definition opengd77base_codeplug.hh:349
@ SS12_5kHz
12.5kHz
Definition opengd77base_codeplug.hh:352
@ SS10kHz
10kHz
Definition opengd77base_codeplug.hh:351
@ SS30kHz
30kHz
Definition opengd77base_codeplug.hh:354
@ SS2_5kHz
2.5kHz
Definition opengd77base_codeplug.hh:348
@ SS20kHz
20kHz
Definition opengd77base_codeplug.hh:353
@ SS6_25kHz
6.25kHz
Definition opengd77base_codeplug.hh:350
@ SS50kHz
50kHz
Definition opengd77base_codeplug.hh:355
virtual void setTXOffset(double f)
Sets the transmit frequency offset in MHz.
Definition opengd77base_codeplug.cc:844
OffsetMode
Possible offset frequency modes.
Definition opengd77base_codeplug.hh:340
@ Positive
Transmit offset frequency is positive (TX above RX).
Definition opengd77base_codeplug.hh:342
@ Off
Disables transmit frequency offset.
Definition opengd77base_codeplug.hh:341
@ Negative
Transmit offset frequency is negative (TX below RX).
Definition opengd77base_codeplug.hh:343
virtual void enable(unsigned idx, bool enabled)
Enable/disable a zone in the bank.
Definition opengd77base_codeplug.cc:1726
ZoneBankElement(uint8_t *ptr, unsigned size)
Hidden constructor.
Definition opengd77base_codeplug.cc:1699
ZoneElement zone(unsigned int n)
Returns the n-th zone.
Definition opengd77base_codeplug.cc:1733
virtual bool link(Context &ctx, const ErrorStack &err=ErrorStack())
Links all zones.
Definition opengd77base_codeplug.cc:1778
~ZoneBankElement()
Destructor.
Definition opengd77base_codeplug.cc:1711
virtual bool isEnabled(unsigned idx) const
Returns true if the zone is enabled.
Definition opengd77base_codeplug.cc:1721
static constexpr unsigned int size()
The size of the zone element.
Definition opengd77base_codeplug.hh:894
virtual bool decode(Context &ctx, const ErrorStack &err=ErrorStack())
Decodes all zones.
Definition opengd77base_codeplug.cc:1758
virtual bool encode(Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all zones.
Definition opengd77base_codeplug.cc:1739
void clear()
Resets the bank.
Definition opengd77base_codeplug.cc:1716
Represents a zone within OpenGD77 codeplugs.
Definition opengd77base_codeplug.hh:819
bool isValid() const
Returns true if the zone is valid.
Definition opengd77base_codeplug.cc:1603
virtual bool encode(const Zone *zone, Context &ctx, const ErrorStack &err=ErrorStack())
Resets this codeplug zone representation from the given generic Zone object.
Definition opengd77base_codeplug.cc:1676
void clear()
Resets the zone.
Definition opengd77base_codeplug.cc:1598
static constexpr unsigned int size()
The size of the zone element.
Definition opengd77base_codeplug.hh:830
virtual QString name() const
Returns the name of the zone.
Definition opengd77base_codeplug.cc:1608
virtual Zone * decode(const Context &ctx, const ErrorStack &err=ErrorStack()) const
Constructs a generic Zone object from this codeplug zone.
Definition opengd77base_codeplug.cc:1645
ZoneElement(uint8_t *ptr, unsigned size)
Hidden constructor.
Definition opengd77base_codeplug.cc:1581
virtual bool hasMember(unsigned n) const
Returns true if a member is stored at the given index.
Definition opengd77base_codeplug.cc:1618
virtual unsigned member(unsigned n) const
Returns the n-th member index.
Definition opengd77base_codeplug.cc:1625
virtual void setMember(unsigned n, unsigned idx)
Sets the n-th member index.
Definition opengd77base_codeplug.cc:1632
virtual void clearMember(unsigned n)
Clears the n-th member index.
Definition opengd77base_codeplug.cc:1639
virtual void setName(const QString &name)
Sets the name of the zone.
Definition opengd77base_codeplug.cc:1612
virtual bool link(Zone *zone, Context &ctx, const ErrorStack &err=ErrorStack()) const
Links a previously constructed Zone object to the rest of the configuration.
Definition opengd77base_codeplug.cc:1656
virtual void clearZones()=0
Clears all zones.
ImageType
Possible image types.
Definition opengd77base_codeplug.hh:22
virtual void clearVFOSettings()=0
Clears the VFO settings.
virtual bool encodeGeneralSettings(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())=0
Updates the general settings from the given configuration.
virtual bool createZones(Context &ctx, const ErrorStack &err=ErrorStack())=0
Adds zones to the configuration.
bool decode(Config *config, const ErrorStack &err=ErrorStack())
Decodes a binary codeplug to the given abstract configuration config.
Definition opengd77base_codeplug.cc:2876
virtual bool encodeBootSettings(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())=0
Encodes boot settings.
virtual bool encodeContacts(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())=0
Encodes all digital contacts in the configuration into the codeplug.
OpenGD77BaseCodeplug(QObject *parent=nullptr)
Default hidden constructor.
Definition opengd77base_codeplug.cc:2705
static uint16_t encodeSelectiveCall(const SelectiveCall &call)
Encodes a selective call (tx/rx tone).
Definition opengd77base_codeplug.cc:31
virtual bool encodeDTMFContacts(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())=0
Encodes all DTMF contacts.
virtual bool decodeAPRSSettings(Context &ctx, const ErrorStack &err=ErrorStack())=0
Decodes the APRS settings.
virtual void clearContacts()=0
Clears all contacts in the codeplug.
virtual bool decodeElements(Context &ctx, const ErrorStack &err=ErrorStack())
Decodes the binary codeplug and stores its content in the given generic configuration using the given...
Definition opengd77base_codeplug.cc:2902
virtual bool encodeElements(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes the given generic configuration as a binary codeplug using the given context.
Definition opengd77base_codeplug.cc:2823
virtual bool createChannels(Context &ctx, const ErrorStack &err=ErrorStack())=0
Adds all defined channels to the configuration.
virtual bool createDTMFContacts(Context &ctx, const ErrorStack &err=ErrorStack())=0
Adds all DTMF contacts to the configuration.
virtual bool linkAPRSSettings(Context &ctx, const ErrorStack &err=ErrorStack())=0
Links the APRS settings.
virtual bool linkZones(Context &ctx, const ErrorStack &err=ErrorStack())=0
Links all zones within the configuration.
virtual bool decodeDTMFSettings(Context &ctx, const ErrorStack &err=ErrorStack())=0
Decodes the DTMF settings.
virtual bool encodeGroupLists(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())=0
Encodes all group lists.
virtual bool linkChannels(Context &ctx, const ErrorStack &err=ErrorStack())=0
Links all channels.
virtual void clearDTMFSettings()=0
Clears the DTMF settings.
virtual bool createContacts(Context &ctx, const ErrorStack &err=ErrorStack())=0
Adds a digital contact to the configuration for each one in the codeplug.
bool encode(Config *config, const Flags &flags=Flags(), const ErrorStack &err=ErrorStack())
Encodes a given abstract configuration (config) to the device specific binary code-plug.
Definition opengd77base_codeplug.cc:2804
virtual void clearGeneralSettings()=0
Clears the general settings in the codeplug.
virtual void clearGroupLists()=0
Clears all group lists.
virtual void clearAPRSSettings()=0
Clears the APRS settings.
virtual bool encodeAPRSSettings(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())=0
Encodes APRS settings.
virtual bool decodeBootSettings(Context &ctx, const ErrorStack &err=ErrorStack())=0
Decodes the boot settings.
virtual bool encodeChannels(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())=0
Encode all channels.
static SelectiveCall decodeSelectiveCall(uint16_t code)
Decodes a selective call (tx/rx tone).
Definition opengd77base_codeplug.cc:53
virtual void clearBootSettings()=0
Clear boot settings.
virtual bool encodeDTMFSettings(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())=0
Encodes DTMF settings.
static double decodeAngle(uint32_t code)
Decodes an angle used to store locations.
Definition opengd77base_codeplug.cc:23
virtual bool decodeGeneralSettings(Context &ctx, const ErrorStack &err=ErrorStack())=0
Updates the given configuration from the general settings.
Config * preprocess(Config *config, const ErrorStack &err=ErrorStack()) const
Returns a prepared configuration for this particular radio.
Definition opengd77base_codeplug.cc:2777
static uint32_t encodeAngle(double degee)
Encodes an angle used to store locations.
Definition opengd77base_codeplug.cc:15
virtual bool linkGroupLists(Context &ctx, const ErrorStack &err=ErrorStack())=0
Links all group lists.
virtual bool encodeZones(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())=0
Encodes zones.
virtual void clearDTMFContacts()=0
Clears all DTMF contacts in the codeplug.
bool postprocess(Config *config, const ErrorStack &err=ErrorStack()) const
Returns a post-processed configuration of the decoded config.
Definition opengd77base_codeplug.cc:2886
virtual void clear()
Clears and resets the complete codeplug to some default values.
Definition opengd77base_codeplug.cc:2713
virtual void clearChannels()=0
Clear all channels.
bool index(Config *config, Context &ctx, const ErrorStack &err=ErrorStack()) const
Indexes all elements of the codeplug.
Definition opengd77base_codeplug.cc:2735
virtual bool createGroupLists(Context &ctx, const ErrorStack &err=ErrorStack())=0
Creates all group lists.
Generic representation of a RX group list.
Definition rxgrouplist.hh:14
A table holding all known satellites.
Definition satellitedatabase.hh:108
Extends the OrbitalElement to include transponder information for a satellite.
Definition satellitedatabase.hh:18
Represents a zone within the generic configuration.
Definition zone.hh:15
Helper type to encode frequencies without any rounding error.
Definition frequency.hh:107
Some limits for the bank.
Definition opengd77base_codeplug.hh:645
static constexpr unsigned int systems()
The total number of APRS systems.
Definition opengd77base_codeplug.hh:647
Some limits.
Definition opengd77base_codeplug.hh:581
static constexpr unsigned int commentLength()
The maximum comment length in chars.
Definition opengd77base_codeplug.hh:585
static constexpr unsigned int nameLength()
The maximum name length in chars.
Definition opengd77base_codeplug.hh:583
Some internal offsets within the element.
Definition opengd77base_codeplug.hh:591
Some limits for the element.
Definition opengd77base_codeplug.hh:1454
static constexpr unsigned int magicStringLength()
Size of magic string.
Definition opengd77base_codeplug.hh:1456
Some internal offsets within the element.
Definition opengd77base_codeplug.hh:1461
Some limits for the melody config.
Definition opengd77base_codeplug.hh:1394
static constexpr unsigned int notes()
The maximum number of notes/pauses.
Definition opengd77base_codeplug.hh:1396
Some internal offsets.
Definition opengd77base_codeplug.hh:1401
Some limits for the settings.
Definition opengd77base_codeplug.hh:799
static constexpr unsigned int lineLength()
The total number of contacts.
Definition opengd77base_codeplug.hh:801
Some limits for the channel bank.
Definition opengd77base_codeplug.hh:316
static constexpr unsigned int channelCount()
The maximum number of channels.
Definition opengd77base_codeplug.hh:318
Some internal offset within the element.
Definition opengd77base_codeplug.hh:323
Some limits for this element.
Definition opengd77base_codeplug.hh:235
static constexpr unsigned int nameLength()
The maximum length of the name.
Definition opengd77base_codeplug.hh:237
Some internal offsets within the channel element.
Definition opengd77base_codeplug.hh:242
Some limits for the element.
Definition opengd77base_codeplug.hh:1040
static constexpr unsigned int contactCount()
Maximum number of contacts.
Definition opengd77base_codeplug.hh:1042
Some internal offsets within the element.
Definition opengd77base_codeplug.hh:1047
Some limits for the contact.
Definition opengd77base_codeplug.hh:993
static constexpr unsigned int nameLength()
Maximum name length.
Definition opengd77base_codeplug.hh:995
Some internal offsets within the element.
Definition opengd77base_codeplug.hh:1000
Some limits for the bank.
Definition opengd77base_codeplug.hh:738
static constexpr unsigned int contacts()
The total number of contacts.
Definition opengd77base_codeplug.hh:740
Some limits.
Definition opengd77base_codeplug.hh:695
static constexpr unsigned int numberLength()
The maximum length of the number.
Definition opengd77base_codeplug.hh:699
static constexpr unsigned int nameLength()
The maximum name length.
Definition opengd77base_codeplug.hh:697
Some limits.
Definition opengd77base_codeplug.hh:449
static constexpr unsigned int callLength()
The maximum call length.
Definition opengd77base_codeplug.hh:451
Some internal offset within the element.
Definition opengd77base_codeplug.hh:456
Some limits for the element.
Definition opengd77base_codeplug.hh:1152
static constexpr unsigned int groupListCount()
Maximum number of group lists.
Definition opengd77base_codeplug.hh:1154
Some internal offsets within the element.
Definition opengd77base_codeplug.hh:1159
Some limits for the element.
Definition opengd77base_codeplug.hh:1096
static constexpr unsigned int contactCount()
Maximum number of contacts.
Definition opengd77base_codeplug.hh:1100
static constexpr unsigned int nameLength()
Maximum name length.
Definition opengd77base_codeplug.hh:1098
Some internal offsets within the element.
Definition opengd77base_codeplug.hh:1105
Internal offsets.
Definition opengd77base_codeplug.hh:1357
Some limits for the satellite config.
Definition opengd77base_codeplug.hh:1312
static constexpr unsigned int satellites()
The maximum number of satellites.
Definition opengd77base_codeplug.hh:1314
Some internal offsets.
Definition opengd77base_codeplug.hh:1319
Some limits for the zone bank.
Definition opengd77base_codeplug.hh:1253
static constexpr unsigned int nameLength()
The maximum name length.
Definition opengd77base_codeplug.hh:1255
static constexpr unsigned int pathLength()
Maximum length of the APRS path.
Definition opengd77base_codeplug.hh:1257
Some internal offsets within the element.
Definition opengd77base_codeplug.hh:1262
Some limits for the zone bank.
Definition opengd77base_codeplug.hh:918
static constexpr unsigned int zoneCount()
The maximum number of zones in this bank.
Definition opengd77base_codeplug.hh:920
Some internal offsets within the element.
Definition opengd77base_codeplug.hh:925
Some limits for zone elements.
Definition opengd77base_codeplug.hh:861
static constexpr unsigned int nameLength()
The maximum length of the zone name.
Definition opengd77base_codeplug.hh:863
static constexpr unsigned int memberCount()
The maximum number of members.
Definition opengd77base_codeplug.hh:865
Some internal offsets within the element.
Definition opengd77base_codeplug.hh:870
Encodes a selective call.
Definition signaling.hh:13