Commit f3286d58 authored by Don Gagne's avatar Don Gagne

Remove unreachable APM code

parent 6cb8eb14
......@@ -324,38 +324,11 @@ FORMS += \
src/ui/uas/QGCMessageView.ui \
src/ui/JoystickButton.ui \
src/ui/JoystickAxis.ui \
src/ui/configuration/ApmHardwareConfig.ui \
src/ui/configuration/ApmSoftwareConfig.ui \
src/ui/configuration/FrameTypeConfig.ui \
src/ui/configuration/CompassConfig.ui \
src/ui/configuration/AccelCalibrationConfig.ui \
src/ui/configuration/RadioCalibrationConfig.ui \
src/ui/configuration/FlightModeConfig.ui \
src/ui/configuration/Radio3DRConfig.ui \
src/ui/configuration/BatteryMonitorConfig.ui \
src/ui/configuration/SonarConfig.ui \
src/ui/configuration/AirspeedConfig.ui \
src/ui/configuration/OpticalFlowConfig.ui \
src/ui/configuration/OsdConfig.ui \
src/ui/configuration/AntennaTrackerConfig.ui \
src/ui/configuration/CameraGimbalConfig.ui \
src/ui/configuration/BasicPidConfig.ui \
src/ui/configuration/StandardParamConfig.ui \
src/ui/configuration/GeoFenceConfig.ui \
src/ui/configuration/FailSafeConfig.ui \
src/ui/configuration/AdvancedParamConfig.ui \
src/ui/configuration/ArduCopterPidConfig.ui \
src/ui/configuration/ApmPlaneLevel.ui \
src/ui/configuration/ParamWidget.ui \
src/ui/configuration/ArduPlanePidConfig.ui \
src/ui/configuration/AdvParameterList.ui \
src/ui/configuration/ArduRoverPidConfig.ui \
src/ui/QGCConfigView.ui \
src/ui/main/QGCViewModeSelection.ui \
src/ui/main/QGCWelcomeMainWindow.ui \
src/ui/configuration/terminalconsole.ui \
src/ui/configuration/SerialSettingsDialog.ui \
src/ui/configuration/ApmFirmwareConfig.ui \
src/ui/px4_configuration/QGCPX4AirframeConfig.ui \
src/ui/px4_configuration/QGCPX4MulticopterConfig.ui \
src/ui/px4_configuration/QGCPX4SensorCalibration.ui \
......@@ -411,7 +384,6 @@ HEADERS += \
src/ui/QGCSensorSettingsWidget.h \
src/ui/linechart/Linecharts.h \
src/uas/PxQuadMAV.h \
src/uas/ArduPilotMegaMAV.h \
src/uas/senseSoarMAV.h \
src/ui/watchdog/WatchdogControl.h \
src/ui/watchdog/WatchdogProcessView.h \
......@@ -503,34 +475,6 @@ HEADERS += \
src/ui/uas/QGCMessageView.h \
src/ui/JoystickButton.h \
src/ui/JoystickAxis.h \
src/ui/configuration/ApmHardwareConfig.h \
src/ui/configuration/ApmSoftwareConfig.h \
src/ui/configuration/FrameTypeConfig.h \
src/ui/configuration/CompassConfig.h \
src/ui/configuration/AccelCalibrationConfig.h \
src/ui/configuration/RadioCalibrationConfig.h \
src/ui/configuration/FlightModeConfig.h \
src/ui/configuration/Radio3DRConfig.h \
src/ui/configuration/BatteryMonitorConfig.h \
src/ui/configuration/SonarConfig.h \
src/ui/configuration/AirspeedConfig.h \
src/ui/configuration/OpticalFlowConfig.h \
src/ui/configuration/OsdConfig.h \
src/ui/configuration/AntennaTrackerConfig.h \
src/ui/configuration/CameraGimbalConfig.h \
src/ui/configuration/AP2ConfigWidget.h \
src/ui/configuration/BasicPidConfig.h \
src/ui/configuration/StandardParamConfig.h \
src/ui/configuration/GeoFenceConfig.h \
src/ui/configuration/FailSafeConfig.h \
src/ui/configuration/AdvancedParamConfig.h \
src/ui/configuration/ArduCopterPidConfig.h \
src/ui/apmtoolbar.h \
src/ui/configuration/ApmPlaneLevel.h \
src/ui/configuration/ParamWidget.h \
src/ui/configuration/ArduPlanePidConfig.h \
src/ui/configuration/AdvParameterList.h \
src/ui/configuration/ArduRoverPidConfig.h \
src/ui/QGCConfigView.h \
src/ui/main/QGCViewModeSelection.h \
src/ui/main/QGCWelcomeMainWindow.h \
......@@ -538,7 +482,6 @@ HEADERS += \
src/ui/configuration/SerialSettingsDialog.h \
src/ui/configuration/terminalconsole.h \
src/ui/configuration/ApmHighlighter.h \
src/ui/configuration/ApmFirmwareConfig.h \
src/uas/UASParameterDataModel.h \
src/uas/UASParameterCommsMgr.h \
src/ui/QGCPendingParamWidget.h \
......@@ -602,7 +545,6 @@ SOURCES += \
src/ui/QGCSensorSettingsWidget.cc \
src/ui/linechart/Linecharts.cc \
src/uas/PxQuadMAV.cc \
src/uas/ArduPilotMegaMAV.cc \
src/uas/senseSoarMAV.cpp \
src/ui/watchdog/WatchdogControl.cc \
src/ui/watchdog/WatchdogProcessView.cc \
......@@ -691,34 +633,6 @@ SOURCES += \
src/ui/JoystickButton.cc \
src/ui/JoystickAxis.cc \
src/ui/uas/QGCMessageView.cc \
src/ui/configuration/ApmHardwareConfig.cc \
src/ui/configuration/ApmSoftwareConfig.cc \
src/ui/configuration/FrameTypeConfig.cc \
src/ui/configuration/CompassConfig.cc \
src/ui/configuration/AccelCalibrationConfig.cc \
src/ui/configuration/RadioCalibrationConfig.cc \
src/ui/configuration/FlightModeConfig.cc \
src/ui/configuration/Radio3DRConfig.cc \
src/ui/configuration/BatteryMonitorConfig.cc \
src/ui/configuration/SonarConfig.cc \
src/ui/configuration/AirspeedConfig.cc \
src/ui/configuration/OpticalFlowConfig.cc \
src/ui/configuration/OsdConfig.cc \
src/ui/configuration/AntennaTrackerConfig.cc \
src/ui/configuration/CameraGimbalConfig.cc \
src/ui/configuration/AP2ConfigWidget.cc \
src/ui/configuration/BasicPidConfig.cc \
src/ui/configuration/StandardParamConfig.cc \
src/ui/configuration/GeoFenceConfig.cc \
src/ui/configuration/FailSafeConfig.cc \
src/ui/configuration/AdvancedParamConfig.cc \
src/ui/configuration/ArduCopterPidConfig.cc \
src/ui/apmtoolbar.cpp \
src/ui/configuration/ApmPlaneLevel.cc \
src/ui/configuration/ParamWidget.cc \
src/ui/configuration/ArduPlanePidConfig.cc \
src/ui/configuration/AdvParameterList.cc \
src/ui/configuration/ArduRoverPidConfig.cc \
src/ui/QGCConfigView.cc \
src/ui/main/QGCViewModeSelection.cc \
src/ui/main/QGCWelcomeMainWindow.cc \
......@@ -726,7 +640,6 @@ SOURCES += \
src/ui/configuration/console.cpp \
src/ui/configuration/SerialSettingsDialog.cc \
src/ui/configuration/ApmHighlighter.cc \
src/ui/configuration/ApmFirmwareConfig.cc \
src/uas/UASParameterDataModel.cc \
src/uas/UASParameterCommsMgr.cc \
src/ui/QGCPendingParamWidget.cc \
......@@ -768,7 +681,6 @@ HEADERS += \
src/qgcunittest/MockMavlinkInterface.h \
src/qgcunittest/MockMavlinkFileServer.h \
src/qgcunittest/MultiSignalSpy.h \
src/qgcunittest/FlightModeConfigTest.h \
src/qgcunittest/FlightGearTest.h \
src/qgcunittest/TCPLinkTest.h \
src/qgcunittest/TCPLoopBackServer.h \
......@@ -782,7 +694,6 @@ SOURCES += \
src/qgcunittest/MockQGCUASParamManager.cc \
src/qgcunittest/MockMavlinkFileServer.cc \
src/qgcunittest/MultiSignalSpy.cc \
src/qgcunittest/FlightModeConfigTest.cc \
src/qgcunittest/FlightGearTest.cc \
src/qgcunittest/TCPLinkTest.cc \
src/qgcunittest/TCPLoopBackServer.cc \
......
......@@ -25,7 +25,6 @@
#include "UASInterface.h"
#include "UAS.h"
#include "PxQuadMAV.h"
#include "ArduPilotMegaMAV.h"
#include "configuration.h"
#include "LinkManager.h"
#include "QGCMAVLink.h"
......
......@@ -585,28 +585,6 @@ void MAVLinkSimulationLink::mainloop()
memcpy(stream+streampointer, buffer, bufferlength);
streampointer += bufferlength;
// // HEARTBEAT VEHICLE 2
// // Pack message and get size of encoded byte string
// mavlink_msg_heartbeat_pack(54, componentId, &msg, MAV_HELICOPTER, MAV_AUTOPILOT_ARDUPILOTMEGA);
// // Allocate buffer with packet data
// bufferlength = mavlink_msg_to_send_buffer(buffer, &msg);
// //add data into datastream
// memcpy(stream+streampointer,buffer, bufferlength);
// streampointer += bufferlength;
// // HEARTBEAT VEHICLE 3
// // Pack message and get size of encoded byte string
// mavlink_msg_heartbeat_pack(60, componentId, &msg, MAV_FIXED_WING, MAV_AUTOPILOT_PIXHAWK);
// // Allocate buffer with packet data
// bufferlength = mavlink_msg_to_send_buffer(buffer, &msg);
// //add data into datastream
// memcpy(stream+streampointer,buffer, bufferlength);
// streampointer += bufferlength;
// Pack message and get size of encoded byte string
mavlink_msg_sys_status_encode(54, componentId, &msg, &status);
// Allocate buffer with packet data
......
......@@ -72,7 +72,7 @@ void MAVLinkSimulationMAV::mainloop()
// 1 Hz execution
if (timer1Hz <= 0) {
mavlink_message_t msg;
mavlink_msg_heartbeat_pack(systemid, MAV_COMP_ID_IMU, &msg, MAV_TYPE_FIXED_WING, MAV_AUTOPILOT_ARDUPILOTMEGA, MAV_MODE_GUIDED_ARMED, 0, MAV_STATE_ACTIVE);
mavlink_msg_heartbeat_pack(systemid, MAV_COMP_ID_IMU, &msg, MAV_TYPE_FIXED_WING, MAV_AUTOPILOT_PIXHAWK, MAV_MODE_GUIDED_ARMED, 0, MAV_STATE_ACTIVE);
link->sendMAVLinkMessage(&msg);
planner.handleMessage(msg);
......
This diff is collapsed.
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
#ifndef FLIGHTMODECONFIGTEST_H
#define FLIGHTMODECONFIGTEST_H
#include "AutoTest.h"
#include "MockUASManager.h"
#include "MockUAS.h"
#include <QLabel>
#include <QComboBox>
#include <QCheckBox>
#include <QLabel>
#include <QPushButton>
class FlightModeConfig;
/// @file
/// @brief FlightModeConfig unit test
///
/// @author Don Gagne <don@thegagnes.com>
class FlightModeConfigUnitTest : public QObject
{
Q_OBJECT
public:
FlightModeConfigUnitTest(void);
private slots:
void init(void);
void cleanup(void);
void _nullUAS_test(void);
void _validUAS_test(void);
void _nullToValidUAS_test(void);
void _simpleModeFixedWing_test(void);
void _simpleModeRover_test(void);
void _simpleModeRotor_test(void);
void _modeSwitchParam_test(void);
void _pwmFixedWing_test(void);
void _pwmRotor_test(void);
void _pwmRover_test(void);
void _pwmInvalidChannel_test(void);
void _unknownSystemType_test(void);
void _unknownMode_test(void);
private:
void _findControls(QObject* fmc);
void _pwmTestWorker(int systemType, int modeSwitchChannel, const char* modeSwitchParam);
private:
MockUASManager* _mockUASManager;
MockUAS* _mockUAS;
// FlightModeConfig ui elements
static const size_t _cCombo = 6;
QLabel* _rgLabel[_cCombo];
QComboBox* _rgCombo[_cCombo];
QCheckBox* _rgSimpleModeCheckBox[_cCombo];
QLabel* _rgPWMLabel[_cCombo];
QPushButton* _saveButton;
};
DECLARE_TEST(FlightModeConfigUnitTest)
#endif
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Implementation of class MainWindow
* @author Your Name here
*/
#include "ArduPilotMegaMAV.h"
#ifdef QGC_USE_ARDUPILOTMEGA_MESSAGES
#ifndef MAVLINK_MSG_ID_MOUNT_CONFIGURE
#include "ardupilotmega/mavlink_msg_mount_configure.h"
#endif
#ifndef MAVLINK_MSG_ID_MOUNT_CONTROL
#include "ardupilotmega/mavlink_msg_mount_control.h"
#endif
#endif
ArduPilotMegaMAV::ArduPilotMegaMAV(MAVLinkProtocol* mavlink, QThread* thread, int id) :
UAS(mavlink, thread, id)//,
// place other initializers here
{
//This does not seem to work. Manually request each stream type at a specified rate.
// Ask for all streams at 4 Hz
//enableAllDataTransmission(4);
txReqTimer = new QTimer(this);
connect(txReqTimer,SIGNAL(timeout()),this,SLOT(sendTxRequests()));
QTimer::singleShot(5000,this,SLOT(sendTxRequests())); //Send an initial TX request in 5 seconds.
txReqTimer->start(300000); //Resend the TX requests every 5 minutes.
}
void ArduPilotMegaMAV::sendTxRequests()
{
enableExtendedSystemStatusTransmission(2);
QGC::SLEEP::msleep(250);
enablePositionTransmission(3);
QGC::SLEEP::msleep(250);
enableExtra1Transmission(10);
QGC::SLEEP::msleep(250);
enableExtra2Transmission(10);
QGC::SLEEP::msleep(250);
enableExtra3Transmission(2);
QGC::SLEEP::msleep(250);
enableRawSensorDataTransmission(2);
QGC::SLEEP::msleep(250);
enableRCChannelDataTransmission(2);
}
/**
* This function is called by MAVLink once a complete, uncorrupted (CRC check valid)
* mavlink packet is received.
*
* @param link Hardware link the message came from (e.g. /dev/ttyUSB0 or UDP port).
* messages can be sent back to the system via this link
* @param message MAVLink message, as received from the MAVLink protocol stack
*/
void ArduPilotMegaMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
{
// Let UAS handle the default message set
UAS::receiveMessage(link, message);
if (message.sysid == uasId) {
// Handle your special messages
switch (message.msgid) {
case MAVLINK_MSG_ID_HEARTBEAT:
{
//qDebug() << "ARDUPILOT RECEIVED HEARTBEAT";
break;
}
default:
//qDebug() << "\nARDUPILOT RECEIVED MESSAGE WITH ID" << message.msgid;
break;
}
}
}
void ArduPilotMegaMAV::setMountConfigure(unsigned char mode, bool stabilize_roll,bool stabilize_pitch,bool stabilize_yaw)
{
#ifdef QGC_USE_ARDUPILOTMEGA_MESSAGES
//Only supported by APM
mavlink_message_t msg;
mavlink_msg_mount_configure_pack(255,1,&msg,this->uasId,1,mode,stabilize_roll,stabilize_pitch,stabilize_yaw);
sendMessage(msg);
#else
Q_UNUSED(mode);
Q_UNUSED(stabilize_roll);
Q_UNUSED(stabilize_pitch);
Q_UNUSED(stabilize_yaw);
#endif
}
void ArduPilotMegaMAV::setMountControl(double pa,double pb,double pc,bool islatlong)
{
#ifdef QGC_USE_ARDUPILOTMEGA_MESSAGES
mavlink_message_t msg;
if (islatlong)
{
mavlink_msg_mount_control_pack(255,1,&msg,this->uasId,1,pa*10000000.0,pb*10000000.0,pc*10000000.0,0);
}
else
{
mavlink_msg_mount_control_pack(255,1,&msg,this->uasId,1,pa,pb,pc,0);
}
sendMessage(msg);
#else
Q_UNUSED(pa);
Q_UNUSED(pb);
Q_UNUSED(pc);
Q_UNUSED(islatlong);
#endif
}
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
#ifndef ARDUPILOTMEGAMAV_H
#define ARDUPILOTMEGAMAV_H
#include "UAS.h"
class ArduPilotMegaMAV : public UAS
{
Q_OBJECT
public:
ArduPilotMegaMAV(MAVLinkProtocol* mavlink, QThread* thread, int id = 0);
/** @brief Set camera mount stabilization modes */
void setMountConfigure(unsigned char mode, bool stabilize_roll,bool stabilize_pitch,bool stabilize_yaw);
/** @brief Set camera mount control */
void setMountControl(double pa,double pb,double pc,bool islatlong);
public slots:
/** @brief Receive a MAVLink message from this MAV */
void receiveMessage(LinkInterface* link, mavlink_message_t message);
void sendTxRequests();
private:
QTimer *txReqTimer;
};
#endif // ARDUPILOTMAV_H
......@@ -67,21 +67,6 @@ UASInterface* QGCMAVLinkUASFactory::createUAS(MAVLinkProtocol* mavlink, LinkInte
uas = px4;
}
break;
// XXX the APM support needs polishing before it can be shown to users
// case MAV_AUTOPILOT_ARDUPILOTMEGA:
// {
// ArduPilotMegaMAV* mav = new ArduPilotMegaMAV(mavlink, worker, sysid);
// // Set the system type
// mav->setSystemType((int)heartbeat->type);
// // Connect this robot to the UAS object
// // it is IMPORTANT here to use the right object type,
// // else the slot of the parent object is called (and thus the special
// // packets never reach their goal)
// connect(mavlink, SIGNAL(messageReceived(LinkInterface*, mavlink_message_t)), mav, SLOT(receiveMessage(LinkInterface*, mavlink_message_t)));
// uas = mav;
// }
// break;
#ifdef QGC_USE_SENSESOAR_MESSAGES
case MAV_AUTOPILOT_SENSESOAR:
{
......
......@@ -12,7 +12,6 @@
#include "UAS.h"
#include "PxQuadMAV.h"
#include "senseSoarMAV.h"
#include "ArduPilotMegaMAV.h"
class QGCMAVLinkUASFactory : public QObject
{
......
......@@ -64,9 +64,6 @@ This file is part of the QGROUNDCONTROL project
#include "QGCTabbedInfoView.h"
#include "UASRawStatusView.h"
#include "PrimaryFlightDisplay.h"
#include <apmtoolbar.h>
#include <ApmHardwareConfig.h>
#include <ApmSoftwareConfig.h>
#include <QGCConfigView.h>
#include "SerialSettingsDialog.h"
#include "terminalconsole.h"
......@@ -205,31 +202,27 @@ void MainWindow::init()
// Load Toolbar
if (!(getCustomMode() == CUSTOM_MODE_APM)) {
toolBar = new QGCToolBar(this);
this->addToolBar(toolBar);
// Add actions for average users (displayed next to each other)
QList<QAction*> actions;
actions << ui.actionMissionView;
actions << ui.actionFlightView;
actions << ui.actionHardwareConfig;
toolBar->setPerspectiveChangeActions(actions);
// Add actions for advanced users (displayed in dropdown under "advanced")
QList<QAction*> advancedActions;
advancedActions << ui.actionEngineersView;
advancedActions << ui.actionGoogleEarthView;
advancedActions << ui.actionLocal3DView;
advancedActions << ui.actionSoftwareConfig;
advancedActions << ui.actionTerminalView;
advancedActions << ui.actionSimulationView;
toolBar->setPerspectiveChangeAdvancedActions(advancedActions);
} else {
ui.actionHardwareConfig->setText(tr("Hardware"));
}
toolBar = new QGCToolBar(this);
this->addToolBar(toolBar);
// Add actions for average users (displayed next to each other)
QList<QAction*> actions;
actions << ui.actionMissionView;
actions << ui.actionFlightView;
actions << ui.actionHardwareConfig;
toolBar->setPerspectiveChangeActions(actions);
// Add actions for advanced users (displayed in dropdown under "advanced")
QList<QAction*> advancedActions;
advancedActions << ui.actionEngineersView;
advancedActions << ui.actionGoogleEarthView;
advancedActions << ui.actionLocal3DView;
advancedActions << ui.actionSoftwareConfig;
advancedActions << ui.actionTerminalView;
advancedActions << ui.actionSimulationView;
toolBar->setPerspectiveChangeAdvancedActions(advancedActions);
customStatusBar = new QGCStatusBar(this);
setStatusBar(customStatusBar);
......@@ -255,28 +248,6 @@ void MainWindow::init()
connect(LinkManager::instance(), SIGNAL(newLink(LinkInterface*)), this, SLOT(addLink(LinkInterface*)));
if (getCustomMode() == CUSTOM_MODE_APM) {
// Add the APM 'toolbar'
APMToolBar *apmToolBar = new APMToolBar();
apmToolBar->setFlightViewAction(ui.actionFlightView);
apmToolBar->setFlightPlanViewAction(ui.actionMissionView);
apmToolBar->setHardwareViewAction(ui.actionHardwareConfig);
apmToolBar->setSoftwareViewAction(ui.actionSoftwareConfig);
apmToolBar->setSimulationViewAction(ui.actionSimulationView);
apmToolBar->setTerminalViewAction(ui.actionTerminalView);
QDockWidget *widget = new QDockWidget(tr("APM Tool Bar"),this);
QWidget *toolbarWidget = QWidget::createWindowContainer(apmToolBar, this);
widget->setWidget(toolbarWidget);
widget->setMinimumHeight(72);
widget->setMaximumHeight(72);
widget->setMinimumWidth(1024);
widget->setFeatures(QDockWidget::NoDockWidgetFeatures);
widget->setTitleBarWidget(new QWidget(this)); // Disables the title bar
this->addDockWidget(Qt::TopDockWidgetArea, widget);
}
// Connect user interface devices
emit initStatusChanged(tr("Initializing joystick interface"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141));
joystick = new JoystickInput();
......@@ -559,31 +530,12 @@ void MainWindow::buildCommonWidgets()
addToCentralStackedWidget(terminalView, VIEW_TERMINAL, tr("Terminal View"));
}
if (getCustomMode() == CUSTOM_MODE_APM) {
if (!configView)
{
configView = new SubMainWindow(this);
configView->setObjectName("VIEW_HARDWARE_CONFIG");
configView->setCentralWidget(new ApmHardwareConfig(this));
addToCentralStackedWidget(configView, VIEW_HARDWARE_CONFIG, "Hardware");
}
if (!softwareConfigView)
{
softwareConfigView = new SubMainWindow(this);
softwareConfigView->setObjectName("VIEW_SOFTWARE_CONFIG");
softwareConfigView->setCentralWidget(new ApmSoftwareConfig(this));
addToCentralStackedWidget(softwareConfigView, VIEW_SOFTWARE_CONFIG, "Software");
}
} else {
if (!configView)
{
configView = new SubMainWindow(this);
configView->setObjectName("VIEW_HARDWARE_CONFIG");
configView->setCentralWidget(new QGCConfigView(this));
addToCentralStackedWidget(configView, VIEW_HARDWARE_CONFIG, "Config");
}
if (!configView)
{
configView = new SubMainWindow(this);
configView->setObjectName("VIEW_HARDWARE_CONFIG");
configView->setCentralWidget(new QGCConfigView(this));
addToCentralStackedWidget(configView, VIEW_HARDWARE_CONFIG, "Config");
}
if (!engineeringView)
......@@ -1209,14 +1161,12 @@ void MainWindow::connectCommonActions()
perspectives->addAction(ui.actionSimulationView);
perspectives->addAction(ui.actionMissionView);
perspectives->addAction(ui.actionHardwareConfig);
perspectives->addAction(ui.actionSoftwareConfig);
perspectives->addAction(ui.actionTerminalView);
perspectives->addAction(ui.actionGoogleEarthView);
perspectives->addAction(ui.actionLocal3DView);
perspectives->setExclusive(true);
/* Hide the actions that are not relevant */
ui.actionSoftwareConfig->setVisible(getCustomMode() == CUSTOM_MODE_APM);
#ifndef QGC_GOOGLE_EARTH_ENABLED
ui.actionGoogleEarthView->setVisible(false);
#endif
......@@ -1617,7 +1567,7 @@ void MainWindow::UASCreated(UASInterface* uas)
watchdogControlDockWidget->setObjectName("WATCHDOG_CONTROL_DOCKWIDGET");
}
}
// Reload view state in case new widgets were added
loadViewState();
}
......
......@@ -98,7 +98,6 @@ public:
CUSTOM_MODE_UNCHANGED = 0,
CUSTOM_MODE_NONE,
CUSTOM_MODE_PX4,
CUSTOM_MODE_APM,
CUSTOM_MODE_WIFI
};
......
......@@ -51,7 +51,7 @@
<x>0</x>
<y>0</y>
<width>1024</width>
<height>21</height>
<height>22</height>
</rect>
</property>
<widget class="QMenu" name="menuMGround">
......@@ -100,7 +100,6 @@
<addaction name="actionEngineersView"/>
<addaction name="actionGoogleEarthView"/>
<addaction name="actionLocal3DView"/>
<addaction name="actionSoftwareConfig"/>
<addaction name="actionTerminalView"/>
<addaction name="actionSimulationView"/>
<addaction name="actionFirmwareUpdateView"/>
......
#include <QDebug>
#include <QQmlContext>
#include <QGraphicsObject>