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
551ffcc8
Commit
551ffcc8
authored
Dec 04, 2014
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed due to collision with new QGCComboBox
parent
6eb11b75
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
36 deletions
+36
-36
QGCToolWidget.cc
src/ui/designer/QGCToolWidget.cc
+4
-4
QGCToolWidgetComboBox.cc
src/ui/designer/QGCToolWidgetComboBox.cc
+22
-22
QGCToolWidgetComboBox.h
src/ui/designer/QGCToolWidgetComboBox.h
+8
-8
QGCToolWidgetComboBox.ui
src/ui/designer/QGCToolWidgetComboBox.ui
+2
-2
No files found.
src/ui/designer/QGCToolWidget.cc
View file @
551ffcc8
...
...
@@ -10,7 +10,7 @@
#include <QStandardPaths>
#include "QGCParamSlider.h"
#include "QGCComboBox.h"
#include "QGC
ToolWidget
ComboBox.h"
#include "QGCTextLabel.h"
#include "QGCXYPlot.h"
#include "QGCCommandButton.h"
...
...
@@ -230,7 +230,7 @@ void QGCToolWidget::setParameterValue(int uas, int component, QString parameterN
QString
checkparam
=
settingsMap
.
value
(
widgetName
+
"
\\
"
+
QString
::
number
(
j
)
+
"
\\
"
+
"QGC_PARAM_COMBOBOX_PARAMID"
).
toString
();
if
(
checkparam
==
parameterName
)
{
item
=
new
QGCComboBox
(
this
);
item
=
new
QGC
ToolWidget
ComboBox
(
this
);
addToolWidget
(
item
);
item
->
readSettings
(
widgetName
+
"
\\
"
+
QString
::
number
(
j
)
+
"
\\
"
,
settingsMap
);
paramToItemMap
[
parameterName
]
=
item
;
...
...
@@ -274,7 +274,7 @@ void QGCToolWidget::loadSettings(QVariantMap& settings)
}
else
if
(
type
==
"COMBO"
)
{
item
=
new
QGCComboBox
(
this
);
item
=
new
QGC
ToolWidget
ComboBox
(
this
);
//qDebug() << "CREATED COMBOBOX";
}
else
if
(
type
==
"XYPLOT"
)
...
...
@@ -330,7 +330,7 @@ void QGCToolWidget::loadSettings(QSettings& settings)
}
else
if
(
type
==
"COMBO"
)
{
item
=
new
QGCComboBox
(
this
);
item
=
new
QGC
ToolWidget
ComboBox
(
this
);
item
->
setActiveUAS
(
mav
);
qDebug
()
<<
"CREATED PARAM COMBOBOX"
;
}
...
...
src/ui/designer/QGCComboBox.cc
→
src/ui/designer/QGC
ToolWidget
ComboBox.cc
View file @
551ffcc8
...
...
@@ -5,13 +5,13 @@
#include <QToolTip>
#include <QDebug>
#include "QGCComboBox.h"
#include "ui_QGCComboBox.h"
#include "QGC
ToolWidget
ComboBox.h"
#include "ui_QGC
ToolWidget
ComboBox.h"
#include "UASInterface.h"
#include "UASManager.h"
QGC
ComboBox
::
QGC
ComboBox
(
QWidget
*
parent
)
:
QGC
ToolWidgetComboBox
::
QGCToolWidget
ComboBox
(
QWidget
*
parent
)
:
QGCToolWidgetItem
(
"Combo"
,
parent
),
parameterName
(
""
),
parameterValue
(
0.0
f
),
...
...
@@ -19,7 +19,7 @@ QGCComboBox::QGCComboBox(QWidget *parent) :
parameterMin
(
0.0
f
),
parameterMax
(
0.0
f
),
componentId
(
0
),
ui
(
new
Ui
::
QGCComboBox
)
ui
(
new
Ui
::
QGC
ToolWidget
ComboBox
)
{
ui
->
setupUi
(
this
);
uas
=
NULL
;
...
...
@@ -64,12 +64,12 @@ QGCComboBox::QGCComboBox(QWidget *parent) :
init
();
}
QGC
ComboBox
::~
QGC
ComboBox
()
QGC
ToolWidgetComboBox
::~
QGCToolWidget
ComboBox
()
{
delete
ui
;
}
void
QGCComboBox
::
showTooltip
()
void
QGC
ToolWidget
ComboBox
::
showTooltip
()
{
QWidget
*
sender
=
dynamic_cast
<
QWidget
*>
(
QObject
::
sender
());
...
...
@@ -80,7 +80,7 @@ void QGCComboBox::showTooltip()
}
}
void
QGCComboBox
::
refreshParameter
()
void
QGC
ToolWidget
ComboBox
::
refreshParameter
()
{
ui
->
editSelectParamComboBox
->
setEnabled
(
true
);
ui
->
editSelectComponentComboBox
->
setEnabled
(
true
);
...
...
@@ -90,7 +90,7 @@ void QGCComboBox::refreshParameter()
}
}
void
QGCComboBox
::
setActiveUAS
(
UASInterface
*
activeUas
)
void
QGC
ToolWidget
ComboBox
::
setActiveUAS
(
UASInterface
*
activeUas
)
{
if
(
activeUas
)
{
...
...
@@ -119,7 +119,7 @@ void QGCComboBox::setActiveUAS(UASInterface* activeUas)
}
}
void
QGCComboBox
::
requestParameter
()
void
QGC
ToolWidget
ComboBox
::
requestParameter
()
{
if
(
!
parameterName
.
isEmpty
()
&&
uas
)
{
...
...
@@ -127,18 +127,18 @@ void QGCComboBox::requestParameter()
}
}
void
QGCComboBox
::
showInfo
(
bool
enable
)
void
QGC
ToolWidget
ComboBox
::
showInfo
(
bool
enable
)
{
ui
->
editInfoCheckBox
->
setChecked
(
enable
);
ui
->
infoLabel
->
setVisible
(
enable
);
}
void
QGCComboBox
::
selectComponent
(
int
componentIndex
)
void
QGC
ToolWidget
ComboBox
::
selectComponent
(
int
componentIndex
)
{
this
->
componentId
=
ui
->
editSelectComponentComboBox
->
itemData
(
componentIndex
).
toInt
();
}
void
QGCComboBox
::
selectParameter
(
int
paramIndex
)
void
QGC
ToolWidget
ComboBox
::
selectParameter
(
int
paramIndex
)
{
// Set name
parameterName
=
ui
->
editSelectParamComboBox
->
itemText
(
paramIndex
);
...
...
@@ -165,7 +165,7 @@ void QGCComboBox::selectParameter(int paramIndex)
}
}
void
QGCComboBox
::
setEditMode
(
bool
editMode
)
void
QGC
ToolWidget
ComboBox
::
setEditMode
(
bool
editMode
)
{
if
(
!
editMode
)
{
// Store component id
...
...
@@ -203,7 +203,7 @@ void QGCComboBox::setEditMode(bool editMode)
QGCToolWidgetItem
::
setEditMode
(
editMode
);
}
void
QGCComboBox
::
setParamPending
()
void
QGC
ToolWidget
ComboBox
::
setParamPending
()
{
if
(
uas
)
{
uas
->
getParamManager
()
->
setPendingParam
(
componentId
,
parameterName
,
parameterValue
);
...
...
@@ -220,7 +220,7 @@ void QGCComboBox::setParamPending()
* @brief parameterName Key/name of the parameter
* @brief value Value of the parameter
*/
void
QGCComboBox
::
setParameterValue
(
int
uas
,
int
component
,
int
paramCount
,
int
paramIndex
,
QString
parameterName
,
QVariant
value
)
void
QGC
ToolWidget
ComboBox
::
setParameterValue
(
int
uas
,
int
component
,
int
paramCount
,
int
paramIndex
,
QString
parameterName
,
QVariant
value
)
{
Q_UNUSED
(
paramCount
);
// Check if this component and parameter are part of the list
...
...
@@ -301,7 +301,7 @@ void QGCComboBox::setParameterValue(int uas, int component, int paramCount, int
}
}
void
QGCComboBox
::
changeEvent
(
QEvent
*
e
)
void
QGC
ToolWidget
ComboBox
::
changeEvent
(
QEvent
*
e
)
{
QWidget
::
changeEvent
(
e
);
switch
(
e
->
type
())
{
...
...
@@ -314,7 +314,7 @@ void QGCComboBox::changeEvent(QEvent *e)
}
void
QGCComboBox
::
writeSettings
(
QSettings
&
settings
)
void
QGC
ToolWidget
ComboBox
::
writeSettings
(
QSettings
&
settings
)
{
settings
.
setValue
(
"TYPE"
,
"COMBOBOX"
);
settings
.
setValue
(
"QGC_PARAM_COMBOBOX_DESCRIPTION"
,
ui
->
nameLabel
->
text
());
...
...
@@ -331,7 +331,7 @@ void QGCComboBox::writeSettings(QSettings& settings)
}
settings
.
sync
();
}
void
QGCComboBox
::
readSettings
(
const
QString
&
pre
,
const
QVariantMap
&
settings
)
void
QGC
ToolWidget
ComboBox
::
readSettings
(
const
QString
&
pre
,
const
QVariantMap
&
settings
)
{
parameterName
=
settings
.
value
(
pre
+
"QGC_PARAM_COMBOBOX_PARAMID"
).
toString
();
componentId
=
settings
.
value
(
pre
+
"QGC_PARAM_COMBOBOX_COMPONENTID"
).
toInt
();
...
...
@@ -370,7 +370,7 @@ void QGCComboBox::readSettings(const QString& pre,const QVariantMap& settings)
// Get param value after settings have been loaded
// requestParameter();
}
void
QGCComboBox
::
readSettings
(
const
QSettings
&
settings
)
void
QGC
ToolWidget
ComboBox
::
readSettings
(
const
QSettings
&
settings
)
{
QVariantMap
map
;
foreach
(
QString
key
,
settings
.
allKeys
())
...
...
@@ -410,19 +410,19 @@ void QGCComboBox::readSettings(const QSettings& settings)
// Get param value after settings have been loaded
//requestParameter();
}
void
QGCComboBox
::
addButtonClicked
()
void
QGC
ToolWidget
ComboBox
::
addButtonClicked
()
{
ui
->
editOptionComboBox
->
addItem
(
ui
->
editItemNameLabel
->
text
());
comboBoxTextToValMap
[
ui
->
editItemNameLabel
->
text
()]
=
ui
->
editItemValueSpinBox
->
value
();
}
void
QGCComboBox
::
delButtonClicked
()
void
QGC
ToolWidget
ComboBox
::
delButtonClicked
()
{
int
index
=
ui
->
editOptionComboBox
->
currentIndex
();
comboBoxTextToValMap
.
remove
(
ui
->
editOptionComboBox
->
currentText
());
ui
->
editOptionComboBox
->
removeItem
(
index
);
}
void
QGCComboBox
::
comboBoxIndexChanged
(
QString
val
)
void
QGC
ToolWidget
ComboBox
::
comboBoxIndexChanged
(
QString
val
)
{
ui
->
imageLabel
->
setPixmap
(
comboBoxIndexToPixmap
[
ui
->
editOptionComboBox
->
currentIndex
()]);
if
(
comboBoxTextToParamMap
.
contains
(
ui
->
editOptionComboBox
->
currentText
()))
...
...
src/ui/designer/QGCComboBox.h
→
src/ui/designer/QGC
ToolWidget
ComboBox.h
View file @
551ffcc8
#ifndef QGC
COMBOBOX
_H
#define QGC
COMBOBOX
_H
#ifndef QGC
ToolWidgetComboBox
_H
#define QGC
ToolWidgetComboBox
_H
#include <QWidget>
#include <QAction>
...
...
@@ -11,16 +11,16 @@ class QGCUASParamManagerInterface;
namespace
Ui
{
class
QGCComboBox
;
class
QGC
ToolWidget
ComboBox
;
}
class
QGCComboBox
:
public
QGCToolWidgetItem
class
QGC
ToolWidget
ComboBox
:
public
QGCToolWidgetItem
{
Q_OBJECT
public:
explicit
QGCComboBox
(
QWidget
*
parent
=
0
);
~
QGCComboBox
();
explicit
QGC
ToolWidget
ComboBox
(
QWidget
*
parent
=
0
);
~
QGC
ToolWidget
ComboBox
();
virtual
void
setEditMode
(
bool
editMode
);
...
...
@@ -70,7 +70,7 @@ protected:
void
changeEvent
(
QEvent
*
e
);
private:
Ui
::
QGCComboBox
*
ui
;
Ui
::
QGC
ToolWidget
ComboBox
*
ui
;
};
#endif // QGC
COMBOBOX
_H
#endif // QGC
ToolWidgetComboBox
_H
src/ui/designer/QGCComboBox.ui
→
src/ui/designer/QGC
ToolWidget
ComboBox.ui
View file @
551ffcc8
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
QGCComboBox
</class>
<widget
class=
"QWidget"
name=
"QGCComboBox"
>
<class>
QGC
ToolWidget
ComboBox
</class>
<widget
class=
"QWidget"
name=
"QGC
ToolWidget
ComboBox"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
...
...
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