Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
31a118ce
Commit
31a118ce
authored
Jul 17, 2013
by
Michael Carpenter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First round of fixes per Bill's git commit comments
parent
8a8e6339
Changes
38
Show whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
490 additions
and
613 deletions
+490
-613
MainWindow.cc
src/ui/MainWindow.cc
+0
-1
MainWindow.h
src/ui/MainWindow.h
+0
-1
AP2ConfigWidget.cc
src/ui/configuration/AP2ConfigWidget.cc
+7
-1
AP2ConfigWidget.h
src/ui/configuration/AP2ConfigWidget.h
+1
-0
AccelCalibrationConfig.cc
src/ui/configuration/AccelCalibrationConfig.cc
+30
-24
AccelCalibrationConfig.h
src/ui/configuration/AccelCalibrationConfig.h
+4
-2
AdvParameterList.cc
src/ui/configuration/AdvParameterList.cc
+9
-11
AdvParameterList.h
src/ui/configuration/AdvParameterList.h
+3
-3
AdvancedParamConfig.cc
src/ui/configuration/AdvancedParamConfig.cc
+4
-4
AdvancedParamConfig.h
src/ui/configuration/AdvancedParamConfig.h
+1
-1
AirspeedConfig.cc
src/ui/configuration/AirspeedConfig.cc
+2
-2
ApmHardwareConfig.cc
src/ui/configuration/ApmHardwareConfig.cc
+42
-42
ApmHardwareConfig.h
src/ui/configuration/ApmHardwareConfig.h
+14
-14
ApmPlaneLevel.cc
src/ui/configuration/ApmPlaneLevel.cc
+13
-7
ApmSoftwareConfig.cc
src/ui/configuration/ApmSoftwareConfig.cc
+35
-139
ApmSoftwareConfig.h
src/ui/configuration/ApmSoftwareConfig.h
+11
-11
ArduCopterPidConfig.cc
src/ui/configuration/ArduCopterPidConfig.cc
+108
-122
ArduCopterPidConfig.h
src/ui/configuration/ArduCopterPidConfig.h
+3
-4
ArduPlanePidConfig.cc
src/ui/configuration/ArduPlanePidConfig.cc
+56
-54
ArduPlanePidConfig.h
src/ui/configuration/ArduPlanePidConfig.h
+1
-1
ArduRoverPidConfig.cc
src/ui/configuration/ArduRoverPidConfig.cc
+2
-0
BatteryMonitorConfig.cc
src/ui/configuration/BatteryMonitorConfig.cc
+42
-34
BatteryMonitorConfig.h
src/ui/configuration/BatteryMonitorConfig.h
+2
-0
BatteryMonitorConfig.ui
src/ui/configuration/BatteryMonitorConfig.ui
+1
-1
CameraGimbalConfig.cc
src/ui/configuration/CameraGimbalConfig.cc
+46
-62
CameraGimbalConfig.h
src/ui/configuration/CameraGimbalConfig.h
+4
-4
CompassConfig.cc
src/ui/configuration/CompassConfig.cc
+1
-14
CompassConfig.h
src/ui/configuration/CompassConfig.h
+2
-2
FailSafeConfig.cc
src/ui/configuration/FailSafeConfig.cc
+23
-5
FlightModeConfig.cc
src/ui/configuration/FlightModeConfig.cc
+6
-6
FlightModeConfig.h
src/ui/configuration/FlightModeConfig.h
+3
-2
FrameTypeConfig.cc
src/ui/configuration/FrameTypeConfig.cc
+1
-14
FrameTypeConfig.h
src/ui/configuration/FrameTypeConfig.h
+2
-2
OsdConfig.cc
src/ui/configuration/OsdConfig.cc
+1
-1
RadioCalibrationConfig.cc
src/ui/configuration/RadioCalibrationConfig.cc
+7
-12
RadioCalibrationConfig.h
src/ui/configuration/RadioCalibrationConfig.h
+3
-2
StandardParamConfig.cc
src/ui/configuration/StandardParamConfig.cc
+0
-7
StandardParamConfig.h
src/ui/configuration/StandardParamConfig.h
+0
-1
No files found.
src/ui/MainWindow.cc
View file @
31a118ce
...
@@ -1527,7 +1527,6 @@ void MainWindow::connectCommonActions()
...
@@ -1527,7 +1527,6 @@ void MainWindow::connectCommonActions()
connect
(
ui
.
actionEngineersView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadEngineerView
()));
connect
(
ui
.
actionEngineersView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadEngineerView
()));
connect
(
ui
.
actionMissionView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadOperatorView
()));
connect
(
ui
.
actionMissionView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadOperatorView
()));
connect
(
ui
.
actionUnconnectedView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadUnconnectedView
()));
connect
(
ui
.
actionUnconnectedView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadUnconnectedView
()));
//connect(ui.actionConfiguration_2,SIGNAL(triggered()),this,SLOT(loadConfigurationView()));
connect
(
ui
.
actionHardwareConfig
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadHardwareConfigView
()));
connect
(
ui
.
actionHardwareConfig
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadHardwareConfigView
()));
connect
(
ui
.
actionSoftwareConfig
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadSoftwareConfigView
()));
connect
(
ui
.
actionSoftwareConfig
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadSoftwareConfigView
()));
...
...
src/ui/MainWindow.h
View file @
31a118ce
...
@@ -30,7 +30,6 @@ This file is part of the QGROUNDCONTROL project
...
@@ -30,7 +30,6 @@ This file is part of the QGROUNDCONTROL project
#ifndef _MAINWINDOW_H_
#ifndef _MAINWINDOW_H_
#define _MAINWINDOW_H_
#define _MAINWINDOW_H_
#include <QtGui/QMainWindow>
#include <QtGui/QMainWindow>
#include <QStatusBar>
#include <QStatusBar>
#include <QStackedWidget>
#include <QStackedWidget>
...
...
src/ui/configuration/AP2ConfigWidget.cc
View file @
31a118ce
#include <QMessageBox>
#include "AP2ConfigWidget.h"
#include "AP2ConfigWidget.h"
AP2ConfigWidget
::
AP2ConfigWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
AP2ConfigWidget
::
AP2ConfigWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
...
@@ -8,11 +9,12 @@ AP2ConfigWidget::AP2ConfigWidget(QWidget *parent) : QWidget(parent)
...
@@ -8,11 +9,12 @@ AP2ConfigWidget::AP2ConfigWidget(QWidget *parent) : QWidget(parent)
}
}
void
AP2ConfigWidget
::
activeUASSet
(
UASInterface
*
uas
)
void
AP2ConfigWidget
::
activeUASSet
(
UASInterface
*
uas
)
{
{
if
(
!
uas
)
return
;
if
(
m_uas
)
if
(
m_uas
)
{
{
disconnect
(
m_uas
,
SIGNAL
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)),
this
,
SLOT
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)));
disconnect
(
m_uas
,
SIGNAL
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)),
this
,
SLOT
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)));
m_uas
=
0
;
}
}
if
(
!
uas
)
return
;
m_uas
=
uas
;
m_uas
=
uas
;
connect
(
m_uas
,
SIGNAL
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)),
this
,
SLOT
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)));
connect
(
m_uas
,
SIGNAL
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)),
this
,
SLOT
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)));
}
}
...
@@ -21,3 +23,7 @@ void AP2ConfigWidget::parameterChanged(int uas, int component, QString parameter
...
@@ -21,3 +23,7 @@ void AP2ConfigWidget::parameterChanged(int uas, int component, QString parameter
{
{
}
}
void
AP2ConfigWidget
::
showNullMAVErrorMessageBox
()
{
QMessageBox
::
information
(
0
,
tr
(
"Error"
),
tr
(
"Please connect to a MAV before attempting to set configuration"
));
}
src/ui/configuration/AP2ConfigWidget.h
View file @
31a118ce
...
@@ -11,6 +11,7 @@ public:
...
@@ -11,6 +11,7 @@ public:
explicit
AP2ConfigWidget
(
QWidget
*
parent
=
0
);
explicit
AP2ConfigWidget
(
QWidget
*
parent
=
0
);
protected:
protected:
UASInterface
*
m_uas
;
UASInterface
*
m_uas
;
void
showNullMAVErrorMessageBox
();
signals:
signals:
public
slots
:
public
slots
:
...
...
src/ui/configuration/AccelCalibrationConfig.cc
View file @
31a118ce
#include "AccelCalibrationConfig.h"
#include "AccelCalibrationConfig.h"
AccelCalibrationConfig
::
AccelCalibrationConfig
(
QWidget
*
parent
)
:
Q
Widget
(
parent
)
AccelCalibrationConfig
::
AccelCalibrationConfig
(
QWidget
*
parent
)
:
AP2Config
Widget
(
parent
)
{
{
m_uas
=
0
;
m_uas
=
0
;
ui
.
setupUi
(
this
);
ui
.
setupUi
(
this
);
...
@@ -9,7 +9,7 @@ AccelCalibrationConfig::AccelCalibrationConfig(QWidget *parent) : QWidget(parent
...
@@ -9,7 +9,7 @@ AccelCalibrationConfig::AccelCalibrationConfig(QWidget *parent) : QWidget(parent
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
activeUASSet
(
UASInterface
*
)));
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
activeUASSet
(
UASInterface
*
)));
activeUASSet
(
UASManager
::
instance
()
->
getActiveUAS
());
activeUASSet
(
UASManager
::
instance
()
->
getActiveUAS
());
accelAckCount
=
0
;
m_
accelAckCount
=
0
;
}
}
AccelCalibrationConfig
::~
AccelCalibrationConfig
()
AccelCalibrationConfig
::~
AccelCalibrationConfig
()
...
@@ -17,42 +17,48 @@ AccelCalibrationConfig::~AccelCalibrationConfig()
...
@@ -17,42 +17,48 @@ AccelCalibrationConfig::~AccelCalibrationConfig()
}
}
void
AccelCalibrationConfig
::
activeUASSet
(
UASInterface
*
uas
)
void
AccelCalibrationConfig
::
activeUASSet
(
UASInterface
*
uas
)
{
{
if
(
!
uas
)
if
(
m_
uas
)
{
{
return
;
disconnect
(
m_uas
,
SIGNAL
(
textMessageReceived
(
int
,
int
,
int
,
QString
)),
this
,
SLOT
(
uasTextMessageReceived
(
int
,
int
,
int
,
QString
)))
;
}
}
if
(
m_uas
)
AP2ConfigWidget
::
activeUASSet
(
uas
);
if
(
!
uas
)
{
{
return
;
}
}
m_uas
=
uas
;
connect
(
m_uas
,
SIGNAL
(
textMessageReceived
(
int
,
int
,
int
,
QString
)),
this
,
SLOT
(
uasTextMessageReceived
(
int
,
int
,
int
,
QString
)));
connect
(
m_uas
,
SIGNAL
(
textMessageReceived
(
int
,
int
,
int
,
QString
)),
this
,
SLOT
(
uasTextMessageReceived
(
int
,
int
,
int
,
QString
)));
}
}
void
AccelCalibrationConfig
::
calibrateButtonClicked
()
void
AccelCalibrationConfig
::
calibrateButtonClicked
()
{
{
if
(
accelAckCount
==
0
)
if
(
!
m_uas
)
{
showNullMAVErrorMessageBox
();
return
;
}
if
(
m_accelAckCount
==
0
)
{
{
MAV_CMD
command
=
MAV_CMD_PREFLIGHT_CALIBRATION
;
MAV_CMD
command
=
MAV_CMD_PREFLIGHT_CALIBRATION
;
int
confirm
=
0
;
int
confirm
=
0
;
float
param1
=
0
;
float
param1
=
0
.0
;
float
param2
=
0
;
float
param2
=
0
.0
;
float
param3
=
0
;
float
param3
=
0
.0
;
float
param4
=
0
;
float
param4
=
0
.0
;
float
param5
=
1
;
float
param5
=
1
.0
;
float
param6
=
0
;
float
param6
=
0
.0
;
float
param7
=
0
;
float
param7
=
0
.0
;
int
component
=
1
;
int
component
=
1
;
m_uas
->
executeCommand
(
command
,
confirm
,
param1
,
param2
,
param3
,
param4
,
param5
,
param6
,
param7
,
component
);
m_uas
->
executeCommand
(
command
,
confirm
,
param1
,
param2
,
param3
,
param4
,
param5
,
param6
,
param7
,
component
);
}
}
else
if
(
accelAckCount
<=
5
)
else
if
(
m_
accelAckCount
<=
5
)
{
{
m_uas
->
executeCommandAck
(
accelAckCount
++
,
true
);
m_uas
->
executeCommandAck
(
m_
accelAckCount
++
,
true
);
}
}
else
else
{
{
m_uas
->
executeCommandAck
(
accelAckCount
++
,
true
);
m_uas
->
executeCommandAck
(
m_
accelAckCount
++
,
true
);
ui
.
calibrateAccelButton
->
setText
(
"Calibrate
\n
Accelerometer"
);
ui
.
calibrateAccelButton
->
setText
(
"Calibrate
\n
Accelerometer"
);
//accelAckCount = 0;
}
}
}
}
...
@@ -63,24 +69,24 @@ void AccelCalibrationConfig::uasTextMessageReceived(int uasid, int componentid,
...
@@ -63,24 +69,24 @@ void AccelCalibrationConfig::uasTextMessageReceived(int uasid, int componentid,
if
(
severity
==
5
)
if
(
severity
==
5
)
{
{
//This is a calibration instruction
//This is a calibration instruction
if
(
accelAckCount
==
0
)
if
(
m_
accelAckCount
==
0
)
{
{
//Calibration Sucessful\r"
//Calibration Sucessful\r"
ui
.
calibrateAccelButton
->
setText
(
"Any
\n
Key"
);
ui
.
calibrateAccelButton
->
setText
(
"Any
\n
Key"
);
accelAckCount
++
;
m_
accelAckCount
++
;
}
}
if
(
accelAckCount
==
7
)
if
(
m_
accelAckCount
==
7
)
{
{
//All finished
//All finished
//ui.outputLabel->setText(ui.outputLabel->text() + "\n" + text);
//ui.outputLabel->setText(ui.outputLabel->text() + "\n" + text);
ui
.
outputLabel
->
setText
(
text
);
ui
.
outputLabel
->
setText
(
text
);
accelAckCount
++
;
m_
accelAckCount
++
;
}
}
if
(
accelAckCount
==
8
)
if
(
m_
accelAckCount
==
8
)
{
{
if
(
text
.
contains
(
"Calibration"
)
&&
text
.
contains
(
"successful"
))
if
(
text
.
contains
(
"Calibration"
)
&&
text
.
contains
(
"successful"
))
{
{
accelAckCount
=
0
;
m_
accelAckCount
=
0
;
}
}
ui
.
outputLabel
->
setText
(
ui
.
outputLabel
->
text
()
+
"
\n
"
+
text
);
ui
.
outputLabel
->
setText
(
ui
.
outputLabel
->
text
()
+
"
\n
"
+
text
);
}
}
...
...
src/ui/configuration/AccelCalibrationConfig.h
View file @
31a118ce
...
@@ -5,7 +5,9 @@
...
@@ -5,7 +5,9 @@
#include "ui_AccelCalibrationConfig.h"
#include "ui_AccelCalibrationConfig.h"
#include "UASManager.h"
#include "UASManager.h"
#include "UASInterface.h"
#include "UASInterface.h"
class
AccelCalibrationConfig
:
public
QWidget
#include "AP2ConfigWidget.h"
class
AccelCalibrationConfig
:
public
AP2ConfigWidget
{
{
Q_OBJECT
Q_OBJECT
...
@@ -17,7 +19,7 @@ private slots:
...
@@ -17,7 +19,7 @@ private slots:
void
calibrateButtonClicked
();
void
calibrateButtonClicked
();
void
uasTextMessageReceived
(
int
uasid
,
int
componentid
,
int
severity
,
QString
text
);
void
uasTextMessageReceived
(
int
uasid
,
int
componentid
,
int
severity
,
QString
text
);
private:
private:
int
accelAckCount
;
int
m_
accelAckCount
;
Ui
::
AccelCalibrationConfig
ui
;
Ui
::
AccelCalibrationConfig
ui
;
UASInterface
*
m_uas
;
UASInterface
*
m_uas
;
};
};
...
...
src/ui/configuration/AdvParameterList.cc
View file @
31a118ce
...
@@ -7,8 +7,6 @@ AdvParameterList::AdvParameterList(QWidget *parent) : AP2ConfigWidget(parent)
...
@@ -7,8 +7,6 @@ AdvParameterList::AdvParameterList(QWidget *parent) : AP2ConfigWidget(parent)
ui
.
tableWidget
->
setColumnCount
(
4
);
ui
.
tableWidget
->
setColumnCount
(
4
);
ui
.
tableWidget
->
horizontalHeader
()
->
hide
();
ui
.
tableWidget
->
horizontalHeader
()
->
hide
();
ui
.
tableWidget
->
verticalHeader
()
->
hide
();
ui
.
tableWidget
->
verticalHeader
()
->
hide
();
//ui.tableWidget->setHorizontalHeader(0);
//ui.tableWidget->setVerticalHeader(0);
ui
.
tableWidget
->
setColumnWidth
(
0
,
200
);
ui
.
tableWidget
->
setColumnWidth
(
0
,
200
);
ui
.
tableWidget
->
setColumnWidth
(
1
,
100
);
ui
.
tableWidget
->
setColumnWidth
(
1
,
100
);
ui
.
tableWidget
->
setColumnWidth
(
2
,
200
);
ui
.
tableWidget
->
setColumnWidth
(
2
,
200
);
...
@@ -21,19 +19,19 @@ AdvParameterList::~AdvParameterList()
...
@@ -21,19 +19,19 @@ AdvParameterList::~AdvParameterList()
}
}
void
AdvParameterList
::
setParameterMetaData
(
QString
name
,
QString
humanname
,
QString
description
)
void
AdvParameterList
::
setParameterMetaData
(
QString
name
,
QString
humanname
,
QString
description
)
{
{
paramToNameMap
[
name
]
=
humanname
;
m_
paramToNameMap
[
name
]
=
humanname
;
paramToDescriptionMap
[
name
]
=
description
;
m_
paramToDescriptionMap
[
name
]
=
description
;
}
}
void
AdvParameterList
::
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
)
void
AdvParameterList
::
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
)
{
{
if
(
!
paramValueMap
.
contains
(
parameterName
))
if
(
!
m_
paramValueMap
.
contains
(
parameterName
))
{
{
ui
.
tableWidget
->
setRowCount
(
ui
.
tableWidget
->
rowCount
()
+
1
);
ui
.
tableWidget
->
setRowCount
(
ui
.
tableWidget
->
rowCount
()
+
1
);
if
(
paramToNameMap
.
contains
(
parameterName
))
if
(
m_
paramToNameMap
.
contains
(
parameterName
))
{
{
ui
.
tableWidget
->
setItem
(
ui
.
tableWidget
->
rowCount
()
-
1
,
0
,
new
QTableWidgetItem
(
paramToNameMap
[
parameterName
]));
ui
.
tableWidget
->
setItem
(
ui
.
tableWidget
->
rowCount
()
-
1
,
0
,
new
QTableWidgetItem
(
m_
paramToNameMap
[
parameterName
]));
}
}
else
else
{
{
...
@@ -41,15 +39,15 @@ void AdvParameterList::parameterChanged(int uas, int component, QString paramete
...
@@ -41,15 +39,15 @@ void AdvParameterList::parameterChanged(int uas, int component, QString paramete
}
}
ui
.
tableWidget
->
setItem
(
ui
.
tableWidget
->
rowCount
()
-
1
,
1
,
new
QTableWidgetItem
(
QString
::
number
(
value
.
toFloat
(),
'f'
,
2
)));
ui
.
tableWidget
->
setItem
(
ui
.
tableWidget
->
rowCount
()
-
1
,
1
,
new
QTableWidgetItem
(
QString
::
number
(
value
.
toFloat
(),
'f'
,
2
)));
ui
.
tableWidget
->
setItem
(
ui
.
tableWidget
->
rowCount
()
-
1
,
2
,
new
QTableWidgetItem
(
parameterName
));
ui
.
tableWidget
->
setItem
(
ui
.
tableWidget
->
rowCount
()
-
1
,
2
,
new
QTableWidgetItem
(
parameterName
));
if
(
paramToDescriptionMap
.
contains
(
parameterName
))
if
(
m_
paramToDescriptionMap
.
contains
(
parameterName
))
{
{
ui
.
tableWidget
->
setItem
(
ui
.
tableWidget
->
rowCount
()
-
1
,
3
,
new
QTableWidgetItem
(
paramToDescriptionMap
[
parameterName
]));
ui
.
tableWidget
->
setItem
(
ui
.
tableWidget
->
rowCount
()
-
1
,
3
,
new
QTableWidgetItem
(
m_
paramToDescriptionMap
[
parameterName
]));
}
}
else
else
{
{
ui
.
tableWidget
->
setItem
(
ui
.
tableWidget
->
rowCount
()
-
1
,
3
,
new
QTableWidgetItem
(
"Unknown"
));
ui
.
tableWidget
->
setItem
(
ui
.
tableWidget
->
rowCount
()
-
1
,
3
,
new
QTableWidgetItem
(
"Unknown"
));
}
}
paramValueMap
[
parameterName
]
=
ui
.
tableWidget
->
item
(
ui
.
tableWidget
->
rowCount
()
-
1
,
1
);
m_
paramValueMap
[
parameterName
]
=
ui
.
tableWidget
->
item
(
ui
.
tableWidget
->
rowCount
()
-
1
,
1
);
}
}
paramValueMap
[
parameterName
]
->
setText
(
QString
::
number
(
value
.
toFloat
(),
'f'
,
2
));
m_
paramValueMap
[
parameterName
]
->
setText
(
QString
::
number
(
value
.
toFloat
(),
'f'
,
2
));
}
}
src/ui/configuration/AdvParameterList.h
View file @
31a118ce
...
@@ -16,9 +16,9 @@ public:
...
@@ -16,9 +16,9 @@ public:
private
slots
:
private
slots
:
void
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
);
void
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
);
private:
private:
QMap
<
QString
,
QTableWidgetItem
*>
paramValueMap
;
QMap
<
QString
,
QTableWidgetItem
*>
m_
paramValueMap
;
QMap
<
QString
,
QString
>
paramToNameMap
;
QMap
<
QString
,
QString
>
m_
paramToNameMap
;
QMap
<
QString
,
QString
>
paramToDescriptionMap
;
QMap
<
QString
,
QString
>
m_
paramToDescriptionMap
;
Ui
::
AdvParameterList
ui
;
Ui
::
AdvParameterList
ui
;
};
};
...
...
src/ui/configuration/AdvancedParamConfig.cc
View file @
31a118ce
...
@@ -12,7 +12,7 @@ AdvancedParamConfig::~AdvancedParamConfig()
...
@@ -12,7 +12,7 @@ AdvancedParamConfig::~AdvancedParamConfig()
void
AdvancedParamConfig
::
addRange
(
QString
title
,
QString
description
,
QString
param
,
double
min
,
double
max
)
void
AdvancedParamConfig
::
addRange
(
QString
title
,
QString
description
,
QString
param
,
double
min
,
double
max
)
{
{
ParamWidget
*
widget
=
new
ParamWidget
(
ui
.
scrollAreaWidgetContents
);
ParamWidget
*
widget
=
new
ParamWidget
(
ui
.
scrollAreaWidgetContents
);
paramToWidgetMap
[
param
]
=
widget
;
m_
paramToWidgetMap
[
param
]
=
widget
;
widget
->
setupDouble
(
title
+
"("
+
param
+
")"
,
description
,
0
,
min
,
max
);
widget
->
setupDouble
(
title
+
"("
+
param
+
")"
,
description
,
0
,
min
,
max
);
ui
.
verticalLayout
->
addWidget
(
widget
);
ui
.
verticalLayout
->
addWidget
(
widget
);
widget
->
show
();
widget
->
show
();
...
@@ -21,15 +21,15 @@ void AdvancedParamConfig::addRange(QString title,QString description,QString par
...
@@ -21,15 +21,15 @@ void AdvancedParamConfig::addRange(QString title,QString description,QString par
void
AdvancedParamConfig
::
addCombo
(
QString
title
,
QString
description
,
QString
param
,
QList
<
QPair
<
int
,
QString
>
>
valuelist
)
void
AdvancedParamConfig
::
addCombo
(
QString
title
,
QString
description
,
QString
param
,
QList
<
QPair
<
int
,
QString
>
>
valuelist
)
{
{
ParamWidget
*
widget
=
new
ParamWidget
(
ui
.
scrollAreaWidgetContents
);
ParamWidget
*
widget
=
new
ParamWidget
(
ui
.
scrollAreaWidgetContents
);
paramToWidgetMap
[
param
]
=
widget
;
m_
paramToWidgetMap
[
param
]
=
widget
;
widget
->
setupCombo
(
title
+
"("
+
param
+
")"
,
description
,
valuelist
);
widget
->
setupCombo
(
title
+
"("
+
param
+
")"
,
description
,
valuelist
);
ui
.
verticalLayout
->
addWidget
(
widget
);
ui
.
verticalLayout
->
addWidget
(
widget
);
widget
->
show
();
widget
->
show
();
}
}
void
AdvancedParamConfig
::
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
)
void
AdvancedParamConfig
::
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
)
{
{
if
(
paramToWidgetMap
.
contains
(
parameterName
))
if
(
m_
paramToWidgetMap
.
contains
(
parameterName
))
{
{
paramToWidgetMap
[
parameterName
]
->
setValue
(
value
.
toDouble
());
m_
paramToWidgetMap
[
parameterName
]
->
setValue
(
value
.
toDouble
());
}
}
}
}
src/ui/configuration/AdvancedParamConfig.h
View file @
31a118ce
...
@@ -17,7 +17,7 @@ public:
...
@@ -17,7 +17,7 @@ public:
private
slots
:
private
slots
:
void
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
);
void
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
);
private:
private:
QMap
<
QString
,
ParamWidget
*>
paramToWidgetMap
;
QMap
<
QString
,
ParamWidget
*>
m_
paramToWidgetMap
;
Ui
::
AdvancedParamConfig
ui
;
Ui
::
AdvancedParamConfig
ui
;
};
};
...
...
src/ui/configuration/AirspeedConfig.cc
View file @
31a118ce
...
@@ -51,7 +51,7 @@ void AirspeedConfig::useCheckBoxClicked(bool checked)
...
@@ -51,7 +51,7 @@ void AirspeedConfig::useCheckBoxClicked(bool checked)
{
{
if
(
!
m_uas
)
if
(
!
m_uas
)
{
{
QMessageBox
::
information
(
0
,
tr
(
"Error"
),
tr
(
"Please connect to a MAV before attempting to set configuration"
)
);
showNullMAVErrorMessageBox
(
);
return
;
return
;
}
}
if
(
checked
)
if
(
checked
)
...
@@ -68,7 +68,7 @@ void AirspeedConfig::enableCheckBoxClicked(bool checked)
...
@@ -68,7 +68,7 @@ void AirspeedConfig::enableCheckBoxClicked(bool checked)
{
{
if
(
!
m_uas
)
if
(
!
m_uas
)
{
{
QMessageBox
::
information
(
0
,
tr
(
"Error"
),
tr
(
"Please connect to a MAV before attempting to set configuration"
)
);
showNullMAVErrorMessageBox
(
);
return
;
return
;
}
}
if
(
checked
)
if
(
checked
)
...
...
src/ui/configuration/ApmHardwareConfig.cc
View file @
31a118ce
...
@@ -62,73 +62,73 @@ ApmHardwareConfig::ApmHardwareConfig(QWidget *parent) : QWidget(parent)
...
@@ -62,73 +62,73 @@ ApmHardwareConfig::ApmHardwareConfig(QWidget *parent) : QWidget(parent)
QWidget
*
widget
=
new
QWidget
(
this
);
QWidget
*
widget
=
new
QWidget
(
this
);
ui
.
stackedWidget
->
addWidget
(
widget
);
//Firmware placeholder.
ui
.
stackedWidget
->
addWidget
(
widget
);
//Firmware placeholder.
buttonToConfigWidgetMap
[
ui
.
firmwareButton
]
=
widget
;
m_
buttonToConfigWidgetMap
[
ui
.
firmwareButton
]
=
widget
;
connect
(
ui
.
firmwareButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
connect
(
ui
.
firmwareButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
frameConfig
=
new
FrameTypeConfig
(
this
);
m_
frameConfig
=
new
FrameTypeConfig
(
this
);
ui
.
stackedWidget
->
addWidget
(
frameConfig
);
ui
.
stackedWidget
->
addWidget
(
m_
frameConfig
);
buttonToConfigWidgetMap
[
ui
.
frameTypeButton
]
=
frameConfig
;
m_buttonToConfigWidgetMap
[
ui
.
frameTypeButton
]
=
m_
frameConfig
;
connect
(
ui
.
frameTypeButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
connect
(
ui
.
frameTypeButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
compassConfig
=
new
CompassConfig
(
this
);
m_
compassConfig
=
new
CompassConfig
(
this
);
ui
.
stackedWidget
->
addWidget
(
compassConfig
);
ui
.
stackedWidget
->
addWidget
(
m_
compassConfig
);
buttonToConfigWidgetMap
[
ui
.
compassButton
]
=
compassConfig
;
m_buttonToConfigWidgetMap
[
ui
.
compassButton
]
=
m_
compassConfig
;
connect
(
ui
.
compassButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
connect
(
ui
.
compassButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
accelConfig
=
new
AccelCalibrationConfig
(
this
);
m_
accelConfig
=
new
AccelCalibrationConfig
(
this
);
ui
.
stackedWidget
->
addWidget
(
accelConfig
);
ui
.
stackedWidget
->
addWidget
(
m_
accelConfig
);
buttonToConfigWidgetMap
[
ui
.
accelCalibrateButton
]
=
accelConfig
;
m_buttonToConfigWidgetMap
[
ui
.
accelCalibrateButton
]
=
m_
accelConfig
;
connect
(
ui
.
accelCalibrateButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
connect
(
ui
.
accelCalibrateButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
planeLevel
=
new
ApmPlaneLevel
(
this
);
m_
planeLevel
=
new
ApmPlaneLevel
(
this
);
ui
.
stackedWidget
->
addWidget
(
planeLevel
);
ui
.
stackedWidget
->
addWidget
(
m_
planeLevel
);
buttonToConfigWidgetMap
[
ui
.
arduPlaneLevelButton
]
=
planeLevel
;
m_buttonToConfigWidgetMap
[
ui
.
arduPlaneLevelButton
]
=
m_
planeLevel
;
connect
(
ui
.
arduPlaneLevelButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
connect
(
ui
.
arduPlaneLevelButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
radioConfig
=
new
RadioCalibrationConfig
(
this
);
m_
radioConfig
=
new
RadioCalibrationConfig
(
this
);
ui
.
stackedWidget
->
addWidget
(
radioConfig
);
ui
.
stackedWidget
->
addWidget
(
m_
radioConfig
);
buttonToConfigWidgetMap
[
ui
.
radioCalibrateButton
]
=
radioConfig
;
m_buttonToConfigWidgetMap
[
ui
.
radioCalibrateButton
]
=
m_
radioConfig
;
connect
(
ui
.
radioCalibrateButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
connect
(
ui
.
radioCalibrateButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
radio3drConfig
=
new
Radio3DRConfig
(
this
);
m_
radio3drConfig
=
new
Radio3DRConfig
(
this
);
ui
.
stackedWidget
->
addWidget
(
radio3drConfig
);
ui
.
stackedWidget
->
addWidget
(
m_
radio3drConfig
);
buttonToConfigWidgetMap
[
ui
.
radio3DRButton
]
=
radio3drConfig
;
m_buttonToConfigWidgetMap
[
ui
.
radio3DRButton
]
=
m_
radio3drConfig
;
connect
(
ui
.
radio3DRButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
connect
(
ui
.
radio3DRButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
batteryConfig
=
new
BatteryMonitorConfig
(
this
);
m_
batteryConfig
=
new
BatteryMonitorConfig
(
this
);
ui
.
stackedWidget
->
addWidget
(
batteryConfig
);
ui
.
stackedWidget
->
addWidget
(
m_
batteryConfig
);
buttonToConfigWidgetMap
[
ui
.
batteryMonitorButton
]
=
batteryConfig
;
m_buttonToConfigWidgetMap
[
ui
.
batteryMonitorButton
]
=
m_
batteryConfig
;
connect
(
ui
.
batteryMonitorButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
connect
(
ui
.
batteryMonitorButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
sonarConfig
=
new
SonarConfig
(
this
);
m_
sonarConfig
=
new
SonarConfig
(
this
);
ui
.
stackedWidget
->
addWidget
(
sonarConfig
);
ui
.
stackedWidget
->
addWidget
(
m_
sonarConfig
);
buttonToConfigWidgetMap
[
ui
.
sonarButton
]
=
sonarConfig
;
m_buttonToConfigWidgetMap
[
ui
.
sonarButton
]
=
m_
sonarConfig
;
connect
(
ui
.
sonarButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
connect
(
ui
.
sonarButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
airspeedConfig
=
new
AirspeedConfig
(
this
);
m_
airspeedConfig
=
new
AirspeedConfig
(
this
);
ui
.
stackedWidget
->
addWidget
(
airspeedConfig
);
ui
.
stackedWidget
->
addWidget
(
m_
airspeedConfig
);
buttonToConfigWidgetMap
[
ui
.
airspeedButton
]
=
airspeedConfig
;
m_buttonToConfigWidgetMap
[
ui
.
airspeedButton
]
=
m_
airspeedConfig
;
connect
(
ui
.
airspeedButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
connect
(
ui
.
airspeedButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
opticalFlowConfig
=
new
OpticalFlowConfig
(
this
);
m_
opticalFlowConfig
=
new
OpticalFlowConfig
(
this
);
ui
.
stackedWidget
->
addWidget
(
opticalFlowConfig
);
ui
.
stackedWidget
->
addWidget
(
m_
opticalFlowConfig
);
buttonToConfigWidgetMap
[
ui
.
opticalFlowButton
]
=
opticalFlowConfig
;
m_buttonToConfigWidgetMap
[
ui
.
opticalFlowButton
]
=
m_
opticalFlowConfig
;
connect
(
ui
.
opticalFlowButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
connect
(
ui
.
opticalFlowButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
osdConfig
=
new
OsdConfig
(
this
);
m_
osdConfig
=
new
OsdConfig
(
this
);
ui
.
stackedWidget
->
addWidget
(
osdConfig
);
ui
.
stackedWidget
->
addWidget
(
m_
osdConfig
);
buttonToConfigWidgetMap
[
ui
.
osdButton
]
=
osdConfig
;
m_buttonToConfigWidgetMap
[
ui
.
osdButton
]
=
m_
osdConfig
;
connect
(
ui
.
osdButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
connect
(
ui
.
osdButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
cameraGimbalConfig
=
new
CameraGimbalConfig
(
this
);
m_
cameraGimbalConfig
=
new
CameraGimbalConfig
(
this
);
ui
.
stackedWidget
->
addWidget
(
cameraGimbalConfig
);
ui
.
stackedWidget
->
addWidget
(
m_
cameraGimbalConfig
);
buttonToConfigWidgetMap
[
ui
.
cameraGimbalButton
]
=
cameraGimbalConfig
;
m_buttonToConfigWidgetMap
[
ui
.
cameraGimbalButton
]
=
m_
cameraGimbalConfig
;
connect
(
ui
.
cameraGimbalButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
connect
(
ui
.
cameraGimbalButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
antennaTrackerConfig
=
new
AntennaTrackerConfig
(
this
);
m_
antennaTrackerConfig
=
new
AntennaTrackerConfig
(
this
);
ui
.
stackedWidget
->
addWidget
(
antennaTrackerConfig
);
ui
.
stackedWidget
->
addWidget
(
m_
antennaTrackerConfig
);
buttonToConfigWidgetMap
[
ui
.
antennaTrackerButton
]
=
antennaTrackerConfig
;
m_buttonToConfigWidgetMap
[
ui
.
antennaTrackerButton
]
=
m_
antennaTrackerConfig
;
connect
(
ui
.
antennaTrackerButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
connect
(
ui
.
antennaTrackerButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
activeUASSet
(
UASInterface
*
)));
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
activeUASSet
(
UASInterface
*
)));
...
@@ -139,9 +139,9 @@ ApmHardwareConfig::ApmHardwareConfig(QWidget *parent) : QWidget(parent)
...
@@ -139,9 +139,9 @@ ApmHardwareConfig::ApmHardwareConfig(QWidget *parent) : QWidget(parent)
}
}
void
ApmHardwareConfig
::
activateStackedWidget
()
void
ApmHardwareConfig
::
activateStackedWidget
()
{
{
if
(
buttonToConfigWidgetMap
.
contains
(
sender
()))
if
(
m_
buttonToConfigWidgetMap
.
contains
(
sender
()))
{
{
ui
.
stackedWidget
->
setCurrentWidget
(
buttonToConfigWidgetMap
[
sender
()]);
ui
.
stackedWidget
->
setCurrentWidget
(
m_
buttonToConfigWidgetMap
[
sender
()]);
}
}
}
}
...
...
src/ui/configuration/ApmHardwareConfig.h
View file @
31a118ce
...
@@ -58,20 +58,20 @@ public:
...
@@ -58,20 +58,20 @@ public:
explicit
ApmHardwareConfig
(
QWidget
*
parent
=
0
);
explicit
ApmHardwareConfig
(
QWidget
*
parent
=
0
);
~
ApmHardwareConfig
();
~
ApmHardwareConfig
();
private:
private:
FrameTypeConfig
*
frameConfig
;
FrameTypeConfig
*
m_
frameConfig
;
CompassConfig
*
compassConfig
;
CompassConfig
*
m_
compassConfig
;
AccelCalibrationConfig
*
accelConfig
;
AccelCalibrationConfig
*
m_
accelConfig
;
RadioCalibrationConfig
*
radioConfig
;
RadioCalibrationConfig
*
m_
radioConfig
;
Radio3DRConfig
*
radio3drConfig
;
Radio3DRConfig
*
m_
radio3drConfig
;
BatteryMonitorConfig
*
batteryConfig
;
BatteryMonitorConfig
*
m_
batteryConfig
;
SonarConfig
*
sonarConfig
;
SonarConfig
*
m_
sonarConfig
;
AirspeedConfig
*
airspeedConfig
;
AirspeedConfig
*
m_
airspeedConfig
;
OpticalFlowConfig
*
opticalFlowConfig
;
OpticalFlowConfig
*
m_
opticalFlowConfig
;
OsdConfig
*
osdConfig
;
OsdConfig
*
m_
osdConfig
;
CameraGimbalConfig
*
cameraGimbalConfig
;
CameraGimbalConfig
*
m_
cameraGimbalConfig
;
AntennaTrackerConfig
*
antennaTrackerConfig
;
AntennaTrackerConfig
*
m_
antennaTrackerConfig
;
ApmPlaneLevel
*
planeLevel
;
ApmPlaneLevel
*
m_
planeLevel
;
private
slots
:
private
slots
:
void
activeUASSet
(
UASInterface
*
uas
);
void
activeUASSet
(
UASInterface
*
uas
);
void
activateStackedWidget
();
void
activateStackedWidget
();
...
@@ -79,7 +79,7 @@ private:
...
@@ -79,7 +79,7 @@ private:
Ui
::
ApmHardwareConfig
ui
;
Ui
::
ApmHardwareConfig
ui
;
//This is a map between the buttons, and the widgets they should be displying
//This is a map between the buttons, and the widgets they should be displying
QMap
<
QObject
*
,
QWidget
*>
buttonToConfigWidgetMap
;
QMap
<
QObject
*
,
QWidget
*>
m_
buttonToConfigWidgetMap
;
};
};
#endif // APMHARDWARECONFIG_H
#endif // APMHARDWARECONFIG_H
src/ui/configuration/ApmPlaneLevel.cc
View file @
31a118ce
...
@@ -13,16 +13,21 @@ ApmPlaneLevel::~ApmPlaneLevel()
...
@@ -13,16 +13,21 @@ ApmPlaneLevel::~ApmPlaneLevel()
}
}
void
ApmPlaneLevel
::
levelClicked
()
void
ApmPlaneLevel
::
levelClicked
()
{
{
if
(
!
m_uas
)
{
showNullMAVErrorMessageBox
();
return
;
}
QMessageBox
::
information
(
0
,
"Warning"
,
"Be sure the plane is completly level, then click ok"
);
QMessageBox
::
information
(
0
,
"Warning"
,
"Be sure the plane is completly level, then click ok"
);
MAV_CMD
command
=
MAV_CMD_PREFLIGHT_CALIBRATION
;
MAV_CMD
command
=
MAV_CMD_PREFLIGHT_CALIBRATION
;
int
confirm
=
0
;
int
confirm
=
0
;
float
param1
=
1
;
float
param1
=
1
.0
;
float
param2
=
0
;
float
param2
=
0
.0
;
float
param3
=
1
;
float
param3
=
1
.0
;
float
param4
=
0
;
float
param4
=
0
.0
;
float
param5
=
0
;
float
param5
=
0
.0
;
float
param6
=
0
;
float
param6
=
0
.0
;
float
param7
=
0
;
float
param7
=
0
.0
;
int
component
=
1
;
int
component
=
1
;
m_uas
->
executeCommand
(
command
,
confirm
,
param1
,
param2
,
param3
,
param4
,
param5
,
param6
,
param7
,
component
);
m_uas
->
executeCommand
(
command
,
confirm
,
param1
,
param2
,
param3
,
param4
,
param5
,
param6
,
param7
,
component
);
QMessageBox
::
information
(
0
,
"Warning"
,
"Leveling completed"
);
QMessageBox
::
information
(
0
,
"Warning"
,
"Leveling completed"
);
...
@@ -32,6 +37,7 @@ void ApmPlaneLevel::manualCheckBoxToggled(bool checked)
...
@@ -32,6 +37,7 @@ void ApmPlaneLevel::manualCheckBoxToggled(bool checked)
{
{
if
(
!
m_uas
)
if
(
!
m_uas
)
{
{
showNullMAVErrorMessageBox
();
return
;
return
;
}
}
if
(
checked
)
if
(
checked
)
...
...
src/ui/configuration/ApmSoftwareConfig.cc
View file @
31a118ce
#include "ApmSoftwareConfig.h"
#include <QXmlStreamReader>
#include <QXmlStreamReader>
#include <QDir>
#include <QDir>
#include <QFile>
#include <QFile>
#include "ApmSoftwareConfig.h"
ApmSoftwareConfig
::
ApmSoftwareConfig
(
QWidget
*
parent
)
:
QWidget
(
parent
)
ApmSoftwareConfig
::
ApmSoftwareConfig
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
{
...
@@ -17,51 +18,48 @@ ApmSoftwareConfig::ApmSoftwareConfig(QWidget *parent) : QWidget(parent)
...
@@ -17,51 +18,48 @@ ApmSoftwareConfig::ApmSoftwareConfig(QWidget *parent) : QWidget(parent)
ui
.
arduRoverPidButton
->
setVisible
(
false
);
ui
.
arduRoverPidButton
->
setVisible
(
false
);
ui
.
arduPlanePidButton
->
setVisible
(
false
);
ui
.
arduPlanePidButton
->
setVisible
(
false
);
flightConfig
=
new
FlightModeConfig
(
this
);
m_
flightConfig
=
new
FlightModeConfig
(
this
);
ui
.
stackedWidget
->
addWidget
(
flightConfig
);
ui
.
stackedWidget
->
addWidget
(
m_
flightConfig
);
buttonToConfigWidgetMap
[
ui
.
flightModesButton
]
=
flightConfig
;
m_buttonToConfigWidgetMap
[
ui
.
flightModesButton
]
=
m_
flightConfig
;
connect
(
ui
.
flightModesButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
connect
(
ui
.
flightModesButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
standardParamConfig
=
new
StandardParamConfig
(
this
);
m_
standardParamConfig
=
new
StandardParamConfig
(
this
);
ui
.
stackedWidget
->
addWidget
(
standardParamConfig
);
ui
.
stackedWidget
->
addWidget
(
m_
standardParamConfig
);
buttonToConfigWidgetMap
[
ui
.
standardParamButton
]
=
standardParamConfig
;
m_buttonToConfigWidgetMap
[
ui
.
standardParamButton
]
=
m_
standardParamConfig
;
connect
(
ui
.
standardParamButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
connect
(
ui
.
standardParamButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
failSafeConfig
=
new
FailSafeConfig
(
this
);
m_
failSafeConfig
=
new
FailSafeConfig
(
this
);
ui
.
stackedWidget
->
addWidget
(
failSafeConfig
);
ui
.
stackedWidget
->
addWidget
(
m_
failSafeConfig
);
buttonToConfigWidgetMap
[
ui
.
failSafeButton
]
=
failSafeConfig
;
m_buttonToConfigWidgetMap
[
ui
.
failSafeButton
]
=
m_
failSafeConfig
;
connect
(
ui
.
failSafeButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
connect
(
ui
.
failSafeButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
advancedParamConfig
=
new
AdvancedParamConfig
(
this
);
m_
advancedParamConfig
=
new
AdvancedParamConfig
(
this
);
ui
.
stackedWidget
->
addWidget
(
advancedParamConfig
);
ui
.
stackedWidget
->
addWidget
(
m_
advancedParamConfig
);
buttonToConfigWidgetMap
[
ui
.
advancedParamButton
]
=
advancedParamConfig
;
m_buttonToConfigWidgetMap
[
ui
.
advancedParamButton
]
=
m_
advancedParamConfig
;
connect
(
ui
.
advancedParamButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
connect
(
ui
.
advancedParamButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
advParameterList
=
new
AdvParameterList
(
this
);
m_
advParameterList
=
new
AdvParameterList
(
this
);
ui
.
stackedWidget
->
addWidget
(
advParameterList
);
ui
.
stackedWidget
->
addWidget
(
m_
advParameterList
);
buttonToConfigWidgetMap
[
ui
.
advParamListButton
]
=
advParameterList
;
m_buttonToConfigWidgetMap
[
ui
.
advParamListButton
]
=
m_
advParameterList
;
connect
(
ui
.
advParamListButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
connect
(
ui
.
advParamListButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
arduCopterPidConfig
=
new
ArduCopterPidConfig
(
this
);
m_
arduCopterPidConfig
=
new
ArduCopterPidConfig
(
this
);
ui
.
stackedWidget
->
addWidget
(
arduCopterPidConfig
);
ui
.
stackedWidget
->
addWidget
(
m_
arduCopterPidConfig
);
buttonToConfigWidgetMap
[
ui
.
arduCopterPidButton
]
=
arduCopterPidConfig
;
m_buttonToConfigWidgetMap
[
ui
.
arduCopterPidButton
]
=
m_
arduCopterPidConfig
;
connect
(
ui
.
arduCopterPidButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
connect
(
ui
.
arduCopterPidButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
arduPlanePidConfig
=
new
ArduPlanePidConfig
(
this
);
m_
arduPlanePidConfig
=
new
ArduPlanePidConfig
(
this
);
ui
.
stackedWidget
->
addWidget
(
arduPlanePidConfig
);
ui
.
stackedWidget
->
addWidget
(
m_
arduPlanePidConfig
);
buttonToConfigWidgetMap
[
ui
.
arduPlanePidButton
]
=
arduPlanePidConfig
;
m_buttonToConfigWidgetMap
[
ui
.
arduPlanePidButton
]
=
m_
arduPlanePidConfig
;
connect
(
ui
.
arduPlanePidButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
connect
(
ui
.
arduPlanePidButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
arduRoverPidConfig
=
new
ArduRoverPidConfig
(
this
);
m_
arduRoverPidConfig
=
new
ArduRoverPidConfig
(
this
);
ui
.
stackedWidget
->
addWidget
(
arduRoverPidConfig
);
ui
.
stackedWidget
->
addWidget
(
m_
arduRoverPidConfig
);
buttonToConfigWidgetMap
[
ui
.
arduRoverPidButton
]
=
arduRoverPidConfig
;
m_buttonToConfigWidgetMap
[
ui
.
arduRoverPidButton
]
=
m_
arduRoverPidConfig
;
connect
(
ui
.
arduRoverPidButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
connect
(
ui
.
arduRoverPidButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
activeUASSet
(
UASInterface
*
)));
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
activeUASSet
(
UASInterface
*
)));
if
(
UASManager
::
instance
()
->
getActiveUAS
())
{
activeUASSet
(
UASManager
::
instance
()
->
getActiveUAS
());
activeUASSet
(
UASManager
::
instance
()
->
getActiveUAS
());
}
}
}
ApmSoftwareConfig
::~
ApmSoftwareConfig
()
ApmSoftwareConfig
::~
ApmSoftwareConfig
()
...
@@ -69,9 +67,9 @@ ApmSoftwareConfig::~ApmSoftwareConfig()
...
@@ -69,9 +67,9 @@ ApmSoftwareConfig::~ApmSoftwareConfig()
}
}
void
ApmSoftwareConfig
::
activateStackedWidget
()
void
ApmSoftwareConfig
::
activateStackedWidget
()
{
{
if
(
buttonToConfigWidgetMap
.
contains
(
sender
()))
if
(
m_
buttonToConfigWidgetMap
.
contains
(
sender
()))
{
{
ui
.
stackedWidget
->
setCurrentWidget
(
buttonToConfigWidgetMap
[
sender
()]);
ui
.
stackedWidget
->
setCurrentWidget
(
m_
buttonToConfigWidgetMap
[
sender
()]);
}
}
}
}
void
ApmSoftwareConfig
::
activeUASSet
(
UASInterface
*
uas
)
void
ApmSoftwareConfig
::
activeUASSet
(
UASInterface
*
uas
)
...
@@ -296,11 +294,6 @@ void ApmSoftwareConfig::activeUASSet(UASInterface *uas)
...
@@ -296,11 +294,6 @@ void ApmSoftwareConfig::activeUASSet(UASInterface *uas)
genset
[
"count"
]
=
genarraycount
;
genset
[
"count"
]
=
genarraycount
;
}
}
//Right here we have a single param in memory
//Right here we have a single param in memory
name
;
docs
;
valuemap
;
fieldmap
;
//standardParamConfig
if
(
valuemap
.
size
()
>
0
)
if
(
valuemap
.
size
()
>
0
)
{
{
QList
<
QPair
<
int
,
QString
>
>
valuelist
;
QList
<
QPair
<
int
,
QString
>
>
valuelist
;
...
@@ -310,13 +303,13 @@ void ApmSoftwareConfig::activeUASSet(UASInterface *uas)
...
@@ -310,13 +303,13 @@ void ApmSoftwareConfig::activeUASSet(UASInterface *uas)
}
}
if
(
tab
==
"Standard"
)
if
(
tab
==
"Standard"
)
{
{
standardParamConfig
->
addCombo
(
humanname
,
docs
,
name
,
valuelist
);
m_
standardParamConfig
->
addCombo
(
humanname
,
docs
,
name
,
valuelist
);
}
}
else
if
(
tab
==
"Advanced"
)
else
if
(
tab
==
"Advanced"
)
{
{
advancedParamConfig
->
addCombo
(
humanname
,
docs
,
name
,
valuelist
);
m_
advancedParamConfig
->
addCombo
(
humanname
,
docs
,
name
,
valuelist
);
}
}
advParameterList
->
setParameterMetaData
(
name
,
humanname
,
docs
);
m_
advParameterList
->
setParameterMetaData
(
name
,
humanname
,
docs
);
}
}
else
if
(
fieldmap
.
size
()
>
0
)
else
if
(
fieldmap
.
size
()
>
0
)
{
{
...
@@ -340,120 +333,23 @@ void ApmSoftwareConfig::activeUASSet(UASInterface *uas)
...
@@ -340,120 +333,23 @@ void ApmSoftwareConfig::activeUASSet(UASInterface *uas)
}
}
if
(
tab
==
"Standard"
)
if
(
tab
==
"Standard"
)
{
{
standardParamConfig
->
addRange
(
humanname
,
docs
,
name
,
min
,
max
);
m_
standardParamConfig
->
addRange
(
humanname
,
docs
,
name
,
min
,
max
);
}
}
else
if
(
tab
==
"Advanced"
)
else
if
(
tab
==
"Advanced"
)
{
{
advancedParamConfig
->
addRange
(
humanname
,
docs
,
name
,
max
,
min
);
m_
advancedParamConfig
->
addRange
(
humanname
,
docs
,
name
,
max
,
min
);
}
}
advParameterList
->
setParameterMetaData
(
name
,
humanname
,
docs
);
m_
advParameterList
->
setParameterMetaData
(
name
,
humanname
,
docs
);
}
}
}
}
xml
.
readNext
();
xml
.
readNext
();
}
}
if
(
genarraycount
>
0
)
{
/*
tool = new QGCToolWidget("", this);
tool->addUAS(mav);
tool->setTitle(parametersname);
tool->setObjectName(parametersname);
tool->setSettings(genset);
QList<QString> paramlist = tool->getParamList();
for (int i=0;i<paramlist.size();i++)
{
//Based on the airframe, we add the parameter to different categories.
if (parametersname == "ArduPlane") //MAV_TYPE_FIXED_WING FIXED_WING
{
systemTypeToParamMap["FIXED_WING"]->insert(paramlist[i],tool);
}
else if (parametersname == "ArduCopter") //MAV_TYPE_QUADROTOR "QUADROTOR
{
systemTypeToParamMap["QUADROTOR"]->insert(paramlist[i],tool);
}
else if (parametersname == "APMrover2") //MAV_TYPE_GROUND_ROVER GROUND_ROVER
{
systemTypeToParamMap["GROUND_ROVER"]->insert(paramlist[i],tool);
}
else
{
libParamToWidgetMap->insert(paramlist[i],tool);
}
}
toolWidgets.append(tool);
QGroupBox *box = new QGroupBox(this);
box->setTitle(tool->objectName());
box->setLayout(new QVBoxLayout());
box->layout()->addWidget(tool);
if (valuetype == "vehicles")
{
ui->leftGeneralLayout->addWidget(box);
}
else if (valuetype == "libraries")
{
ui->rightGeneralLayout->addWidget(box);
}
box->hide();
toolToBoxMap[tool] = box;*/
}
if
(
advarraycount
>
0
)
{
/*
tool = new QGCToolWidget("", this);
tool->addUAS(mav);
tool->setTitle(parametersname);
tool->setObjectName(parametersname);
tool->setSettings(advset);
QList<QString> paramlist = tool->getParamList();
for (int i=0;i<paramlist.size();i++)
{
//Based on the airframe, we add the parameter to different categories.
if (parametersname == "ArduPlane") //MAV_TYPE_FIXED_WING FIXED_WING
{
systemTypeToParamMap["FIXED_WING"]->insert(paramlist[i],tool);
}
else if (parametersname == "ArduCopter") //MAV_TYPE_QUADROTOR "QUADROTOR
{
systemTypeToParamMap["QUADROTOR"]->insert(paramlist[i],tool);
}
else if (parametersname == "APMrover2") //MAV_TYPE_GROUND_ROVER GROUND_ROVER
{
systemTypeToParamMap["GROUND_ROVER"]->insert(paramlist[i],tool);
}
else
{
libParamToWidgetMap->insert(paramlist[i],tool);
}
}
toolWidgets.append(tool);
QGroupBox *box = new QGroupBox(this);
box->setTitle(tool->objectName());
box->setLayout(new QVBoxLayout());
box->layout()->addWidget(tool);
if (valuetype == "vehicles")
{
ui->leftAdvancedLayout->addWidget(box);
}
else if (valuetype == "libraries")
{
ui->rightAdvancedLayout->addWidget(box);
}
box->hide();
toolToBoxMap[tool] = box;*/
}
}
}
xml
.
readNext
();
xml
.
readNext
();
}
}
}
}
xml
.
readNext
();
xml
.
readNext
();
}
}
}
}
...
...
src/ui/configuration/ApmSoftwareConfig.h
View file @
31a118ce
...
@@ -28,17 +28,17 @@ private slots:
...
@@ -28,17 +28,17 @@ private slots:
void
activeUASSet
(
UASInterface
*
uas
);
void
activeUASSet
(
UASInterface
*
uas
);
private:
private:
Ui
::
ApmSoftwareConfig
ui
;
Ui
::
ApmSoftwareConfig
ui
;
BasicPidConfig
*
basicPidConfig
;
BasicPidConfig
*
m_
basicPidConfig
;
FlightModeConfig
*
flightConfig
;
FlightModeConfig
*
m_
flightConfig
;
StandardParamConfig
*
standardParamConfig
;
StandardParamConfig
*
m_
standardParamConfig
;
GeoFenceConfig
*
geoFenceConfig
;
GeoFenceConfig
*
m_
geoFenceConfig
;
FailSafeConfig
*
failSafeConfig
;
FailSafeConfig
*
m_
failSafeConfig
;
AdvancedParamConfig
*
advancedParamConfig
;
AdvancedParamConfig
*
m_
advancedParamConfig
;
ArduCopterPidConfig
*
arduCopterPidConfig
;
ArduCopterPidConfig
*
m_
arduCopterPidConfig
;
ArduPlanePidConfig
*
arduPlanePidConfig
;
ArduPlanePidConfig
*
m_
arduPlanePidConfig
;
ArduRoverPidConfig
*
arduRoverPidConfig
;
ArduRoverPidConfig
*
m_
arduRoverPidConfig
;
AdvParameterList
*
advParameterList
;
AdvParameterList
*
m_
advParameterList
;
QMap
<
QObject
*
,
QWidget
*>
buttonToConfigWidgetMap
;
QMap
<
QObject
*
,
QWidget
*>
m_
buttonToConfigWidgetMap
;
};
};
#endif // APMSOFTWARECONFIG_H
#endif // APMSOFTWARECONFIG_H
src/ui/configuration/ArduCopterPidConfig.cc
View file @
31a118ce
...
@@ -3,126 +3,110 @@
...
@@ -3,126 +3,110 @@
ArduCopterPidConfig
::
ArduCopterPidConfig
(
QWidget
*
parent
)
:
AP2ConfigWidget
(
parent
)
ArduCopterPidConfig
::
ArduCopterPidConfig
(
QWidget
*
parent
)
:
AP2ConfigWidget
(
parent
)
{
{
ui
.
setupUi
(
this
);
ui
.
setupUi
(
this
);
nameToBoxMap
[
"STB_RLL_P"
]
=
ui
.
stabilPitchPSpinBox
;
m_
nameToBoxMap
[
"STB_RLL_P"
]
=
ui
.
stabilPitchPSpinBox
;
nameToBoxMap
[
"STB_PIT_P"
]
=
ui
.
stabilRollPSpinBox
;
m_
nameToBoxMap
[
"STB_PIT_P"
]
=
ui
.
stabilRollPSpinBox
;
nameToBoxMap
[
"STB_YAW_P"
]
=
ui
.
stabilYawPSpinBox
;
m_
nameToBoxMap
[
"STB_YAW_P"
]
=
ui
.
stabilYawPSpinBox
;
nameToBoxMap
[
"HLD_LAT_P"
]
=
ui
.
loiterPidPSpinBox
;
m_
nameToBoxMap
[
"HLD_LAT_P"
]
=
ui
.
loiterPidPSpinBox
;
nameToBoxMap
[
"RATE_RLL_P"
]
=
ui
.
rateRollPSpinBox
;
m_
nameToBoxMap
[
"RATE_RLL_P"
]
=
ui
.
rateRollPSpinBox
;
nameToBoxMap
[
"RATE_RLL_I"
]
=
ui
.
rateRollISpinBox
;
m_
nameToBoxMap
[
"RATE_RLL_I"
]
=
ui
.
rateRollISpinBox
;
nameToBoxMap
[
"RATE_RLL_D"
]
=
ui
.
rateRollDSpinBox
;
m_
nameToBoxMap
[
"RATE_RLL_D"
]
=
ui
.
rateRollDSpinBox
;
nameToBoxMap
[
"RATE_RLL_IMAX"
]
=
ui
.
rateRollIMAXSpinBox
;
m_
nameToBoxMap
[
"RATE_RLL_IMAX"
]
=
ui
.
rateRollIMAXSpinBox
;
nameToBoxMap
[
"RATE_PIT_P"
]
=
ui
.
ratePitchPSpinBox
;
m_
nameToBoxMap
[
"RATE_PIT_P"
]
=
ui
.
ratePitchPSpinBox
;
nameToBoxMap
[
"RATE_PIT_I"
]
=
ui
.
ratePitchISpinBox
;
m_
nameToBoxMap
[
"RATE_PIT_I"
]
=
ui
.
ratePitchISpinBox
;
nameToBoxMap
[
"RATE_PIT_D"
]
=
ui
.
ratePitchDSpinBox
;
m_
nameToBoxMap
[
"RATE_PIT_D"
]
=
ui
.
ratePitchDSpinBox
;
nameToBoxMap
[
"RATE_PIT_IMAX"
]
=
ui
.
ratePitchIMAXSpinBox
;
m_
nameToBoxMap
[
"RATE_PIT_IMAX"
]
=
ui
.
ratePitchIMAXSpinBox
;
nameToBoxMap
[
"RATE_YAW_P"
]
=
ui
.
rateYawPSpinBox
;
m_
nameToBoxMap
[
"RATE_YAW_P"
]
=
ui
.
rateYawPSpinBox
;
nameToBoxMap
[
"RATE_YAW_I"
]
=
ui
.
rateYawISpinBox
;
m_
nameToBoxMap
[
"RATE_YAW_I"
]
=
ui
.
rateYawISpinBox
;
nameToBoxMap
[
"RATE_YAW_D"
]
=
ui
.
rateYawDSpinBox
;
m_
nameToBoxMap
[
"RATE_YAW_D"
]
=
ui
.
rateYawDSpinBox
;
nameToBoxMap
[
"RATE_YAW_IMAX"
]
=
ui
.
rateYawIMAXSpinBox
;
m_
nameToBoxMap
[
"RATE_YAW_IMAX"
]
=
ui
.
rateYawIMAXSpinBox
;
nameToBoxMap
[
"LOITER_LAT_P"
]
=
ui
.
rateLoiterPSpinBox
;
m_
nameToBoxMap
[
"LOITER_LAT_P"
]
=
ui
.
rateLoiterPSpinBox
;
nameToBoxMap
[
"LOITER_LAT_I"
]
=
ui
.
rateLoiterISpinBox
;
m_
nameToBoxMap
[
"LOITER_LAT_I"
]
=
ui
.
rateLoiterISpinBox
;
nameToBoxMap
[
"LOITER_LAT_D"
]
=
ui
.
rateLoiterDSpinBox
;
m_
nameToBoxMap
[
"LOITER_LAT_D"
]
=
ui
.
rateLoiterDSpinBox
;
nameToBoxMap
[
"LOITER_LAT_IMAX"
]
=
ui
.
rateLoiterIMAXSpinBox
;
m_
nameToBoxMap
[
"LOITER_LAT_IMAX"
]
=
ui
.
rateLoiterIMAXSpinBox
;
nameToBoxMap
[
"THR_ACCEL_P"
]
=
ui
.
throttleAccelPSpinBox
;
m_
nameToBoxMap
[
"THR_ACCEL_P"
]
=
ui
.
throttleAccelPSpinBox
;
nameToBoxMap
[
"THR_ACCEL_I"
]
=
ui
.
throttleAccelISpinBox
;
m_
nameToBoxMap
[
"THR_ACCEL_I"
]
=
ui
.
throttleAccelISpinBox
;
nameToBoxMap
[
"THR_ACCEL_D"
]
=
ui
.
throttleAccelDSpinBox
;
m_
nameToBoxMap
[
"THR_ACCEL_D"
]
=
ui
.
throttleAccelDSpinBox
;
nameToBoxMap
[
"THR_ACCEL_IMAX"
]
=
ui
.
throttleAccelIMAXSpinBox
;
m_
nameToBoxMap
[
"THR_ACCEL_IMAX"
]
=
ui
.
throttleAccelIMAXSpinBox
;
nameToBoxMap
[
"THR_RATE_P"
]
=
ui
.
throttleRatePSpinBox
;
m_
nameToBoxMap
[
"THR_RATE_P"
]
=
ui
.
throttleRatePSpinBox
;
nameToBoxMap
[
"THR_RATE_D"
]
=
ui
.
throttleDateDSpinBox
;
m_
nameToBoxMap
[
"THR_RATE_D"
]
=
ui
.
throttleDateDSpinBox
;
nameToBoxMap
[
"THR_ALT_P"
]
=
ui
.
altitudeHoldPSpinBox
;
m_
nameToBoxMap
[
"THR_ALT_P"
]
=
ui
.
altitudeHoldPSpinBox
;
nameToBoxMap
[
"WPNAV_SPEED"
]
=
ui
.
wpNavLoiterSpeedSpinBox
;
m_
nameToBoxMap
[
"WPNAV_SPEED"
]
=
ui
.
wpNavLoiterSpeedSpinBox
;
nameToBoxMap
[
"WPNAV_RADIUS"
]
=
ui
.
wpNavRadiusSpinBox
;
m_
nameToBoxMap
[
"WPNAV_RADIUS"
]
=
ui
.
wpNavRadiusSpinBox
;
nameToBoxMap
[
"WPNAV_SPEED_DN"
]
=
ui
.
wpNavSpeedDownSpinBox
;
m_
nameToBoxMap
[
"WPNAV_SPEED_DN"
]
=
ui
.
wpNavSpeedDownSpinBox
;
nameToBoxMap
[
"WPNAV_LOIT_SPEED"
]
=
ui
.
wpNavSpeedSpinBox
;
m_
nameToBoxMap
[
"WPNAV_LOIT_SPEED"
]
=
ui
.
wpNavSpeedSpinBox
;
nameToBoxMap
[
"WPNAV_SPEED_UP"
]
=
ui
.
wpNavSpeedUpSpinBox
;
m_
nameToBoxMap
[
"WPNAV_SPEED_UP"
]
=
ui
.
wpNavSpeedUpSpinBox
;
nameToBoxMap
[
"TUNE_HIGH"
]
=
ui
.
ch6MaxSpinBox
;
m_
nameToBoxMap
[
"TUNE_HIGH"
]
=
ui
.
ch6MaxSpinBox
;
nameToBoxMap
[
"TUNE_LOW"
]
=
ui
.
ch6MinSpinBox
;
m_
nameToBoxMap
[
"TUNE_LOW"
]
=
ui
.
ch6MinSpinBox
;
connect
(
ui
.
writePushButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
writeButtonClicked
()));
connect
(
ui
.
writePushButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
writeButtonClicked
()));
connect
(
ui
.
refreshPushButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
refreshButtonClicked
()));
connect
(
ui
.
refreshPushButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
refreshButtonClicked
()));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
0
,
"CH6_NONE"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
0
,
"CH6_NONE"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
1
,
"CH6_STABILIZE_KP"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
1
,
"CH6_STABILIZE_KP"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
2
,
"CH6_STABILIZE_KI"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
2
,
"CH6_STABILIZE_KI"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
3
,
"CH6_YAW_KP"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
3
,
"CH6_YAW_KP"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
24
,
"CH6_YAW_KI"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
24
,
"CH6_YAW_KI"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
4
,
"CH6_RATE_KP"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
4
,
"CH6_RATE_KP"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
5
,
"CH6_RATE_KI"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
5
,
"CH6_RATE_KI"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
6
,
"CH6_YAW_RATE_KP"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
6
,
"CH6_YAW_RATE_KP"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
26
,
"CH6_YAW_RATE_KD"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
26
,
"CH6_YAW_RATE_KD"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
7
,
"CH6_THROTTLE_KP"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
7
,
"CH6_THROTTLE_KP"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
9
,
"CH6_RELAY"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
9
,
"CH6_RELAY"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
10
,
"CH6_WP_SPEED"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
10
,
"CH6_WP_SPEED"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
12
,
"CH6_LOITER_KP"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
12
,
"CH6_LOITER_KP"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
13
,
"CH6_HELI_EXTERNAL_GYRO"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
13
,
"CH6_HELI_EXTERNAL_GYRO"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
14
,
"CH6_THR_HOLD_KP"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
14
,
"CH6_THR_HOLD_KP"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
17
,
"CH6_OPTFLOW_KP"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
17
,
"CH6_OPTFLOW_KP"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
18
,
"CH6_OPTFLOW_KI"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
18
,
"CH6_OPTFLOW_KI"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
19
,
"CH6_OPTFLOW_KD"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
19
,
"CH6_OPTFLOW_KD"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
21
,
"CH6_RATE_KD"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
21
,
"CH6_RATE_KD"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
22
,
"CH6_LOITER_RATE_KP"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
22
,
"CH6_LOITER_RATE_KP"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
23
,
"CH6_LOITER_RATE_KD"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
23
,
"CH6_LOITER_RATE_KD"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
25
,
"CH6_ACRO_KP"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
25
,
"CH6_ACRO_KP"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
27
,
"CH6_LOITER_KI"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
27
,
"CH6_LOITER_KI"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
28
,
"CH6_LOITER_RATE_KI"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
28
,
"CH6_LOITER_RATE_KI"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
29
,
"CH6_STABILIZE_KD"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
29
,
"CH6_STABILIZE_KD"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
30
,
"CH6_AHRS_YAW_KP"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
30
,
"CH6_AHRS_YAW_KP"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
31
,
"CH6_AHRS_KP"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
31
,
"CH6_AHRS_KP"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
32
,
"CH6_INAV_TC"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
32
,
"CH6_INAV_TC"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
33
,
"CH6_THROTTLE_KI"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
33
,
"CH6_THROTTLE_KI"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
34
,
"CH6_THR_ACCEL_KP"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
34
,
"CH6_THR_ACCEL_KP"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
35
,
"CH6_THR_ACCEL_KI"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
35
,
"CH6_THR_ACCEL_KI"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
36
,
"CH6_THR_ACCEL_KD"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
36
,
"CH6_THR_ACCEL_KD"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
38
,
"CH6_DECLINATION"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
38
,
"CH6_DECLINATION"
));
ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
39
,
"CH6_CIRCLE_RATE"
));
m_ch6ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
39
,
"CH6_CIRCLE_RATE"
));
for
(
int
i
=
0
;
i
<
ch6ValueToTextList
.
size
();
i
++
)
for
(
int
i
=
0
;
i
<
m_ch6ValueToTextList
.
size
();
i
++
)
{
{
ui
.
ch6OptComboBox
->
addItem
(
ch6ValueToTextList
[
i
].
second
);
ui
.
ch6OptComboBox
->
addItem
(
m_ch6ValueToTextList
[
i
].
second
);
}
}
ch7ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
0
,
"Do nothing"
));
m_ch78ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
0
,
"Do nothing"
));
ch7ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
2
,
"Flip"
));
m_ch78ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
2
,
"Flip"
));
ch7ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
3
,
"Simple mode"
));
m_ch78ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
3
,
"Simple mode"
));
ch7ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
4
,
"RTL"
));
m_ch78ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
4
,
"RTL"
));
ch7ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
5
,
"Save Trim"
));
m_ch78ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
5
,
"Save Trim"
));
ch7ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
7
,
"Save WP"
));
m_ch78ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
7
,
"Save WP"
));
ch7ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
8
,
"Multi Mode"
));
m_ch78ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
8
,
"Multi Mode"
));
ch7ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
9
,
"Camera Trigger"
));
m_ch78ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
9
,
"Camera Trigger"
));
ch7ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
10
,
"Sonar"
));
m_ch78ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
10
,
"Sonar"
));
ch7ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
11
,
"Fence"
));
m_ch78ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
11
,
"Fence"
));
ch7ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
12
,
"ResetToArmedYaw"
));
m_ch78ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
12
,
"ResetToArmedYaw"
));
for
(
int
i
=
0
;
i
<
ch7ValueToTextList
.
size
();
i
++
)
for
(
int
i
=
0
;
i
<
m_ch78ValueToTextList
.
size
();
i
++
)
{
{
ui
.
ch7OptComboBox
->
addItem
(
ch7ValueToTextList
[
i
].
second
);
ui
.
ch7OptComboBox
->
addItem
(
m_ch78ValueToTextList
[
i
].
second
);
}
ui
.
ch8OptComboBox
->
addItem
(
m_ch78ValueToTextList
[
i
].
second
);
ch8ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
0
,
"Do nothing"
));
ch8ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
2
,
"Flip"
));
ch8ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
3
,
"Simple mode"
));
ch8ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
4
,
"RTL"
));
ch8ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
5
,
"Save Trim"
));
ch8ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
7
,
"Save WP"
));
ch8ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
8
,
"Multi Mode"
));
ch8ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
9
,
"Camera Trigger"
));
ch8ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
10
,
"Sonar"
));
ch8ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
11
,
"Fence"
));
ch8ValueToTextList
.
append
(
QPair
<
int
,
QString
>
(
12
,
"ResetToArmedYaw"
));
for
(
int
i
=
0
;
i
<
ch8ValueToTextList
.
size
();
i
++
)
{
ui
.
ch8OptComboBox
->
addItem
(
ch8ValueToTextList
[
i
].
second
);
}
}
}
}
ArduCopterPidConfig
::~
ArduCopterPidConfig
()
ArduCopterPidConfig
::~
ArduCopterPidConfig
()
...
@@ -130,15 +114,15 @@ ArduCopterPidConfig::~ArduCopterPidConfig()
...
@@ -130,15 +114,15 @@ ArduCopterPidConfig::~ArduCopterPidConfig()
}
}
void
ArduCopterPidConfig
::
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
)
void
ArduCopterPidConfig
::
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
)
{
{
if
(
nameToBoxMap
.
contains
(
parameterName
))
if
(
m_
nameToBoxMap
.
contains
(
parameterName
))
{
{
nameToBoxMap
[
parameterName
]
->
setValue
(
value
.
toDouble
());
m_
nameToBoxMap
[
parameterName
]
->
setValue
(
value
.
toDouble
());
}
}
else
if
(
parameterName
==
"TUNE"
)
else
if
(
parameterName
==
"TUNE"
)
{
{
for
(
int
i
=
0
;
i
<
ch6ValueToTextList
.
size
();
i
++
)
for
(
int
i
=
0
;
i
<
m_
ch6ValueToTextList
.
size
();
i
++
)
{
{
if
(
ch6ValueToTextList
[
i
].
first
==
value
.
toInt
())
if
(
m_
ch6ValueToTextList
[
i
].
first
==
value
.
toInt
())
{
{
ui
.
ch6OptComboBox
->
setCurrentIndex
(
i
);
ui
.
ch6OptComboBox
->
setCurrentIndex
(
i
);
}
}
...
@@ -146,9 +130,9 @@ void ArduCopterPidConfig::parameterChanged(int uas, int component, QString param
...
@@ -146,9 +130,9 @@ void ArduCopterPidConfig::parameterChanged(int uas, int component, QString param
}
}
else
if
(
parameterName
==
"CH7_OPT"
)
else
if
(
parameterName
==
"CH7_OPT"
)
{
{
for
(
int
i
=
0
;
i
<
ch7
ValueToTextList
.
size
();
i
++
)
for
(
int
i
=
0
;
i
<
m_ch78
ValueToTextList
.
size
();
i
++
)
{
{
if
(
ch7
ValueToTextList
[
i
].
first
==
value
.
toInt
())
if
(
m_ch78
ValueToTextList
[
i
].
first
==
value
.
toInt
())
{
{
ui
.
ch7OptComboBox
->
setCurrentIndex
(
i
);
ui
.
ch7OptComboBox
->
setCurrentIndex
(
i
);
}
}
...
@@ -156,9 +140,9 @@ void ArduCopterPidConfig::parameterChanged(int uas, int component, QString param
...
@@ -156,9 +140,9 @@ void ArduCopterPidConfig::parameterChanged(int uas, int component, QString param
}
}
else
if
(
parameterName
==
"CH8_OPT"
)
else
if
(
parameterName
==
"CH8_OPT"
)
{
{
for
(
int
i
=
0
;
i
<
ch
8ValueToTextList
.
size
();
i
++
)
for
(
int
i
=
0
;
i
<
m_ch7
8ValueToTextList
.
size
();
i
++
)
{
{
if
(
ch
8ValueToTextList
[
i
].
first
==
value
.
toInt
())
if
(
m_ch7
8ValueToTextList
[
i
].
first
==
value
.
toInt
())
{
{
ui
.
ch8OptComboBox
->
setCurrentIndex
(
i
);
ui
.
ch8OptComboBox
->
setCurrentIndex
(
i
);
}
}
...
@@ -169,24 +153,26 @@ void ArduCopterPidConfig::writeButtonClicked()
...
@@ -169,24 +153,26 @@ void ArduCopterPidConfig::writeButtonClicked()
{
{
if
(
!
m_uas
)
if
(
!
m_uas
)
{
{
showNullMAVErrorMessageBox
();
return
;
return
;
}
}
for
(
QMap
<
QString
,
QDoubleSpinBox
*>::
const_iterator
i
=
nameToBoxMap
.
constBegin
();
i
!=
nameToBoxMap
.
constEnd
();
i
++
)
for
(
QMap
<
QString
,
QDoubleSpinBox
*>::
const_iterator
i
=
m_nameToBoxMap
.
constBegin
();
i
!=
m_
nameToBoxMap
.
constEnd
();
i
++
)
{
{
m_uas
->
getParamManager
()
->
setParameter
(
1
,
i
.
key
(),
i
.
value
()
->
value
());
m_uas
->
getParamManager
()
->
setParameter
(
1
,
i
.
key
(),
i
.
value
()
->
value
());
}
}
m_uas
->
getParamManager
()
->
setParameter
(
1
,
"TUNE"
,
ch
8ValueToTextList
[
ui
.
ch6OptComboBox
->
currentIndex
()].
first
);
m_uas
->
getParamManager
()
->
setParameter
(
1
,
"TUNE"
,
m_ch7
8ValueToTextList
[
ui
.
ch6OptComboBox
->
currentIndex
()].
first
);
m_uas
->
getParamManager
()
->
setParameter
(
1
,
"CH7_OPT"
,
ch7
ValueToTextList
[
ui
.
ch7OptComboBox
->
currentIndex
()].
first
);
m_uas
->
getParamManager
()
->
setParameter
(
1
,
"CH7_OPT"
,
m_ch78
ValueToTextList
[
ui
.
ch7OptComboBox
->
currentIndex
()].
first
);
m_uas
->
getParamManager
()
->
setParameter
(
1
,
"CH8_OPT"
,
ch
8ValueToTextList
[
ui
.
ch8OptComboBox
->
currentIndex
()].
first
);
m_uas
->
getParamManager
()
->
setParameter
(
1
,
"CH8_OPT"
,
m_ch7
8ValueToTextList
[
ui
.
ch8OptComboBox
->
currentIndex
()].
first
);
}
}
void
ArduCopterPidConfig
::
refreshButtonClicked
()
void
ArduCopterPidConfig
::
refreshButtonClicked
()
{
{
if
(
!
m_uas
)
if
(
!
m_uas
)
{
{
showNullMAVErrorMessageBox
();
return
;
return
;
}
}
for
(
QMap
<
QString
,
QDoubleSpinBox
*>::
const_iterator
i
=
nameToBoxMap
.
constBegin
();
i
!=
nameToBoxMap
.
constEnd
();
i
++
)
for
(
QMap
<
QString
,
QDoubleSpinBox
*>::
const_iterator
i
=
m_nameToBoxMap
.
constBegin
();
i
!=
m_
nameToBoxMap
.
constEnd
();
i
++
)
{
{
m_uas
->
getParamManager
()
->
requestParameterUpdate
(
1
,
i
.
key
());
m_uas
->
getParamManager
()
->
requestParameterUpdate
(
1
,
i
.
key
());
}
}
...
...
src/ui/configuration/ArduCopterPidConfig.h
View file @
31a118ce
...
@@ -18,10 +18,9 @@ private slots:
...
@@ -18,10 +18,9 @@ private slots:
void
refreshButtonClicked
();
void
refreshButtonClicked
();
void
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
);
void
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
);
private:
private:
QList
<
QPair
<
int
,
QString
>
>
ch6ValueToTextList
;
QList
<
QPair
<
int
,
QString
>
>
m_ch6ValueToTextList
;
QList
<
QPair
<
int
,
QString
>
>
ch7ValueToTextList
;
QList
<
QPair
<
int
,
QString
>
>
m_ch78ValueToTextList
;
QList
<
QPair
<
int
,
QString
>
>
ch8ValueToTextList
;
QMap
<
QString
,
QDoubleSpinBox
*>
m_nameToBoxMap
;
QMap
<
QString
,
QDoubleSpinBox
*>
nameToBoxMap
;
Ui
::
ArduCopterPidConfig
ui
;
Ui
::
ArduCopterPidConfig
ui
;
};
};
...
...
src/ui/configuration/ArduPlanePidConfig.cc
View file @
31a118ce
...
@@ -5,56 +5,56 @@ ArduPlanePidConfig::ArduPlanePidConfig(QWidget *parent) : AP2ConfigWidget(parent
...
@@ -5,56 +5,56 @@ ArduPlanePidConfig::ArduPlanePidConfig(QWidget *parent) : AP2ConfigWidget(parent
{
{
ui
.
setupUi
(
this
);
ui
.
setupUi
(
this
);
nameToBoxMap
[
"RLL2SRV_P"
]
=
ui
.
servoRollPSpinBox
;
m_
nameToBoxMap
[
"RLL2SRV_P"
]
=
ui
.
servoRollPSpinBox
;
nameToBoxMap
[
"RLL2SRV_I"
]
=
ui
.
servoRollISpinBox
;
m_
nameToBoxMap
[
"RLL2SRV_I"
]
=
ui
.
servoRollISpinBox
;
nameToBoxMap
[
"RLL2SRV_D"
]
=
ui
.
servoRollDSpinBox
;
m_
nameToBoxMap
[
"RLL2SRV_D"
]
=
ui
.
servoRollDSpinBox
;
nameToBoxMap
[
"RLL2SRV_IMAX"
]
=
ui
.
servoRollIMAXSpinBox
;
m_
nameToBoxMap
[
"RLL2SRV_IMAX"
]
=
ui
.
servoRollIMAXSpinBox
;
nameToBoxMap
[
"PTCH2SRV_P"
]
=
ui
.
servoPitchPSpinBox
;
m_
nameToBoxMap
[
"PTCH2SRV_P"
]
=
ui
.
servoPitchPSpinBox
;
nameToBoxMap
[
"PTCH2SRV_I"
]
=
ui
.
servoPitchISpinBox
;
m_
nameToBoxMap
[
"PTCH2SRV_I"
]
=
ui
.
servoPitchISpinBox
;
nameToBoxMap
[
"PTCH2SRV_D"
]
=
ui
.
servoPitchDSpinBox
;
m_
nameToBoxMap
[
"PTCH2SRV_D"
]
=
ui
.
servoPitchDSpinBox
;
nameToBoxMap
[
"PTCH2SRV_IMAX"
]
=
ui
.
servoPitchIMAXSpinBox
;
m_
nameToBoxMap
[
"PTCH2SRV_IMAX"
]
=
ui
.
servoPitchIMAXSpinBox
;
nameToBoxMap
[
"YW2SRV_P"
]
=
ui
.
servoYawPSpinBox
;
m_
nameToBoxMap
[
"YW2SRV_P"
]
=
ui
.
servoYawPSpinBox
;
nameToBoxMap
[
"YW2SRV_I"
]
=
ui
.
servoYawISpinBox
;
m_
nameToBoxMap
[
"YW2SRV_I"
]
=
ui
.
servoYawISpinBox
;
nameToBoxMap
[
"YW2SRV_D"
]
=
ui
.
servoYawDSpinBox
;
m_
nameToBoxMap
[
"YW2SRV_D"
]
=
ui
.
servoYawDSpinBox
;
nameToBoxMap
[
"YW2SRV_IMAX"
]
=
ui
.
servoYawIMAXSpinBox
;
m_
nameToBoxMap
[
"YW2SRV_IMAX"
]
=
ui
.
servoYawIMAXSpinBox
;
nameToBoxMap
[
"ALT2PTCH_P"
]
=
ui
.
navAltPSpinBox
;
m_
nameToBoxMap
[
"ALT2PTCH_P"
]
=
ui
.
navAltPSpinBox
;
nameToBoxMap
[
"ALT2PTCH_I"
]
=
ui
.
navAltISpinBox
;
m_
nameToBoxMap
[
"ALT2PTCH_I"
]
=
ui
.
navAltISpinBox
;
nameToBoxMap
[
"ALT2PTCH_D"
]
=
ui
.
navAltDSpinBox
;
m_
nameToBoxMap
[
"ALT2PTCH_D"
]
=
ui
.
navAltDSpinBox
;
nameToBoxMap
[
"ALT2PTCH_IMAX"
]
=
ui
.
navAltIMAXSpinBox
;
m_
nameToBoxMap
[
"ALT2PTCH_IMAX"
]
=
ui
.
navAltIMAXSpinBox
;
nameToBoxMap
[
"ARSP2PTCH_P"
]
=
ui
.
navASPSpinBox
;
m_
nameToBoxMap
[
"ARSP2PTCH_P"
]
=
ui
.
navASPSpinBox
;
nameToBoxMap
[
"ARSP2PTCH_I"
]
=
ui
.
navASISpinBox
;
m_
nameToBoxMap
[
"ARSP2PTCH_I"
]
=
ui
.
navASISpinBox
;
nameToBoxMap
[
"ARSP2PTCH_D"
]
=
ui
.
navASDSpinBox
;
m_
nameToBoxMap
[
"ARSP2PTCH_D"
]
=
ui
.
navASDSpinBox
;
nameToBoxMap
[
"ARSP2PTCH_IMAX"
]
=
ui
.
navASIMAXSpinBox
;
m_
nameToBoxMap
[
"ARSP2PTCH_IMAX"
]
=
ui
.
navASIMAXSpinBox
;
nameToBoxMap
[
"ENRGY2THR_P"
]
=
ui
.
energyPSpinBox
;
m_
nameToBoxMap
[
"ENRGY2THR_P"
]
=
ui
.
energyPSpinBox
;
nameToBoxMap
[
"ENRGY2THR_I"
]
=
ui
.
energyISpinBox
;
m_
nameToBoxMap
[
"ENRGY2THR_I"
]
=
ui
.
energyISpinBox
;
nameToBoxMap
[
"ENRGY2THR_D"
]
=
ui
.
energyDSpinBox
;
m_
nameToBoxMap
[
"ENRGY2THR_D"
]
=
ui
.
energyDSpinBox
;
nameToBoxMap
[
"ENRGY2THR_IMAX"
]
=
ui
.
energyIMAXSpinBox
;
m_
nameToBoxMap
[
"ENRGY2THR_IMAX"
]
=
ui
.
energyIMAXSpinBox
;
nameToBoxMap
[
"KFF_PTCH2THR"
]
=
ui
.
otherPitchCompSpinBox
;
m_
nameToBoxMap
[
"KFF_PTCH2THR"
]
=
ui
.
otherPitchCompSpinBox
;
nameToBoxMap
[
"KFF_PTCHCOMP"
]
=
ui
.
otherPtTSpinBox
;
m_
nameToBoxMap
[
"KFF_PTCHCOMP"
]
=
ui
.
otherPtTSpinBox
;
nameToBoxMap
[
"KFF_RDDRMIX"
]
=
ui
.
otherRudderMixSpinBox
;
m_
nameToBoxMap
[
"KFF_RDDRMIX"
]
=
ui
.
otherRudderMixSpinBox
;
nameToBoxMap
[
"TRIM_THROTTLE"
]
=
ui
.
throttleCruiseSpinBox
;
m_
nameToBoxMap
[
"TRIM_THROTTLE"
]
=
ui
.
throttleCruiseSpinBox
;
nameToBoxMap
[
"THR_FS_VALUE"
]
=
ui
.
throttleFSSpinBox
;
m_
nameToBoxMap
[
"THR_FS_VALUE"
]
=
ui
.
throttleFSSpinBox
;
nameToBoxMap
[
"THR_MAX"
]
=
ui
.
throttleMaxSpinBox
;
m_
nameToBoxMap
[
"THR_MAX"
]
=
ui
.
throttleMaxSpinBox
;
nameToBoxMap
[
"THR_MIN"
]
=
ui
.
throttleMinSpinBox
;
m_
nameToBoxMap
[
"THR_MIN"
]
=
ui
.
throttleMinSpinBox
;
nameToBoxMap
[
"TRIM_ARSPD_CM"
]
=
ui
.
airspeedCruiseSpinBox
;
m_
nameToBoxMap
[
"TRIM_ARSPD_CM"
]
=
ui
.
airspeedCruiseSpinBox
;
nameToBoxMap
[
"ARSPD_FBW_MAX"
]
=
ui
.
airspeedFBWMaxSpinBox
;
m_
nameToBoxMap
[
"ARSPD_FBW_MAX"
]
=
ui
.
airspeedFBWMaxSpinBox
;
nameToBoxMap
[
"ARSPD_FBW_MIN"
]
=
ui
.
airspeedFBWMinSpinBox
;
m_
nameToBoxMap
[
"ARSPD_FBW_MIN"
]
=
ui
.
airspeedFBWMinSpinBox
;
nameToBoxMap
[
"ARSPD_RATIO"
]
=
ui
.
airspeedRatioSpinBox
;
m_
nameToBoxMap
[
"ARSPD_RATIO"
]
=
ui
.
airspeedRatioSpinBox
;
nameToBoxMap
[
"NAVL1_DAMPING"
]
=
ui
.
l1DampingSpinBox
;
m_
nameToBoxMap
[
"NAVL1_DAMPING"
]
=
ui
.
l1DampingSpinBox
;
nameToBoxMap
[
"NAVL1_PERIOD"
]
=
ui
.
l1PeriodSpinBox
;
m_
nameToBoxMap
[
"NAVL1_PERIOD"
]
=
ui
.
l1PeriodSpinBox
;
nameToBoxMap
[
"LIM_ROLL_CD"
]
=
ui
.
navBankMaxSpinBox
;
m_
nameToBoxMap
[
"LIM_ROLL_CD"
]
=
ui
.
navBankMaxSpinBox
;
nameToBoxMap
[
"LIM_PITCH_MAX"
]
=
ui
.
navPitchMaxSpinBox
;
m_
nameToBoxMap
[
"LIM_PITCH_MAX"
]
=
ui
.
navPitchMaxSpinBox
;
nameToBoxMap
[
"LIM_PITCH_MIN"
]
=
ui
.
navPitchMinSpinBox
;
m_
nameToBoxMap
[
"LIM_PITCH_MIN"
]
=
ui
.
navPitchMinSpinBox
;
connect
(
ui
.
writePushButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
writeButtonClicked
()));
connect
(
ui
.
writePushButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
writeButtonClicked
()));
connect
(
ui
.
refreshPushButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
refreshButtonClicked
()));
connect
(
ui
.
refreshPushButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
refreshButtonClicked
()));
...
@@ -66,18 +66,19 @@ ArduPlanePidConfig::~ArduPlanePidConfig()
...
@@ -66,18 +66,19 @@ ArduPlanePidConfig::~ArduPlanePidConfig()
}
}
void
ArduPlanePidConfig
::
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
)
void
ArduPlanePidConfig
::
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
)
{
{
if
(
nameToBoxMap
.
contains
(
parameterName
))
if
(
m_
nameToBoxMap
.
contains
(
parameterName
))
{
{
nameToBoxMap
[
parameterName
]
->
setValue
(
value
.
toDouble
());
m_
nameToBoxMap
[
parameterName
]
->
setValue
(
value
.
toDouble
());
}
}
}
}
void
ArduPlanePidConfig
::
writeButtonClicked
()
void
ArduPlanePidConfig
::
writeButtonClicked
()
{
{
if
(
!
m_uas
)
if
(
!
m_uas
)
{
{
showNullMAVErrorMessageBox
();
return
;
return
;
}
}
for
(
QMap
<
QString
,
QDoubleSpinBox
*>::
const_iterator
i
=
nameToBoxMap
.
constBegin
();
i
!=
nameToBoxMap
.
constEnd
();
i
++
)
for
(
QMap
<
QString
,
QDoubleSpinBox
*>::
const_iterator
i
=
m_nameToBoxMap
.
constBegin
();
i
!=
m_
nameToBoxMap
.
constEnd
();
i
++
)
{
{
m_uas
->
getParamManager
()
->
setParameter
(
1
,
i
.
key
(),
i
.
value
()
->
value
());
m_uas
->
getParamManager
()
->
setParameter
(
1
,
i
.
key
(),
i
.
value
()
->
value
());
}
}
...
@@ -87,9 +88,10 @@ void ArduPlanePidConfig::refreshButtonClicked()
...
@@ -87,9 +88,10 @@ void ArduPlanePidConfig::refreshButtonClicked()
{
{
if
(
!
m_uas
)
if
(
!
m_uas
)
{
{
showNullMAVErrorMessageBox
();
return
;
return
;
}
}
for
(
QMap
<
QString
,
QDoubleSpinBox
*>::
const_iterator
i
=
nameToBoxMap
.
constBegin
();
i
!=
nameToBoxMap
.
constEnd
();
i
++
)
for
(
QMap
<
QString
,
QDoubleSpinBox
*>::
const_iterator
i
=
m_nameToBoxMap
.
constBegin
();
i
!=
m_
nameToBoxMap
.
constEnd
();
i
++
)
{
{
m_uas
->
getParamManager
()
->
requestParameterUpdate
(
1
,
i
.
key
());
m_uas
->
getParamManager
()
->
requestParameterUpdate
(
1
,
i
.
key
());
}
}
...
...
src/ui/configuration/ArduPlanePidConfig.h
View file @
31a118ce
...
@@ -17,7 +17,7 @@ private slots:
...
@@ -17,7 +17,7 @@ private slots:
void
writeButtonClicked
();
void
writeButtonClicked
();
void
refreshButtonClicked
();
void
refreshButtonClicked
();
private:
private:
QMap
<
QString
,
QDoubleSpinBox
*>
nameToBoxMap
;
QMap
<
QString
,
QDoubleSpinBox
*>
m_
nameToBoxMap
;
Ui
::
ArduPlanePidConfig
ui
;
Ui
::
ArduPlanePidConfig
ui
;
};
};
...
...
src/ui/configuration/ArduRoverPidConfig.cc
View file @
31a118ce
...
@@ -49,6 +49,7 @@ void ArduRoverPidConfig::writeButtonClicked()
...
@@ -49,6 +49,7 @@ void ArduRoverPidConfig::writeButtonClicked()
{
{
if
(
!
m_uas
)
if
(
!
m_uas
)
{
{
showNullMAVErrorMessageBox
();
return
;
return
;
}
}
for
(
QMap
<
QString
,
QDoubleSpinBox
*>::
const_iterator
i
=
nameToBoxMap
.
constBegin
();
i
!=
nameToBoxMap
.
constEnd
();
i
++
)
for
(
QMap
<
QString
,
QDoubleSpinBox
*>::
const_iterator
i
=
nameToBoxMap
.
constBegin
();
i
!=
nameToBoxMap
.
constEnd
();
i
++
)
...
@@ -61,6 +62,7 @@ void ArduRoverPidConfig::refreshButtonClicked()
...
@@ -61,6 +62,7 @@ void ArduRoverPidConfig::refreshButtonClicked()
{
{
if
(
!
m_uas
)
if
(
!
m_uas
)
{
{
showNullMAVErrorMessageBox
();
return
;
return
;
}
}
for
(
QMap
<
QString
,
QDoubleSpinBox
*>::
const_iterator
i
=
nameToBoxMap
.
constBegin
();
i
!=
nameToBoxMap
.
constEnd
();
i
++
)
for
(
QMap
<
QString
,
QDoubleSpinBox
*>::
const_iterator
i
=
nameToBoxMap
.
constBegin
();
i
!=
nameToBoxMap
.
constEnd
();
i
++
)
...
...
src/ui/configuration/BatteryMonitorConfig.cc
View file @
31a118ce
...
@@ -4,11 +4,11 @@
...
@@ -4,11 +4,11 @@
BatteryMonitorConfig
::
BatteryMonitorConfig
(
QWidget
*
parent
)
:
AP2ConfigWidget
(
parent
)
BatteryMonitorConfig
::
BatteryMonitorConfig
(
QWidget
*
parent
)
:
AP2ConfigWidget
(
parent
)
{
{
ui
.
setupUi
(
this
);
ui
.
setupUi
(
this
);
ui
.
monitorComboBox
->
addItem
(
"0: Disabled"
);
ui
.
monitorComboBox
->
addItem
(
tr
(
"0: Disabled"
)
);
ui
.
monitorComboBox
->
addItem
(
"3: Battery Volts"
);
ui
.
monitorComboBox
->
addItem
(
tr
(
"3: Battery Volts"
)
);
ui
.
monitorComboBox
->
addItem
(
"4: Voltage and Current"
);
ui
.
monitorComboBox
->
addItem
(
tr
(
"4: Voltage and Current"
)
);
ui
.
sensorComboBox
->
addItem
(
"0: Other"
);
ui
.
sensorComboBox
->
addItem
(
tr
(
"0: Other"
)
);
ui
.
sensorComboBox
->
addItem
(
"1: AttoPilot 45A"
);
ui
.
sensorComboBox
->
addItem
(
"1: AttoPilot 45A"
);
ui
.
sensorComboBox
->
addItem
(
"2: AttoPilot 90A"
);
ui
.
sensorComboBox
->
addItem
(
"2: AttoPilot 90A"
);
ui
.
sensorComboBox
->
addItem
(
"3: AttoPilot 180A"
);
ui
.
sensorComboBox
->
addItem
(
"3: AttoPilot 180A"
);
...
@@ -34,19 +34,24 @@ BatteryMonitorConfig::BatteryMonitorConfig(QWidget *parent) : AP2ConfigWidget(pa
...
@@ -34,19 +34,24 @@ BatteryMonitorConfig::BatteryMonitorConfig(QWidget *parent) : AP2ConfigWidget(pa
}
}
void
BatteryMonitorConfig
::
activeUASSet
(
UASInterface
*
uas
)
void
BatteryMonitorConfig
::
activeUASSet
(
UASInterface
*
uas
)
{
{
if
(
m_uas
)
{
disconnect
(
m_uas
,
SIGNAL
(
batteryChanged
(
UASInterface
*
,
double
,
double
,
double
,
int
)),
this
,
SLOT
(
batteryChanged
(
UASInterface
*
,
double
,
double
,
double
,
int
)));
}
AP2ConfigWidget
::
activeUASSet
(
uas
);
if
(
!
uas
)
if
(
!
uas
)
{
{
return
;
return
;
}
}
connect
(
uas
,
SIGNAL
(
batteryChanged
(
UASInterface
*
,
double
,
double
,
double
,
int
)),
this
,
SLOT
(
batteryChanged
(
UASInterface
*
,
double
,
double
,
double
,
int
)));
connect
(
uas
,
SIGNAL
(
batteryChanged
(
UASInterface
*
,
double
,
double
,
double
,
int
)),
this
,
SLOT
(
batteryChanged
(
UASInterface
*
,
double
,
double
,
double
,
int
)));
AP2ConfigWidget
::
activeUASSet
(
uas
);
}
}
void
BatteryMonitorConfig
::
calcDividerSet
()
void
BatteryMonitorConfig
::
calcDividerSet
()
{
{
if
(
!
m_uas
)
if
(
!
m_uas
)
{
{
QMessageBox
::
information
(
0
,
tr
(
"Error"
),
tr
(
"Please connect to a MAV before attempting to set configuration"
)
);
showNullMAVErrorMessageBox
(
);
return
;
return
;
}
}
bool
ok
=
false
;
bool
ok
=
false
;
...
@@ -63,7 +68,7 @@ void BatteryMonitorConfig::ampsPerVoltSet()
...
@@ -63,7 +68,7 @@ void BatteryMonitorConfig::ampsPerVoltSet()
{
{
if
(
!
m_uas
)
if
(
!
m_uas
)
{
{
QMessageBox
::
information
(
0
,
tr
(
"Error"
),
tr
(
"Please connect to a MAV before attempting to set configuration"
)
);
showNullMAVErrorMessageBox
(
);
return
;
return
;
}
}
bool
ok
=
false
;
bool
ok
=
false
;
...
@@ -80,7 +85,7 @@ void BatteryMonitorConfig::batteryCapacitySet()
...
@@ -80,7 +85,7 @@ void BatteryMonitorConfig::batteryCapacitySet()
{
{
if
(
!
m_uas
)
if
(
!
m_uas
)
{
{
QMessageBox
::
information
(
0
,
tr
(
"Error"
),
tr
(
"Please connect to a MAV before attempting to set configuration"
)
);
showNullMAVErrorMessageBox
(
);
return
;
return
;
}
}
bool
ok
=
false
;
bool
ok
=
false
;
...
@@ -98,10 +103,10 @@ void BatteryMonitorConfig::monitorCurrentIndexChanged(int index)
...
@@ -98,10 +103,10 @@ void BatteryMonitorConfig::monitorCurrentIndexChanged(int index)
{
{
if
(
!
m_uas
)
if
(
!
m_uas
)
{
{
QMessageBox
::
information
(
0
,
tr
(
"Error"
),
tr
(
"Please connect to a MAV before attempting to set configuration"
)
);
showNullMAVErrorMessageBox
(
);
return
;
return
;
}
}
if
(
index
==
0
)
if
(
index
==
0
)
//Battery Monitor Disabled
{
{
m_uas
->
getParamManager
()
->
setParameter
(
1
,
"BATT_VOLT_PIN"
,
-
1
);
m_uas
->
getParamManager
()
->
setParameter
(
1
,
"BATT_VOLT_PIN"
,
-
1
);
m_uas
->
getParamManager
()
->
setParameter
(
1
,
"BATT_CURR_PIN"
,
-
1
);
m_uas
->
getParamManager
()
->
setParameter
(
1
,
"BATT_CURR_PIN"
,
-
1
);
...
@@ -114,7 +119,7 @@ void BatteryMonitorConfig::monitorCurrentIndexChanged(int index)
...
@@ -114,7 +119,7 @@ void BatteryMonitorConfig::monitorCurrentIndexChanged(int index)
ui
.
calcVoltsLineEdit
->
setEnabled
(
false
);
ui
.
calcVoltsLineEdit
->
setEnabled
(
false
);
ui
.
ampsPerVoltsLineEdit
->
setEnabled
(
false
);
ui
.
ampsPerVoltsLineEdit
->
setEnabled
(
false
);
}
}
else
if
(
index
==
1
)
else
if
(
index
==
1
)
//Monitor voltage only
{
{
m_uas
->
getParamManager
()
->
setParameter
(
1
,
"BATT_MONITOR"
,
3
);
m_uas
->
getParamManager
()
->
setParameter
(
1
,
"BATT_MONITOR"
,
3
);
ui
.
sensorComboBox
->
setEnabled
(
false
);
ui
.
sensorComboBox
->
setEnabled
(
false
);
...
@@ -124,7 +129,7 @@ void BatteryMonitorConfig::monitorCurrentIndexChanged(int index)
...
@@ -124,7 +129,7 @@ void BatteryMonitorConfig::monitorCurrentIndexChanged(int index)
ui
.
calcVoltsLineEdit
->
setEnabled
(
false
);
ui
.
calcVoltsLineEdit
->
setEnabled
(
false
);
ui
.
ampsPerVoltsLineEdit
->
setEnabled
(
false
);
ui
.
ampsPerVoltsLineEdit
->
setEnabled
(
false
);
}
}
else
if
(
index
==
2
)
else
if
(
index
==
2
)
//Monitor voltage and current
{
{
m_uas
->
getParamManager
()
->
setParameter
(
1
,
"BATT_MONITOR"
,
4
);
m_uas
->
getParamManager
()
->
setParameter
(
1
,
"BATT_MONITOR"
,
4
);
ui
.
sensorComboBox
->
setEnabled
(
true
);
ui
.
sensorComboBox
->
setEnabled
(
true
);
...
@@ -139,45 +144,39 @@ void BatteryMonitorConfig::monitorCurrentIndexChanged(int index)
...
@@ -139,45 +144,39 @@ void BatteryMonitorConfig::monitorCurrentIndexChanged(int index)
}
}
void
BatteryMonitorConfig
::
sensorCurrentIndexChanged
(
int
index
)
void
BatteryMonitorConfig
::
sensorCurrentIndexChanged
(
int
index
)
{
{
float
maxvolt
=
0
;
float
maxvolt
=
0
.0
;
float
maxamps
=
0
;
float
maxamps
=
0
.0
;
float
mvpervolt
=
0
;
float
mvpervolt
=
0
.0
;
float
mvperamp
=
0
;
float
mvperamp
=
0
.0
;
float
topvolt
=
0
;
float
topvolt
=
0
.0
;
float
topamps
=
0
;
float
topamps
=
0
.0
;
if
(
index
==
1
)
if
(
index
==
1
)
{
{
//atto 45
//atto 45
see https://www.sparkfun.com/products/10643
maxvolt
=
13.6
;
maxvolt
=
13.6
;
maxamps
=
44.7
;
maxamps
=
44.7
;
mvpervolt
=
242.3
;
mvperamp
=
73.20
;
}
}
else
if
(
index
==
2
)
else
if
(
index
==
2
)
{
{
//atto 90
//atto 90
see https://www.sparkfun.com/products/9028
maxvolt
=
5
0
;
maxvolt
=
5
1.8
;
maxamps
=
89.4
;
maxamps
=
89.4
;
mvpervolt
=
63.69
;
mvperamp
=
36.60
;
}
}
else
if
(
index
==
3
)
else
if
(
index
==
3
)
{
{
//atto 180
//atto 180
see https://www.sparkfun.com/products/10644
maxvolt
=
5
0
;
maxvolt
=
5
1.8
;
maxamps
=
178.8
;
maxamps
=
178.8
;
mvpervolt
=
63.69
;
mvperamp
=
18.30
;
}
}
else
if
(
index
==
4
)
else
if
(
index
==
4
)
{
{
//3dr
//3dr
maxvolt
=
50
;
maxvolt
=
50.0
;
maxamps
=
90
;
maxamps
=
90.0
;
mvpervolt
=
100
;
mvperamp
=
55.55
;
}
}
mvpervolt
=
calculatemVPerVolt
(
3.3
,
maxvolt
);
mvperamp
=
calculatemVPerAmp
(
3.3
,
maxamps
);
if
(
index
==
0
)
if
(
index
==
0
)
{
{
//Other
//Other
...
@@ -197,12 +196,21 @@ void BatteryMonitorConfig::sensorCurrentIndexChanged(int index)
...
@@ -197,12 +196,21 @@ void BatteryMonitorConfig::sensorCurrentIndexChanged(int index)
ui
.
measuredVoltsLineEdit
->
setEnabled
(
false
);
ui
.
measuredVoltsLineEdit
->
setEnabled
(
false
);
}
}
}
}
float
BatteryMonitorConfig
::
calculatemVPerAmp
(
float
maxvoltsout
,
float
maxamps
)
{
return
(
1000.0
*
(
maxvoltsout
/
maxamps
));
}
float
BatteryMonitorConfig
::
calculatemVPerVolt
(
float
maxvoltsout
,
float
maxvolts
)
{
return
(
1000.0
*
(
maxvoltsout
/
maxvolts
));
}
void
BatteryMonitorConfig
::
apmVerCurrentIndexChanged
(
int
index
)
void
BatteryMonitorConfig
::
apmVerCurrentIndexChanged
(
int
index
)
{
{
if
(
!
m_uas
)
if
(
!
m_uas
)
{
{
QMessageBox
::
information
(
0
,
tr
(
"Error"
),
tr
(
"Please connect to a MAV before attempting to set configuration"
)
);
showNullMAVErrorMessageBox
(
);
return
;
return
;
}
}
if
(
index
==
0
)
//APM1
if
(
index
==
0
)
//APM1
...
...
src/ui/configuration/BatteryMonitorConfig.h
View file @
31a118ce
...
@@ -24,6 +24,8 @@ private slots:
...
@@ -24,6 +24,8 @@ private slots:
void
batteryChanged
(
UASInterface
*
uas
,
double
voltage
,
double
current
,
double
percent
,
int
seconds
);
void
batteryChanged
(
UASInterface
*
uas
,
double
voltage
,
double
current
,
double
percent
,
int
seconds
);
private:
private:
Ui
::
BatteryMonitorConfig
ui
;
Ui
::
BatteryMonitorConfig
ui
;
inline
float
calculatemVPerAmp
(
float
maxvoltsout
,
float
maxamps
);
inline
float
calculatemVPerVolt
(
float
maxvoltsout
,
float
maxvolts
);
};
};
#endif // BATTERYMONITORCONFIG_H
#endif // BATTERYMONITORCONFIG_H
src/ui/configuration/BatteryMonitorConfig.ui
View file @
31a118ce
...
@@ -150,7 +150,7 @@
...
@@ -150,7 +150,7 @@
<x>
160
</x>
<x>
160
</x>
<y>
70
</y>
<y>
70
</y>
<width>
281
</width>
<width>
281
</width>
<height>
80
</height>
<height>
91
</height>
</rect>
</rect>
</property>
</property>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_3"
stretch=
"0,1"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_3"
stretch=
"0,1"
>
...
...
src/ui/configuration/CameraGimbalConfig.cc
View file @
31a118ce
#include "CameraGimbalConfig.h"
#include <QMessageBox>
#include <QMessageBox>
#include <QDebug>
#include <QDebug>
#include "CameraGimbalConfig.h"
CameraGimbalConfig
::
CameraGimbalConfig
(
QWidget
*
parent
)
:
AP2ConfigWidget
(
parent
)
CameraGimbalConfig
::
CameraGimbalConfig
(
QWidget
*
parent
)
:
AP2ConfigWidget
(
parent
)
{
{
ui
.
setupUi
(
this
);
ui
.
setupUi
(
this
);
ui
.
tiltChannelComboBox
->
addItem
(
"Disable"
);
ui
.
tiltChannelComboBox
->
addItem
(
tr
(
"Disable"
)
);
ui
.
tiltChannelComboBox
->
addItem
(
"RC5"
);
ui
.
tiltChannelComboBox
->
addItem
(
"RC5"
);
ui
.
tiltChannelComboBox
->
addItem
(
"RC6"
);
ui
.
tiltChannelComboBox
->
addItem
(
"RC6"
);
ui
.
tiltChannelComboBox
->
addItem
(
"RC7"
);
ui
.
tiltChannelComboBox
->
addItem
(
"RC7"
);
...
@@ -12,13 +14,13 @@ CameraGimbalConfig::CameraGimbalConfig(QWidget *parent) : AP2ConfigWidget(parent
...
@@ -12,13 +14,13 @@ CameraGimbalConfig::CameraGimbalConfig(QWidget *parent) : AP2ConfigWidget(parent
ui
.
tiltChannelComboBox
->
addItem
(
"RC10"
);
ui
.
tiltChannelComboBox
->
addItem
(
"RC10"
);
ui
.
tiltChannelComboBox
->
addItem
(
"RC11"
);
ui
.
tiltChannelComboBox
->
addItem
(
"RC11"
);
ui
.
tiltInputChannelComboBox
->
addItem
(
"Disable"
);
ui
.
tiltInputChannelComboBox
->
addItem
(
tr
(
"Disable"
)
);
ui
.
tiltInputChannelComboBox
->
addItem
(
"RC5"
);
ui
.
tiltInputChannelComboBox
->
addItem
(
"RC5"
);
ui
.
tiltInputChannelComboBox
->
addItem
(
"RC6"
);
ui
.
tiltInputChannelComboBox
->
addItem
(
"RC6"
);
ui
.
tiltInputChannelComboBox
->
addItem
(
"RC7"
);
ui
.
tiltInputChannelComboBox
->
addItem
(
"RC7"
);
ui
.
tiltInputChannelComboBox
->
addItem
(
"RC8"
);
ui
.
tiltInputChannelComboBox
->
addItem
(
"RC8"
);
ui
.
rollChannelComboBox
->
addItem
(
"Disable"
);
ui
.
rollChannelComboBox
->
addItem
(
tr
(
"Disable"
)
);
ui
.
rollChannelComboBox
->
addItem
(
"RC5"
);
ui
.
rollChannelComboBox
->
addItem
(
"RC5"
);
ui
.
rollChannelComboBox
->
addItem
(
"RC6"
);
ui
.
rollChannelComboBox
->
addItem
(
"RC6"
);
ui
.
rollChannelComboBox
->
addItem
(
"RC7"
);
ui
.
rollChannelComboBox
->
addItem
(
"RC7"
);
...
@@ -26,14 +28,14 @@ CameraGimbalConfig::CameraGimbalConfig(QWidget *parent) : AP2ConfigWidget(parent
...
@@ -26,14 +28,14 @@ CameraGimbalConfig::CameraGimbalConfig(QWidget *parent) : AP2ConfigWidget(parent
ui
.
rollChannelComboBox
->
addItem
(
"RC10"
);
ui
.
rollChannelComboBox
->
addItem
(
"RC10"
);
ui
.
rollChannelComboBox
->
addItem
(
"RC11"
);
ui
.
rollChannelComboBox
->
addItem
(
"RC11"
);
ui
.
rollInputChannelComboBox
->
addItem
(
"Disable"
);
ui
.
rollInputChannelComboBox
->
addItem
(
tr
(
"Disable"
)
);
ui
.
rollInputChannelComboBox
->
addItem
(
"RC5"
);
ui
.
rollInputChannelComboBox
->
addItem
(
"RC5"
);
ui
.
rollInputChannelComboBox
->
addItem
(
"RC6"
);
ui
.
rollInputChannelComboBox
->
addItem
(
"RC6"
);
ui
.
rollInputChannelComboBox
->
addItem
(
"RC7"
);
ui
.
rollInputChannelComboBox
->
addItem
(
"RC7"
);
ui
.
rollInputChannelComboBox
->
addItem
(
"RC8"
);
ui
.
rollInputChannelComboBox
->
addItem
(
"RC8"
);
ui
.
panChannelComboBox
->
addItem
(
"Disable"
);
ui
.
panChannelComboBox
->
addItem
(
tr
(
"Disable"
)
);
ui
.
panChannelComboBox
->
addItem
(
"RC5"
);
ui
.
panChannelComboBox
->
addItem
(
"RC5"
);
ui
.
panChannelComboBox
->
addItem
(
"RC6"
);
ui
.
panChannelComboBox
->
addItem
(
"RC6"
);
ui
.
panChannelComboBox
->
addItem
(
"RC7"
);
ui
.
panChannelComboBox
->
addItem
(
"RC7"
);
...
@@ -41,16 +43,16 @@ CameraGimbalConfig::CameraGimbalConfig(QWidget *parent) : AP2ConfigWidget(parent
...
@@ -41,16 +43,16 @@ CameraGimbalConfig::CameraGimbalConfig(QWidget *parent) : AP2ConfigWidget(parent
ui
.
panChannelComboBox
->
addItem
(
"RC10"
);
ui
.
panChannelComboBox
->
addItem
(
"RC10"
);
ui
.
panChannelComboBox
->
addItem
(
"RC11"
);
ui
.
panChannelComboBox
->
addItem
(
"RC11"
);
ui
.
panInputChannelComboBox
->
addItem
(
"Disable"
);
ui
.
panInputChannelComboBox
->
addItem
(
tr
(
"Disable"
)
);
ui
.
panInputChannelComboBox
->
addItem
(
"RC5"
);
ui
.
panInputChannelComboBox
->
addItem
(
"RC5"
);
ui
.
panInputChannelComboBox
->
addItem
(
"RC6"
);
ui
.
panInputChannelComboBox
->
addItem
(
"RC6"
);
ui
.
panInputChannelComboBox
->
addItem
(
"RC7"
);
ui
.
panInputChannelComboBox
->
addItem
(
"RC7"
);
ui
.
panInputChannelComboBox
->
addItem
(
"RC8"
);
ui
.
panInputChannelComboBox
->
addItem
(
"RC8"
);
ui
.
shutterChannelComboBox
->
addItem
(
"Disable"
);
ui
.
shutterChannelComboBox
->
addItem
(
tr
(
"Disable"
)
);
ui
.
shutterChannelComboBox
->
addItem
(
"Relay"
);
ui
.
shutterChannelComboBox
->
addItem
(
tr
(
"Relay"
)
);
ui
.
shutterChannelComboBox
->
addItem
(
"Transistor"
);
ui
.
shutterChannelComboBox
->
addItem
(
tr
(
"Transistor"
)
);
ui
.
shutterChannelComboBox
->
addItem
(
"RC5"
);
ui
.
shutterChannelComboBox
->
addItem
(
"RC5"
);
ui
.
shutterChannelComboBox
->
addItem
(
"RC6"
);
ui
.
shutterChannelComboBox
->
addItem
(
"RC6"
);
ui
.
shutterChannelComboBox
->
addItem
(
"RC7"
);
ui
.
shutterChannelComboBox
->
addItem
(
"RC7"
);
...
@@ -100,13 +102,13 @@ void CameraGimbalConfig::updateTilt()
...
@@ -100,13 +102,13 @@ void CameraGimbalConfig::updateTilt()
{
{
if
(
!
m_uas
)
if
(
!
m_uas
)
{
{
QMessageBox
::
information
(
0
,
tr
(
"Error"
),
tr
(
"Please connect to a MAV before attempting to set configuration"
)
);
showNullMAVErrorMessageBox
(
);
return
;
return
;
}
}
if
(
!
tiltPrefix
.
isEmpty
())
if
(
!
m_
tiltPrefix
.
isEmpty
())
{
{
//We need to set this to 0 for disabled.
//We need to set this to 0 for disabled.
m_uas
->
getParamManager
()
->
setParameter
(
1
,
tiltPrefix
+
"FUNCTION"
,
0
);
m_uas
->
getParamManager
()
->
setParameter
(
1
,
m_
tiltPrefix
+
"FUNCTION"
,
0
);
}
}
if
(
ui
.
tiltChannelComboBox
->
currentIndex
()
==
0
)
if
(
ui
.
tiltChannelComboBox
->
currentIndex
()
==
0
)
{
{
...
@@ -134,7 +136,7 @@ void CameraGimbalConfig::updateRoll()
...
@@ -134,7 +136,7 @@ void CameraGimbalConfig::updateRoll()
{
{
if
(
!
m_uas
)
if
(
!
m_uas
)
{
{
QMessageBox
::
information
(
0
,
tr
(
"Error"
),
tr
(
"Please connect to a MAV before attempting to set configuration"
)
);
showNullMAVErrorMessageBox
(
);
return
;
return
;
}
}
m_uas
->
getParamManager
()
->
setParameter
(
1
,
ui
.
rollChannelComboBox
->
currentText
()
+
"_FUNCTION"
,
8
);
m_uas
->
getParamManager
()
->
setParameter
(
1
,
ui
.
rollChannelComboBox
->
currentText
()
+
"_FUNCTION"
,
8
);
...
@@ -157,7 +159,7 @@ void CameraGimbalConfig::updatePan()
...
@@ -157,7 +159,7 @@ void CameraGimbalConfig::updatePan()
{
{
if
(
!
m_uas
)
if
(
!
m_uas
)
{
{
QMessageBox
::
information
(
0
,
tr
(
"Error"
),
tr
(
"Please connect to a MAV before attempting to set configuration"
)
);
showNullMAVErrorMessageBox
(
);
return
;
return
;
}
}
m_uas
->
getParamManager
()
->
setParameter
(
1
,
ui
.
panChannelComboBox
->
currentText
()
+
"_FUNCTION"
,
6
);
m_uas
->
getParamManager
()
->
setParameter
(
1
,
ui
.
panChannelComboBox
->
currentText
()
+
"_FUNCTION"
,
6
);
...
@@ -180,7 +182,7 @@ void CameraGimbalConfig::updateShutter()
...
@@ -180,7 +182,7 @@ void CameraGimbalConfig::updateShutter()
{
{
if
(
!
m_uas
)
if
(
!
m_uas
)
{
{
QMessageBox
::
information
(
0
,
tr
(
"Error"
),
tr
(
"Please connect to a MAV before attempting to set configuration"
)
);
showNullMAVErrorMessageBox
(
);
return
;
return
;
}
}
if
(
ui
.
shutterChannelComboBox
->
currentIndex
()
==
0
)
//Disabled
if
(
ui
.
shutterChannelComboBox
->
currentIndex
()
==
0
)
//Disabled
...
@@ -216,24 +218,6 @@ CameraGimbalConfig::~CameraGimbalConfig()
...
@@ -216,24 +218,6 @@ CameraGimbalConfig::~CameraGimbalConfig()
void
CameraGimbalConfig
::
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
)
void
CameraGimbalConfig
::
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
)
{
{
connect
(
ui
.
tiltChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateTilt
()));
disconnect
(
ui
.
tiltChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateTilt
()));
connect
(
ui
.
tiltInputChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateTilt
()));
disconnect
(
ui
.
tiltInputChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateTilt
()));
connect
(
ui
.
panChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updatePan
()));
disconnect
(
ui
.
panChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updatePan
()));
connect
(
ui
.
panInputChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updatePan
()));
disconnect
(
ui
.
panInputChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updatePan
()));
connect
(
ui
.
rollChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateRoll
()));
disconnect
(
ui
.
rollChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateRoll
()));
connect
(
ui
.
rollInputChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateRoll
()));
disconnect
(
ui
.
rollInputChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateRoll
()));
connect
(
ui
.
shutterChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateShutter
()));
disconnect
(
ui
.
shutterChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateShutter
()));
if
(
parameterName
==
"MNT_ANGMIN_TIL"
)
//TILT
if
(
parameterName
==
"MNT_ANGMIN_TIL"
)
//TILT
{
{
ui
.
tiltAngleMinSpinBox
->
setValue
(
value
.
toInt
()
/
100.0
);
ui
.
tiltAngleMinSpinBox
->
setValue
(
value
.
toInt
()
/
100.0
);
...
@@ -327,7 +311,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
...
@@ -327,7 +311,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
}
}
connect
(
ui
.
shutterChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateShutter
()));
connect
(
ui
.
shutterChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateShutter
()));
}
}
if
(
parameterName
.
startsWith
(
shutterPrefix
)
&&
!
shutterPrefix
.
isEmpty
())
if
(
parameterName
.
startsWith
(
m_shutterPrefix
)
&&
!
m_
shutterPrefix
.
isEmpty
())
{
{
if
(
parameterName
.
endsWith
(
"MIN"
))
if
(
parameterName
.
endsWith
(
"MIN"
))
{
{
...
@@ -338,7 +322,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
...
@@ -338,7 +322,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
ui
.
shutterServoMaxSpinBox
->
setValue
(
value
.
toInt
());
ui
.
shutterServoMaxSpinBox
->
setValue
(
value
.
toInt
());
}
}
}
}
else
if
(
parameterName
.
startsWith
(
tiltPrefix
)
&&
!
tiltPrefix
.
isEmpty
())
else
if
(
parameterName
.
startsWith
(
m_tiltPrefix
)
&&
!
m_
tiltPrefix
.
isEmpty
())
{
{
if
(
parameterName
.
endsWith
(
"MIN"
))
if
(
parameterName
.
endsWith
(
"MIN"
))
{
{
...
@@ -360,7 +344,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
...
@@ -360,7 +344,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
}
}
}
}
}
}
else
if
(
parameterName
.
startsWith
(
rollPrefix
)
&&
!
rollPrefix
.
isEmpty
())
else
if
(
parameterName
.
startsWith
(
m_rollPrefix
)
&&
!
m_
rollPrefix
.
isEmpty
())
{
{
if
(
parameterName
.
endsWith
(
"MIN"
))
if
(
parameterName
.
endsWith
(
"MIN"
))
{
{
...
@@ -382,7 +366,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
...
@@ -382,7 +366,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
}
}
}
}
}
}
else
if
(
parameterName
.
startsWith
(
panPrefix
)
&&
!
panPrefix
.
isEmpty
())
else
if
(
parameterName
.
startsWith
(
m_panPrefix
)
&&
!
m_
panPrefix
.
isEmpty
())
{
{
if
(
parameterName
.
endsWith
(
"MIN"
))
if
(
parameterName
.
endsWith
(
"MIN"
))
{
{
...
@@ -412,7 +396,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
...
@@ -412,7 +396,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
disconnect
(
ui
.
shutterChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateShutter
()));
disconnect
(
ui
.
shutterChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateShutter
()));
ui
.
shutterChannelComboBox
->
setCurrentIndex
(
3
);
ui
.
shutterChannelComboBox
->
setCurrentIndex
(
3
);
connect
(
ui
.
shutterChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateShutter
()));
connect
(
ui
.
shutterChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateShutter
()));
shutterPrefix
=
"RC5_"
;
m_
shutterPrefix
=
"RC5_"
;
}
}
else
if
(
value
.
toInt
()
==
8
)
else
if
(
value
.
toInt
()
==
8
)
{
{
...
@@ -420,7 +404,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
...
@@ -420,7 +404,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
disconnect
(
ui
.
rollChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateRoll
()));
disconnect
(
ui
.
rollChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateRoll
()));
ui
.
rollChannelComboBox
->
setCurrentIndex
(
1
);
ui
.
rollChannelComboBox
->
setCurrentIndex
(
1
);
connect
(
ui
.
rollChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateRoll
()));
connect
(
ui
.
rollChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateRoll
()));
rollPrefix
=
"RC5_"
;
m_
rollPrefix
=
"RC5_"
;
}
}
else
if
(
value
.
toInt
()
==
7
)
else
if
(
value
.
toInt
()
==
7
)
{
{
...
@@ -428,7 +412,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
...
@@ -428,7 +412,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
disconnect
(
ui
.
tiltChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateTilt
()));
disconnect
(
ui
.
tiltChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateTilt
()));
ui
.
tiltChannelComboBox
->
setCurrentIndex
(
1
);
ui
.
tiltChannelComboBox
->
setCurrentIndex
(
1
);
connect
(
ui
.
tiltChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateTilt
()));
connect
(
ui
.
tiltChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateTilt
()));
tiltPrefix
=
"RC5_"
;
m_
tiltPrefix
=
"RC5_"
;
}
}
else
if
(
value
.
toInt
()
==
6
)
else
if
(
value
.
toInt
()
==
6
)
{
{
...
@@ -436,7 +420,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
...
@@ -436,7 +420,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
disconnect
(
ui
.
panChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updatePan
()));
disconnect
(
ui
.
panChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updatePan
()));
ui
.
panChannelComboBox
->
setCurrentIndex
(
1
);
ui
.
panChannelComboBox
->
setCurrentIndex
(
1
);
connect
(
ui
.
panChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updatePan
()));
connect
(
ui
.
panChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updatePan
()));
panPrefix
=
"RC5_"
;
m_
panPrefix
=
"RC5_"
;
}
}
m_uas
->
getParamManager
()
->
requestParameterUpdate
(
1
,
"RC5_MIN"
);
m_uas
->
getParamManager
()
->
requestParameterUpdate
(
1
,
"RC5_MIN"
);
m_uas
->
getParamManager
()
->
requestParameterUpdate
(
1
,
"RC5_MAX"
);
m_uas
->
getParamManager
()
->
requestParameterUpdate
(
1
,
"RC5_MAX"
);
...
@@ -450,7 +434,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
...
@@ -450,7 +434,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
disconnect
(
ui
.
shutterChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateShutter
()));
disconnect
(
ui
.
shutterChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateShutter
()));
ui
.
shutterChannelComboBox
->
setCurrentIndex
(
4
);
ui
.
shutterChannelComboBox
->
setCurrentIndex
(
4
);
connect
(
ui
.
shutterChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateShutter
()));
connect
(
ui
.
shutterChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateShutter
()));
shutterPrefix
=
"RC6_"
;
m_
shutterPrefix
=
"RC6_"
;
}
}
else
if
(
value
.
toInt
()
==
8
)
else
if
(
value
.
toInt
()
==
8
)
{
{
...
@@ -458,7 +442,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
...
@@ -458,7 +442,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
disconnect
(
ui
.
rollChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateRoll
()));
disconnect
(
ui
.
rollChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateRoll
()));
ui
.
rollChannelComboBox
->
setCurrentIndex
(
2
);
ui
.
rollChannelComboBox
->
setCurrentIndex
(
2
);
connect
(
ui
.
rollChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateRoll
()));
connect
(
ui
.
rollChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateRoll
()));
rollPrefix
=
"RC6_"
;
m_
rollPrefix
=
"RC6_"
;
}
}
else
if
(
value
.
toInt
()
==
7
)
else
if
(
value
.
toInt
()
==
7
)
{
{
...
@@ -466,7 +450,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
...
@@ -466,7 +450,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
disconnect
(
ui
.
tiltChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateTilt
()));
disconnect
(
ui
.
tiltChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateTilt
()));
ui
.
tiltChannelComboBox
->
setCurrentIndex
(
2
);
ui
.
tiltChannelComboBox
->
setCurrentIndex
(
2
);
connect
(
ui
.
tiltChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateTilt
()));
connect
(
ui
.
tiltChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateTilt
()));
tiltPrefix
=
"RC6_"
;
m_
tiltPrefix
=
"RC6_"
;
}
}
else
if
(
value
.
toInt
()
==
6
)
else
if
(
value
.
toInt
()
==
6
)
{
{
...
@@ -474,7 +458,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
...
@@ -474,7 +458,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
disconnect
(
ui
.
panChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updatePan
()));
disconnect
(
ui
.
panChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updatePan
()));
ui
.
panChannelComboBox
->
setCurrentIndex
(
2
);
ui
.
panChannelComboBox
->
setCurrentIndex
(
2
);
connect
(
ui
.
panChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updatePan
()));
connect
(
ui
.
panChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updatePan
()));
panPrefix
=
"RC6_"
;
m_
panPrefix
=
"RC6_"
;
}
}
m_uas
->
getParamManager
()
->
requestParameterUpdate
(
1
,
"RC6_MIN"
);
m_uas
->
getParamManager
()
->
requestParameterUpdate
(
1
,
"RC6_MIN"
);
m_uas
->
getParamManager
()
->
requestParameterUpdate
(
1
,
"RC6_MAX"
);
m_uas
->
getParamManager
()
->
requestParameterUpdate
(
1
,
"RC6_MAX"
);
...
@@ -488,7 +472,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
...
@@ -488,7 +472,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
disconnect
(
ui
.
shutterChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateShutter
()));
disconnect
(
ui
.
shutterChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateShutter
()));
ui
.
shutterChannelComboBox
->
setCurrentIndex
(
5
);
ui
.
shutterChannelComboBox
->
setCurrentIndex
(
5
);
connect
(
ui
.
shutterChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateShutter
()));
connect
(
ui
.
shutterChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateShutter
()));
shutterPrefix
=
"RC7_"
;
m_
shutterPrefix
=
"RC7_"
;
}
}
else
if
(
value
.
toInt
()
==
8
)
else
if
(
value
.
toInt
()
==
8
)
{
{
...
@@ -496,7 +480,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
...
@@ -496,7 +480,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
disconnect
(
ui
.
rollChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateRoll
()));
disconnect
(
ui
.
rollChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateRoll
()));
ui
.
rollChannelComboBox
->
setCurrentIndex
(
3
);
ui
.
rollChannelComboBox
->
setCurrentIndex
(
3
);
connect
(
ui
.
rollChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateRoll
()));
connect
(
ui
.
rollChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateRoll
()));
rollPrefix
=
"RC7_"
;
m_
rollPrefix
=
"RC7_"
;
}
}
else
if
(
value
.
toInt
()
==
7
)
else
if
(
value
.
toInt
()
==
7
)
{
{
...
@@ -504,7 +488,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
...
@@ -504,7 +488,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
disconnect
(
ui
.
tiltChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateTilt
()));
disconnect
(
ui
.
tiltChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateTilt
()));
ui
.
tiltChannelComboBox
->
setCurrentIndex
(
3
);
ui
.
tiltChannelComboBox
->
setCurrentIndex
(
3
);
connect
(
ui
.
tiltChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateTilt
()));
connect
(
ui
.
tiltChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateTilt
()));
tiltPrefix
=
"RC7_"
;
m_
tiltPrefix
=
"RC7_"
;
}
}
else
if
(
value
.
toInt
()
==
6
)
else
if
(
value
.
toInt
()
==
6
)
{
{
...
@@ -512,7 +496,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
...
@@ -512,7 +496,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
disconnect
(
ui
.
panChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updatePan
()));
disconnect
(
ui
.
panChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updatePan
()));
ui
.
panChannelComboBox
->
setCurrentIndex
(
3
);
ui
.
panChannelComboBox
->
setCurrentIndex
(
3
);
connect
(
ui
.
panChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updatePan
()));
connect
(
ui
.
panChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updatePan
()));
panPrefix
=
"RC7_"
;
m_
panPrefix
=
"RC7_"
;
}
}
m_uas
->
getParamManager
()
->
requestParameterUpdate
(
1
,
"RC7_MIN"
);
m_uas
->
getParamManager
()
->
requestParameterUpdate
(
1
,
"RC7_MIN"
);
m_uas
->
getParamManager
()
->
requestParameterUpdate
(
1
,
"RC7_MAX"
);
m_uas
->
getParamManager
()
->
requestParameterUpdate
(
1
,
"RC7_MAX"
);
...
@@ -526,7 +510,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
...
@@ -526,7 +510,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
disconnect
(
ui
.
shutterChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateShutter
()));
disconnect
(
ui
.
shutterChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateShutter
()));
ui
.
shutterChannelComboBox
->
setCurrentIndex
(
6
);
ui
.
shutterChannelComboBox
->
setCurrentIndex
(
6
);
connect
(
ui
.
shutterChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateShutter
()));
connect
(
ui
.
shutterChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateShutter
()));
shutterPrefix
=
"RC8_"
;
m_
shutterPrefix
=
"RC8_"
;
}
}
else
if
(
value
.
toInt
()
==
8
)
else
if
(
value
.
toInt
()
==
8
)
{
{
...
@@ -534,7 +518,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
...
@@ -534,7 +518,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
disconnect
(
ui
.
rollChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateRoll
()));
disconnect
(
ui
.
rollChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateRoll
()));
ui
.
rollChannelComboBox
->
setCurrentIndex
(
4
);
ui
.
rollChannelComboBox
->
setCurrentIndex
(
4
);
connect
(
ui
.
rollChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateRoll
()));
connect
(
ui
.
rollChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateRoll
()));
rollPrefix
=
"RC8_"
;
m_
rollPrefix
=
"RC8_"
;
}
}
else
if
(
value
.
toInt
()
==
7
)
else
if
(
value
.
toInt
()
==
7
)
{
{
...
@@ -542,7 +526,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
...
@@ -542,7 +526,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
disconnect
(
ui
.
tiltChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateTilt
()));
disconnect
(
ui
.
tiltChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateTilt
()));
ui
.
tiltChannelComboBox
->
setCurrentIndex
(
4
);
ui
.
tiltChannelComboBox
->
setCurrentIndex
(
4
);
connect
(
ui
.
tiltChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateTilt
()));
connect
(
ui
.
tiltChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateTilt
()));
tiltPrefix
=
"RC8_"
;
m_
tiltPrefix
=
"RC8_"
;
}
}
else
if
(
value
.
toInt
()
==
6
)
else
if
(
value
.
toInt
()
==
6
)
{
{
...
@@ -550,7 +534,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
...
@@ -550,7 +534,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
disconnect
(
ui
.
panChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updatePan
()));
disconnect
(
ui
.
panChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updatePan
()));
ui
.
panChannelComboBox
->
setCurrentIndex
(
4
);
ui
.
panChannelComboBox
->
setCurrentIndex
(
4
);
connect
(
ui
.
panChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updatePan
()));
connect
(
ui
.
panChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updatePan
()));
panPrefix
=
"RC8_"
;
m_
panPrefix
=
"RC8_"
;
}
}
m_uas
->
getParamManager
()
->
requestParameterUpdate
(
1
,
"RC8_MIN"
);
m_uas
->
getParamManager
()
->
requestParameterUpdate
(
1
,
"RC8_MIN"
);
m_uas
->
getParamManager
()
->
requestParameterUpdate
(
1
,
"RC8_MAX"
);
m_uas
->
getParamManager
()
->
requestParameterUpdate
(
1
,
"RC8_MAX"
);
...
@@ -564,7 +548,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
...
@@ -564,7 +548,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
disconnect
(
ui
.
shutterChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateShutter
()));
disconnect
(
ui
.
shutterChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateShutter
()));
ui
.
shutterChannelComboBox
->
setCurrentIndex
(
7
);
ui
.
shutterChannelComboBox
->
setCurrentIndex
(
7
);
connect
(
ui
.
shutterChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateShutter
()));
connect
(
ui
.
shutterChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateShutter
()));
shutterPrefix
=
"RC10_"
;
m_
shutterPrefix
=
"RC10_"
;
}
}
else
if
(
value
.
toInt
()
==
8
)
else
if
(
value
.
toInt
()
==
8
)
{
{
...
@@ -572,7 +556,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
...
@@ -572,7 +556,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
disconnect
(
ui
.
rollChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateRoll
()));
disconnect
(
ui
.
rollChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateRoll
()));
ui
.
rollChannelComboBox
->
setCurrentIndex
(
5
);
ui
.
rollChannelComboBox
->
setCurrentIndex
(
5
);
connect
(
ui
.
rollChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateRoll
()));
connect
(
ui
.
rollChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateRoll
()));
rollPrefix
=
"RC10_"
;
m_
rollPrefix
=
"RC10_"
;
}
}
else
if
(
value
.
toInt
()
==
7
)
else
if
(
value
.
toInt
()
==
7
)
{
{
...
@@ -580,7 +564,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
...
@@ -580,7 +564,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
disconnect
(
ui
.
tiltChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateTilt
()));
disconnect
(
ui
.
tiltChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateTilt
()));
ui
.
tiltChannelComboBox
->
setCurrentIndex
(
5
);
ui
.
tiltChannelComboBox
->
setCurrentIndex
(
5
);
connect
(
ui
.
tiltChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateTilt
()));
connect
(
ui
.
tiltChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateTilt
()));
tiltPrefix
=
"RC10_"
;
m_
tiltPrefix
=
"RC10_"
;
}
}
else
if
(
value
.
toInt
()
==
6
)
else
if
(
value
.
toInt
()
==
6
)
{
{
...
@@ -588,7 +572,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
...
@@ -588,7 +572,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
disconnect
(
ui
.
panChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updatePan
()));
disconnect
(
ui
.
panChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updatePan
()));
ui
.
panChannelComboBox
->
setCurrentIndex
(
5
);
ui
.
panChannelComboBox
->
setCurrentIndex
(
5
);
connect
(
ui
.
panChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updatePan
()));
connect
(
ui
.
panChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updatePan
()));
panPrefix
=
"RC10_"
;
m_
panPrefix
=
"RC10_"
;
}
}
m_uas
->
getParamManager
()
->
requestParameterUpdate
(
1
,
"RC10_MIN"
);
m_uas
->
getParamManager
()
->
requestParameterUpdate
(
1
,
"RC10_MIN"
);
m_uas
->
getParamManager
()
->
requestParameterUpdate
(
1
,
"RC10_MAX"
);
m_uas
->
getParamManager
()
->
requestParameterUpdate
(
1
,
"RC10_MAX"
);
...
@@ -602,7 +586,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
...
@@ -602,7 +586,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
disconnect
(
ui
.
shutterChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateShutter
()));
disconnect
(
ui
.
shutterChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateShutter
()));
ui
.
shutterChannelComboBox
->
setCurrentIndex
(
8
);
ui
.
shutterChannelComboBox
->
setCurrentIndex
(
8
);
connect
(
ui
.
shutterChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateShutter
()));
connect
(
ui
.
shutterChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateShutter
()));
shutterPrefix
=
"RC11_"
;
m_
shutterPrefix
=
"RC11_"
;
}
}
else
if
(
value
.
toInt
()
==
8
)
else
if
(
value
.
toInt
()
==
8
)
{
{
...
@@ -610,7 +594,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
...
@@ -610,7 +594,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
disconnect
(
ui
.
rollChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateRoll
()));
disconnect
(
ui
.
rollChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateRoll
()));
ui
.
rollChannelComboBox
->
setCurrentIndex
(
6
);
ui
.
rollChannelComboBox
->
setCurrentIndex
(
6
);
connect
(
ui
.
rollChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateRoll
()));
connect
(
ui
.
rollChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateRoll
()));
rollPrefix
=
"RC11_"
;
m_
rollPrefix
=
"RC11_"
;
}
}
else
if
(
value
.
toInt
()
==
7
)
else
if
(
value
.
toInt
()
==
7
)
{
{
...
@@ -618,7 +602,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
...
@@ -618,7 +602,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
disconnect
(
ui
.
tiltChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateTilt
()));
disconnect
(
ui
.
tiltChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateTilt
()));
ui
.
tiltChannelComboBox
->
setCurrentIndex
(
6
);
ui
.
tiltChannelComboBox
->
setCurrentIndex
(
6
);
connect
(
ui
.
tiltChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateTilt
()));
connect
(
ui
.
tiltChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updateTilt
()));
tiltPrefix
=
"RC11_"
;
m_
tiltPrefix
=
"RC11_"
;
}
}
else
if
(
value
.
toInt
()
==
6
)
else
if
(
value
.
toInt
()
==
6
)
{
{
...
@@ -626,7 +610,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
...
@@ -626,7 +610,7 @@ void CameraGimbalConfig::parameterChanged(int uas, int component, QString parame
disconnect
(
ui
.
panChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updatePan
()));
disconnect
(
ui
.
panChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updatePan
()));
ui
.
panChannelComboBox
->
setCurrentIndex
(
6
);
ui
.
panChannelComboBox
->
setCurrentIndex
(
6
);
connect
(
ui
.
panChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updatePan
()));
connect
(
ui
.
panChannelComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
updatePan
()));
panPrefix
=
"RC11_"
;
m_
panPrefix
=
"RC11_"
;
}
}
m_uas
->
getParamManager
()
->
requestParameterUpdate
(
1
,
"RC11_MIN"
);
m_uas
->
getParamManager
()
->
requestParameterUpdate
(
1
,
"RC11_MIN"
);
m_uas
->
getParamManager
()
->
requestParameterUpdate
(
1
,
"RC11_MAX"
);
m_uas
->
getParamManager
()
->
requestParameterUpdate
(
1
,
"RC11_MAX"
);
...
...
src/ui/configuration/CameraGimbalConfig.h
View file @
31a118ce
...
@@ -21,10 +21,10 @@ private slots:
...
@@ -21,10 +21,10 @@ private slots:
private:
private:
Ui
::
CameraGimbalConfig
ui
;
Ui
::
CameraGimbalConfig
ui
;
QString
shutterPrefix
;
QString
m_
shutterPrefix
;
QString
rollPrefix
;
QString
m_
rollPrefix
;
QString
tiltPrefix
;
QString
m_
tiltPrefix
;
QString
panPrefix
;
QString
m_
panPrefix
;
};
};
#endif // CAMERAGIMBALCONFIG_H
#endif // CAMERAGIMBALCONFIG_H
src/ui/configuration/CompassConfig.cc
View file @
31a118ce
#include "CompassConfig.h"
#include "CompassConfig.h"
CompassConfig
::
CompassConfig
(
QWidget
*
parent
)
:
Q
Widget
(
parent
)
CompassConfig
::
CompassConfig
(
QWidget
*
parent
)
:
AP2Config
Widget
(
parent
)
{
{
m_uas
=
0
;
m_uas
=
0
;
ui
.
setupUi
(
this
);
ui
.
setupUi
(
this
);
...
@@ -13,9 +13,6 @@ CompassConfig::CompassConfig(QWidget *parent) : QWidget(parent)
...
@@ -13,9 +13,6 @@ CompassConfig::CompassConfig(QWidget *parent) : QWidget(parent)
connect
(
ui
.
autoDecCheckBox
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
autoDecClicked
(
bool
)));
connect
(
ui
.
autoDecCheckBox
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
autoDecClicked
(
bool
)));
connect
(
ui
.
orientationComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
orientationComboChanged
(
int
)));
connect
(
ui
.
orientationComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
orientationComboChanged
(
int
)));
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
activeUASSet
(
UASInterface
*
)));
activeUASSet
(
UASManager
::
instance
()
->
getActiveUAS
());
ui
.
orientationComboBox
->
addItem
(
"ROTATION_NONE"
);
ui
.
orientationComboBox
->
addItem
(
"ROTATION_NONE"
);
ui
.
orientationComboBox
->
addItem
(
"ROTATION_YAW_45"
);
ui
.
orientationComboBox
->
addItem
(
"ROTATION_YAW_45"
);
ui
.
orientationComboBox
->
addItem
(
"ROTATION_YAW_90"
);
ui
.
orientationComboBox
->
addItem
(
"ROTATION_YAW_90"
);
...
@@ -47,16 +44,6 @@ CompassConfig::CompassConfig(QWidget *parent) : QWidget(parent)
...
@@ -47,16 +44,6 @@ CompassConfig::CompassConfig(QWidget *parent) : QWidget(parent)
CompassConfig
::~
CompassConfig
()
CompassConfig
::~
CompassConfig
()
{
{
}
}
void
CompassConfig
::
activeUASSet
(
UASInterface
*
uas
)
{
if
(
!
uas
)
return
;
if
(
!
m_uas
)
{
disconnect
(
m_uas
,
SIGNAL
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)),
this
,
SLOT
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)));
}
m_uas
=
uas
;
connect
(
m_uas
,
SIGNAL
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)),
this
,
SLOT
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)));
}
void
CompassConfig
::
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
)
void
CompassConfig
::
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
)
{
{
if
(
parameterName
==
"MAG_ENABLE"
)
if
(
parameterName
==
"MAG_ENABLE"
)
...
...
src/ui/configuration/CompassConfig.h
View file @
31a118ce
...
@@ -5,7 +5,8 @@
...
@@ -5,7 +5,8 @@
#include "ui_CompassConfig.h"
#include "ui_CompassConfig.h"
#include "UASManager.h"
#include "UASManager.h"
#include "UASInterface.h"
#include "UASInterface.h"
class
CompassConfig
:
public
QWidget
#include "AP2ConfigWidget.h"
class
CompassConfig
:
public
AP2ConfigWidget
{
{
Q_OBJECT
Q_OBJECT
...
@@ -13,7 +14,6 @@ public:
...
@@ -13,7 +14,6 @@ public:
explicit
CompassConfig
(
QWidget
*
parent
=
0
);
explicit
CompassConfig
(
QWidget
*
parent
=
0
);
~
CompassConfig
();
~
CompassConfig
();
private
slots
:
private
slots
:
void
activeUASSet
(
UASInterface
*
uas
);
void
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
);
void
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
);
void
enableClicked
(
bool
enabled
);
void
enableClicked
(
bool
enabled
);
void
autoDecClicked
(
bool
enabled
);
void
autoDecClicked
(
bool
enabled
);
...
...
src/ui/configuration/FailSafeConfig.cc
View file @
31a118ce
...
@@ -87,6 +87,7 @@ void FailSafeConfig::gcsChecked(bool checked)
...
@@ -87,6 +87,7 @@ void FailSafeConfig::gcsChecked(bool checked)
{
{
if
(
!
m_uas
)
if
(
!
m_uas
)
{
{
showNullMAVErrorMessageBox
();
return
;
return
;
}
}
if
(
checked
)
if
(
checked
)
...
@@ -103,6 +104,7 @@ void FailSafeConfig::throttleActionChecked(bool checked)
...
@@ -103,6 +104,7 @@ void FailSafeConfig::throttleActionChecked(bool checked)
{
{
if
(
!
m_uas
)
if
(
!
m_uas
)
{
{
showNullMAVErrorMessageBox
();
return
;
return
;
}
}
if
(
checked
)
if
(
checked
)
...
@@ -119,6 +121,7 @@ void FailSafeConfig::throttleChecked(bool checked)
...
@@ -119,6 +121,7 @@ void FailSafeConfig::throttleChecked(bool checked)
{
{
if
(
!
m_uas
)
if
(
!
m_uas
)
{
{
showNullMAVErrorMessageBox
();
return
;
return
;
}
}
if
(
checked
)
if
(
checked
)
...
@@ -135,6 +138,7 @@ void FailSafeConfig::throttlePwmChanged()
...
@@ -135,6 +138,7 @@ void FailSafeConfig::throttlePwmChanged()
{
{
if
(
!
m_uas
)
if
(
!
m_uas
)
{
{
showNullMAVErrorMessageBox
();
return
;
return
;
}
}
m_uas
->
setParameter
(
1
,
"THR_FS_VALUE"
,
ui
.
throttlePwmSpinBox
->
value
());
m_uas
->
setParameter
(
1
,
"THR_FS_VALUE"
,
ui
.
throttlePwmSpinBox
->
value
());
...
@@ -144,6 +148,7 @@ void FailSafeConfig::throttleFailSafeChanged(int index)
...
@@ -144,6 +148,7 @@ void FailSafeConfig::throttleFailSafeChanged(int index)
{
{
if
(
!
m_uas
)
if
(
!
m_uas
)
{
{
showNullMAVErrorMessageBox
();
return
;
return
;
}
}
m_uas
->
setParameter
(
1
,
"FS_THR_ENABLE"
,
index
);
m_uas
->
setParameter
(
1
,
"FS_THR_ENABLE"
,
index
);
...
@@ -153,6 +158,7 @@ void FailSafeConfig::fsLongClicked(bool checked)
...
@@ -153,6 +158,7 @@ void FailSafeConfig::fsLongClicked(bool checked)
{
{
if
(
!
m_uas
)
if
(
!
m_uas
)
{
{
showNullMAVErrorMessageBox
();
return
;
return
;
}
}
if
(
checked
)
if
(
checked
)
...
@@ -169,6 +175,7 @@ void FailSafeConfig::fsShortClicked(bool checked)
...
@@ -169,6 +175,7 @@ void FailSafeConfig::fsShortClicked(bool checked)
{
{
if
(
!
m_uas
)
if
(
!
m_uas
)
{
{
showNullMAVErrorMessageBox
();
return
;
return
;
}
}
if
(
checked
)
if
(
checked
)
...
@@ -185,6 +192,7 @@ void FailSafeConfig::batteryFailChecked(bool checked)
...
@@ -185,6 +192,7 @@ void FailSafeConfig::batteryFailChecked(bool checked)
{
{
if
(
!
m_uas
)
if
(
!
m_uas
)
{
{
showNullMAVErrorMessageBox
();
return
;
return
;
}
}
if
(
checked
)
if
(
checked
)
...
@@ -202,11 +210,21 @@ FailSafeConfig::~FailSafeConfig()
...
@@ -202,11 +210,21 @@ FailSafeConfig::~FailSafeConfig()
}
}
void
FailSafeConfig
::
activeUASSet
(
UASInterface
*
uas
)
void
FailSafeConfig
::
activeUASSet
(
UASInterface
*
uas
)
{
{
if
(
m_uas
)
{
disconnect
(
m_uas
,
SIGNAL
(
remoteControlChannelRawChanged
(
int
,
float
)),
this
,
SLOT
(
remoteControlChannelRawChanges
(
int
,
float
)));
disconnect
(
m_uas
,
SIGNAL
(
hilActuatorsChanged
(
uint64_t
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
)),
this
,
SLOT
(
hilActuatorsChanged
(
uint64_t
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
)));
disconnect
(
m_uas
,
SIGNAL
(
armingChanged
(
bool
)),
this
,
SLOT
(
armingChanged
(
bool
)));
}
AP2ConfigWidget
::
activeUASSet
(
uas
);
AP2ConfigWidget
::
activeUASSet
(
uas
);
connect
(
uas
,
SIGNAL
(
remoteControlChannelRawChanged
(
int
,
float
)),
this
,
SLOT
(
remoteControlChannelRawChanges
(
int
,
float
)));
if
(
!
uas
)
connect
(
uas
,
SIGNAL
(
hilActuatorsChanged
(
uint64_t
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
)),
this
,
SLOT
(
hilActuatorsChanged
(
uint64_t
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
)));
{
connect
(
uas
,
SIGNAL
(
armingChanged
(
bool
)),
this
,
SLOT
(
armingChanged
(
bool
)));
return
;
if
(
uas
->
getSystemType
()
==
MAV_TYPE_FIXED_WING
)
}
connect
(
m_uas
,
SIGNAL
(
remoteControlChannelRawChanged
(
int
,
float
)),
this
,
SLOT
(
remoteControlChannelRawChanges
(
int
,
float
)));
connect
(
m_uas
,
SIGNAL
(
hilActuatorsChanged
(
uint64_t
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
)),
this
,
SLOT
(
hilActuatorsChanged
(
uint64_t
,
float
,
float
,
float
,
float
,
float
,
float
,
float
,
float
)));
connect
(
m_uas
,
SIGNAL
(
armingChanged
(
bool
)),
this
,
SLOT
(
armingChanged
(
bool
)));
if
(
m_uas
->
getSystemType
()
==
MAV_TYPE_FIXED_WING
)
{
{
ui
.
batteryFailCheckBox
->
setVisible
(
false
);
ui
.
batteryFailCheckBox
->
setVisible
(
false
);
ui
.
throttleFailSafeComboBox
->
setVisible
(
false
);
ui
.
throttleFailSafeComboBox
->
setVisible
(
false
);
...
@@ -221,7 +239,7 @@ void FailSafeConfig::activeUASSet(UASInterface *uas)
...
@@ -221,7 +239,7 @@ void FailSafeConfig::activeUASSet(UASInterface *uas)
ui
.
fsLongCheckBox
->
setVisible
(
true
);
ui
.
fsLongCheckBox
->
setVisible
(
true
);
ui
.
fsShortCheckBox
->
setVisible
(
true
);
ui
.
fsShortCheckBox
->
setVisible
(
true
);
}
}
else
if
(
uas
->
getSystemType
()
==
MAV_TYPE_QUADROTOR
)
else
if
(
m_
uas
->
getSystemType
()
==
MAV_TYPE_QUADROTOR
)
{
{
ui
.
batteryFailCheckBox
->
setVisible
(
true
);
ui
.
batteryFailCheckBox
->
setVisible
(
true
);
ui
.
throttleFailSafeComboBox
->
setVisible
(
true
);
ui
.
throttleFailSafeComboBox
->
setVisible
(
true
);
...
...
src/ui/configuration/FlightModeConfig.cc
View file @
31a118ce
#include "FlightModeConfig.h"
#include "FlightModeConfig.h"
FlightModeConfig
::
FlightModeConfig
(
QWidget
*
parent
)
:
Q
Widget
(
parent
)
FlightModeConfig
::
FlightModeConfig
(
QWidget
*
parent
)
:
AP2Config
Widget
(
parent
)
{
{
ui
.
setupUi
(
this
);
ui
.
setupUi
(
this
);
connect
(
ui
.
savePushButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
saveButtonClicked
()));
connect
(
ui
.
savePushButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
saveButtonClicked
()));
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
setActiveUAS
(
UASInterface
*
)));
}
}
FlightModeConfig
::~
FlightModeConfig
()
FlightModeConfig
::~
FlightModeConfig
()
{
{
}
}
void
FlightModeConfig
::
setActiveUAS
(
UASInterface
*
uas
)
void
FlightModeConfig
::
activeUASSet
(
UASInterface
*
uas
)
{
{
if
(
!
uas
)
return
;
if
(
m_uas
)
if
(
m_uas
)
{
{
disconnect
(
m_uas
,
SIGNAL
(
modeChanged
(
int
,
QString
,
QString
)),
this
,
SLOT
(
modeChanged
(
int
,
QString
,
QString
)));
disconnect
(
m_uas
,
SIGNAL
(
remoteControlChannelRawChanged
(
int
,
float
)),
this
,
SLOT
(
remoteControlChannelRawChanged
(
int
,
float
)));
}
}
m_uas
=
uas
;
AP2ConfigWidget
::
activeUASSet
(
uas
);
if
(
!
uas
)
return
;
connect
(
m_uas
,
SIGNAL
(
modeChanged
(
int
,
QString
,
QString
)),
this
,
SLOT
(
modeChanged
(
int
,
QString
,
QString
)));
connect
(
m_uas
,
SIGNAL
(
modeChanged
(
int
,
QString
,
QString
)),
this
,
SLOT
(
modeChanged
(
int
,
QString
,
QString
)));
connect
(
m_uas
,
SIGNAL
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)),
this
,
SLOT
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)));
connect
(
m_uas
,
SIGNAL
(
remoteControlChannelRawChanged
(
int
,
float
)),
this
,
SLOT
(
remoteControlChannelRawChanged
(
int
,
float
)));
connect
(
m_uas
,
SIGNAL
(
remoteControlChannelRawChanged
(
int
,
float
)),
this
,
SLOT
(
remoteControlChannelRawChanged
(
int
,
float
)));
QStringList
itemlist
;
QStringList
itemlist
;
if
(
m_uas
->
getSystemType
()
==
MAV_TYPE_FIXED_WING
)
if
(
m_uas
->
getSystemType
()
==
MAV_TYPE_FIXED_WING
)
...
...
src/ui/configuration/FlightModeConfig.h
View file @
31a118ce
...
@@ -5,8 +5,9 @@
...
@@ -5,8 +5,9 @@
#include "ui_FlightModeConfig.h"
#include "ui_FlightModeConfig.h"
#include "UASInterface.h"
#include "UASInterface.h"
#include "UASManager.h"
#include "UASManager.h"
#include "AP2ConfigWidget.h"
class
FlightModeConfig
:
public
Q
Widget
class
FlightModeConfig
:
public
AP2Config
Widget
{
{
Q_OBJECT
Q_OBJECT
...
@@ -14,7 +15,7 @@ public:
...
@@ -14,7 +15,7 @@ public:
explicit
FlightModeConfig
(
QWidget
*
parent
=
0
);
explicit
FlightModeConfig
(
QWidget
*
parent
=
0
);
~
FlightModeConfig
();
~
FlightModeConfig
();
private
slots
:
private
slots
:
void
setActiveUAS
(
UASInterface
*
uas
);
void
activeUASSet
(
UASInterface
*
uas
);
void
saveButtonClicked
();
void
saveButtonClicked
();
void
modeChanged
(
int
sysId
,
QString
status
,
QString
description
);
void
modeChanged
(
int
sysId
,
QString
status
,
QString
description
);
void
remoteControlChannelRawChanged
(
int
chan
,
float
val
);
void
remoteControlChannelRawChanged
(
int
chan
,
float
val
);
...
...
src/ui/configuration/FrameTypeConfig.cc
View file @
31a118ce
...
@@ -32,9 +32,8 @@ This file is part of the QGROUNDCONTROL project
...
@@ -32,9 +32,8 @@ This file is part of the QGROUNDCONTROL project
#include "FrameTypeConfig.h"
#include "FrameTypeConfig.h"
FrameTypeConfig
::
FrameTypeConfig
(
QWidget
*
parent
)
:
Q
Widget
(
parent
)
FrameTypeConfig
::
FrameTypeConfig
(
QWidget
*
parent
)
:
AP2Config
Widget
(
parent
)
{
{
m_uas
=
0
;
ui
.
setupUi
(
this
);
ui
.
setupUi
(
this
);
//Disable until we get a FRAME parameter.
//Disable until we get a FRAME parameter.
...
@@ -45,23 +44,11 @@ FrameTypeConfig::FrameTypeConfig(QWidget *parent) : QWidget(parent)
...
@@ -45,23 +44,11 @@ FrameTypeConfig::FrameTypeConfig(QWidget *parent) : QWidget(parent)
connect
(
ui
.
plusRadioButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
plusFrameSelected
()));
connect
(
ui
.
plusRadioButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
plusFrameSelected
()));
connect
(
ui
.
xRadioButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
xFrameSelected
()));
connect
(
ui
.
xRadioButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
xFrameSelected
()));
connect
(
ui
.
vRadioButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
vFrameSelected
()));
connect
(
ui
.
vRadioButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
vFrameSelected
()));
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
activeUASSet
(
UASInterface
*
)));
activeUASSet
(
UASManager
::
instance
()
->
getActiveUAS
());
}
}
FrameTypeConfig
::~
FrameTypeConfig
()
FrameTypeConfig
::~
FrameTypeConfig
()
{
{
}
}
void
FrameTypeConfig
::
activeUASSet
(
UASInterface
*
uas
)
{
if
(
!
uas
)
return
;
if
(
!
m_uas
)
{
disconnect
(
m_uas
,
SIGNAL
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)),
this
,
SLOT
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)));
}
m_uas
=
uas
;
connect
(
m_uas
,
SIGNAL
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)),
this
,
SLOT
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)));
}
void
FrameTypeConfig
::
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
)
void
FrameTypeConfig
::
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
)
{
{
if
(
parameterName
==
"FRAME"
)
if
(
parameterName
==
"FRAME"
)
...
...
src/ui/configuration/FrameTypeConfig.h
View file @
31a118ce
...
@@ -37,7 +37,8 @@ This file is part of the QGROUNDCONTROL project
...
@@ -37,7 +37,8 @@ This file is part of the QGROUNDCONTROL project
#include "UASInterface.h"
#include "UASInterface.h"
#include "UASManager.h"
#include "UASManager.h"
#include "QGCUASParamManager.h"
#include "QGCUASParamManager.h"
class
FrameTypeConfig
:
public
QWidget
#include "AP2ConfigWidget.h"
class
FrameTypeConfig
:
public
AP2ConfigWidget
{
{
Q_OBJECT
Q_OBJECT
...
@@ -45,7 +46,6 @@ public:
...
@@ -45,7 +46,6 @@ public:
explicit
FrameTypeConfig
(
QWidget
*
parent
=
0
);
explicit
FrameTypeConfig
(
QWidget
*
parent
=
0
);
~
FrameTypeConfig
();
~
FrameTypeConfig
();
private
slots
:
private
slots
:
void
activeUASSet
(
UASInterface
*
uas
);
void
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
);
void
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
);
void
xFrameSelected
();
void
xFrameSelected
();
void
plusFrameSelected
();
void
plusFrameSelected
();
...
...
src/ui/configuration/OsdConfig.cc
View file @
31a118ce
...
@@ -14,7 +14,7 @@ void OsdConfig::enableButtonClicked()
...
@@ -14,7 +14,7 @@ void OsdConfig::enableButtonClicked()
{
{
if
(
!
m_uas
)
if
(
!
m_uas
)
{
{
QMessageBox
::
information
(
0
,
tr
(
"Error"
),
tr
(
"Please connect to a MAV before attempting to set configuration"
)
);
showNullMAVErrorMessageBox
(
);
return
;
return
;
}
}
m_uas
->
getParamManager
()
->
setParameter
(
1
,
"SR0_EXT_STAT"
,
2
);
m_uas
->
getParamManager
()
->
setParameter
(
1
,
"SR0_EXT_STAT"
,
2
);
...
...
src/ui/configuration/RadioCalibrationConfig.cc
View file @
31a118ce
...
@@ -32,15 +32,12 @@ This file is part of the QGROUNDCONTROL project
...
@@ -32,15 +32,12 @@ This file is part of the QGROUNDCONTROL project
#include "RadioCalibrationConfig.h"
#include "RadioCalibrationConfig.h"
#include <QMessageBox>
#include <QMessageBox>
RadioCalibrationConfig
::
RadioCalibrationConfig
(
QWidget
*
parent
)
:
Q
Widget
(
parent
)
RadioCalibrationConfig
::
RadioCalibrationConfig
(
QWidget
*
parent
)
:
AP2Config
Widget
(
parent
)
{
{
ui
.
setupUi
(
this
);
ui
.
setupUi
(
this
);
connect
(
ui
.
calibrateButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
calibrateButtonClicked
()));
connect
(
ui
.
calibrateButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
calibrateButtonClicked
()));
m_uas
=
0
;
m_calibrationEnabled
=
false
;
m_calibrationEnabled
=
false
;
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
setActiveUAS
(
UASInterface
*
)));
setActiveUAS
(
UASManager
::
instance
()
->
getActiveUAS
());
ui
.
rollWidget
->
setMin
(
800
);
ui
.
rollWidget
->
setMin
(
800
);
ui
.
rollWidget
->
setMax
(
2200
);
ui
.
rollWidget
->
setMax
(
2200
);
ui
.
pitchWidget
->
setMin
(
800
);
ui
.
pitchWidget
->
setMin
(
800
);
...
@@ -79,20 +76,18 @@ RadioCalibrationConfig::RadioCalibrationConfig(QWidget *parent) : QWidget(parent
...
@@ -79,20 +76,18 @@ RadioCalibrationConfig::RadioCalibrationConfig(QWidget *parent) : QWidget(parent
RadioCalibrationConfig
::~
RadioCalibrationConfig
()
RadioCalibrationConfig
::~
RadioCalibrationConfig
()
{
{
}
}
void
RadioCalibrationConfig
::
setActiveUAS
(
UASInterface
*
uas
)
void
RadioCalibrationConfig
::
activeUASSet
(
UASInterface
*
uas
)
{
{
if
(
uas
==
NULL
)
return
;
if
(
m_uas
)
if
(
m_uas
)
{
{
// Disconnect old system
disconnect
(
m_uas
,
SIGNAL
(
remoteControlChannelRawChanged
(
int
,
float
)),
this
,
SLOT
(
remoteControlChannelRawChanged
(
int
,
float
)));
disconnect
(
m_uas
,
SIGNAL
(
remoteControlChannelRawChanged
(
int
,
float
)),
this
,
SLOT
(
remoteControlChannelRawChanged
(
int
,
float
)));
disconnect
(
m_uas
,
SIGNAL
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)),
this
,
SLOT
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)));
}
}
m_uas
=
uas
;
AP2ConfigWidget
::
activeUASSet
(
uas
);
if
(
!
uas
)
{
return
;
}
connect
(
m_uas
,
SIGNAL
(
remoteControlChannelRawChanged
(
int
,
float
)),
this
,
SLOT
(
remoteControlChannelRawChanged
(
int
,
float
)));
connect
(
m_uas
,
SIGNAL
(
remoteControlChannelRawChanged
(
int
,
float
)),
this
,
SLOT
(
remoteControlChannelRawChanged
(
int
,
float
)));
connect
(
m_uas
,
SIGNAL
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)),
this
,
SLOT
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)));
}
}
void
RadioCalibrationConfig
::
remoteControlChannelRawChanged
(
int
chan
,
float
val
)
void
RadioCalibrationConfig
::
remoteControlChannelRawChanged
(
int
chan
,
float
val
)
{
{
...
...
src/ui/configuration/RadioCalibrationConfig.h
View file @
31a118ce
...
@@ -39,7 +39,8 @@ This file is part of the QGROUNDCONTROL project
...
@@ -39,7 +39,8 @@ This file is part of the QGROUNDCONTROL project
#include "ui_RadioCalibrationConfig.h"
#include "ui_RadioCalibrationConfig.h"
#include "UASManager.h"
#include "UASManager.h"
#include "UASInterface.h"
#include "UASInterface.h"
class
RadioCalibrationConfig
:
public
QWidget
#include "AP2ConfigWidget.h"
class
RadioCalibrationConfig
:
public
AP2ConfigWidget
{
{
Q_OBJECT
Q_OBJECT
...
@@ -50,7 +51,7 @@ protected:
...
@@ -50,7 +51,7 @@ protected:
void
showEvent
(
QShowEvent
*
event
);
void
showEvent
(
QShowEvent
*
event
);
void
hideEvent
(
QHideEvent
*
event
);
void
hideEvent
(
QHideEvent
*
event
);
private
slots
:
private
slots
:
void
setActiveUAS
(
UASInterface
*
uas
);
void
activeUASSet
(
UASInterface
*
uas
);
void
remoteControlChannelRawChanged
(
int
chan
,
float
val
);
void
remoteControlChannelRawChanged
(
int
chan
,
float
val
);
void
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
);
void
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
);
void
guiUpdateTimerTick
();
void
guiUpdateTimerTick
();
...
...
src/ui/configuration/StandardParamConfig.cc
View file @
31a118ce
...
@@ -7,13 +7,6 @@ StandardParamConfig::StandardParamConfig(QWidget *parent) : AP2ConfigWidget(pare
...
@@ -7,13 +7,6 @@ StandardParamConfig::StandardParamConfig(QWidget *parent) : AP2ConfigWidget(pare
StandardParamConfig
::~
StandardParamConfig
()
StandardParamConfig
::~
StandardParamConfig
()
{
{
}
}
void
StandardParamConfig
::
activeUASSet
(
UASInterface
*
uas
)
{
AP2ConfigWidget
::
activeUASSet
(
uas
);
}
void
StandardParamConfig
::
addRange
(
QString
title
,
QString
description
,
QString
param
,
double
min
,
double
max
)
void
StandardParamConfig
::
addRange
(
QString
title
,
QString
description
,
QString
param
,
double
min
,
double
max
)
{
{
ParamWidget
*
widget
=
new
ParamWidget
(
ui
.
scrollAreaWidgetContents
);
ParamWidget
*
widget
=
new
ParamWidget
(
ui
.
scrollAreaWidgetContents
);
...
...
src/ui/configuration/StandardParamConfig.h
View file @
31a118ce
...
@@ -18,7 +18,6 @@ private slots:
...
@@ -18,7 +18,6 @@ private slots:
void
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
);
void
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
);
private:
private:
QMap
<
QString
,
ParamWidget
*>
paramToWidgetMap
;
QMap
<
QString
,
ParamWidget
*>
paramToWidgetMap
;
void
activeUASSet
(
UASInterface
*
uas
);
Ui
::
StandardParamConfig
ui
;
Ui
::
StandardParamConfig
ui
;
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment