From 6bd785b5103a41d947c38fc86f6a5b32377b6c88 Mon Sep 17 00:00:00 2001 From: tecnosapiens Date: Tue, 7 Dec 2010 17:24:17 -0600 Subject: [PATCH] connect signal for get all values pid from UAS --- src/ui/SlugsPIDControl.cpp | 1 + src/ui/SlugsPadCameraControl.cpp | 30 +++++++++++++++++++++++------- src/ui/SlugsPadCameraControl.h | 1 + src/ui/WaypointList.cc | 6 +++--- 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/ui/SlugsPIDControl.cpp b/src/ui/SlugsPIDControl.cpp index 18fd51630..08630c4e5 100644 --- a/src/ui/SlugsPIDControl.cpp +++ b/src/ui/SlugsPIDControl.cpp @@ -55,6 +55,7 @@ void SlugsPIDControl::activeUasSet(UASInterface* uas) connect(slugsMav,SIGNAL(slugsPidValues(int,mavlink_pid_t)),this, SLOT(receivePidValues(int,mavlink_pid_t)) ); connect(ui->setGeneral_pushButton,SIGNAL(clicked()),this,SLOT(slugsTimerStartSet())); + connect(ui->getGeneral_pushButton,SIGNAL(clicked()),this,SLOT(slugsTimerStartGet())); } #endif // MAVLINK_ENABLED_SLUG diff --git a/src/ui/SlugsPadCameraControl.cpp b/src/ui/SlugsPadCameraControl.cpp index 40b40c072..071585d39 100644 --- a/src/ui/SlugsPadCameraControl.cpp +++ b/src/ui/SlugsPadCameraControl.cpp @@ -23,13 +23,25 @@ SlugsPadCameraControl::~SlugsPadCameraControl() void SlugsPadCameraControl::mouseMoveEvent(QMouseEvent *event) { - emit mouseMoveCoord(event->x(),event->y()); + //emit mouseMoveCoord(event->x(),event->y()); + if(dragging) + { + if(abs(x1-event->x())>20 || abs(y1-event->y())>20) + { + + getDeltaPositionPad(event->x(), event->y()); + x1 = event->x(); + y1 = event->y(); + } + } + } void SlugsPadCameraControl::mousePressEvent(QMouseEvent *event) { - emit mousePressCoord(event->x(),event->y()); + //emit mousePressCoord(event->x(),event->y()); + dragging = true; x1 = event->x(); y1 = event->y(); @@ -37,8 +49,10 @@ void SlugsPadCameraControl::mousePressEvent(QMouseEvent *event) void SlugsPadCameraControl::mouseReleaseEvent(QMouseEvent *event) { - emit mouseReleaseCoord(event->x(),event->y()); - getDeltaPositionPad(event->x(), event->y()); + dragging = false; + //emit mouseReleaseCoord(event->x(),event->y()); + //getDeltaPositionPad(event->x(), event->y()); + } @@ -92,7 +106,7 @@ void SlugsPadCameraControl::getDeltaPositionPad(int x2, int y2) { emit dirCursorText("right up"); //bearing = 315; - dir = "riht up"; + dir = "right up"; } else { @@ -100,7 +114,7 @@ void SlugsPadCameraControl::getDeltaPositionPad(int x2, int y2) { emit dirCursorText("right"); //bearing = 315; - dir = "riht"; + dir = "right"; } else { @@ -108,7 +122,7 @@ void SlugsPadCameraControl::getDeltaPositionPad(int x2, int y2) { emit dirCursorText("right down"); //bearing = 315; - dir = "riht down"; + dir = "right down"; } else { @@ -229,3 +243,5 @@ QPointF SlugsPadCameraControl::ObtenerMarcacionDistanciaPixel(double lon1, doubl return QPointF(marcacion,distancia); } + + diff --git a/src/ui/SlugsPadCameraControl.h b/src/ui/SlugsPadCameraControl.h index 06a923328..ca7c04a68 100644 --- a/src/ui/SlugsPadCameraControl.h +++ b/src/ui/SlugsPadCameraControl.h @@ -22,6 +22,7 @@ public slots: double getDistPixel(int x1, int y1, int x2, int y2); QPointF ObtenerMarcacionDistanciaPixel(double lon1, double lat1, double lon2, double lat2); + signals: void mouseMoveCoord(int x, int y); void mousePressCoord(int x, int y); diff --git a/src/ui/WaypointList.cc b/src/ui/WaypointList.cc index 2138b4634..a87888f7c 100644 --- a/src/ui/WaypointList.cc +++ b/src/ui/WaypointList.cc @@ -346,11 +346,11 @@ void WaypointList::waypointListChanged() WaypointGlobalView *wpgv = wpGlobalViews.value(wp); wpgv->updateValues(); listLayout->addWidget(wpgv); - if(loadFileGlobalWP || readGlobalWP) - { +// if(loadFileGlobalWP || readGlobalWP) +// { emit createWaypointAtMap(QPointF(wp->getX(),wp->getY())); qDebug()<<"Emitiendo Pos: "<getX()<<" - "<getY(); - } +// } } } -- 2.22.0