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
c9a76441
Commit
c9a76441
authored
Jul 25, 2012
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed visibility / instance of message sender widget for now, fixed transmission of param widget
parent
b5dde789
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
111 additions
and
214 deletions
+111
-214
MainWindow.cc
src/ui/MainWindow.cc
+7
-7
QGCParamWidget.cc
src/ui/QGCParamWidget.cc
+25
-8
QGCMAVLinkMessageSender.cc
src/ui/mavlink/QGCMAVLinkMessageSender.cc
+79
-199
No files found.
src/ui/MainWindow.cc
View file @
c9a76441
...
...
@@ -420,10 +420,10 @@ void MainWindow::buildCommonWidgets()
if
(
!
mavlinkSenderWidget
)
{
mavlinkSenderWidget
=
new
QDockWidget
(
tr
(
"MAVLink Message Sender"
),
this
);
mavlinkSenderWidget
->
setWidget
(
new
QGCMAVLinkMessageSender
(
mavlink
,
this
)
);
mavlinkSenderWidget
->
setObjectName
(
"MAVLINK_SENDER_DOCKWIDGET"
);
addTool
(
mavlinkSenderWidget
,
tr
(
"MAVLink Sender"
),
Qt
::
RightDockWidgetArea
);
//
mavlinkSenderWidget = new QDockWidget(tr("MAVLink Message Sender"), this);
//
mavlinkSenderWidget->setWidget( new QGCMAVLinkMessageSender(mavlink, this) );
//
mavlinkSenderWidget->setObjectName("MAVLINK_SENDER_DOCKWIDGET");
//
addTool(mavlinkSenderWidget, tr("MAVLink Sender"), Qt::RightDockWidgetArea);
}
//FIXME: memory of acceptList will never be freed again
...
...
@@ -1420,7 +1420,7 @@ void MainWindow::loadViewState()
debugConsoleDockWidget
->
show
();
logPlayerDockWidget
->
show
();
mavlinkInspectorWidget
->
show
();
mavlinkSenderWidget
->
show
();
//
mavlinkSenderWidget->show();
parametersDockWidget
->
show
();
hsiDockWidget
->
hide
();
headDown1DockWidget
->
hide
();
...
...
@@ -1457,7 +1457,7 @@ void MainWindow::loadViewState()
debugConsoleDockWidget
->
hide
();
logPlayerDockWidget
->
hide
();
mavlinkInspectorWidget
->
show
();
mavlinkSenderWidget
->
show
();
//
mavlinkSenderWidget->show();
parametersDockWidget
->
hide
();
hsiDockWidget
->
hide
();
headDown1DockWidget
->
hide
();
...
...
@@ -1476,7 +1476,7 @@ void MainWindow::loadViewState()
debugConsoleDockWidget
->
hide
();
logPlayerDockWidget
->
hide
();
mavlinkInspectorWidget
->
hide
();
mavlinkSenderWidget
->
hide
();
//
mavlinkSenderWidget->hide();
parametersDockWidget
->
hide
();
hsiDockWidget
->
hide
();
headDown1DockWidget
->
hide
();
...
...
src/ui/QGCParamWidget.cc
View file @
c9a76441
...
...
@@ -58,15 +58,17 @@ QGCParamWidget::QGCParamWidget(UASInterface* uas, QWidget *parent) :
tree
=
new
QTreeWidget
(
this
);
statusLabel
=
new
QLabel
();
statusLabel
->
setAutoFillBackground
(
true
);
tree
->
setColumnWidth
(
0
,
1
50
);
tree
->
setColumnWidth
(
0
,
1
75
);
// Set tree widget as widget onto this component
QGridLayout
*
horizontalLayout
;
//form->setAutoFillBackground(false);
horizontalLayout
=
new
QGridLayout
(
this
);
horizontalLayout
->
setSpacing
(
6
);
horizontalLayout
->
setHorizontalSpacing
(
6
);
horizontalLayout
->
setVerticalSpacing
(
6
);
horizontalLayout
->
setMargin
(
0
);
horizontalLayout
->
setSizeConstraint
(
QLayout
::
SetMinimumSize
);
//horizontalLayout->setSizeConstraint(QLayout::SetMinimumSize);
horizontalLayout
->
setSizeConstraint
(
QLayout
::
SetFixedSize
);
// Parameter tree
horizontalLayout
->
addWidget
(
tree
,
0
,
0
,
1
,
3
);
...
...
@@ -113,6 +115,12 @@ QGCParamWidget::QGCParamWidget(UASInterface* uas, QWidget *parent) :
connect
(
readButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
readParameters
()));
horizontalLayout
->
addWidget
(
readButton
,
3
,
2
);
// Set correct vertical scaling
horizontalLayout
->
setRowStretch
(
0
,
100
);
horizontalLayout
->
setRowStretch
(
1
,
10
);
horizontalLayout
->
setRowStretch
(
2
,
10
);
horizontalLayout
->
setRowStretch
(
3
,
10
);
// Set layout
this
->
setLayout
(
horizontalLayout
);
...
...
@@ -135,6 +143,9 @@ QGCParamWidget::QGCParamWidget(UASInterface* uas, QWidget *parent) :
connect
(
this
,
SIGNAL
(
requestParameter
(
int
,
QString
)),
uas
,
SLOT
(
requestParameter
(
int
,
QString
)));
connect
(
this
,
SIGNAL
(
requestParameter
(
int
,
int
)),
uas
,
SLOT
(
requestParameter
(
int
,
int
)));
connect
(
&
retransmissionTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
retransmissionGuardTick
()));
// Get parameters
if
(
uas
)
mav
->
requestParameters
();
}
void
QGCParamWidget
::
loadSettings
()
...
...
@@ -431,7 +442,9 @@ void QGCParamWidget::addParameter(int uas, int component, int paramCount, int pa
pal
.
setColor
(
backgroundRole
(),
QGC
::
colorGreen
);
statusLabel
->
setPalette
(
pal
);
}
statusLabel
->
setText
(
tr
(
"Got %2 (#%1/%5): %3 (%4 missing)"
).
arg
(
paramId
+
1
).
arg
(
parameterName
).
arg
(
value
.
toDouble
()).
arg
(
missCount
).
arg
(
paramCount
));
QString
val
=
QString
(
"%1"
).
arg
(
value
.
toFloat
(),
5
,
'f'
,
1
,
QChar
(
' '
));
//statusLabel->setText(tr("OK: %1 %2 #%3/%4, %5 miss").arg(parameterName).arg(val).arg(paramId+1).arg(paramCount).arg(missCount));
statusLabel
->
setText
(
tr
(
"OK: %1 %2 (%3/%4)"
).
arg
(
parameterName
).
arg
(
val
).
arg
(
paramCount
-
missCount
).
arg
(
paramCount
));
}
// Check if last parameter was received
...
...
@@ -444,6 +457,9 @@ void QGCParamWidget::addParameter(int uas, int component, int paramCount, int pa
{
transmissionMissingPackets
.
value
(
key
)
->
clear
();
}
// Expand visual tree
tree
->
expandItem
(
tree
->
topLevelItem
(
0
));
}
}
...
...
@@ -564,7 +580,7 @@ void QGCParamWidget::addParameter(int uas, int component, QString parameterName,
//tree->expandAll();
}
// Reset background color
parameterItem
->
setBackground
(
0
,
Q
Brush
(
QColor
(
0
,
0
,
0
))
);
parameterItem
->
setBackground
(
0
,
Q
t
::
NoBrush
);
parameterItem
->
setBackground
(
1
,
Qt
::
NoBrush
);
// Add tooltip
QString
tooltipFormat
;
...
...
@@ -614,7 +630,6 @@ void QGCParamWidget::requestParameterList()
// Set status text
statusLabel
->
setText
(
tr
(
"Requested param list.. waiting"
));
// Request twice as mean of forward error correction
mav
->
requestParameters
();
}
...
...
@@ -634,9 +649,11 @@ void QGCParamWidget::parameterItemChanged(QTreeWidgetItem* current, int column)
if
(
map
)
{
QString
str
=
current
->
data
(
0
,
Qt
::
DisplayRole
).
toString
();
QVariant
value
=
current
->
data
(
1
,
Qt
::
DisplayRole
);
qDebug
()
<<
"CHANGED PARAM:"
<<
value
;
// Set parameter on changed list to be transmitted to MAV
statusLabel
->
setText
(
tr
(
"Changed Param %1:%2: %3"
).
arg
(
key
).
arg
(
str
).
arg
(
value
.
toDouble
()));
QPalette
pal
=
statusLabel
->
palette
();
pal
.
setColor
(
backgroundRole
(),
QGC
::
colorOrange
);
statusLabel
->
setPalette
(
pal
);
statusLabel
->
setText
(
tr
(
"Transmit pend. %1:%2: %3"
).
arg
(
key
).
arg
(
str
).
arg
(
value
.
toFloat
(),
5
,
'f'
,
1
,
QChar
(
' '
)));
//qDebug() << "PARAM CHANGED: COMP:" << key << "KEY:" << str << "VALUE:" << value;
// Changed values list
if
(
map
->
contains
(
str
))
map
->
remove
(
str
);
...
...
src/ui/mavlink/QGCMAVLinkMessageSender.cc
View file @
c9a76441
This diff is collapsed.
Click to expand it.
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