libdrmconf 0.15.0
A library to program DMR radios.
Loading...
Searching...
No Matches
bootsettings.hh
1//
2// Created by hannes on 02.04.26.
3//
4
5#ifndef BOOTSETTINGS_HH
6#define BOOTSETTINGS_HH
7
8#include "configobject.hh"
9#include "configreference.hh"
10
11
15{
16 Q_OBJECT
17
21 Q_PROPERTY(QString message1 READ message1 WRITE setMessage1)
23 Q_PROPERTY(QString message2 READ message2 WRITE setMessage2)
27 Q_PROPERTY(QString password READ bootPassword WRITE setBootPassword)
28
29 Q_CLASSINFO("defaultChannelDescription", "If enabled, the default channels are selected at boot.")
32 Q_CLASSINFO("zoneADescription", "The default zone for VFO A.")
34 Q_PROPERTY(ZoneReference* zoneA READ zoneA)
35 Q_CLASSINFO("channelADescription", "The default channel for VFO A. Must be within zone A.")
38 Q_CLASSINFO("zoneBDescription", "The default zone for VFO B.")
40 Q_PROPERTY(ZoneReference* zoneB READ zoneB)
41 Q_CLASSINFO("channelBDescription", "The default channel for VFO B. Must be within zone B.")
44
46 Q_PROPERTY(bool allowFactoryReset READ resetEnabled WRITE enableReset)
47
48public:
50 enum class BootDisplay {
54 };
55 Q_ENUM(BootDisplay)
56
57public:
59 explicit BootSettings(QObject *parent=nullptr);
60
61 ConfigItem *clone() const override;
62
66 void setBootDisplay(BootDisplay mode);
67
69 const QString &message1() const;
71 void setMessage1(const QString &value);
72
74 const QString &message2() const;
76 void setMessage2(const QString &value);
77
79 bool bootPasswordEnabled() const;
81 void enableBootPassword(bool enable);
83 const QString &bootPassword() const;
85 void setBootPassword(const QString &pass);
86
88 bool defaultChannelEnabled() const;
90 void enableDefaultChannel(bool enable);
92 ZoneReference *zoneA() const;
96 ZoneReference *zoneB() const;
99
101 bool resetEnabled() const;
103 void enableReset(bool enable);
104
105protected:
107 QString _message1, _message2;
115 bool _reset;
116};
117
118
119#endif //BOOTSETTINGS_HH
void enableReset(bool enable)
Enables/disables MCU reset on boot.
Definition bootsettings.cc:138
ChannelReference * _channelB
Default channel for VFO B, must be member of zone for VFO B.
Definition bootsettings.hh:114
bool bootPasswordEnabled() const
Returns true if the boot password is enabled.
Definition bootsettings.cc:69
BootDisplay bootDisplay() const
Returns the boot display setting.
Definition bootsettings.cc:28
ChannelReference * channelA
The default channel for VFO A.
Definition bootsettings.hh:37
ZoneReference * zoneB
The current zone for VFO B.
Definition bootsettings.hh:40
QString password
Holds the boot password.
Definition bootsettings.hh:27
bool _defaultChannel
Change to the default channel on boot.
Definition bootsettings.hh:110
ChannelReference * _channelA
Default channel for VFO A, must be member of zone for VFO A.
Definition bootsettings.hh:112
void enableBootPassword(bool enable)
Enables the boot password.
Definition bootsettings.cc:74
ZoneReference * zoneA
The default zone for VFO A.
Definition bootsettings.hh:34
ChannelReference * channelB
The default channel for VFO B.
Definition bootsettings.hh:43
bool _bootPasswordEnabled
If true, the boot password is enabled.
Definition bootsettings.hh:108
ZoneReference * _zoneB
Default zone for VFO B.
Definition bootsettings.hh:113
bool defaultChannel
If enabled, the default channels are selected at boot.
Definition bootsettings.hh:31
const QString & bootPassword() const
Returns the boot password.
Definition bootsettings.cc:83
QString _bootPassword
The boot password.
Definition bootsettings.hh:109
BootDisplay
What to display during boot.
Definition bootsettings.hh:50
@ Logo
Default or build in logo.
Definition bootsettings.hh:51
@ Text
Custom text.
Definition bootsettings.hh:52
@ Image
Custom image.
Definition bootsettings.hh:53
ConfigItem * clone() const override
Clones this item.
Definition bootsettings.cc:17
QString message2
The second boot message line.
Definition bootsettings.hh:23
QString message1
The first boot message line.
Definition bootsettings.hh:21
bool _reset
Enables MCU reset on boot.
Definition bootsettings.hh:115
void enableDefaultChannel(bool enable)
Enables/disables boot default channel.
Definition bootsettings.cc:102
void setBootDisplay(BootDisplay mode)
Sets the boot display.
Definition bootsettings.cc:33
bool defaultChannelEnabled() const
If true, the radio switches to the default channel at boot.
Definition bootsettings.cc:97
BootSettings(QObject *parent=nullptr)
Default constructor.
Definition bootsettings.cc:4
BootDisplay display
The boot display setting.
Definition bootsettings.hh:19
bool passwordEnabled
If true, the boot password is enabled.
Definition bootsettings.hh:25
BootDisplay _bootDisplay
The boot display property.
Definition bootsettings.hh:106
void setMessage2(const QString &value)
Sets the second boot message line.
Definition bootsettings.cc:60
ZoneReference * _zoneA
Default zone for VFO A.
Definition bootsettings.hh:111
QString _message2
The two boot messages.
Definition bootsettings.hh:107
void setMessage1(const QString &value)
Sets the first boot message line.
Definition bootsettings.cc:47
bool allowFactoryReset
Allows a factory reset during boot.
Definition bootsettings.hh:46
bool resetEnabled() const
Returns true if the MCU is reset on boot.
Definition bootsettings.cc:133
void setBootPassword(const QString &pass)
Sets the boot password.
Definition bootsettings.cc:88
Represents a reference to a channel.
Definition configreference.hh:135
ConfigExtension(QObject *parent=nullptr)
Hidden constructor.
Definition configobject.cc:1234
Base class for all configuration objects (channels, zones, contacts, etc).
Definition configobject.hh:35
Implements a reference to a zone.
Definition configreference.hh:307