Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
44a11040
Commit
44a11040
authored
Mar 26, 2015
by
Don Gagne
Browse files
Remove unused code
parent
bb3a268d
Changes
10
Expand all
Show whitespace changes
Inline
Side-by-side
qgroundcontrol.pro
View file @
44a11040
...
...
@@ -717,7 +717,6 @@ INCLUDEPATH += \
FORMS
+=
\
src
/
VehicleSetup
/
ParameterEditor
.
ui
\
src
/
ui
/
QGCPX4VehicleConfig
.
ui
\
src
/
VehicleSetup
/
SetupView
.
ui
\
HEADERS
+=
\
...
...
src/ui/QGCConfigView.cc
deleted
100644 → 0
View file @
bb3a268d
#include
"QGCConfigView.h"
#include
"ui_QGCConfigView.h"
#include
"UASManager.h"
#include
"QGCPX4VehicleConfig.h"
#include
"MainWindow.h"
QGCConfigView
::
QGCConfigView
(
QWidget
*
parent
)
:
QWidget
(
parent
),
ui
(
new
Ui
::
QGCConfigView
),
config
(
NULL
),
mav
(
NULL
)
{
ui
->
setupUi
(
this
);
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
activeUASChanged
(
UASInterface
*
)));
ui
->
gridLayout
->
removeWidget
(
ui
->
waitingLabel
);
ui
->
waitingLabel
->
setVisible
(
false
);
delete
ui
->
waitingLabel
;
ui
->
waitingLabel
=
NULL
;
config
=
new
QGCPX4VehicleConfig
();
ui
->
gridLayout
->
addWidget
(
config
);
}
QGCConfigView
::~
QGCConfigView
()
{
delete
ui
;
}
void
QGCConfigView
::
activeUASChanged
(
UASInterface
*
uas
)
{
if
(
mav
==
uas
)
return
;
int
type
=
-
1
;
if
(
mav
)
type
=
mav
->
getAutopilotType
();
mav
=
uas
;
if
(
uas
&&
type
!=
uas
->
getAutopilotType
())
{
if
(
ui
->
waitingLabel
)
{
ui
->
gridLayout
->
removeWidget
(
ui
->
waitingLabel
);
ui
->
waitingLabel
->
setVisible
(
false
);
}
//remove all child widgets since they could contain stale data
//for example, when we switch from one PX4 UAS to another UAS
foreach
(
QObject
*
obj
,
ui
->
gridLayout
->
children
())
{
QWidget
*
w
=
dynamic_cast
<
QWidget
*>
(
obj
);
if
(
w
)
{
if
(
obj
!=
ui
->
waitingLabel
)
{
ui
->
gridLayout
->
removeWidget
(
w
);
delete
obj
;
}
}
}
QGCPX4VehicleConfig
*
px4config
=
qobject_cast
<
QGCPX4VehicleConfig
*>
(
config
);
if
(
!
px4config
)
{
if
(
config
)
delete
config
;
config
=
new
QGCPX4VehicleConfig
();
ui
->
gridLayout
->
addWidget
(
config
);
}
}
else
{
if
(
ui
->
waitingLabel
)
{
//restore waiting label if we no longer have a connection
ui
->
gridLayout
->
addWidget
(
ui
->
waitingLabel
);
ui
->
waitingLabel
->
setVisible
(
true
);
}
}
}
src/ui/QGCConfigView.h
deleted
100644 → 0
View file @
bb3a268d
#ifndef QGCCONFIGVIEW_H
#define QGCCONFIGVIEW_H
#include
<QWidget>
#include
<UASInterface.h>
namespace
Ui
{
class
QGCConfigView
;
}
class
QGCConfigView
:
public
QWidget
{
Q_OBJECT
public:
explicit
QGCConfigView
(
QWidget
*
parent
=
0
);
~
QGCConfigView
();
public
slots
:
void
activeUASChanged
(
UASInterface
*
uas
);
private:
Ui
::
QGCConfigView
*
ui
;
QWidget
*
config
;
UASInterface
*
mav
;
};
#endif // QGCCONFIGVIEW_H
src/ui/QGCConfigView.ui
deleted
100644 → 0
View file @
bb3a268d
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
QGCConfigView
</class>
<widget
class=
"QWidget"
name=
"QGCConfigView"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
400
</width>
<height>
300
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Form
</string>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<property
name=
"margin"
>
<number>
0
</number>
</property>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"waitingLabel"
>
<property
name=
"text"
>
<string>
Waiting for connection...
</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
src/ui/QGCPX4VehicleConfig.cc
deleted
100644 → 0
View file @
bb3a268d
// On Windows (for VS2010) stdint.h contains the limits normally contained in limits.h
// It also needs the __STDC_LIMIT_MACROS macro defined in order to include them (done
// in qgroundcontrol.pri).
#ifdef WIN32
#include
<stdint.h>
#else
#include
<limits.h>
#endif
#include
<QTimer>
#include
<QDir>
#include
<QXmlStreamReader>
#include
<QLabel>
#include
"QGCPX4VehicleConfig.h"
#include
"QGC.h"
#include
"QGCToolWidget.h"
#include
"UASManager.h"
#include
"LinkManager.h"
#include
"UASParameterCommsMgr.h"
#include
"ui_QGCPX4VehicleConfig.h"
#include
"px4_configuration/QGCPX4AirframeConfig.h"
#include
"px4_configuration/QGCPX4SensorCalibration.h"
#include
"px4_configuration/PX4RCCalibration.h"
#include
"PX4FirmwareUpgrade.h"
#define WIDGET_INDEX_FIRMWARE 0
#define WIDGET_INDEX_RC 1
#define WIDGET_INDEX_SENSOR_CAL 2
#define WIDGET_INDEX_AIRFRAME_CONFIG 3
#define WIDGET_INDEX_GENERAL_CONFIG 4
#define WIDGET_INDEX_ADV_CONFIG 5
#define MIN_PWM_VAL 800
#define MAX_PWM_VAL 2200
QGCPX4VehicleConfig
::
QGCPX4VehicleConfig
(
QWidget
*
parent
)
:
QWidget
(
parent
),
mav
(
NULL
),
px4AirframeConfig
(
NULL
),
planeBack
(
":/files/images/px4/rc/cessna_back.png"
),
planeSide
(
":/files/images/px4/rc/cessna_side.png"
),
px4SensorCalibration
(
NULL
),
ui
(
new
Ui
::
QGCPX4VehicleConfig
)
{
doneLoadingConfig
=
false
;
setObjectName
(
"QGC_VEHICLECONFIG"
);
ui
->
setupUi
(
this
);
ui
->
advancedMenuButton
->
setEnabled
(
false
);
ui
->
airframeMenuButton
->
setEnabled
(
false
);
ui
->
sensorMenuButton
->
setEnabled
(
false
);
ui
->
rcMenuButton
->
setEnabled
(
false
);
px4AirframeConfig
=
new
QGCPX4AirframeConfig
(
this
);
ui
->
airframeLayout
->
addWidget
(
px4AirframeConfig
);
px4SensorCalibration
=
new
QGCPX4SensorCalibration
(
this
);
ui
->
sensorLayout
->
addWidget
(
px4SensorCalibration
);
px4RCCalibration
=
new
PX4RCCalibration
(
this
);
ui
->
rcLayout
->
addWidget
(
px4RCCalibration
);
PX4FirmwareUpgrade
*
firmwareUpgrade
=
new
PX4FirmwareUpgrade
(
this
);
ui
->
firmwareLayout
->
addWidget
(
firmwareUpgrade
);
connect
(
ui
->
rcMenuButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
rcMenuButtonClicked
()));
connect
(
ui
->
sensorMenuButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
sensorMenuButtonClicked
()));
connect
(
ui
->
flightModeMenuButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
flightModeMenuButtonClicked
()));
connect
(
ui
->
safetyConfigButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
safetyConfigMenuButtonClicked
()));
connect
(
ui
->
tuningMenuButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
tuningMenuButtonClicked
()));
connect
(
ui
->
advancedMenuButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
advancedMenuButtonClicked
()));
connect
(
ui
->
airframeMenuButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
airframeMenuButtonClicked
()));
connect
(
ui
->
firmwareMenuButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
firmwareMenuButtonClicked
()));
//TODO connect buttons here to save/clear actions?
UASInterface
*
tmpMav
=
UASManager
::
instance
()
->
getActiveUAS
();
if
(
tmpMav
)
{
ui
->
pendingCommitsWidget
->
initWithUAS
(
tmpMav
);
ui
->
pendingCommitsWidget
->
update
();
setActiveUAS
(
tmpMav
);
}
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
setActiveUAS
(
UASInterface
*
)));
firmwareMenuButtonClicked
();
}
QGCPX4VehicleConfig
::~
QGCPX4VehicleConfig
()
{
delete
ui
;
}
void
QGCPX4VehicleConfig
::
rcMenuButtonClicked
()
{
ui
->
stackedWidget
->
setCurrentWidget
(
ui
->
rcTab
);
ui
->
tabTitleLabel
->
setText
(
tr
(
"Radio Calibration"
));
}
void
QGCPX4VehicleConfig
::
sensorMenuButtonClicked
()
{
ui
->
stackedWidget
->
setCurrentWidget
(
ui
->
sensorTab
);
ui
->
tabTitleLabel
->
setText
(
tr
(
"Sensor Calibration"
));
}
void
QGCPX4VehicleConfig
::
tuningMenuButtonClicked
()
{
ui
->
stackedWidget
->
setCurrentWidget
(
ui
->
tuningTab
);
ui
->
tabTitleLabel
->
setText
(
tr
(
"Controller Tuning"
));
}
void
QGCPX4VehicleConfig
::
flightModeMenuButtonClicked
()
{
ui
->
stackedWidget
->
setCurrentWidget
(
ui
->
flightModeTab
);
ui
->
tabTitleLabel
->
setText
(
tr
(
"Flight Mode Configuration"
));
}
void
QGCPX4VehicleConfig
::
safetyConfigMenuButtonClicked
()
{
ui
->
stackedWidget
->
setCurrentWidget
(
ui
->
safetyConfigTab
);
ui
->
tabTitleLabel
->
setText
(
tr
(
"Safety Feature Configuration"
));
}
void
QGCPX4VehicleConfig
::
advancedMenuButtonClicked
()
{
ui
->
stackedWidget
->
setCurrentWidget
(
ui
->
advancedTab
);
ui
->
tabTitleLabel
->
setText
(
tr
(
"Advanced Configuration Options"
));
}
void
QGCPX4VehicleConfig
::
airframeMenuButtonClicked
()
{
ui
->
stackedWidget
->
setCurrentWidget
(
ui
->
airframeTab
);
ui
->
tabTitleLabel
->
setText
(
tr
(
"Airframe Configuration"
));
}
void
QGCPX4VehicleConfig
::
firmwareMenuButtonClicked
()
{
ui
->
stackedWidget
->
setCurrentWidget
(
ui
->
firmwareTab
);
ui
->
tabTitleLabel
->
setText
(
tr
(
"Firmware Upgrade"
));
}
void
QGCPX4VehicleConfig
::
menuButtonClicked
()
{
QPushButton
*
button
=
qobject_cast
<
QPushButton
*>
(
sender
());
if
(
!
button
)
{
return
;
}
if
(
buttonToWidgetMap
.
contains
(
button
))
{
ui
->
stackedWidget
->
setCurrentWidget
(
buttonToWidgetMap
[
button
]);
}
}
void
QGCPX4VehicleConfig
::
setActiveUAS
(
UASInterface
*
active
)
{
// Hide items if NULL and abort
if
(
!
active
)
{
return
;
}
// Do nothing if UAS is already visible
if
(
mav
==
active
)
return
;
if
(
mav
)
{
//TODO use paramCommsMgr instead
disconnect
(
mav
,
SIGNAL
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)),
this
,
SLOT
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)));
foreach
(
QWidget
*
child
,
ui
->
airframeLayout
->
findChildren
<
QWidget
*>
())
{
child
->
deleteLater
();
}
// And then delete any custom tabs
foreach
(
QWidget
*
child
,
additionalTabs
)
{
child
->
deleteLater
();
}
additionalTabs
.
clear
();
toolWidgets
.
clear
();
paramToWidgetMap
.
clear
();
libParamToWidgetMap
.
clear
();
systemTypeToParamMap
.
clear
();
toolToBoxMap
.
clear
();
paramTooltips
.
clear
();
}
// Connect new system
mav
=
active
;
paramMgr
=
mav
->
getParamManager
();
ui
->
pendingCommitsWidget
->
setUAS
(
mav
);
ui
->
paramTreeWidget
->
setUAS
(
mav
);
//TODO eliminate the separate RC_TYPE call
mav
->
requestParameter
(
0
,
"RC_TYPE"
);
// Connect new system
connect
(
mav
,
SIGNAL
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)),
this
,
SLOT
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)));
if
(
systemTypeToParamMap
.
contains
(
mav
->
getSystemTypeName
()))
{
paramToWidgetMap
=
systemTypeToParamMap
[
mav
->
getSystemTypeName
()];
}
else
{
//Indication that we have no meta data for this system type.
qDebug
()
<<
"No parameters defined for system type:"
<<
mav
->
getSystemTypeName
();
paramToWidgetMap
=
systemTypeToParamMap
[
mav
->
getSystemTypeName
()];
}
if
(
!
paramTooltips
.
isEmpty
())
{
mav
->
getParamManager
()
->
setParamDescriptions
(
paramTooltips
);
}
qDebug
()
<<
"CALIBRATION!! System Type Name:"
<<
mav
->
getSystemTypeName
();
updateStatus
(
QString
(
"Reading from system %1"
).
arg
(
mav
->
getUASName
()));
// Since a system is now connected, enable the VehicleConfig UI.
// Enable buttons
bool
px4Firmware
=
mav
->
getAutopilotType
()
==
MAV_AUTOPILOT_PX4
;
ui
->
airframeMenuButton
->
setEnabled
(
px4Firmware
);
ui
->
sensorMenuButton
->
setEnabled
(
px4Firmware
);
ui
->
rcMenuButton
->
setEnabled
(
px4Firmware
);
ui
->
advancedMenuButton
->
setEnabled
(
true
);
}
void
QGCPX4VehicleConfig
::
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
)
{
if
(
!
doneLoadingConfig
)
{
//We do not want to attempt to generate any UI elements until loading of the config file is complete.
//We should re-request params later if needed, that is not implemented yet.
return
;
}
if
(
paramToWidgetMap
.
contains
(
parameterName
))
{
//Main group of parameters of the selected airframe
paramToWidgetMap
.
value
(
parameterName
)
->
setParameterValue
(
uas
,
component
,
parameterName
,
value
);
if
(
toolToBoxMap
.
contains
(
paramToWidgetMap
.
value
(
parameterName
)))
{
toolToBoxMap
[
paramToWidgetMap
.
value
(
parameterName
)]
->
show
();
}
else
{
qCritical
()
<<
"Widget with no box, possible memory corruption for param:"
<<
parameterName
;
}
}
else
if
(
libParamToWidgetMap
.
contains
(
parameterName
))
{
//All the library parameters
libParamToWidgetMap
.
value
(
parameterName
)
->
setParameterValue
(
uas
,
component
,
parameterName
,
value
);
if
(
toolToBoxMap
.
contains
(
libParamToWidgetMap
.
value
(
parameterName
)))
{
toolToBoxMap
[
libParamToWidgetMap
.
value
(
parameterName
)]
->
show
();
}
else
{
qCritical
()
<<
"Widget with no box, possible memory corruption for param:"
<<
parameterName
;
}
}
else
{
//Param recieved that we have no metadata for. Search to see if it belongs in a
//group with some other params
//bool found = false;
for
(
int
i
=
0
;
i
<
toolWidgets
.
size
();
i
++
)
{
if
(
parameterName
.
startsWith
(
toolWidgets
[
i
]
->
objectName
()))
{
//It should be grouped with this one, add it.
toolWidgets
[
i
]
->
addParam
(
uas
,
component
,
parameterName
,
value
);
libParamToWidgetMap
.
insert
(
parameterName
,
toolWidgets
[
i
]);
//found = true;
break
;
}
}
// if (!found) {
// //New param type, create a QGroupBox for it.
// QWidget* parent = ui->advanceColumnContents;
// // Create the tool, attaching it to the QGroupBox
// QGCToolWidget *tool = new QGCToolWidget("", parent);
// QString tooltitle = parameterName;
// if (parameterName.split("_").size() > 1) {
// tooltitle = parameterName.split("_")[0] + "_";
// }
// tool->setTitle(tooltitle);
// tool->setObjectName(tooltitle);
// //tool->setSettings(set);
// libParamToWidgetMap.insert(parameterName,tool);
// toolWidgets.append(tool);
// tool->addParam(uas, component, parameterName, value);
// QGroupBox *box = new QGroupBox(parent);
// box->setTitle(tool->objectName());
// box->setLayout(new QVBoxLayout(box));
// box->layout()->addWidget(tool);
// libParamToWidgetMap.insert(parameterName,tool);
// toolWidgets.append(tool);
// ui->advancedColumnLayout->addWidget(box);
// toolToBoxMap[tool] = box;
// }
}
}
void
QGCPX4VehicleConfig
::
updateStatus
(
const
QString
&
str
)
{
ui
->
advancedStatusLabel
->
setText
(
str
);
ui
->
advancedStatusLabel
->
setStyleSheet
(
""
);
}
void
QGCPX4VehicleConfig
::
updateError
(
const
QString
&
str
)
{
ui
->
advancedStatusLabel
->
setText
(
str
);
ui
->
advancedStatusLabel
->
setStyleSheet
(
QString
(
"QLabel { margin: 0px 2px; font: 14px; color: %1; background-color: %2; }"
).
arg
(
QGC
::
colorDarkWhite
.
name
()).
arg
(
QGC
::
colorMagenta
.
name
()));
}
src/ui/QGCPX4VehicleConfig.h
deleted
100644 → 0
View file @
bb3a268d
#ifndef QGCPX4VehicleConfig_H
#define QGCPX4VehicleConfig_H
#include
<QWidget>
#include
<QTimer>
#include
<QList>
#include
<QGroupBox>
#include
<QPushButton>
#include
<QStringList>
#include
<QGraphicsScene>
#include
"QGCToolWidget.h"
#include
"UASInterface.h"
#include
"px4_configuration/QGCPX4AirframeConfig.h"
class
UASParameterCommsMgr
;
class
QGCPX4SensorCalibration
;
class
PX4RCCalibration
;
namespace
Ui
{
class
QGCPX4VehicleConfig
;
}
class
QGCPX4VehicleConfig
:
public
QWidget
{
Q_OBJECT
public:
explicit
QGCPX4VehicleConfig
(
QWidget
*
parent
=
0
);
~
QGCPX4VehicleConfig
();
enum
RC_MODE
{
RC_MODE_1
=
1
,
RC_MODE_2
=
2
,
RC_MODE_3
=
3
,
RC_MODE_4
=
4
,
RC_MODE_NONE
=
5
};
public
slots
:
void
rcMenuButtonClicked
();
void
sensorMenuButtonClicked
();
void
tuningMenuButtonClicked
();
void
flightModeMenuButtonClicked
();
void
safetyConfigMenuButtonClicked
();
void
advancedMenuButtonClicked
();
void
airframeMenuButtonClicked
();
void
firmwareMenuButtonClicked
();
/** Set the MAV currently being calibrated */
void
setActiveUAS
(
UASInterface
*
active
);
protected
slots
:
void
menuButtonClicked
();
/** Parameter changed onboard */
void
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
);
void
updateStatus
(
const
QString
&
str
);
void
updateError
(
const
QString
&
str
);
protected:
bool
doneLoadingConfig
;
UASInterface
*
mav
;
///< The current MAV
QGCUASParamManagerInterface
*
paramMgr
;
///< params mgr for the mav
QList
<
QGCToolWidget
*>
toolWidgets
;
///< Configurable widgets
QMap
<
QString
,
QGCToolWidget
*>
toolWidgetsByName
;
///<
QMap
<
QString
,
QGCToolWidget
*>
paramToWidgetMap
;
///< Holds the current active MAV's parameter widgets.
QList
<
QWidget
*>
additionalTabs
;
///< Stores additional tabs loaded for this vehicle/autopilot configuration. Used for cleaning up.
QMap
<
QString
,
QGCToolWidget
*>
libParamToWidgetMap
;
///< Holds the library parameter widgets
QMap
<
QString
,
QMap
<
QString
,
QGCToolWidget
*>
>
systemTypeToParamMap
;
///< Holds all loaded MAV specific parameter widgets, for every MAV.
QMap
<
QGCToolWidget
*
,
QGroupBox
*>
toolToBoxMap
;
///< Easy method of figuring out which QGroupBox is tied to which ToolWidget.
QMap
<
QString
,
QString
>
paramTooltips
;
///< Tooltips for the ? button next to a parameter.
QGCPX4AirframeConfig
*
px4AirframeConfig
;
QPixmap
planeBack
;
QPixmap
planeSide
;
QGCPX4SensorCalibration
*
px4SensorCalibration
;
PX4RCCalibration
*
px4RCCalibration
;
QGraphicsScene
scene
;
QPushButton
*
skipActionButton
;
private:
Ui
::
QGCPX4VehicleConfig
*
ui
;
QMap
<
QPushButton
*
,
QWidget
*>
buttonToWidgetMap
;
signals:
void
visibilityChanged
(
bool
visible
);
};
#endif // QGCPX4VehicleConfig_H
src/ui/QGCPX4VehicleConfig.ui
deleted
100644 → 0
View file @
bb3a268d
This diff is collapsed.
Click to expand it.
src/ui/px4_configuration/QGCPX4SensorCalibration.cc
deleted
100644 → 0
View file @
bb3a268d
This diff is collapsed.
Click to expand it.
src/ui/px4_configuration/QGCPX4SensorCalibration.h
deleted
100644 → 0
View file @
bb3a268d
#ifndef QGCPX4SENSORCALIBRATION_H
#define QGCPX4SENSORCALIBRATION_H
#include
<QWidget>
#include
<UASInterface.h>
#include
<QAction>
namespace
Ui
{
class
QGCPX4SensorCalibration
;
}
class
QGCPX4SensorCalibration
:
public
QWidget
{
Q_OBJECT
public:
explicit
QGCPX4SensorCalibration
(
QWidget
*
parent
=
0
);
~
QGCPX4SensorCalibration
();
public
slots
:
/**
* @brief Set currently active UAS
* @param uas the current active UAS
*/
void
setActiveUAS
(
UASInterface
*
uas
);
/**
* @brief Handle text message from current active UAS
* @param uasid
* @param componentid
* @param severity
* @param text
*/
void
handleTextMessage
(
int
uasid
,
int
componentid
,
int
severity
,
QString
text
);
/**
* @brief Update system specs / properties
* @param id the UID of the aircraft
*/
void
updateSystemSpecs
(
int
id
);
void
gyroButtonClicked
();
void
magButtonClicked
();
void
accelButtonClicked
();
void
diffPressureButtonClicked
();
/**
* @brief Hand context menu event
* @param event
*/
virtual
void
contextMenuEvent
(
QContextMenuEvent
*
event
);
void
setAutopilotOrientation
(
int
index
);
void
setGpsOrientation
(
int
index
);
void
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
);
protected
slots
:
void
setInstructionImage
(
const
QString
&
path
);
void
setAutopilotImage
(
const
QString
&
path
);
void
setGpsImage
(
const
int
index
);
void
setAutopilotImage
(
const
int
index
);
void
setGpsImage
(
const
QString
&
path
);
protected:
UASInterface
*
activeUAS
;
QAction
*
clearAction
;
QPixmap
instructionIcon
;
QPixmap
autopilotIcon
;
QPixmap
gpsIcon
;
virtual
void
resizeEvent
(
QResizeEvent
*
event
);
void
setMagCalibrated
(
bool
calibrated
);
void
setGyroCalibrated
(
bool
calibrated
);
void
setAccelCalibrated
(
bool
calibrated
);
void
setDiffPressureCalibrated
(
bool
calibrated
);
void
updateIcons
();
private:
void
_requestAllSensorParameters
(
void
);
Ui
::
QGCPX4SensorCalibration
*
ui
;
};
#endif // QGCPX4SENSORCALIBRATION_H
src/ui/px4_configuration/QGCPX4SensorCalibration.ui
deleted
100644 → 0
View file @
bb3a268d
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
QGCPX4SensorCalibration
</class>
<widget
class=
"QWidget"
name=
"QGCPX4SensorCalibration"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
659
</width>
<height>
636
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Form
</string>
</property>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
QPushButton#magButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #73D95D, stop: 1 #18A154);
border-radius: 8px;
min-height: 25px;
max-height: 30px;
min-width: 60px;
max-width: 140px;
margin: 5px;
border: 2px solid #465158;
}
QPushButton#gyroButton, QPushButton#accelButton, QPushButton#diffPressureButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #D3795D, stop: 1 #A81154);
border-radius: 8px;
min-height: 25px;
max-height: 30px;
min-width: 60px;
max-width: 140px;
margin: 5px;
border: 2px solid #465158;
}
</string>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
rowstretch=
"40,5,1,1,1,1,1,1"
columnstretch=
"1,2,30,1,1,10"
>
<item
row=
"0"
column=
"4"
rowspan=
"6"
colspan=
"2"
>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_4"
stretch=
"0,10,10"
>
<item>
<spacer
name=
"verticalSpacer_2"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
40
</height>
</size>
</property>
</spacer>
</item>
<item>
<widget
class=
"QGroupBox"
name=
"groupBox_2"
>
<property
name=
"title"
>
<string>
Autopilot Orientation
</string>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_2"
>
<item>
<widget
class=
"QLabel"
name=
"autopilotLabel"
>
<property
name=
"minimumSize"
>
<size>
<width>
0
</width>
<height>
250
</height>
</size>
</property>
<property
name=
"text"
>
<string/>
</property>
</widget>
</item>
<item>
<widget
class=
"QComboBox"
name=
"autopilotComboBox"
/>
</item>
</layout>
</widget>
</item>
<item>
<widget
class=
"QGroupBox"
name=
"groupBox"
>
<property
name=
"title"
>
<string>
Magnetometer Orientation
</string>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<item>
<widget
class=
"QLabel"
name=
"gpsLabel"
>
<property
name=
"minimumSize"
>
<size>
<width>
150
</width>
<height>
120
</height>
</size>
</property>
<property
name=
"text"
>
<string/>
</property>
</widget>
</item>
<item>
<widget
class=
"QComboBox"
name=
"magComboBox"
/>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item
row=
"6"
column=
"2"
colspan=
"4"
>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
498
</width>
<height>
5
</height>
</size>
</property>
</spacer>
</item>
<item
row=
"0"
column=
"0"
rowspan=
"2"
colspan=
"4"
>
<widget
class=
"QLabel"
name=
"iconLabel"
>
<property
name=
"text"
>
<string/>
</property>
</widget>
</item>
<item
row=
"2"
column=
"2"
colspan=
"2"
>
<widget
class=
"QProgressBar"
name=
"progressBar"
>
<property
name=
"value"
>
<number>
24
</number>
</property>
</widget>
</item>
<item
row=
"3"
column=
"0"
colspan=
"4"
>
<widget
class=
"QPlainTextEdit"
name=
"textView"
>
<property
name=
"enabled"
>
<bool>
false
</bool>
</property>
</widget>
</item>
<item
row=
"7"
column=
"0"
colspan=
"4"
>
<layout
class=
"QGridLayout"
name=
"gridLayout_2"
columnstretch=
"1,1,1,1"
>
<item
row=
"0"
column=
"2"
>
<widget
class=
"QLabel"
name=
"accelLabel"
>
<property
name=
"text"
>
<string/>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
</widget>
</item>
<item
row=
"0"
column=
"1"
>
<widget
class=
"QLabel"
name=
"gyroLabel"
>
<property
name=
"text"
>
<string/>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
</widget>
</item>
<item
row=
"1"
column=
"1"
>
<widget
class=
"QPushButton"
name=
"gyroButton"
>
<property
name=
"text"
>
<string>
Gyroscope
</string>
</property>
<property
name=
"icon"
>
<iconset
resource=
"../../../qgroundcontrol.qrc"
>
<normaloff>
:/files/images/px4/calibration/arrows.png
</normaloff>
:/files/images/px4/calibration/arrows.png
</iconset>
</property>
</widget>
</item>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"magButton"
>
<property
name=
"text"
>
<string>
Magnetometer
</string>
</property>
<property
name=
"icon"
>
<iconset
resource=
"../../../qgroundcontrol.qrc"
>
<normaloff>
:/files/images/px4/calibration/arrows.png
</normaloff>
:/files/images/px4/calibration/arrows.png
</iconset>
</property>
</widget>
</item>
<item
row=
"1"
column=
"2"
>
<widget
class=
"QPushButton"
name=
"accelButton"
>
<property
name=
"text"
>
<string>
Accelerometer
</string>
</property>
<property
name=
"icon"
>
<iconset
resource=
"../../../qgroundcontrol.qrc"
>
<normaloff>
:/files/images/px4/calibration/arrows.png
</normaloff>
:/files/images/px4/calibration/arrows.png
</iconset>
</property>
</widget>
</item>
<item
row=
"1"
column=
"3"
>
<widget
class=
"QPushButton"
name=
"diffPressureButton"
>
<property
name=
"text"
>
<string>
Diff. pressure
</string>
</property>
<property
name=
"icon"
>
<iconset
resource=
"../../../qgroundcontrol.qrc"
>
<normaloff>
:/files/images/px4/calibration/arrows.png
</normaloff>
:/files/images/px4/calibration/arrows.png
</iconset>
</property>
</widget>
</item>
<item
row=
"0"
column=
"3"
>
<widget
class=
"QLabel"
name=
"diffPressureLabel"
>
<property
name=
"text"
>
<string/>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
</widget>
</item>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"magLabel"
>
<property
name=
"text"
>
<string/>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
</widget>
</item>
</layout>
</item>
<item
row=
"5"
column=
"0"
colspan=
"4"
>
<widget
class=
"QLabel"
name=
"instructionLabel"
>
<property
name=
"text"
>
<string/>
</property>
</widget>
</item>
<item
row=
"7"
column=
"4"
>
<spacer
name=
"horizontalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
40
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
<item
row=
"2"
column=
"0"
>
<widget
class=
"QCheckBox"
name=
"logCheckBox"
>
<property
name=
"text"
>
<string>
Log
</string>
</property>
</widget>
</item>
<item
row=
"2"
column=
"1"
>
<spacer
name=
"horizontalSpacer_2"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
40
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources>
<include
location=
"../../../qgroundcontrol.qrc"
/>
</resources>
<connections/>
</ui>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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