Skip to content

Commit

Permalink
Fixed bogus gitignore file
Browse files Browse the repository at this point in the history
  • Loading branch information
lm committed Jul 10, 2011
1 parent eab5a16 commit 1b6606b
Show file tree
Hide file tree
Showing 24 changed files with 1,265 additions and 97 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Info.plist
obj
*.log
*~
*qtc*
bin/*.exe
bin/*.txt
bin/mac
Expand Down
5 changes: 3 additions & 2 deletions src/Waypoint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ Waypoint::Waypoint(quint16 _id, double _x, double _y, double _z, double _param1,
param1(_param1),
param2(_param2),
name(QString("WP%1").arg(id, 2, 10, QChar('0'))),
description(_description)
description(_description),
reachedTime(0)
{
}

Expand Down Expand Up @@ -79,7 +80,7 @@ void Waypoint::save(QTextStream &saveStream)
bool Waypoint::load(QTextStream &loadStream)
{
const QStringList &wpParams = loadStream.readLine().split("\t");
if (wpParams.size() == 13) {
if (wpParams.size() == 12) {
this->id = wpParams[0].toInt();
this->current = (wpParams[1].toInt() == 1 ? true : false);
this->frame = (MAV_FRAME) wpParams[2].toInt();
Expand Down
8 changes: 8 additions & 0 deletions src/Waypoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ This file is part of the PIXHAWK project
#include <QString>
#include <QTextStream>
#include "QGCMAVLink.h"
#include "QGC.h"

class Waypoint : public QObject
{
Expand Down Expand Up @@ -145,6 +146,7 @@ class Waypoint : public QObject
int turns;
QString name;
QString description;
quint64 reachedTime;

public slots:
void setId(quint16 id);
Expand Down Expand Up @@ -177,6 +179,12 @@ public slots:
void setHoldTime(double holdTime);
/** @brief Number of turns for loiter waypoints */
void setTurns(int turns);
/** @brief Set waypoint as reached */
void setReached() { reachedTime = QGC::groundTimeMilliseconds(); }
/** @brief Wether this waypoint has been reached yet */
bool isReached() { return (reachedTime > 0); }
/** @brief Get the time this waypoint was reached */
quint64 getReachedTime() { return reachedTime; }

