Commit f8a90520 authored by tecnosapiens's avatar tecnosapiens

add SlugsPadCameraWidget

parent deb6ba86
...@@ -140,7 +140,8 @@ FORMS += src/ui/MainWindow.ui \ ...@@ -140,7 +140,8 @@ FORMS += src/ui/MainWindow.ui \
src/ui/SlugsDataSensorView.ui \ src/ui/SlugsDataSensorView.ui \
src/ui/SlugsHilSim.ui \ src/ui/SlugsHilSim.ui \
src/ui/SlugsPIDControl.ui \ src/ui/SlugsPIDControl.ui \
src/ui/SlugsVideoCamControl.ui src/ui/SlugsVideoCamControl.ui \
src/ui/SlugsPadCameraControl.ui
INCLUDEPATH += src \ INCLUDEPATH += src \
src/ui \ src/ui \
src/ui/linechart \ src/ui/linechart \
...@@ -243,7 +244,8 @@ HEADERS += src/MG.h \ ...@@ -243,7 +244,8 @@ HEADERS += src/MG.h \
src/ui/SlugsDataSensorView.h \ src/ui/SlugsDataSensorView.h \
src/ui/SlugsHilSim.h \ src/ui/SlugsHilSim.h \
src/ui/SlugsPIDControl.h \ src/ui/SlugsPIDControl.h \
src/ui/SlugsVideoCamControl.h src/ui/SlugsVideoCamControl.h \
src/ui/SlugsPadCameraControl.h
SOURCES += src/main.cc \ SOURCES += src/main.cc \
src/Core.cc \ src/Core.cc \
src/uas/UASManager.cc \ src/uas/UASManager.cc \
...@@ -326,7 +328,8 @@ SOURCES += src/main.cc \ ...@@ -326,7 +328,8 @@ SOURCES += src/main.cc \
src/ui/SlugsDataSensorView.cc \ src/ui/SlugsDataSensorView.cc \
src/ui/SlugsHilSim.cc \ src/ui/SlugsHilSim.cc \
src/ui/SlugsPIDControl.cpp \ src/ui/SlugsPIDControl.cpp \
src/ui/SlugsVideoCamControl.cpp src/ui/SlugsVideoCamControl.cpp \
src/ui/SlugsPadCameraControl.cpp
RESOURCES = mavground.qrc RESOURCES = mavground.qrc
......
...@@ -410,6 +410,7 @@ void MapWidget::createWaypointGraphAtMap(const QPointF coordinate) ...@@ -410,6 +410,7 @@ void MapWidget::createWaypointGraphAtMap(const QPointF coordinate)
// Create waypoint name // Create waypoint name
QString str; QString str;
str = QString("%1").arg(path->numberOfPoints()); str = QString("%1").arg(path->numberOfPoints());
// create the WP and set everything in the LineString to display the path // create the WP and set everything in the LineString to display the path
...@@ -431,6 +432,7 @@ void MapWidget::createWaypointGraphAtMap(const QPointF coordinate) ...@@ -431,6 +432,7 @@ void MapWidget::createWaypointGraphAtMap(const QPointF coordinate)
path->addPoint(tempPoint); path->addPoint(tempPoint);
wpIndex.insert(str,tempPoint); wpIndex.insert(str,tempPoint);
qDebug()<<"Funcion createWaypointGraphAtMap WP= "<<str<<" -> x= "<<tempPoint->latitude()<<" y= "<<tempPoint->longitude();
// Refresh the screen // Refresh the screen
mc->updateRequestNew(); mc->updateRequestNew();
......
...@@ -9,6 +9,10 @@ ...@@ -9,6 +9,10 @@
#include <QWheelEvent> #include <QWheelEvent>
#include <QDebug> #include <QDebug>
#include <qmath.h> #include <qmath.h>
#include <QPainter>
#include <QGridLayout>
#include <QVBoxLayout>
#include <QHBoxLayout>
SlugsVideoCamControl::SlugsVideoCamControl(QWidget *parent) : SlugsVideoCamControl::SlugsVideoCamControl(QWidget *parent) :
...@@ -20,6 +24,22 @@ SlugsVideoCamControl::SlugsVideoCamControl(QWidget *parent) : ...@@ -20,6 +24,22 @@ SlugsVideoCamControl::SlugsVideoCamControl(QWidget *parent) :
x1= 0; x1= 0;
y1 = 0; y1 = 0;
connect(ui->viewCamBordeatMap_checkBox,SIGNAL(clicked(bool)),this,SLOT(changeViewCamBorderAtMapStatus(bool))); connect(ui->viewCamBordeatMap_checkBox,SIGNAL(clicked(bool)),this,SLOT(changeViewCamBorderAtMapStatus(bool)));
tL = ui->padCamContro_frame->frameGeometry().topLeft();
bR = ui->padCamContro_frame->frameGeometry().bottomRight();
//ui->padCamContro_frame->setVisible(true);
// create a layout for camera pad
QGridLayout* padCameraLayout = new QGridLayout(ui->padCamContro_frame);
padCameraLayout->setSpacing(2);
padCameraLayout->setMargin(0);
padCameraLayout->setAlignment(Qt::AlignTop);
ui->padCamContro_frame->setLayout(padCameraLayout);
// create a camera pad widget
padCamera = new SlugsPadCameraControl();
padCameraLayout->addWidget(padCamera);
...@@ -326,6 +346,28 @@ QPointF SlugsVideoCamControl::ObtenerMarcacionDistanciaPixel(double lon1, double ...@@ -326,6 +346,28 @@ QPointF SlugsVideoCamControl::ObtenerMarcacionDistanciaPixel(double lon1, double
} }
void SlugsVideoCamControl::paintEvent(QPaintEvent *pe)
{
Q_UNUSED(pe);
QPainter painter(this);
painter.setPen(Qt::blue);
painter.setFont(QFont("Arial", 30));
// QRectF rectangle(tL.x(), tL.y(), ui->padCamContro_frame->width(), ui->padCamContro_frame->height());
// int startAngle = 30 * 16;
// int spanAngle = 120 * 16;
painter.drawLine(QPoint(tL.x(),tL.y()),QPoint(bR.x(),bR.y()));
// painter.drawLine(QPoint());
//painter.drawLines(padLines);
// painter.drawPie(rectangle, startAngle, spanAngle);
//painter.drawText(rect(), Qt::AlignCenter, "Qt");
}
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include <QGraphicsView> #include <QGraphicsView>
#include <QGraphicsSceneMouseEvent> #include <QGraphicsSceneMouseEvent>
#include <QGraphicsScene> #include <QGraphicsScene>
#include "SlugsPadCameraControl.h"
#define DELTA 1000 #define DELTA 1000
...@@ -36,6 +38,8 @@ protected: ...@@ -36,6 +38,8 @@ protected:
virtual void mousePressEvent(QMouseEvent* event); virtual void mousePressEvent(QMouseEvent* event);
virtual void mouseReleaseEvent(QMouseEvent* event); virtual void mouseReleaseEvent(QMouseEvent* event);
void mouseMoveEvent(QMouseEvent* event); void mouseMoveEvent(QMouseEvent* event);
//virtual void paintEvent(QPaintEvent *pe);
void paintEvent(QPaintEvent *pe);
private: private:
...@@ -44,6 +48,10 @@ private: ...@@ -44,6 +48,10 @@ private:
int x1; int x1;
int y1; int y1;
QPoint tL;
QPoint bR;
SlugsPadCameraControl* padCamera;
}; };
......
...@@ -6,14 +6,14 @@ ...@@ -6,14 +6,14 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>153</width> <width>165</width>
<height>200</height> <height>191</height>
</rect> </rect>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>153</width> <width>0</width>
<height>176</height> <height>0</height>
</size> </size>
</property> </property>
<property name="mouseTracking"> <property name="mouseTracking">
...@@ -27,15 +27,16 @@ ...@@ -27,15 +27,16 @@
<widget class="QFrame" name="padCamContro_frame"> <widget class="QFrame" name="padCamContro_frame">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>131</width> <width>0</width>
<height>91</height> <height>0</height>
</size> </size>
</property> </property>
<property name="mouseTracking"> <property name="mouseTracking">
<bool>true</bool> <bool>false</bool>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">background-color: rgb(255, 170, 0);</string> <string notr="true">background-color: rgba(255, 170, 0,0%);
</string>
</property> </property>
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::WinPanel</enum> <enum>QFrame::WinPanel</enum>
......
...@@ -480,6 +480,7 @@ void WaypointList::changeEvent(QEvent *e) ...@@ -480,6 +480,7 @@ void WaypointList::changeEvent(QEvent *e)
void WaypointList::on_clearWPListButton_clicked() void WaypointList::on_clearWPListButton_clicked()
{ {
if (uas) if (uas)
{ {
if(isGlobalWP) if(isGlobalWP)
...@@ -520,6 +521,13 @@ void WaypointList::on_clearWPListButton_clicked() ...@@ -520,6 +521,13 @@ void WaypointList::on_clearWPListButton_clicked()
} }
} }
else
{
if(isGlobalWP)
{
emit clearPathclicked();
}
}
} }
/** @brief Add a waypoint by mouse click over the map */ /** @brief Add a waypoint by mouse click over the map */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment