diff --git a/pps_ws/src/d_fall_pps/CMakeLists.txt b/pps_ws/src/d_fall_pps/CMakeLists.txt index 58a69ae5b4a79f25e292b220b181b1a8db41a280..e57ee18314ab6ad5716826ea22469a7c0a2d5d22 100755 --- a/pps_ws/src/d_fall_pps/CMakeLists.txt +++ b/pps_ws/src/d_fall_pps/CMakeLists.txt @@ -260,6 +260,7 @@ set(MY_CPP_SOURCES_GUI # compilation of sources ${MY_GUI_LIB_PATH_SRC}/crazyFly.cpp ${MY_GUI_LIB_PATH_SRC}/CFLinker.cpp ${MY_GUI_LIB_PATH_SRC}/channelLUT.cpp + ${MY_GUI_LIB_PATH_SRC}/centerMarker.cpp ) # StudentGUI -- Add sources here diff --git a/pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/CrazyFlyGUI.qrc b/pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/CrazyFlyGUI.qrc index ff5d1cbb34addf9d8b8a6ca7b182c75f2c83c8f5..55f60357b429ec3b90fa147d791f7d1c4b507372 100644 --- a/pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/CrazyFlyGUI.qrc +++ b/pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/CrazyFlyGUI.qrc @@ -12,5 +12,6 @@ <file>images/drone_fixed_07.svg</file> <file>images/drone_fixed_08.svg</file> <file>images/drone_fixed_09.svg</file> + <file>images/center_rect.svg</file> </qresource> </RCC> diff --git a/pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/images/center_rect.svg b/pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/images/center_rect.svg index 53d15a1335d8953d39f1439c4354054b63de8f68..0c9eb7a8c8c0918b453f389c857913eb90c9df43 100644 --- a/pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/images/center_rect.svg +++ b/pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/images/center_rect.svg @@ -9,9 +9,9 @@ xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="210mm" - height="297mm" - viewBox="0 0 744.09448819 1052.3622047" + width="151.66655mm" + height="151.66655mm" + viewBox="0 0 537.40116 537.40116" id="svg2" version="1.1" inkscape:version="0.91 r13725" @@ -26,8 +26,8 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="0.98994949" - inkscape:cx="299.90787" - inkscape:cy="691.68435" + inkscape:cx="149.39514" + inkscape:cy="309.84671" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="false" @@ -35,7 +35,11 @@ inkscape:window-height="1056" inkscape:window-x="65" inkscape:window-y="24" - inkscape:window-maximized="1" /> + inkscape:window-maximized="1" + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="0" + fit-margin-bottom="0" /> <metadata id="metadata7"> <rdf:RDF> @@ -51,12 +55,13 @@ <g inkscape:label="Layer 1" inkscape:groupmode="layer" - id="layer1"> + id="layer1" + transform="translate(0,-133.12338)"> <circle style="fill:#000000;fill-opacity:1" id="path4136" - cx="346.48233" - cy="324.04221" - r="47.477169" /> + cx="268.70059" + cy="401.82397" + r="268.70059" /> </g> </svg> diff --git a/pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/include/centerMarker.h b/pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/include/centerMarker.h new file mode 100644 index 0000000000000000000000000000000000000000..32f513f718b442d5c7287909aeddf17cc1004a4f --- /dev/null +++ b/pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/include/centerMarker.h @@ -0,0 +1,27 @@ +#ifndef CENTER_MARKER_H +#define CENTER_MARKER_H + +#include "globalDefinitions.h" + +#include <QGraphicsSvgItem> +#include <QSvgRenderer> + +#define DIAMETER 100 * FROM_MILIMETERS_TO_UNITS + +class centerMarker : public QGraphicsSvgItem +{ +public: + explicit centerMarker(QString filename, QGraphicsItem * parent = 0); + ~centerMarker(); + QRectF boundingRect() const; + + void paint(QPainter * painter, + const QStyleOptionGraphicsItem * option, + QWidget * widget); + +private: + qreal m_diameter; +}; + + +#endif diff --git a/pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/include/crazyFly.h b/pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/include/crazyFly.h index 6671a1f390a4670e41299c8f3aa70cefe79021be..d1ac3d4f3a922e492677d9f95d668208b9f06991 100644 --- a/pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/include/crazyFly.h +++ b/pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/include/crazyFly.h @@ -68,5 +68,4 @@ private: int m_assigned_cf_zone_index; }; - #endif diff --git a/pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/include/crazyFlyZone.h b/pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/include/crazyFlyZone.h index 0d5c433f12bf429d1a371f624735e80197ff448a..0ae5dbc9d154f3f50f65eb9ff223ed4687d1b69c 100755 --- a/pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/include/crazyFlyZone.h +++ b/pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/include/crazyFlyZone.h @@ -3,8 +3,8 @@ #include <QGraphicsSimpleTextItem> - #include "myGraphicsRectItem.h" +#include "centerMarker.h" class crazyFlyZone : public myGraphicsRectItem { @@ -31,7 +31,7 @@ protected: private: int _index; QGraphicsSimpleTextItem* label; - QGraphicsEllipseItem* m_center_marker; + centerMarker* m_center_marker; // stuff for linking bool m_linked; diff --git a/pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/src/centerMarker.cpp b/pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/src/centerMarker.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4f412d2a0eedbe419e3cdef6f07341e05c593e03 --- /dev/null +++ b/pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/src/centerMarker.cpp @@ -0,0 +1,25 @@ +#include "centerMarker.h" + +#include <QPen> +#include <QBrush> + + +centerMarker::centerMarker(QString filename, QGraphicsItem * parent) + : QGraphicsSvgItem(filename, parent) +{ + m_diameter = DIAMETER; +} + +centerMarker::~centerMarker() +{ +} + +QRectF centerMarker::boundingRect() const +{ + return QRectF(-m_diameter/2, -m_diameter/2, m_diameter, m_diameter); +} + +void centerMarker::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +{ + this->renderer()->render(painter,this->boundingRect()); +} diff --git a/pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/src/crazyFlyZone.cpp b/pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/src/crazyFlyZone.cpp index 49d0e43b26dea2c7ab8b7e7d7bc3ea91d6326395..3b68c898e0944598b198226a4a2b63c2ce805fb0 100755 --- a/pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/src/crazyFlyZone.cpp +++ b/pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/src/crazyFlyZone.cpp @@ -23,7 +23,8 @@ void crazyFlyZone::updateLabel(QString string) void crazyFlyZone::createCenterMarker() { qreal diameter = 0.1 * FROM_METERS_TO_UNITS; - m_center_marker = new QGraphicsEllipseItem(QRectF(-diameter/2, -diameter/2, diameter, diameter), this); + // m_center_marker = new QGraphicsEllipseItem(QRectF(-diameter/2, -diameter/2, diameter, diameter), this); + m_center_marker = new centerMarker(":/images/center_rect.svg", this); updateCenterMarker(); m_center_marker->setZValue(10); //max z value, always on top of things } diff --git a/pps_ws/src/d_fall_pps/param/Crazyflie.db b/pps_ws/src/d_fall_pps/param/Crazyflie.db index 92f7e458c1817d5ad3e76e4c1c9ff79c46ce93de..5fdd872abde30c83b53e0883f970c849ae82e02e 100644 --- a/pps_ws/src/d_fall_pps/param/Crazyflie.db +++ b/pps_ws/src/d_fall_pps/param/Crazyflie.db @@ -1 +1 @@ -5,cfTwo,0/69/2M,0,-0.251699,-1.96387,-0.2,0.0792386,-1.54593,2 +5,PPS_CF04,0/24/2M,0,-0.885221,-0.268794,-0.2,0.379322,0.827822,2