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
691fc57b
Commit
691fc57b
authored
Oct 14, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1993 from DonLakeFlyer/AnalyzeWidget
Move Analyze view to widget
parents
aa9f5591
02b946ef
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
54 additions
and
225 deletions
+54
-225
QGCApplication.pro
QGCApplication.pro
+18
-18
qgroundcontrol.desktop
qgroundcontrol.desktop
+0
-10
MainWindowTest.cc
src/qgcunittest/MainWindowTest.cc
+0
-2
MainWindow.cc
src/ui/MainWindow.cc
+6
-49
MainWindow.h
src/ui/MainWindow.h
+2
-6
MainWindow.ui
src/ui/MainWindow.ui
+1
-12
MultiVehicleDockWidget.cc
src/ui/MultiVehicleDockWidget.cc
+4
-1
Linecharts.cc
src/ui/linechart/Linecharts.cc
+14
-86
Linecharts.h
src/ui/linechart/Linecharts.h
+8
-16
MainToolBar.cc
src/ui/toolbar/MainToolBar.cc
+1
-10
MainToolBar.h
src/ui/toolbar/MainToolBar.h
+0
-1
MainToolBar.qml
src/ui/toolbar/MainToolBar.qml
+0
-14
No files found.
QGCApplication.pro
View file @
691fc57b
...
...
@@ -162,12 +162,10 @@ INCLUDEPATH += \
FORMS
+=
\
src
/
QGCQmlWidgetHolder
.
ui
\
src
/
ui
/
Linechart
.
ui
\
src
/
ui
/
LogReplayLinkConfigurationWidget
.
ui
\
src
/
ui
/
MainWindow
.
ui
\
src
/
ui
/
MAVLinkSettingsWidget
.
ui
\
src
/
ui
/
QGCCommConfiguration
.
ui
\
src
/
ui
/
QGCDataPlot2D
.
ui
\
src
/
ui
/
QGCLinkConfiguration
.
ui
\
src
/
ui
/
QGCMapRCToParamDialog
.
ui
\
src
/
ui
/
QGCMAVLinkLogPlayer
.
ui
\
...
...
@@ -185,7 +183,9 @@ FORMS += \
!
MobileBuild
{
FORMS
+=
\
src
/
ui
/
Linechart
.
ui
\
src
/
ui
/
MultiVehicleDockWidget
.
ui
\
src
/
ui
/
QGCDataPlot2D
.
ui
\
src
/
ui
/
QGCHilConfiguration
.
ui
\
src
/
ui
/
QGCHilFlightGearConfiguration
.
ui
\
src
/
ui
/
QGCHilJSBSimConfiguration
.
ui
\
...
...
@@ -252,19 +252,11 @@ HEADERS += \
src
/
uas
/
UAS
.
h
\
src
/
uas
/
UASInterface
.
h
\
src
/
uas
/
UASMessageHandler
.
h
\
src
/
ui
/
linechart
/
ChartPlot
.
h
\
src
/
ui
/
linechart
/
IncrementalPlot
.
h
\
src
/
ui
/
linechart
/
LinechartPlot
.
h
\
src
/
ui
/
linechart
/
Linecharts
.
h
\
src
/
ui
/
linechart
/
LinechartWidget
.
h
\
src
/
ui
/
linechart
/
Scrollbar
.
h
\
src
/
ui
/
linechart
/
ScrollZoomer
.
h
\
src
/
ui
/
LogReplayLinkConfigurationWidget
.
h
\
src
/
ui
/
MainWindow
.
h
\
src
/
ui
/
MAVLinkDecoder
.
h
\
src
/
ui
/
MAVLinkSettingsWidget
.
h
\
src
/
ui
/
QGCCommConfiguration
.
h
\
src
/
ui
/
QGCDataPlot2D
.
h
\
src
/
ui
/
QGCLinkConfiguration
.
h
\
src
/
ui
/
QGCMapRCToParamDialog
.
h
\
src
/
ui
/
QGCMAVLinkLogPlayer
.
h
\
...
...
@@ -292,7 +284,15 @@ HEADERS += \
src
/
comm
/
QGCXPlaneLink
.
h
\
src
/
ui
/
CameraView
.
h
\
src
/
ui
/
HILDockWidget
.
h
\
src
/
ui
/
linechart
/
ChartPlot
.
h
\
src
/
ui
/
linechart
/
IncrementalPlot
.
h
\
src
/
ui
/
linechart
/
LinechartPlot
.
h
\
src
/
ui
/
linechart
/
Linecharts
.
h
\
src
/
ui
/
linechart
/
LinechartWidget
.
h
\
src
/
ui
/
linechart
/
Scrollbar
.
h
\
src
/
ui
/
linechart
/
ScrollZoomer
.
h
\
src
/
ui
/
MultiVehicleDockWidget
.
h
\
src
/
ui
/
QGCDataPlot2D
.
h
\
src
/
ui
/
QGCHilConfiguration
.
h
\
src
/
ui
/
QGCHilFlightGearConfiguration
.
h
\
src
/
ui
/
QGCHilJSBSimConfiguration
.
h
\
...
...
@@ -357,19 +357,11 @@ SOURCES += \
src
/
uas
/
FileManager
.
cc
\
src
/
uas
/
UAS
.
cc
\
src
/
uas
/
UASMessageHandler
.
cc
\
src
/
ui
/
linechart
/
ChartPlot
.
cc
\
src
/
ui
/
linechart
/
IncrementalPlot
.
cc
\
src
/
ui
/
linechart
/
LinechartPlot
.
cc
\
src
/
ui
/
linechart
/
Linecharts
.
cc
\
src
/
ui
/
linechart
/
LinechartWidget
.
cc
\
src
/
ui
/
linechart
/
Scrollbar
.
cc
\
src
/
ui
/
linechart
/
ScrollZoomer
.
cc
\
src
/
ui
/
LogReplayLinkConfigurationWidget
.
cc
\
src
/
ui
/
MainWindow
.
cc
\
src
/
ui
/
MAVLinkDecoder
.
cc
\
src
/
ui
/
MAVLinkSettingsWidget
.
cc
\
src
/
ui
/
QGCCommConfiguration
.
cc
\
src
/
ui
/
QGCDataPlot2D
.
cc
\
src
/
ui
/
QGCLinkConfiguration
.
cc
\
src
/
ui
/
QGCMapRCToParamDialog
.
cpp
\
src
/
ui
/
QGCMAVLinkLogPlayer
.
cc
\
...
...
@@ -396,7 +388,15 @@ SOURCES += \
src
/
comm
/
QGCXPlaneLink
.
cc
\
src
/
ui
/
CameraView
.
cc
\
src
/
ui
/
HILDockWidget
.
cc
\
src
/
ui
/
linechart
/
ChartPlot
.
cc
\
src
/
ui
/
linechart
/
IncrementalPlot
.
cc
\
src
/
ui
/
linechart
/
LinechartPlot
.
cc
\
src
/
ui
/
linechart
/
Linecharts
.
cc
\
src
/
ui
/
linechart
/
LinechartWidget
.
cc
\
src
/
ui
/
linechart
/
Scrollbar
.
cc
\
src
/
ui
/
linechart
/
ScrollZoomer
.
cc
\
src
/
ui
/
MultiVehicleDockWidget
.
cc
\
src
/
ui
/
QGCDataPlot2D
.
cc
\
src
/
ui
/
QGCHilConfiguration
.
cc
\
src
/
ui
/
QGCHilFlightGearConfiguration
.
cc
\
src
/
ui
/
QGCHilJSBSimConfiguration
.
cc
\
...
...
qgroundcontrol.desktop
deleted
100644 → 0
View file @
aa9f5591
[Desktop Entry]
Type=Application
Name=qgroundcontrol
GenericName=Ground Control Station
Comment=UAS ground control station
Icon=qgroundcontrol
Exec=qgroundcontrol
Terminal=false
Categories=Utility;
Keywords=computer;
src/qgcunittest/MainWindowTest.cc
View file @
691fc57b
...
...
@@ -84,8 +84,6 @@ void MainWindowTest::_connectWindowClose_test(MAV_AUTOPILOT autopilot)
QTest
::
qWait
(
200
);
_mainToolBar
->
onFlyView
();
QTest
::
qWait
(
200
);
_mainToolBar
->
onAnalyzeView
();
QTest
::
qWait
(
200
);
// On MainWindow close we should get a message box telling the user to disconnect first. Cancel should do nothing.
setExpectedMessageBox
(
QGCMessageBox
::
Cancel
);
...
...
src/ui/MainWindow.cc
View file @
691fc57b
...
...
@@ -46,8 +46,6 @@ This file is part of the QGROUNDCONTROL project
#include "QGCMAVLinkLogPlayer.h"
#include "SettingsDialog.h"
#include "MAVLinkDecoder.h"
#include "QGCDataPlot2D.h"
#include "Linecharts.h"
#include "FlightDisplayView.h"
#include "SetupView.h"
#include "QGCApplication.h"
...
...
@@ -60,6 +58,8 @@ This file is part of the QGROUNDCONTROL project
#include "UAS.h"
#ifndef __mobile__
#include "QGCDataPlot2D.h"
#include "Linecharts.h"
#include "QGCUASFileViewMulti.h"
#include "UASQuickView.h"
#include "QGCTabbedInfoView.h"
...
...
@@ -95,6 +95,7 @@ const char* MainWindow::_uasStatusDetailsDockWidgetName = "Status Details";
const
char
*
MainWindow
::
_pfdDockWidgetName
=
"Primary Flight Display"
;
const
char
*
MainWindow
::
_uasInfoViewDockWidgetName
=
"Info View"
;
const
char
*
MainWindow
::
_hilDockWidgetName
=
"HIL Config"
;
const
char
*
MainWindow
::
_analyzeDockWidgetName
=
"Analyze"
;
const
char
*
MainWindow
::
_visibleWidgetsKey
=
"VisibleWidgets"
;
#endif
...
...
@@ -277,13 +278,11 @@ MainWindow::MainWindow(QSplashScreen* splashScreen)
_ui
.
actionSetup
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+1"
,
0
));
_ui
.
actionPlan
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+2"
,
0
));
_ui
.
actionFlight
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+3"
,
0
));
_ui
.
actionAnalyze
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+4"
,
0
));
_ui
.
actionFullscreen
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+Return"
,
0
));
#else
_ui
.
actionSetup
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+1"
,
0
));
_ui
.
actionPlan
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+2"
,
0
));
_ui
.
actionFlight
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+3"
,
0
));
_ui
.
actionAnalyze
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+4"
,
0
));
_ui
.
actionFullscreen
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+Return"
,
0
));
#endif
...
...
@@ -367,6 +366,7 @@ void MainWindow::_buildCommonWidgets(void)
_pfdDockWidgetName
,
_uasInfoViewDockWidgetName
,
_hilDockWidgetName
,
_analyzeDockWidgetName
,
};
static
const
size_t
cDockWidgetNames
=
sizeof
(
rgDockWidgetNames
)
/
sizeof
(
rgDockWidgetNames
[
0
]);
...
...
@@ -419,6 +419,8 @@ void MainWindow::_createInnerDockWidget(const QString& widgetName)
widget
=
new
FlightDisplayWidget
(
widgetName
,
_mapName2Action
[
widgetName
],
this
);
}
else
if
(
widgetName
==
_hilDockWidgetName
)
{
widget
=
new
HILDockWidget
(
widgetName
,
_mapName2Action
[
widgetName
],
this
);
}
else
if
(
widgetName
==
_analyzeDockWidgetName
)
{
widget
=
new
Linecharts
(
widgetName
,
_mapName2Action
[
widgetName
],
mavlinkDecoder
,
this
);
}
else
if
(
widgetName
==
_uasInfoViewDockWidgetName
)
{
QGCTabbedInfoView
*
pInfoView
=
new
QGCTabbedInfoView
(
widgetName
,
_mapName2Action
[
widgetName
],
this
);
pInfoView
->
addSource
(
mavlinkDecoder
);
...
...
@@ -469,14 +471,6 @@ void MainWindow::_buildSetupView(void)
}
}
void
MainWindow
::
_buildAnalyzeView
(
void
)
{
if
(
!
_analyzeView
)
{
_analyzeView
=
new
QGCDataPlot2D
(
this
);
_analyzeView
->
setVisible
(
false
);
}
}
void
MainWindow
::
fullScreenActionItemCallback
(
bool
)
{
_ui
.
actionNormal
->
setChecked
(
false
);
...
...
@@ -589,18 +583,10 @@ void MainWindow::connectCommonActions()
{
// Bind together the perspective actions
QActionGroup
*
perspectives
=
new
QActionGroup
(
_ui
.
menuPerspectives
);
perspectives
->
addAction
(
_ui
.
actionAnalyze
);
perspectives
->
addAction
(
_ui
.
actionFlight
);
perspectives
->
addAction
(
_ui
.
actionPlan
);
perspectives
->
addAction
(
_ui
.
actionSetup
);
perspectives
->
setExclusive
(
true
);
// Mark the right one as selected
if
(
_currentView
==
VIEW_ANALYZE
)
{
_ui
.
actionAnalyze
->
setChecked
(
true
);
_ui
.
actionAnalyze
->
activate
(
QAction
::
Trigger
);
}
if
(
_currentView
==
VIEW_FLIGHT
)
{
_ui
.
actionFlight
->
setChecked
(
true
);
...
...
@@ -625,7 +611,6 @@ void MainWindow::connectCommonActions()
// Views actions
connect
(
_ui
.
actionFlight
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadFlightView
()));
connect
(
_ui
.
actionAnalyze
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadAnalyzeView
()));
connect
(
_ui
.
actionPlan
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadPlanView
()));
// Help Actions
...
...
@@ -695,18 +680,6 @@ void MainWindow::commsWidgetDestroyed(QObject *obj)
void
MainWindow
::
_vehicleAdded
(
Vehicle
*
vehicle
)
{
connect
(
vehicle
->
uas
(),
SIGNAL
(
valueChanged
(
int
,
QString
,
QString
,
QVariant
,
quint64
)),
this
,
SIGNAL
(
valueChanged
(
int
,
QString
,
QString
,
QVariant
,
quint64
)));
if
(
!
linechartWidget
)
{
linechartWidget
=
new
Linecharts
(
this
);
linechartWidget
->
setVisible
(
false
);
}
linechartWidget
->
addSource
(
mavlinkDecoder
);
if
(
_analyzeView
!=
linechartWidget
)
{
_analyzeView
=
linechartWidget
;
}
}
/// Stores the state of the toolbar, status bar and widgets associated with the current view
...
...
@@ -733,11 +706,6 @@ void MainWindow::_loadCurrentViewState(void)
centerView
=
_setupView
;
break
;
case
VIEW_ANALYZE
:
_buildAnalyzeView
();
centerView
=
_analyzeView
;
break
;
case
VIEW_FLIGHT
:
_buildFlightView
();
centerView
=
_flightView
;
...
...
@@ -779,17 +747,6 @@ void MainWindow::_loadCurrentViewState(void)
emit
repaintCanvas
();
}
void
MainWindow
::
loadAnalyzeView
()
{
if
(
_currentView
!=
VIEW_ANALYZE
)
{
_storeCurrentViewState
();
_currentView
=
VIEW_ANALYZE
;
_ui
.
actionAnalyze
->
setChecked
(
true
);
_loadCurrentViewState
();
}
}
void
MainWindow
::
loadPlanView
()
{
if
(
_currentView
!=
VIEW_MISSIONEDITOR
)
...
...
src/ui/MainWindow.h
View file @
691fc57b
...
...
@@ -56,7 +56,6 @@ This file is part of the QGROUNDCONTROL project
#endif // QGC_MOUSE_ENABLED_WIN
class
QGCFirmwareUpdate
;
class
QSplashScreen
;
class
QGCStatusBar
;
class
Linecharts
;
...
...
@@ -122,7 +121,6 @@ public slots:
void
loadSetupView
();
void
loadFlightView
();
void
loadAnalyzeView
();
void
loadPlanView
();
void
manageLinks
();
...
...
@@ -187,7 +185,7 @@ protected:
typedef
enum
_VIEW_SECTIONS
{
VIEW_
ANALYZE
,
// Engineering/Analyze view mode. Used for analyzing data and modifying onboard parameters
VIEW_
UNUSED5
,
// Unused (don't remove, or it will screw up saved settigns indices)
VIEW_UNUSED3
,
// Unused (don't remove, or it will screw up saved settigns indices)
VIEW_FLIGHT
,
// Flight/Fly/Operate view mode. Used for 1st-person observation of the vehicle.
VIEW_UNUSED4
,
// Unused (don't remove, or it will screw up saved settigns indices)
...
...
@@ -205,7 +203,6 @@ protected:
void
loadSettings
();
void
storeSettings
();
QSettings
settings
;
// Center widgets
...
...
@@ -263,7 +260,6 @@ private:
QPointer
<
QWidget
>
_planView
;
QPointer
<
QWidget
>
_flightView
;
QPointer
<
QWidget
>
_setupView
;
QPointer
<
QWidget
>
_analyzeView
;
QPointer
<
QWidget
>
_missionEditorView
;
#ifndef __mobile__
...
...
@@ -275,6 +271,7 @@ private:
static
const
char
*
_pfdDockWidgetName
;
static
const
char
*
_uasInfoViewDockWidgetName
;
static
const
char
*
_hilDockWidgetName
;
static
const
char
*
_analyzeDockWidgetName
;
QMap
<
QString
,
QGCDockWidget
*>
_mapName2DockWidget
;
QMap
<
QString
,
QAction
*>
_mapName2Action
;
...
...
@@ -283,7 +280,6 @@ private:
void
_buildPlanView
(
void
);
void
_buildFlightView
(
void
);
void
_buildSetupView
(
void
);
void
_buildAnalyzeView
(
void
);
void
_buildTerminalView
(
void
);
void
_buildMissionEditorView
(
void
);
...
...
src/ui/MainWindow.ui
View file @
691fc57b
...
...
@@ -80,7 +80,6 @@
<addaction
name=
"actionSetup"
/>
<addaction
name=
"actionPlan"
/>
<addaction
name=
"actionFlight"
/>
<addaction
name=
"actionAnalyze"
/>
<addaction
name=
"separator"
/>
<addaction
name=
"actionFullscreen"
/>
<addaction
name=
"actionNormal"
/>
...
...
@@ -134,14 +133,6 @@
<string>
Plan
</string>
</property>
</action>
<action
name=
"actionAnalyze"
>
<property
name=
"checkable"
>
<bool>
true
</bool>
</property>
<property
name=
"text"
>
<string>
Analyze
</string>
</property>
</action>
<action
name=
"actionFlight"
>
<property
name=
"checkable"
>
<bool>
true
</bool>
...
...
@@ -237,9 +228,7 @@
</action>
</widget>
<layoutdefault
spacing=
"6"
margin=
"11"
/>
<resources>
<include
location=
"../../qgroundcontrol.qrc"
/>
</resources>
<resources/>
<connections>
<connection>
<sender>
actionExit
</sender>
...
...
src/ui/MultiVehicleDockWidget.cc
View file @
691fc57b
...
...
@@ -40,8 +40,11 @@ MultiVehicleDockWidget::MultiVehicleDockWidget(const QString& title, QAction* ac
void
MultiVehicleDockWidget
::
init
(
void
)
{
foreach
(
Vehicle
*
vehicle
,
MultiVehicleManager
::
instance
()
->
vehicles
())
{
_vehicleAdded
(
vehicle
);
}
if
(
MultiVehicleManager
::
instance
()
->
activeVehicle
())
{
_vehicleAdded
(
MultiVehicleManager
::
instance
()
->
activeVehicle
());
_activeVehicleChanged
(
MultiVehicleManager
::
instance
()
->
activeVehicle
());
}
}
...
...
src/ui/linechart/Linecharts.cc
View file @
691fc57b
...
...
@@ -5,99 +5,27 @@
#include "MainWindow.h"
#include "UAS.h"
Linecharts
::
Linecharts
(
QWidget
*
parent
)
:
QStackedWidget
(
parent
),
plots
(),
active
(
true
)
Linecharts
::
Linecharts
(
const
QString
&
title
,
QAction
*
action
,
MAVLinkDecoder
*
decoder
,
QWidget
*
parent
)
:
MultiVehicleDockWidget
(
title
,
action
,
parent
)
,
_mavlinkDecoder
(
decoder
)
{
this
->
setVisible
(
false
);
// Add each MAV
foreach
(
Vehicle
*
vehicle
,
MultiVehicleManager
::
instance
()
->
vehicles
())
{
addVehicle
(
vehicle
);
}
connect
(
MultiVehicleManager
::
instance
(),
&
MultiVehicleManager
::
vehicleAdded
,
this
,
&
Linecharts
::
addVehicle
);
}
init
();
void
Linecharts
::
showEvent
(
QShowEvent
*
event
)
{
// React only to internal (pre-display)
// events
Q_UNUSED
(
event
)
QWidget
*
prevWidget
=
currentWidget
();
if
(
prevWidget
)
{
LinechartWidget
*
chart
=
dynamic_cast
<
LinechartWidget
*>
(
prevWidget
);
if
(
chart
)
{
this
->
active
=
true
;
chart
->
setActive
(
true
);
}
}
QWidget
::
showEvent
(
event
);
emit
visibilityChanged
(
true
);
}
void
Linecharts
::
hideEvent
(
QHideEvent
*
event
)
{
// React only to internal (pre-display)
// events
Q_UNUSED
(
event
)
QWidget
*
prevWidget
=
currentWidget
();
if
(
prevWidget
)
{
LinechartWidget
*
chart
=
dynamic_cast
<
LinechartWidget
*>
(
prevWidget
);
if
(
chart
)
{
this
->
active
=
false
;
chart
->
setActive
(
false
);
}
}
QWidget
::
hideEvent
(
event
);
emit
visibilityChanged
(
false
);
this
->
setVisible
(
false
);
}
void
Linecharts
::
addVehicle
(
Vehicle
*
vehicle
)
QWidget
*
Linecharts
::
_newVehicleWidget
(
Vehicle
*
vehicle
,
QWidget
*
parent
)
{
UAS
*
uas
=
vehicle
->
uas
();
// FIXME Add removeSystem() call
// Compatibility hack
int
uasid
=
0
;
/*uas->getUASID()*/
if
(
!
plots
.
contains
(
uasid
))
{
LinechartWidget
*
widget
=
new
LinechartWidget
(
uasid
,
this
);
addWidget
(
widget
);
plots
.
insert
(
uasid
,
widget
);
LinechartWidget
*
widget
=
new
LinechartWidget
(
vehicle
->
id
(),
parent
);
// Connect valueChanged signals
connect
(
uas
,
SIGNAL
(
valueChanged
(
int
,
QString
,
QString
,
QVariant
,
quint64
)),
widget
,
SLOT
(
appendData
(
int
,
QString
,
QString
,
QVariant
,
quint64
)));
connect
(
vehicle
->
uas
(),
&
UAS
::
valueChanged
,
widget
,
&
LinechartWidget
::
appendData
);
// Connect decoder
connect
(
_mavlinkDecoder
,
&
MAVLinkDecoder
::
valueChanged
,
widget
,
&
LinechartWidget
::
appendData
);
connect
(
widget
,
SIGNAL
(
logfileWritten
(
QString
)),
this
,
SIGNAL
(
logfileWritten
(
QString
)));
// Set system active if this is the only system
// if (active)
// {
// if (plots.size() == 1)
// {
// FIXME XXX HACK
// Connect generic sources
for
(
int
i
=
0
;
i
<
genericSources
.
count
();
++
i
)
{
connect
(
genericSources
[
i
],
SIGNAL
(
valueChanged
(
int
,
QString
,
QString
,
QVariant
,
quint64
)),
plots
.
values
().
first
(),
SLOT
(
appendData
(
int
,
QString
,
QString
,
QVariant
,
quint64
)));
}
// Select system
widget
->
setActive
(
true
);
//widget->selectActiveSystem(0);
}
// }
// }
}
void
Linecharts
::
addSource
(
QObject
*
obj
)
{
genericSources
.
append
(
obj
);
// FIXME XXX HACK
if
(
plots
.
size
()
>
0
)
{
// Connect generic source
connect
(
obj
,
SIGNAL
(
valueChanged
(
int
,
QString
,
QString
,
QVariant
,
quint64
)),
plots
.
values
().
first
(),
SLOT
(
appendData
(
int
,
QString
,
QString
,
QVariant
,
quint64
)));
}
return
widget
;
}
src/ui/linechart/Linecharts.h
View file @
691fc57b
...
...
@@ -7,34 +7,26 @@
#include "LinechartWidget.h"
#include "Vehicle.h"
#include "MultiVehicleDockWidget.h"
#include "MAVLinkDecoder.h"
class
Linecharts
:
public
QStacked
Widget
class
Linecharts
:
public
MultiVehicleDock
Widget
{
Q_OBJECT
public:
explicit
Linecharts
(
QWidget
*
parent
=
0
);
explicit
Linecharts
(
const
QString
&
title
,
QAction
*
action
,
MAVLinkDecoder
*
decoder
,
QWidget
*
parent
=
0
);
signals:
/** @brief This signal is emitted once a logfile has been finished writing */
void
logfileWritten
(
QString
fileName
);
void
visibilityChanged
(
bool
visible
);
public
slots
:
/** @brief Add a new system to the list of plots */
void
addVehicle
(
Vehicle
*
vehicle
);
/** @brief Add a new generic message source (not a system) */
void
addSource
(
QObject
*
obj
);
protected:
// Override from MultiVehicleDockWidget
virtual
QWidget
*
_newVehicleWidget
(
Vehicle
*
vehicle
,
QWidget
*
parent
);
QMap
<
int
,
LinechartWidget
*>
plots
;
QVector
<
QObject
*>
genericSources
;
bool
active
;
/** @brief Start updating widget */
void
showEvent
(
QShowEvent
*
event
);
/** @brief Stop updating widget */
void
hideEvent
(
QHideEvent
*
event
);
private:
MAVLinkDecoder
*
_mavlinkDecoder
;
};
#endif // LINECHARTS_H
src/ui/toolbar/MainToolBar.cc
View file @
691fc57b
...
...
@@ -161,12 +161,6 @@ void MainToolBar::onFlyViewMenu()
}
}
void
MainToolBar
::
onAnalyzeView
()
{
setCurrentView
(
MainWindow
::
VIEW_ANALYZE
);
MainWindow
::
instance
()
->
loadAnalyzeView
();
}
void
MainToolBar
::
onDisconnect
(
QString
conf
)
{
if
(
conf
.
isEmpty
())
{
...
...
@@ -248,9 +242,6 @@ void MainToolBar::setCurrentView(int currentView)
{
ViewType_t
view
=
ViewNone
;
switch
((
MainWindow
::
VIEW_SECTIONS
)
currentView
)
{
case
MainWindow
:
:
VIEW_ANALYZE
:
view
=
ViewAnalyze
;
break
;
case
MainWindow
:
:
VIEW_MISSIONEDITOR
:
view
=
ViewPlan
;
break
;
...
...
src/ui/toolbar/MainToolBar.h
View file @
691fc57b
...
...
@@ -64,7 +64,6 @@ public:
Q_INVOKABLE
void
onPlanView
();
Q_INVOKABLE
void
onFlyView
();
Q_INVOKABLE
void
onFlyViewMenu
();
Q_INVOKABLE
void
onAnalyzeView
();
Q_INVOKABLE
void
onConnect
(
QString
conf
);
Q_INVOKABLE
void
onDisconnect
(
QString
conf
);
Q_INVOKABLE
void
onEnterMessageArea
(
int
x
,
int
y
);
...
...
src/ui/toolbar/MainToolBar.qml
View file @
691fc57b
...
...
@@ -626,7 +626,6 @@ Rectangle {
setupButton
.
repaintChevron
=
true
;
planButton
.
repaintChevron
=
true
;
flyButton
.
repaintChevron
=
true
;
analyzeButton
.
repaintChevron
=
true
;
}
}
...
...
@@ -670,19 +669,6 @@ Rectangle {
}
z
:
800
}
QGCToolBarButton
{
id
:
analyzeButton
width
:
getProportionalDimmension
(
90
)
height
:
cellHeight
exclusiveGroup
:
mainActionGroup
text
:
qsTr
(
"
Analyze
"
)
checked
:
(
mainToolBar
.
currentView
===
MainToolBar
.
ViewAnalyze
)
onClicked
:
{
mainToolBar
.
onAnalyzeView
();
}
z
:
700
}
}
// Row
//---------------------------------------------------------------------
...
...
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