dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
brainconfiguration.cpp
Go to the documentation of this file.
1 
14 /*
15  * This program is free software; you can redistribute it and/or modify
16  * it under the terms of the GNU General Public License as published by
17  * the Free Software Foundation; either version 3 of the License, or
18  * (at your option) any later version.
19  *
20  * This program is distributed in the hope that it will be useful, but
21  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23  * for more details.
24  *
25  * You should have received a copy of the GNU General Public License along
26  * with this program; if not, see <http://www.gnu.org/licenses/>
27  */
28 
30 #include "brainconfiguration.h"
31 #include "ui_brainconfiguration.h"
32 
33 #include "hwbrain.h"
34 
36  : ConfigTaskWidget(parent)
37  , ui(new Ui::BrainConfiguration)
38 {
39  ui->setupUi(this);
40 
41  addUAVObjectToWidgetRelation("HwBrain", "RxPort", ui->cmbRxPort);
42  addUAVObjectToWidgetRelation("HwBrain", "RxPortUsart", ui->cmbRxPortUsart);
43  addUAVObjectToWidgetRelation("HwBrain", "MainPort", ui->cmbMainPort);
44  addUAVObjectToWidgetRelation("HwBrain", "FlxPort", ui->cmbFlxPort);
45 
46  addUAVObjectToWidgetRelation("HwBrain", "Magnetometer", ui->cmbMagnetometer);
47  addUAVObjectToWidgetRelation("HwBrain", "ExtMagOrientation", ui->cmbExtMagOrientation);
48  addUAVObjectToWidgetRelation("HwBrain", "USB_HIDPort", ui->cmbUsbHidPort);
49  addUAVObjectToWidgetRelation("HwBrain", "USB_VCPPort", ui->cmbUsbVcpPort);
50  addUAVObjectToWidgetRelation("HwBrain", "GyroFullScale", ui->cmbGyroRange);
51  addUAVObjectToWidgetRelation("HwBrain", "AccelFullScale", ui->cmbAccelRange);
52  addUAVObjectToWidgetRelation("HwBrain", "MPU9250GyroLPF", ui->cmbGyroLpf);
53  addUAVObjectToWidgetRelation("HwBrain", "MPU9250AccelLPF", ui->cmbAccelLpf);
54  addUAVObjectToWidgetRelation("HwBrain", "DSMxMode", ui->cbDsmxMode);
55 
56  // Load UAVObjects to widget relations from UI file
57  // using objrelation dynamic property
59 
60  // enableControls(false);
61  enableControls(true);
65 
66  img = QPixmap(":/brainfpv/images/brain.png");
67  ui->imgLabel->setPixmap(img);
68 }
69 
71 {
72  delete ui;
73 }
void addUAVObjectToWidgetRelation(QString object, QString field, QWidget *widget, int index=0, double scale=1, bool isLimited=false, bool useUnits=false, QList< int > *defaultReloadGroups=nullptr, quint32 instID=0, bool oneWayBind=false)
Add an UAVObject field to widget relation to the management system Note: This is the instance called ...
BrainConfiguration(QWidget *parent=nullptr)
virtual void populateWidgets()
virtual void enableControls(bool enable)
virtual void refreshWidgetsValues(UAVObject *obj=NULL)