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
36060bd1
Commit
36060bd1
authored
Jun 21, 2013
by
Michael Carpenter
Browse files
Implementation of FrameTypeConfig completed, now reads and sets Frame Type
parent
274b20d8
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/ui/configuration/FrameTypeConfig.cc
View file @
36060bd1
...
...
@@ -34,27 +34,76 @@ This file is part of the QGROUNDCONTROL project
FrameTypeConfig
::
FrameTypeConfig
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
m_uas
=
0
;
ui
.
setupUi
(
this
);
//Disable until we get a FRAME parameter.
ui
.
xRadioButton
->
setEnabled
(
false
);
ui
.
vRadioButton
->
setEnabled
(
false
);
ui
.
plusRadioButton
->
setEnabled
(
false
);
connect
(
ui
.
plusRadioButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
plusFrameSelected
()));
connect
(
ui
.
xRadioButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
xFrameSelected
()));
connect
(
ui
.
vRadioButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
vFrameSelected
()));
//connect(UASManager::instance()->getActiveUAS()->getParamManager(),SIGNAL(parameterListUpToDate(int))
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
activeUASSet
(
UASInterface
*
)));
activeUASSet
(
UASManager
::
instance
()
->
getActiveUAS
());
}
FrameTypeConfig
::~
FrameTypeConfig
()
{
}
void
FrameTypeConfig
::
xFrameSelected
()
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
)
{
if
(
parameterName
==
"FRAME"
)
{
ui
.
xRadioButton
->
setEnabled
(
true
);
ui
.
vRadioButton
->
setEnabled
(
true
);
ui
.
plusRadioButton
->
setEnabled
(
true
);
if
(
value
.
toInt
()
==
0
)
{
ui
.
plusRadioButton
->
setChecked
(
true
);
}
else
if
(
value
.
toInt
()
==
1
)
{
ui
.
xRadioButton
->
setChecked
(
true
);
}
else
if
(
value
.
toInt
()
==
2
)
{
ui
.
vRadioButton
->
setChecked
(
true
);
}
}
}
void
FrameTypeConfig
::
xFrameSelected
()
{
if
(
m_uas
)
{
m_uas
->
setParameter
(
0
,
"FRAME"
,
QVariant
(
1
));
}
}
void
FrameTypeConfig
::
plusFrameSelected
()
{
if
(
m_uas
)
{
m_uas
->
setParameter
(
0
,
"FRAME"
,
QVariant
(
0
));
}
}
void
FrameTypeConfig
::
vFrameSelected
()
{
if
(
m_uas
)
{
m_uas
->
setParameter
(
0
,
"FRAME"
,
QVariant
(
2
));
}
}
src/ui/configuration/FrameTypeConfig.h
View file @
36060bd1
...
...
@@ -45,11 +45,14 @@ public:
explicit
FrameTypeConfig
(
QWidget
*
parent
=
0
);
~
FrameTypeConfig
();
private
slots
:
void
activeUASSet
(
UASInterface
*
uas
);
void
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
);
void
xFrameSelected
();
void
plusFrameSelected
();
void
vFrameSelected
();
private:
Ui
::
FrameTypeConfig
ui
;
UASInterface
*
m_uas
;
};
#endif // FRAMETYPECONFIG_H
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