libdrmconf  0.11.0
A library to program DMR radios.
radiolimits.hh
1 
29 #ifndef RADIOLIMITS_HH
30 #define RADIOLIMITS_HH
31 
32 #include <QObject>
33 #include <QTextStream>
34 #include <QMetaType>
35 #include <QSet>
36 
37 // Forward declaration
38 class Config;
39 class ConfigItem;
40 class ConfigObject;
41 class RadioLimits;
42 
43 
46 class RadioLimitIssue: public QTextStream
47 {
48 public:
50  enum Severity {
52  Hint,
54  Critical
55  };
56 
57 public:
60  RadioLimitIssue(Severity severity, const QStringList &stack);
62  RadioLimitIssue(const RadioLimitIssue &other);
63 
67  RadioLimitIssue &operator =(const QString &message);
68 
70  Severity severity() const;
72  const QString &message() const;
74  QString format() const;
75 
76 protected:
80  QStringList _stack;
82  QString _message;
83 };
84 
85 
91 {
92 public:
94  explicit RadioLimitContext(bool ignoreFrequencyLimits=false);
95 
98 
100  int count() const;
102  const RadioLimitIssue &message(int n) const;
103 
106  void push(const QString &element);
108  void pop();
109 
111  bool ignoreFrequencyLimits() const;
113  void enableIgnoreFrequencyLimits(bool enable=true);
114 
117 
118 protected:
120  QStringList _stack;
122  QList<RadioLimitIssue> _messages;
127 };
128 
129 
133 class RadioLimitElement: public QObject
134 {
135  Q_OBJECT
136 
137 public:
139  typedef std::initializer_list< std::pair<QString, RadioLimitElement *> > PropList;
140 
141 protected:
143  explicit RadioLimitElement(QObject *parent=nullptr);
144 
145 public:
148  virtual bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const = 0;
149 
150 public:
152  virtual ~RadioLimitElement();
153 };
154 
155 
161 {
162  Q_OBJECT
163 
164 protected:
166  explicit RadioLimitValue(QObject *parent=nullptr);
167 };
168 
169 
177 {
178  Q_OBJECT
179 
180 public:
182  enum Encoding {
184  Unicode
185  };
186 
187 public:
193  RadioLimitString(int minLen, int maxLen, Encoding enc, QObject *parent=nullptr);
194 
195  bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const;
196 
197 protected:
199  int _minLen;
201  int _maxLen;
204 };
205 
206 
210 {
211  Q_OBJECT
212 
213 public:
217  RadioLimitStringRegEx(const QString &pattern, QObject *parent=nullptr);
218 
219  bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const;
220 
221 protected:
223  QRegExp _pattern;
224 };
225 
226 
231  Q_OBJECT
232 
233 public:
236 
237  bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const;
238 
239 protected:
242 };
243 
244 
248 {
249  Q_OBJECT
250 
251 public:
253  explicit RadioLimitBool(QObject *parent=nullptr);
254 
255  bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const;
256 };
257 
258 
263 {
264  Q_OBJECT
265 
266 public:
271  QObject *parent=nullptr);
272 
273  bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const;
274 
275 protected:
278 };
279 
280 
284 {
285  Q_OBJECT
286 
287 public:
293  RadioLimitUInt(qint64 minValue=-1, qint64 maxValue=-1, qint64 defValue=-1, QObject *parent=nullptr);
294 
295  bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const;
296 
297 protected:
299  qint64 _minValue;
301  qint64 _maxValue;
303  qint64 _defValue;
304 };
305 
306 
311 {
312  Q_OBJECT
313 
314 public:
317  explicit RadioLimitDMRId(QObject *parent=nullptr);
318 };
319 
320 
324 {
325  Q_OBJECT
326 
327 public:
329  RadioLimitEnum(const std::initializer_list<unsigned> &values, QObject *parent=nullptr);
330 
331  bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const;
332 
333 protected:
335  QSet<unsigned> _values;
336 };
337 
338 
342 {
343  Q_OBJECT
344 
345 public:
347  typedef std::initializer_list<std::pair<double, double>> RangeList;
348 public:
350  struct FrequencyRange {
351  double min;
352  double max;
354  FrequencyRange(double lower, double upper);
356  FrequencyRange(const std::pair<double, double> &limit);
358  bool contains(double f) const;
359  };
360 
361 public:
363  explicit RadioLimitFrequencies(QObject *parent=nullptr);
365  RadioLimitFrequencies(const RangeList &ranges, bool warnOnly=false, QObject *parent=nullptr);
366 
367  bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const;
368 
369 protected:
371  QList<FrequencyRange> _frequencyRanges;
373  bool _warnOnly;
374 };
375 
376 
381 {
382  Q_OBJECT
383 
384 public:
386  explicit RadioLimitTransmitFrequencies(QObject *parent=nullptr);
388  RadioLimitTransmitFrequencies(const RangeList &ranges, QObject *parent=nullptr);
389 
390  bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const;
391 };
392 
393 
401 {
402  Q_OBJECT
403 
404 public:
406  explicit RadioLimitItem(QObject *parent=nullptr);
409  RadioLimitItem(const PropList &list, QObject *parent=nullptr);
410 
419  bool add(const QString &prop, RadioLimitElement *structure);
420 
421  virtual bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const;
423  virtual bool verifyItem(const ConfigItem *item, RadioLimitContext &context) const;
424 
425 protected:
427  QHash<QString, RadioLimitElement *> _elements;
428 };
429 
430 
434 {
435  Q_OBJECT
436 
437 public:
439  explicit RadioLimitObject(QObject *parent=nullptr);
442  RadioLimitObject(const PropList &list, QObject *parent=nullptr);
443 
445  virtual bool verifyObject(const ConfigObject *item, RadioLimitContext &context) const;
446 };
447 
448 
456 {
457  Q_OBJECT
458 
459 public:
461  RadioLimitIgnored(RadioLimitIssue::Severity notify=RadioLimitIssue::Hint, QObject *parent=nullptr);
462 
463  bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const;
464  bool verifyObject(const ConfigObject *item, RadioLimitContext &context) const;
465 
466 protected:
469 };
470 
471 
480 {
481  Q_OBJECT
482 
483 public:
485  typedef std::initializer_list<std::pair<const QMetaObject&, RadioLimitObject *> > TypeList;
486 
487 public:
506  RadioLimitObjects(const TypeList &list, QObject *parent=nullptr);
507 
508  bool verifyItem(const ConfigItem *item, RadioLimitContext &context) const;
509 
510 protected:
512  QHash<QString, RadioLimitObject *> _types;
513 };
514 
515 
519 {
520  Q_OBJECT
521 
522 public:
527  RadioLimitObjRef(const QMetaObject &type, bool allowNull=true, QObject *parent=nullptr);
528 
529  bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const;
530 
531 protected:
533  bool validType(const QMetaObject *type) const;
534 
535 protected:
539  QSet<QString> _types;
540 };
541 
542 
546 {
547  Q_OBJECT
548 
549 public:
556  QObject *parent=nullptr);
557 
558  bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const;
559 
560 protected:
565 };
566 
567 
571 {
572  Q_OBJECT
573 
574 public:
576  struct ElementLimits {
577  const QMetaObject &type;
578  int minCount;
579  int maxCount;
581  };
582 
583 public:
591  RadioLimitList(const QMetaObject &type, int minSize, int maxSize, RadioLimitObject *element, QObject *parent=nullptr);
593  RadioLimitList(const std::initializer_list<ElementLimits> &elements, QObject *parent=nullptr);
594 
595  bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const;
596 
597 protected:
599  QString findClassName(const QMetaObject &type) const;
600 
601 protected:
603  QHash<QString, RadioLimitObject *> _elements;
605  QHash<QString, qint64> _minCount;
607  QHash<QString, qint64> _maxCount;
608 };
609 
610 
614 {
615  Q_OBJECT
616 
617 public:
623  RadioLimitRefList(int minSize, int maxSize, const QMetaObject &type, QObject *parent=nullptr);
624 
625  bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const;
626 
627 protected:
629  bool validType(const QMetaObject *type) const;
630 
631 protected:
633  qint64 _minSize;
635  qint64 _maxSize;
637  QSet<QString> _types;
638 };
639 
640 
645 {
646  Q_OBJECT
647 
648 public:
653  RadioLimitGroupCallRefList(int minSize, int maxSize, QObject *parent=nullptr);
654 
655  bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const;
656 
657 protected:
659  qint64 _minSize;
661  qint64 _maxSize;
662 };
663 
664 
673 {
674  Q_OBJECT
675 
676 public:
681  RadioLimitSingleZone(qint64 maxSize, const PropList &list, QObject *parent=nullptr);
682 
683  bool verifyItem(const ConfigItem *item, RadioLimitContext &context) const;
684 };
685 
686 
692 {
693  Q_OBJECT
694 
695 public:
697  explicit RadioLimits(bool betaWarning, QObject *parent = nullptr);
699  RadioLimits(const std::initializer_list<std::pair<QString,RadioLimitElement *> > &list, QObject *parent=nullptr);
700 
702  virtual bool verifyConfig(const Config *config, RadioLimitContext &context) const;
703 
705  bool hasCallSignDB() const;
707  bool callSignDBImplemented() const;
709  unsigned numCallSignDBEntries() const;
710 
711 protected:
721 };
722 
723 #endif // RADIOLIMITS_HH
Base class for all configuration objects (channels, zones, contacts, etc).
Definition: configobject.hh:40
Base class of all labeled and named objects.
Definition: configobject.hh:199
The config class, representing the codeplug configuration.
Definition: config.hh:68
Checks if a property is a boolean value.
Definition: radiolimits.hh:248
RadioLimitBool(QObject *parent=nullptr)
Constructor.
Definition: radiolimits.cc:276
bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const
Verifies the given property of the specified item.
Definition: radiolimits.cc:283
Collects the issues found during verification.
Definition: radiolimits.hh:91
RadioLimitIssue::Severity _maxSeverity
Holds the highest severity of all messages.
Definition: radiolimits.hh:126
bool ignoreFrequencyLimits() const
If true, frequency limit voilations are warnings.
Definition: radiolimits.cc:111
void pop()
Pops the top-most property name/element index from the stack.
Definition: radiolimits.cc:106
const RadioLimitIssue & message(int n) const
Returns the n-th issue.
Definition: radiolimits.cc:96
RadioLimitContext(bool ignoreFrequencyLimits=false)
Empty constructor.
Definition: radiolimits.cc:76
bool _ignoreFrequencyLimits
If true, any frequency range voilation is a warning.
Definition: radiolimits.hh:124
void push(const QString &element)
Push a property name/element index onto the stack.
Definition: radiolimits.cc:101
QStringList _stack
The current item stack.
Definition: radiolimits.hh:120
QList< RadioLimitIssue > _messages
The list of issues found.
Definition: radiolimits.hh:122
RadioLimitIssue::Severity maxSeverity() const
Returns the highest severity of the messages.
Definition: radiolimits.cc:120
RadioLimitIssue & newMessage(RadioLimitIssue::Severity severity=RadioLimitIssue::Hint)
Constructs a new message and puts it into the list of issues.
Definition: radiolimits.cc:83
int count() const
Returns the number of issues.
Definition: radiolimits.cc:91
void enableIgnoreFrequencyLimits(bool enable=true)
Enables/disables that frequency range voilations are handled as warnings.
Definition: radiolimits.cc:115
Represents a DMR ID.
Definition: radiolimits.hh:311
RadioLimitDMRId(QObject *parent=nullptr)
Constructor.
Definition: radiolimits.cc:359
Abstract base class for all radio limits.
Definition: radiolimits.hh:134
virtual ~RadioLimitElement()
Destructor.
Definition: radiolimits.cc:134
std::initializer_list< std::pair< QString, RadioLimitElement * > > PropList
Initializer lists of ConfigItem properties.
Definition: radiolimits.hh:139
RadioLimitElement(QObject *parent=nullptr)
Hidden constructor.
Definition: radiolimits.cc:128
virtual bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const =0
Verifies the given property of the specified item.
Represents a limit for a set of enum values.
Definition: radiolimits.hh:324
QSet< unsigned > _values
Holds the set of valid values.
Definition: radiolimits.hh:335
bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const
Verifies the given property of the specified item.
Definition: radiolimits.cc:376
RadioLimitEnum(const std::initializer_list< unsigned > &values, QObject *parent=nullptr)
Constructor from initializer list of possible enum values.
Definition: radiolimits.cc:369
Represents a limit on frequencies in MHz.
Definition: radiolimits.hh:342
std::initializer_list< std::pair< double, double > > RangeList
Typedef for the initializer list.
Definition: radiolimits.hh:347
RadioLimitFrequencies(QObject *parent=nullptr)
Empty constructor.
Definition: radiolimits.cc:424
QList< FrequencyRange > _frequencyRanges
Holds the frequency ranges for the device.
Definition: radiolimits.hh:371
bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const
Verifies the given property of the specified item.
Definition: radiolimits.cc:439
bool _warnOnly
If true, throw only a warning.
Definition: radiolimits.hh:373
Implements the limits for a list of references to group call contacts.
Definition: radiolimits.hh:645
bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const
Verifies the given property of the specified item.
Definition: radiolimits.cc:857
qint64 _minSize
Holds the minimum size of the list.
Definition: radiolimits.hh:659
RadioLimitGroupCallRefList(int minSize, int maxSize, QObject *parent=nullptr)
Constructor.
Definition: radiolimits.cc:850
qint64 _maxSize
Holds the maximum size of the list.
Definition: radiolimits.hh:661
Specifies an boolean value as ignored.
Definition: radiolimits.hh:263
RadioLimitIssue::Severity _severity
The severity of the issue generated.
Definition: radiolimits.hh:277
RadioLimitIgnoredBool(RadioLimitIssue::Severity notify=RadioLimitIssue::Hint, QObject *parent=nullptr)
Constructor.
Definition: radiolimits.cc:299
bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const
Verifies the given property of the specified item.
Definition: radiolimits.cc:306
Represents an ignored element in the codeplug.
Definition: radiolimits.hh:456
RadioLimitIssue::Severity _notification
Holds the level of the notification.
Definition: radiolimits.hh:468
bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const
Verifies the given property of the specified item.
Definition: radiolimits.cc:149
RadioLimitIgnored(RadioLimitIssue::Severity notify=RadioLimitIssue::Hint, QObject *parent=nullptr)
Constructor for a ignored setting verification element.
Definition: radiolimits.cc:142
bool verifyObject(const ConfigObject *item, RadioLimitContext &context) const
Verifies the properties of the given object.
Definition: radiolimits.cc:158
Represents a single issue found during verification.
Definition: radiolimits.hh:47
Severity
Defines the possible severity levels.
Definition: radiolimits.hh:50
@ Critical
Assembly of the codeplug will fail or a non-functional codeplug might be created.
Definition: radiolimits.hh:54
@ Hint
Just a hint, a working codplug will be assembled.
Definition: radiolimits.hh:52
@ Silent
The user will not be notified.
Definition: radiolimits.hh:51
@ Warning
The codeplug gets changed but a working codeplug might be assembled.
Definition: radiolimits.hh:53
Severity severity() const
Returns the severity of the issue.
Definition: radiolimits.cc:49
QStringList _stack
Holds the item-stack (where the issue occurred).
Definition: radiolimits.hh:80
RadioLimitIssue(Severity severity, const QStringList &stack)
Constructs an empty message for the specified severity at the specified point of the verification.
Definition: radiolimits.cc:21
QString format() const
Formats the message.
Definition: radiolimits.cc:59
const QString & message() const
Returns the text message.
Definition: radiolimits.cc:54
RadioLimitIssue & operator=(const RadioLimitIssue &other)
Copy assignment.
Definition: radiolimits.cc:34
QString _message
Holds the text message.
Definition: radiolimits.hh:82
Severity _severity
Holds the severity of the issue.
Definition: radiolimits.hh:78
Represents the limits for a ConfigItem instance.
Definition: radiolimits.hh:401
virtual bool verifyItem(const ConfigItem *item, RadioLimitContext &context) const
Verifies the properties of the given item.
Definition: radiolimits.cc:547
bool add(const QString &prop, RadioLimitElement *structure)
Adds a property declaration.
Definition: radiolimits.cc:515
QHash< QString, RadioLimitElement * > _elements
Holds the property <-> limits map.
Definition: radiolimits.hh:427
RadioLimitItem(QObject *parent=nullptr)
Empty constructor.
Definition: radiolimits.cc:500
virtual bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const
Verifies the given property of the specified item.
Definition: radiolimits.cc:524
Specifies the limits for a list of ConfigObject instances.
Definition: radiolimits.hh:571
QString findClassName(const QMetaObject &type) const
Searches for the specified type or one of its super-clsases in the set of allowed types.
Definition: radiolimits.cc:778
RadioLimitList(const QMetaObject &type, int minSize, int maxSize, RadioLimitObject *element, QObject *parent=nullptr)
Constructor.
Definition: radiolimits.cc:692
QHash< QString, qint64 > _minCount
Maps typename to minimum count.
Definition: radiolimits.hh:605
QHash< QString, RadioLimitObject * > _elements
Maps typename to element definition.
Definition: radiolimits.hh:603
QHash< QString, qint64 > _maxCount
Maps typename to maximum count.
Definition: radiolimits.hh:607
bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const
Verifies the given property of the specified item.
Definition: radiolimits.cc:713
Issues a notification if a reference is set.
Definition: radiolimits.hh:546
RadioLimitObjRefIgnored(ConfigObject *defObj=nullptr, RadioLimitIssue::Severity notify=RadioLimitIssue::Hint, QObject *parent=nullptr)
Constructor.
Definition: radiolimits.cc:667
ConfigObject * _default
A weak reference to a default value, that gets silently ignored.
Definition: radiolimits.hh:564
RadioLimitIssue::Severity _severity
The severity of the issue.
Definition: radiolimits.hh:562
bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const
Verifies the given property of the specified item.
Definition: radiolimits.cc:676
Limits the possible classes a ConfigObjectReference may refer to.
Definition: radiolimits.hh:519
RadioLimitObjRef(const QMetaObject &type, bool allowNull=true, QObject *parent=nullptr)
Constructor.
Definition: radiolimits.cc:617
bool _allowNull
If true, a null reference is allowed.
Definition: radiolimits.hh:537
bool validType(const QMetaObject *type) const
Checks if the given type is one of the valid ones in _types.
Definition: radiolimits.cc:655
QSet< QString > _types
Possible classes of instances, the reference may point to.
Definition: radiolimits.hh:539
bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const
Verifies the given property of the specified item.
Definition: radiolimits.cc:624
Represents the limits for all properties of a ConfigObject instance.
Definition: radiolimits.hh:434
virtual bool verifyObject(const ConfigObject *item, RadioLimitContext &context) const
Verifies the properties of the given object.
Definition: radiolimits.cc:582
RadioLimitObject(QObject *parent=nullptr)
Empty constructor.
Definition: radiolimits.cc:569
Dispatch by class.
Definition: radiolimits.hh:480
RadioLimitObjects(const TypeList &list, QObject *parent=nullptr)
Constructor from initializer list.
Definition: radiolimits.cc:593
bool verifyItem(const ConfigItem *item, RadioLimitContext &context) const
Verifies the properties of the given item.
Definition: radiolimits.cc:603
std::initializer_list< std::pair< const QMetaObject &, RadioLimitObject * > > TypeList
Initializer lists of type properties.
Definition: radiolimits.hh:485
QHash< QString, RadioLimitObject * > _types
Maps class-names to object limits.
Definition: radiolimits.hh:512
Implements the limits for reference lists.
Definition: radiolimits.hh:614
qint64 _maxSize
Holds the maximum size of the list.
Definition: radiolimits.hh:635
bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const
Verifies the given property of the specified item.
Definition: radiolimits.cc:797
QSet< QString > _types
Possible classes of instances, the references may point to.
Definition: radiolimits.hh:637
RadioLimitRefList(int minSize, int maxSize, const QMetaObject &type, QObject *parent=nullptr)
Constructor.
Definition: radiolimits.cc:790
qint64 _minSize
Holds the minimum size of the list.
Definition: radiolimits.hh:633
bool validType(const QMetaObject *type) const
Checks if the given type is one of the valid ones in _types.
Definition: radiolimits.cc:838
Specialized RadioLimitObject handling a zone for radio supporting only a single channel list per zone...
Definition: radiolimits.hh:673
RadioLimitSingleZone(qint64 maxSize, const PropList &list, QObject *parent=nullptr)
Constructor.
Definition: radiolimits.cc:906
bool verifyItem(const ConfigItem *item, RadioLimitContext &context) const
Verifies the properties of the given item.
Definition: radiolimits.cc:915
Notifies the user that a string gets ignored.
Definition: radiolimits.hh:230
bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const
Verifies the given property of the specified item.
Definition: radiolimits.cc:256
RadioLimitIssue::Severity _severity
Holds the severity of the message.
Definition: radiolimits.hh:241
RadioLimitStringIgnored(RadioLimitIssue::Severity severity=RadioLimitIssue::Hint, QObject *parent=nullptr)
Constructor.
Definition: radiolimits.cc:249
Verifies that a string matches a regular expression.
Definition: radiolimits.hh:210
RadioLimitStringRegEx(const QString &pattern, QObject *parent=nullptr)
Constructor.
Definition: radiolimits.cc:221
QRegExp _pattern
Holds the regular expression pattern.
Definition: radiolimits.hh:223
bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const
Verifies the given property of the specified item.
Definition: radiolimits.cc:228
Checks a string valued property.
Definition: radiolimits.hh:177
RadioLimitString(int minLen, int maxLen, Encoding enc, QObject *parent=nullptr)
Constructor.
Definition: radiolimits.cc:181
int _minLen
Holds the minimum length of the string.
Definition: radiolimits.hh:199
int _maxLen
Holds the maximum length of the string.
Definition: radiolimits.hh:201
Encoding
Possible encoding of strings.
Definition: radiolimits.hh:182
@ ASCII
Just ASCII is allowed.
Definition: radiolimits.hh:183
@ Unicode
Any Unicode character is allowed.
Definition: radiolimits.hh:184
bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const
Verifies the given property of the specified item.
Definition: radiolimits.cc:188
Encoding _encoding
Holds the allowed character encoding.
Definition: radiolimits.hh:203
Specialization for transmit frequency limits.
Definition: radiolimits.hh:381
RadioLimitTransmitFrequencies(QObject *parent=nullptr)
Empty constructor.
Definition: radiolimits.cc:469
bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const
Verifies the given property of the specified item.
Definition: radiolimits.cc:482
Represents a limit for an unsigned integer value.
Definition: radiolimits.hh:284
qint64 _maxValue
Holds the maximum value.
Definition: radiolimits.hh:301
qint64 _defValue
Holds the default value.
Definition: radiolimits.hh:303
bool verify(const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const
Verifies the given property of the specified item.
Definition: radiolimits.cc:333
qint64 _minValue
Holds the minimum value.
Definition: radiolimits.hh:299
RadioLimitUInt(qint64 minValue=-1, qint64 maxValue=-1, qint64 defValue=-1, QObject *parent=nullptr)
Constructor.
Definition: radiolimits.cc:326
Base class to verify values.
Definition: radiolimits.hh:161
RadioLimitValue(QObject *parent=nullptr)
Hidden constructor.
Definition: radiolimits.cc:171
Represents the limits or the entire codeplug.
Definition: radiolimits.hh:692
unsigned numCallSignDBEntries() const
Returns the maximum number of entries in the call-sign DB.
Definition: radiolimits.cc:956
virtual bool verifyConfig(const Config *config, RadioLimitContext &context) const
Verifies the given configuration.
Definition: radiolimits.cc:961
bool _callSignDBImplemented
If true, the call-sign is implemented.
Definition: radiolimits.hh:718
bool _hasCallSignDB
If true, the radio supports a call-sign DB.
Definition: radiolimits.hh:716
bool hasCallSignDB() const
Returns true if the radio supports a call-sign DB.
Definition: radiolimits.cc:946
unsigned _numCallSignDBEntries
Holds the number of possible call-sign DB entries.
Definition: radiolimits.hh:720
RadioLimits(bool betaWarning, QObject *parent=nullptr)
Empty constructor.
Definition: radiolimits.cc:933
bool callSignDBImplemented() const
Returns true if the call-sign DB is implemented.
Definition: radiolimits.cc:951
bool _betaWarning
If true, a warning is issued that the radio is still under development and not well tested yet.
Definition: radiolimits.hh:714
Represents a single frequency range.
Definition: radiolimits.hh:350
bool contains(double f) const
Returns true if f is inside this limit.
Definition: radiolimits.cc:416
FrequencyRange(double lower, double upper)
Constructs a frequency range from limits.
Definition: radiolimits.cc:403
double min
Lower frequency limit.
Definition: radiolimits.hh:351
double max
Upper frequency limit.
Definition: radiolimits.hh:352
Helper struct to pass list entry definitions.
Definition: radiolimits.hh:576
int minCount
Minimum count of elements.
Definition: radiolimits.hh:578
const QMetaObject & type
The type of the object.
Definition: radiolimits.hh:577
int maxCount
Maximum count of elements.
Definition: radiolimits.hh:579
RadioLimitObject * structure
The structure of the elements.
Definition: radiolimits.hh:580