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
42161c97
Commit
42161c97
authored
Sep 10, 2010
by
tecnosapiens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add WaypointGlobalView file
parent
4c2798a8
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
659 additions
and
0 deletions
+659
-0
WaypointGlobalView.cpp
src/ui/WaypointGlobalView.cpp
+155
-0
WaypointGlobalView.h
src/ui/WaypointGlobalView.h
+44
-0
WaypointGlobalView.ui
src/ui/WaypointGlobalView.ui
+460
-0
No files found.
src/ui/WaypointGlobalView.cpp
0 → 100644
View file @
42161c97
#include "WaypointGlobalView.h"
#include "ui_WaypointGlobalView.h"
#include <math.h>
WaypointGlobalView
::
WaypointGlobalView
(
Waypoint
*
wp
,
QWidget
*
parent
)
:
QWidget
(
parent
),
ui
(
new
Ui
::
WaypointGlobalView
)
{
ui
->
setupUi
(
this
);
this
->
wp
=
wp
;
ui
->
m_orbitalSpinBox
->
hide
();
connect
(
ui
->
m_orbitalSpinBox
,
SIGNAL
(
valueChanged
(
double
)),
wp
,
SLOT
(
setOrbit
(
double
)));
connect
(
ui
->
m_heigthSpinBox
,
SIGNAL
(
valueChanged
(
double
)),
wp
,
SLOT
(
setZ
(
double
)));
connect
(
ui
->
m_orbitCheckBox
,
SIGNAL
(
stateChanged
(
int
)),
this
,
SLOT
(
changeOrbitalState
(
int
)));
// Read values and set user interface
updateValues
();
// connect(m_ui->xSpinBox, SIGNAL(valueChanged(double)), wp, SLOT(setX(double)));
// connect(m_ui->ySpinBox, SIGNAL(valueChanged(double)), wp, SLOT(setY(double)));
// connect(m_ui->zSpinBox, SIGNAL(valueChanged(double)), wp, SLOT(setZ(double)));
// //hidden degree to radian conversion of the yaw angle
// connect(m_ui->yawSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setYaw(int)));
// connect(this, SIGNAL(setYaw(double)), wp, SLOT(setYaw(double)));
// connect(m_ui->upButton, SIGNAL(clicked()), this, SLOT(moveUp()));
// connect(m_ui->downButton, SIGNAL(clicked()), this, SLOT(moveDown()));
// connect(m_ui->removeButton, SIGNAL(clicked()), this, SLOT(remove()));
// connect(m_ui->autoContinue, SIGNAL(stateChanged(int)), this, SLOT(changedAutoContinue(int)));
// connect(m_ui->selectedBox, SIGNAL(stateChanged(int)), this, SLOT(changedCurrent(int)));
//
// connect(m_ui->holdTimeSpinBox, SIGNAL(valueChanged(int)), wp, SLOT(setHoldTime(int)));
}
WaypointGlobalView
::~
WaypointGlobalView
()
{
delete
ui
;
}
void
WaypointGlobalView
::
updateValues
()
{
ui
->
m_latitudtextEdit
->
setText
(
getLatitudString
(
wp
->
getY
()));
ui
->
m_longitudtextEdit
->
setText
(
getLongitudString
(
wp
->
getX
()));
ui
->
idWP_label
->
setText
(
QString
(
"%1"
).
arg
(
wp
->
getId
()));
\
}
void
WaypointGlobalView
::
changeEvent
(
QEvent
*
e
)
{
switch
(
e
->
type
())
{
case
QEvent
:
:
LanguageChange
:
ui
->
retranslateUi
(
this
);
break
;
default:
break
;
}
}
void
WaypointGlobalView
::
remove
()
{
emit
removeWaypoint
(
wp
);
delete
this
;
}
QString
WaypointGlobalView
::
getLatitudString
(
float
latitud
)
{
QString
tempNS
=
""
;
QString
stringLatitudTemp
=
""
;
float
minutos
=
0
;
float
grados
=
0
;
float
entero
=
0
;
float
dec
=
0
;
if
(
latitud
<
0
){
tempNS
=
"S"
;
latitud
=
latitud
*
-
1
;}
else
{
tempNS
=
"N"
;}
if
(
latitud
<
90
||
latitud
>
-
90
)
{
dec
=
latitud
-
(
entero
=
::
floor
(
latitud
));;
minutos
=
dec
*
60
;
grados
=
entero
;
if
(
grados
<
0
)
grados
=
grados
*
(
-
1
);
if
(
minutos
<
0
)
minutos
=
minutos
*
(
-
1
);
stringLatitudTemp
=
QString
::
number
(
grados
)
+
" "
+
QString
::
number
(
minutos
)
+
"' "
+
tempNS
;
return
stringLatitudTemp
;
}
else
{
stringLatitudTemp
=
"erroneous latitude"
;
return
stringLatitudTemp
;
}
}
QString
WaypointGlobalView
::
getLongitudString
(
float
longitud
)
{
QString
tempEW
=
""
;
QString
stringLongitudTemp
=
""
;
float
minutos
=
0
;
float
grados
=
0
;
float
entero
=
0
;
float
dec
=
0
;
if
(
longitud
<
0
){
tempEW
=
"W"
;
longitud
=
longitud
*
-
1
;}
else
{
tempEW
=
"E"
;}
if
(
longitud
<
180
||
longitud
>
-
180
)
{
dec
=
longitud
-
(
entero
=
::
floor
(
longitud
));;
minutos
=
dec
*
60
;
grados
=
entero
;
if
(
grados
<
0
)
grados
=
grados
*
(
-
1
);
if
(
minutos
<
0
)
minutos
=
minutos
*
(
-
1
);
stringLongitudTemp
=
QString
::
number
(
grados
)
+
" "
+
QString
::
number
(
minutos
)
+
"' "
+
tempEW
;
return
stringLongitudTemp
;
}
else
{
stringLongitudTemp
=
"erroneous longitude"
;
return
stringLongitudTemp
;
}
}
void
WaypointGlobalView
::
changeOrbitalState
(
int
state
)
{
Q_UNUSED
(
state
);
if
(
ui
->
m_orbitCheckBox
->
isChecked
())
{
ui
->
m_orbitalSpinBox
->
setEnabled
(
true
);
ui
->
m_orbitalSpinBox
->
show
();
}
else
{
ui
->
m_orbitalSpinBox
->
setEnabled
(
false
);
ui
->
m_orbitalSpinBox
->
hide
();
}
}
src/ui/WaypointGlobalView.h
0 → 100644
View file @
42161c97
#ifndef WAYPOINTGLOBALVIEW_H
#define WAYPOINTGLOBALVIEW_H
#include <QWidget>
#include "Waypoint.h"
namespace
Ui
{
class
WaypointGlobalView
;
}
class
WaypointGlobalView
:
public
QWidget
{
Q_OBJECT
public:
explicit
WaypointGlobalView
(
Waypoint
*
wp
,
QWidget
*
parent
=
0
);
~
WaypointGlobalView
();
public
slots
:
void
updateValues
(
void
);
void
remove
();
QString
getLatitudString
(
float
lat
);
QString
getLongitudString
(
float
lon
);
void
changeOrbitalState
(
int
state
);
signals:
void
removeWaypoint
(
Waypoint
*
);
protected:
virtual
void
changeEvent
(
QEvent
*
e
);
Waypoint
*
wp
;
private:
Ui
::
WaypointGlobalView
*
ui
;
private
slots
:
};
#endif // WAYPOINTGLOBALVIEW_H
src/ui/WaypointGlobalView.ui
0 → 100644
View file @
42161c97
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