signals:
/** @brief Announces a change to the waypoint data */
Expand Down
2 changes: 1 addition & 1 deletion src/libs/opmapcontrol/src/core/opmaps.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ namespace core {
// PureImageCache ImageCacheLocal;//TODO Criar acesso Get Set
TileCacheQueue TileDBcacheQueue;
OPMaps();
OPMaps(OPMaps const&){}
//OPMaps(OPMaps const&){}
OPMaps& operator=(OPMaps const&){ return *this; }
static OPMaps* m_pInstance;
diagnostics diag;
Expand Down
17 changes: 15 additions & 2 deletions src/libs/opmapcontrol/src/internals/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,21 @@ qlonglong internals::Core::debugcounter=0;
using namespace projections;

namespace internals {
Core::Core():MouseWheelZooming(false),currentPosition(0,0),currentPositionPixel(0,0),LastLocationInBounds(-1,-1),sizeOfMapArea(0,0)
,minOfTiles(0,0),maxOfTiles(0,0),zoom(0),isDragging(false),TooltipTextPadding(10,10),loaderLimit(5),maxzoom(21),started(false),runningThreads(0)
Core::Core() :
MouseWheelZooming(false),
currentPosition(0,0),
currentPositionPixel(0,0),
LastLocationInBounds(-1,-1),
sizeOfMapArea(0,0),
minOfTiles(0,0),
maxOfTiles(0,0),
zoom(0),
isDragging(false),
TooltipTextPadding(10,10),
loaderLimit(5),
maxzoom(21),
runningThreads(0),
started(false)
{
mousewheelzoomtype=MouseWheelZoomType::MousePositionAndCenter;
SetProjection(new MercatorProjection());
Expand Down
3 changes: 2 additions & 1 deletion src/libs/opmapcontrol/src/mapwidget/mapgraphicitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,15 @@ namespace mapcontrol
internals::PointLatLng selectionStart;
internals::PointLatLng selectionEnd;
double zoomReal;
qreal rotation;
double zoomDigi;
QRectF maprect;
bool isSelected;
bool isMouseOverMarker;
QPixmap dragons;
void SetIsMouseOverMarker(bool const& value){isMouseOverMarker = value;}

qreal rotation;

/**
* @brief Creates a rectangle that represents the "view" of the cuurent map, to compensate
* rotation
Expand Down
3 changes: 2 additions & 1 deletion src/libs/opmapcontrol/src/mapwidget/opmapwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,9 @@ namespace mapcontrol
bool showuav;
bool showhome;
QTimer * diagTimer;
QGraphicsTextItem * diagGraphItem;
bool showDiag;
QGraphicsTextItem * diagGraphItem;

private slots:
void diagRefresh();
// WayPointItem* item;//apagar
Expand Down
54 changes: 41 additions & 13 deletions src/libs/opmapcontrol/src/mapwidget/waypointitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "waypointitem.h"
namespace mapcontrol
{
WayPointItem::WayPointItem(const internals::PointLatLng &coord,double const& altitude, MapGraphicItem *map):coord(coord),reached(false),description(""),shownumber(true),isDragging(false),altitude(altitude),heading(0),map(map)
WayPointItem::WayPointItem(const internals::PointLatLng &coord,double const& altitude, MapGraphicItem *map):coord(coord),reached(false),description(""),shownumber(true),isDragging(false),altitude(altitude),heading(0),map(map),autoreachedEnabled(true)
{
text=0;
numberI=0;
Expand Down Expand Up @@ -169,28 +169,53 @@ namespace mapcontrol
}
void WayPointItem::SetReached(const bool &value)
{
reached=value;
emit WPValuesChanged(this);
if(value)
picture.load(QString::fromUtf8(":/markers/images/bigMarkerGreen.png"));
else
picture.load(QString::fromUtf8(":/markers/images/marker.png"));
this->update();

if (autoreachedEnabled)
{
reached=value;
emit WPValuesChanged(this);
if(value)
picture.load(QString::fromUtf8(":/markers/images/bigMarkerGreen.png"));
else
picture.load(QString::fromUtf8(":/markers/images/marker.png"));
this->update();
}
}
void WayPointItem::SetShowNumber(const bool &value)
{
// shownumber=value;
// if((numberI==0) && value)
// {
// numberI=new QGraphicsSimpleTextItem(this);
// numberIBG=new QGraphicsRectItem(this);
// numberIBG->setBrush(Qt::white);
// numberIBG->setOpacity(0.5);
// numberI->setZValue(3);
// numberI->setPen(QPen(Qt::blue));
// numberI->setPos(0,-13-picture.height());
// numberIBG->setPos(0,-13-picture.height());
// numberI->setText(QString::number(number));
// numberIBG->setRect(numberI->boundingRect().adjusted(-2,0,1,0));
// }
// else if (!value && numberI)
// {
// delete numberI;
// delete numberIBG;
// }
// this->update();



shownumber=value;
if((numberI==0) && value)
{
numberI=new QGraphicsSimpleTextItem(this);
numberIBG=new QGraphicsRectItem(this);
numberIBG->setBrush(Qt::white);
numberIBG->setBrush(Qt::black);
numberIBG->setOpacity(0.5);
numberI->setZValue(3);
numberI->setPen(QPen(Qt::blue));
numberI->setPos(0,-13-picture.height());
numberIBG->setPos(0,-13-picture.height());
numberI->setPen(QPen(Qt::white));
numberI->setPos(18,-picture.height()/2-2);
numberIBG->setPos(18,-picture.height()/2-2);
numberI->setText(QString::number(number));
numberIBG->setRect(numberI->boundingRect().adjusted(-2,0,1,0));
}
Expand All @@ -200,6 +225,9 @@ namespace mapcontrol
delete numberIBG;
}
this->update();



}
void WayPointItem::WPDeleted(const int &onumber)
{
Expand Down
17 changes: 7 additions & 10 deletions src/libs/opmapcontrol/src/mapwidget/waypointitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class WayPointItem:public QObject,public QGraphicsItem
*
* @param value
*/
void SetShowNumber(bool const& value);
virtual void SetShowNumber(bool const& value);
/**
* @brief Returns the WayPoint altitude in meters
*
Expand Down Expand Up @@ -162,8 +162,12 @@ class WayPointItem:public QObject,public QGraphicsItem
void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event );

MapGraphicItem* map;

private:
bool autoreachedEnabled; ///< If the waypoint should change appearance once it has been reached
QGraphicsSimpleTextItem* text;
QGraphicsRectItem* textBG;
QGraphicsSimpleTextItem* numberI;
QGraphicsRectItem* numberIBG;
QTransform transf;
internals::PointLatLng coord;//coordinates of this WayPoint
bool reached;
QString description;
Expand All @@ -173,13 +177,6 @@ class WayPointItem:public QObject,public QGraphicsItem
float heading;
int number;


QGraphicsSimpleTextItem* text;
QGraphicsRectItem* textBG;
QGraphicsSimpleTextItem* numberI;
QGraphicsRectItem* numberIBG;
QTransform transf;

public slots:
/**
* @brief Called when a WayPoint is deleted
Expand Down
10 changes: 9 additions & 1 deletion src/libs/opmapcontrol/src/mapwidget/waypointlineitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
namespace mapcontrol
{
WaypointLineItem::WaypointLineItem(WayPointItem* wp1, WayPointItem* wp2, QColor color, mapcontrol::MapGraphicItem* map) :
QGraphicsLineItem(map),
wp1(wp1),
wp2(wp2),
map(map)
{
// Make sure this stick to the map
this->setFlag(QGraphicsItem::ItemIgnoresTransformations,true);
//this->setFlag(QGraphicsItem::Item,true);
setParentItem(map);

// Set up the pen for this icon with the UAV color
Expand All @@ -30,6 +31,8 @@ WaypointLineItem::WaypointLineItem(WayPointItem* wp1, WayPointItem* wp2, QColor
// Delete line if one of the waypoints get deleted
connect(wp1, SIGNAL(destroyed()), this, SLOT(deleteLater()));
connect(wp2, SIGNAL(destroyed()), this, SLOT(deleteLater()));

// Map Zoom and move
}

void WaypointLineItem::updateWPValues(WayPointItem* waypoint)
Expand All @@ -50,4 +53,9 @@ void WaypointLineItem::updateWPValues(WayPointItem* waypoint)
}
}

int WaypointLineItem::type()const
{
return Type;
}

}
2 changes: 2 additions & 0 deletions src/libs/opmapcontrol/src/mapwidget/waypointlineitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ class WaypointLineItem : public QObject,public QGraphicsLineItem
Q_OBJECT
Q_INTERFACES(QGraphicsItem)
public:
enum { Type = UserType + 7 };
WaypointLineItem(WayPointItem* wp1, WayPointItem* wp2, QColor color=QColor(Qt::red), MapGraphicItem* parent=0);
int type() const;

public slots:
/**
Expand Down
31 changes: 31 additions & 0 deletions src/libs/qtconcurrent/QtConcurrentTools
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation ([email protected])
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/

#include "qtconcurrent/multitask.h"
#include "qtconcurrent/runextensions.h"
Loading

0 comments on commit 1b6606b

Please sign in to comment.