diff --git a/qgroundcontrol-plugins.pro b/qgroundcontrol-plugins.pro new file mode 100644 index 0000000000000000000000000000000000000000..5f00ac29488907920180b16eff1210166faa360b --- /dev/null +++ b/qgroundcontrol-plugins.pro @@ -0,0 +1,45 @@ +# ------------------------------------------------- +# QGroundControl - Micro Air Vehicle Groundstation +# Please see our website at +# Author: +# Lorenz Meier +# (c) 2009-2010 PIXHAWK Team +# This file is part of the mav groundstation project +# QGroundControl is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# QGroundControl is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# You should have received a copy of the GNU General Public License +# along with QGroundControl. If not, see . +# ------------------------------------------------- +# Include QMapControl map library +# prefer version from external directory / +# from http://github.com/pixhawk/qmapcontrol/ +# over bundled version in lib directory +# Version from GIT repository is preferred +# include ( "../qmapcontrol/QMapControl/QMapControl.pri" ) #{ +# Include bundled version if necessary + + CONFIG += designer plugin + TARGET = $$qtLibraryTarget($$TARGET) + TEMPLATE = lib + QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/designer + + FORMS = src/ui/designer/QGCParamSlider.ui + + HEADERS = src/ui/designer/QGCParamSlider.h \ + src/ui/designer/QGCParamSliderPlugin.h + SOURCES = src/ui/designer/QGCParamSlider.cc \ + src/ui/designer/QGCParamSliderPlugin.cc + + # install + target.path = $$[QT_INSTALL_PLUGINS]/designer + sources.files = $$SOURCES $$HEADERS *.pro + sources.path = $$[QT_INSTALL_EXAMPLES]/designer/worldtimeclockplugin + INSTALLS += target + + symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/src/comm/MAVLinkSimulationLink.cc b/src/comm/MAVLinkSimulationLink.cc index ed67251bfed6263c07566ba55c8a4511ad77bac7..50bf6c1fc90613155df8e8d8cf3b10ff86c1c545 100644 --- a/src/comm/MAVLinkSimulationLink.cc +++ b/src/comm/MAVLinkSimulationLink.cc @@ -375,9 +375,9 @@ void MAVLinkSimulationLink::mainloop() // Move X Position - x = 8.0*sin((double)circleCounter/50.0); - y = 3.0*cos((double)circleCounter/40.0); - z = 1.8 + 1.2*sin((double)circleCounter/60.0); + x = 12.0*sin(((double)circleCounter)/100.0); + y = 5.0*cos(((double)circleCounter)/100.0); + z = 1.8 + 1.2*sin(((double)circleCounter)/60.0); circleCounter++; @@ -413,7 +413,7 @@ void MAVLinkSimulationLink::mainloop() // streampointer += bufferlength; // GLOBAL POSITION - mavlink_msg_global_position_pack(systemId, componentId, &ret, 0, 47.378028137103+(x*0.001), 8.54899892510421+(y*0.001), z+25.0, 0, 0, 0); + mavlink_msg_global_position_pack(systemId, componentId, &ret, 0, 47.378028137103+(x*0.002), 8.54899892510421+(y*0.002), z+35.0, 0, 0, 0); bufferlength = mavlink_msg_to_send_buffer(buffer, &ret); //add data into datastream memcpy(stream+streampointer,buffer, bufferlength); diff --git a/src/ui/designer/QGCParamSlider.cc b/src/ui/designer/QGCParamSlider.cc new file mode 100644 index 0000000000000000000000000000000000000000..bfaf3e3258757d933c0af29b5760727285802af4 --- /dev/null +++ b/src/ui/designer/QGCParamSlider.cc @@ -0,0 +1,26 @@ +#include "QGCParamSlider.h" +#include "ui_QGCParamSlider.h" + +QGCParamSlider::QGCParamSlider(QWidget *parent) : + QWidget(parent), + ui(new Ui::QGCParamSlider) +{ + ui->setupUi(this); +} + +QGCParamSlider::~QGCParamSlider() +{ + delete ui; +} + +void QGCParamSlider::changeEvent(QEvent *e) +{ + QWidget::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + ui->retranslateUi(this); + break; + default: + break; + } +} diff --git a/src/ui/designer/QGCParamSlider.h b/src/ui/designer/QGCParamSlider.h new file mode 100644 index 0000000000000000000000000000000000000000..56f063b96c4fefa4246bce115e8fcbe5060431b6 --- /dev/null +++ b/src/ui/designer/QGCParamSlider.h @@ -0,0 +1,26 @@ +#ifndef QGCPARAMSLIDER_H +#define QGCPARAMSLIDER_H + +#include +#include + +namespace Ui { + class QGCParamSlider; +} + +class QDESIGNER_WIDGET_EXPORT QGCParamSlider : public QWidget +{ + Q_OBJECT + +public: + explicit QGCParamSlider(QWidget *parent = 0); + ~QGCParamSlider(); + +protected: + void changeEvent(QEvent *e); + +private: + Ui::QGCParamSlider *ui; +}; + +#endif // QGCPARAMSLIDER_H diff --git a/src/ui/designer/QGCParamSlider.ui b/src/ui/designer/QGCParamSlider.ui new file mode 100644 index 0000000000000000000000000000000000000000..9534679e76f860edb7b862631eee2d9121af53dd --- /dev/null +++ b/src/ui/designer/QGCParamSlider.ui @@ -0,0 +1,48 @@ + + + QGCParamSlider + + + + 0 + 0 + 400 + 22 + + + + Form + + + + 8 + + + 0 + + + + + Name + + + + + + + 0.00 + + + + + + + Qt::Horizontal + + + + + + + + diff --git a/src/ui/designer/QGCParamSliderPlugin.cc b/src/ui/designer/QGCParamSliderPlugin.cc new file mode 100644 index 0000000000000000000000000000000000000000..daa7646883da1df1b9d5636a17450ab9b451f05d --- /dev/null +++ b/src/ui/designer/QGCParamSliderPlugin.cc @@ -0,0 +1,81 @@ +#include "QGCParamSliderPlugin.h" +#include "QGCParamSlider.h" + +#include + +QGCParamSliderPlugin::QGCParamSliderPlugin(QObject *parent) : + QObject(parent) +{ + initialized = false; +} + +void QGCParamSliderPlugin::initialize(QDesignerFormEditorInterface * /* core */) +{ + if (initialized) + return; + + initialized = true; +} + +bool QGCParamSliderPlugin::isInitialized() const +{ + return initialized; +} + +QWidget *QGCParamSliderPlugin::createWidget(QWidget *parent) +{ + return new QGCParamSlider(parent); +} + +QString QGCParamSliderPlugin::name() const +{ + return "QGCParamSlider"; +} + +QString QGCParamSliderPlugin::group() const +{ + return "QGroundControl"; +} + +QIcon QGCParamSliderPlugin::icon() const +{ + return QIcon(); +} + +QString QGCParamSliderPlugin::toolTip() const +{ + return ""; +} + +QString QGCParamSliderPlugin::whatsThis() const +{ + return ""; +} + +bool QGCParamSliderPlugin::isContainer() const +{ + return false; +} + +QString QGCParamSliderPlugin::domXml() const +{ + return "\n" + " \n" + " \n" + " \n" + " 0\n" + " 0\n" + " 150\n" + " 16\n" + " \n" + " \n" + " \n" + ""; +} + +QString QGCParamSliderPlugin::includeFile() const +{ + return "QGCParamSlider.h"; +} + +Q_EXPORT_PLUGIN2(qgcparamsliderplugin, QGCParamSliderPlugin) diff --git a/src/ui/designer/QGCParamSliderPlugin.h b/src/ui/designer/QGCParamSliderPlugin.h new file mode 100644 index 0000000000000000000000000000000000000000..3b0a316f9e9029db39a18a51bb91e937f026151a --- /dev/null +++ b/src/ui/designer/QGCParamSliderPlugin.h @@ -0,0 +1,31 @@ +#ifndef QGCPARAMSLIDERPLUGIN_H +#define QGCPARAMSLIDERPLUGIN_H + +#include + +class QGCParamSliderPlugin : public QObject, + public QDesignerCustomWidgetInterface +{ + Q_OBJECT + Q_INTERFACES(QDesignerCustomWidgetInterface) + +public: + explicit QGCParamSliderPlugin(QObject *parent = 0); + + bool isContainer() const; + bool isInitialized() const; + QIcon icon() const; + QString domXml() const; + QString group() const; + QString includeFile() const; + QString name() const; + QString toolTip() const; + QString whatsThis() const; + QWidget *createWidget(QWidget *parent); + void initialize(QDesignerFormEditorInterface *core); + +private: + bool initialized; +}; + +#endif // QGCPARAMSLIDERPLUGIN_H diff --git a/src/ui/map/MAV2DIcon.cc b/src/ui/map/MAV2DIcon.cc index a87962c052174e0c91b751a8b5f48ddd53a37b43..e8d52e7758c222049e4a5beb18241e323ffe00b3 100644 --- a/src/ui/map/MAV2DIcon.cc +++ b/src/ui/map/MAV2DIcon.cc @@ -47,7 +47,7 @@ void MAV2DIcon::drawIcon(QPen* pen) if (pen) { mypixmap = new QPixmap(radius+1, radius+1); - mypixmap->fill(Qt::transparent); + //mypixmap->fill(Qt::transparent); QPainter painter(mypixmap); // DRAW MICRO AIR VEHICLE