1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

OP-37 GCS/MapPlugin cleaning and bug hunting

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@706 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
zedamota 2010-06-02 20:27:13 +00:00 committed by zedamota
parent 570bbb4353
commit df4ae77798
7 changed files with 29 additions and 14 deletions

View File

@ -1,15 +1,15 @@
DESTDIR = ../build
DESTDIR = ../build
QT += network
QT += sql
INCLUDEPATH += . ..
INCLUDEPATH += . \
..
WARNINGS += -Wall
#CONFIG += console
#CONFIG -= app_bundle
# CONFIG += console
# CONFIG -= app_bundle
CONFIG += dll
TEMPLATE = lib
UI_DIR = uics
MOC_DIR = mocs
OBJECTS_DIR = objs
HEADERS +=

View File

@ -32,7 +32,14 @@ int main(int argc, char *argv[])
PureImageCache* p=new PureImageCache();
QPixmap pixmap;
//Tile Polling test
QTime t;
t.start();
OPMaps::Instance()->setUseMemoryCache(false);
OPMaps::Instance()->setAccessMode(AccessMode::ServerOnly);
pixmap=PureImageProxy::FromStream(OPMaps::Instance()->GetImageFrom(MapType::GoogleSatellite,Point(1,0),1));
OPMaps::Instance()->GetImageFrom(MapType::GoogleSatellite,Point(0,1),1);
OPMaps::Instance()->GetImageFrom(MapType::GoogleSatellite,Point(1,1),1);
qDebug()<<"elapsed="<<t.elapsed();
QLabel label;
label.setPixmap(pixmap);
label.show();

View File

@ -1,5 +1,6 @@
#include "opmapcontrol.h"
namespace mapcontrol
{
OPMapControl::OPMapControl(QWidget *parent):QWidget(parent),MapRenderTransform(1), maxZoom(17),minZoom(2),zoomReal(0),isSelected(false)
{
EmptytileBrush = Qt::cyan;
@ -13,8 +14,9 @@ OPMapControl::OPMapControl(QWidget *parent):QWidget(parent),MapRenderTransform(1
DragButton = Qt::RightButton;
isMouseOverMarker=false;
core.SetCurrentRegion(Rectangle(-50, -50, this->width()+100, this->height()+100));
core.SetMapType(MapType::GoogleSatellite);
core.SetMapType(MapType::OpenStreetMap);
core.SetZoom(3);
connect(&core,SIGNAL(OnNeedInvalidation()),this,SLOT(Core_OnNeedInvalidation()));
@ -56,7 +58,7 @@ void OPMapControl::paintEvent(QPaintEvent* evnt)
void OPMapControl::DrawMap2D(QPainter &painter)
{
qDebug()<<core.Matrix.count();
// qDebug()<<core.Matrix.count();
// painter.drawText(10,10,"TESTE");
for(int i = -core.GetsizeOfMapArea().Width(); i <= core.GetsizeOfMapArea().Width(); i++)
{
@ -360,3 +362,4 @@ void OPMapControl::closeEvent(QCloseEvent *event)
core.OnMapClose();
event->accept();
}
}

View File

@ -8,9 +8,14 @@
#include <QBrush>
#include <QFont>
namespace mapcontrol
{
using namespace core;
//using namespace internals;
class internals::Core;
class OPMapControl:public QWidget
{
Q_OBJECT
@ -83,5 +88,5 @@ private:
private slots:
void Core_OnNeedInvalidation();
};
}
#endif // OPMAPCONTROL_H

View File

@ -12,7 +12,7 @@ int main(int argc, char *argv[])
// mw->setWindowTitle("Map");
// mw->adjustSize();
// mw->show();1022 680
OPMapControl map;
mapcontrol::OPMapControl map;
map.setGeometry(20,20,1022,680);
map.show();
return app.exec();

View File

@ -1,7 +1,7 @@
#include "map.h"
map::map(QWidget* parent)
{
mc= new OPMapControl();
mc= new mapcontrol::OPMapControl();
QVBoxLayout* layout = new QVBoxLayout;
layout->addWidget(mc);

View File

@ -7,7 +7,7 @@ class map:public QMainWindow
public:
map(QWidget* parent = 0);
private:
OPMapControl* mc;
mapcontrol::OPMapControl* mc;
};
#endif // MAP_H