diff --git a/src/ui/SlugsPIDControl.cpp b/src/ui/SlugsPIDControl.cpp index 18fd516304cd92f4aff41c4726dc55ffecc8051f..08630c4e5d1f4fe7c5c40a18fc9276b4dceee917 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 40b40c072ec83feb6c385387f04c696cccac969e..071585d39a46d23662cf615f104ec7005e5f5656 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 06a923328c5c12042a81d197072254fec56df9c4..ca7c04a681d51ba5f0dacf89edc9056ffe8547f6 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 2138b4634f7671f4e5f4d9c7435ced73096370bb..a87888f7c6f64ecc746842d2172ba5f206bff555 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(); - } +// } } }