35 : IUAVGadgetConfiguration(classId, parent)
42 for (i = 0; i < 8; i++) {
46 channelReverse[
i] = 0;
49 if (qSettings !=
nullptr) {
50 controlsMode = qSettings->value(
"controlsMode").toInt();
51 rollChannel = qSettings->value(
"rollChannel").toInt();
52 pitchChannel = qSettings->value(
"pitchChannel").toInt();
53 yawChannel = qSettings->value(
"yawChannel").toInt();
54 throttleChannel = qSettings->value(
"throttleChannel").toInt();
56 gcsReceiverMode = qSettings->value(
"gcsReceiverMode").toBool();
58 for (
unsigned int i = 0; i < 8; i++) {
60 qSettings->value(QString().sprintf(
"button%dAction", i)).toInt();
62 qSettings->value(QString().sprintf(
"button%dFunction", i)).toInt();
64 qSettings->value(QString().sprintf(
"button%dAmount", i)).toDouble();
65 channelReverse[
i] = qSettings->value(QString().sprintf(
"channel%dReverse", i)).toBool();
75 throttleChannel = throttle;
81 ql << rollChannel << pitchChannel << yawChannel << throttleChannel;
88 for (i = 0; i < 8; i++)
89 ql << channelReverse[i];
96 return gcsReceiverMode;
101 gcsReceiverMode = enable;
112 m->controlsMode = controlsMode;
113 m->rollChannel = rollChannel;
114 m->pitchChannel = pitchChannel;
115 m->yawChannel = yawChannel;
116 m->throttleChannel = throttleChannel;
118 m->gcsReceiverMode = gcsReceiverMode;
121 for (i = 0; i < 8; i++) {
125 m->channelReverse[
i] = channelReverse[
i];
137 settings->setValue(
"controlsMode", controlsMode);
138 settings->setValue(
"rollChannel", rollChannel);
139 settings->setValue(
"pitchChannel", pitchChannel);
140 settings->setValue(
"yawChannel", yawChannel);
141 settings->setValue(
"throttleChannel", throttleChannel);
143 settings->setValue(
"gcsReceiverMode", gcsReceiverMode);
145 for (
unsigned int i = 0;
i < 8;
i++) {
146 settings->setValue(QString().sprintf(
"button%dAction",
i), buttonSettings[
i].ActionID);
147 settings->setValue(QString().sprintf(
"button%dFunction",
i), buttonSettings[
i].FunctionID);
148 settings->setValue(QString().sprintf(
"button%dAmount",
i), buttonSettings[
i].Amount);
149 settings->setValue(QString().sprintf(
"channel%dReverse",
i), channelReverse[
i]);
IUAVGadgetConfiguration * clone()
GCSControlGadgetConfiguration(QString classId, QSettings *qSettings=nullptr, QObject *parent=nullptr)
virtual void saveConfig() const
void setRPYTchannels(int roll, int pitch, int yaw, int throttle)
QList< bool > getChannelsReverse()
bool getGcsReceiverMode()
QList< int > getChannelsMapping()
void setGcsReceiverMode(bool enable)