1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-02 10:24:11 +01:00

OP-975 die, die my paperplane

This commit is contained in:
Alessio Morale 2014-04-09 01:15:08 +02:00
parent 45915e3387
commit d13d3da204
12 changed files with 34 additions and 332 deletions

View File

@ -2,7 +2,6 @@
<qresource prefix="/configgadget"> <qresource prefix="/configgadget">
<file>images/help2.png</file> <file>images/help2.png</file>
<file>images/ahrs-calib.svg</file> <file>images/ahrs-calib.svg</file>
<file>images/paper-plane.svg</file>
<file>images/multirotor-shapes.svg</file> <file>images/multirotor-shapes.svg</file>
<file>images/ccpm_setup.svg</file> <file>images/ccpm_setup.svg</file>
<file>images/PipXtreme.png</file> <file>images/PipXtreme.png</file>
@ -31,5 +30,11 @@
<file>images/pipx-normal.png</file> <file>images/pipx-normal.png</file>
<file>images/revolution_top.png</file> <file>images/revolution_top.png</file>
<file>calibration/WizardStepIndicator.qml</file> <file>calibration/WizardStepIndicator.qml</file>
<file>images/calibration/plane-down.png</file>
<file>images/calibration/plane-flip.png</file>
<file>images/calibration/plane-horizontal.png</file>
<file>images/calibration/plane-left.png</file>
<file>images/calibration/plane-right.png</file>
<file>images/calibration/plane-up.png</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@ -83,13 +83,7 @@ ConfigRevoWidget::ConfigRevoWidget(QWidget *parent) :
// Initialization of the Paper plane widget // Initialization of the Paper plane widget
m_ui->sixPointsHelp->setScene(new QGraphicsScene(this)); m_ui->sixPointsHelp->setScene(new QGraphicsScene(this));
displayPlane("plane-horizontal");
paperplane = new QGraphicsSvgItem();
paperplane->setSharedRenderer(new QSvgRenderer());
paperplane->renderer()->load(QString(":/configgadget/images/paper-plane.svg"));
paperplane->setElementId("plane-horizontal");
m_ui->sixPointsHelp->scene()->addItem(paperplane);
m_ui->sixPointsHelp->setSceneRect(paperplane->boundingRect());
// Must set up the UI (above) before setting up the UAVO mappings or refreshWidgetValues // Must set up the UI (above) before setting up the UAVO mappings or refreshWidgetValues
// will be dealing with some null pointers // will be dealing with some null pointers
@ -149,14 +143,14 @@ void ConfigRevoWidget::showEvent(QShowEvent *event)
// Thit fitInView method should only be called now, once the // Thit fitInView method should only be called now, once the
// widget is shown, otherwise it cannot compute its values and // widget is shown, otherwise it cannot compute its values and
// the result is usually a sensorsBargraph that is way too small. // the result is usually a sensorsBargraph that is way too small.
m_ui->sixPointsHelp->fitInView(paperplane, Qt::KeepAspectRatio); m_ui->sixPointsHelp->fitInView(m_ui->sixPointsHelp->scene()->sceneRect(), Qt::IgnoreAspectRatio);
m_thermalCalibrationModel->init(); m_thermalCalibrationModel->init();
} }
void ConfigRevoWidget::resizeEvent(QResizeEvent *event) void ConfigRevoWidget::resizeEvent(QResizeEvent *event)
{ {
Q_UNUSED(event) Q_UNUSED(event)
m_ui->sixPointsHelp->fitInView(paperplane, Qt::KeepAspectRatio); m_ui->sixPointsHelp->fitInView(m_ui->sixPointsHelp->scene()->sceneRect(), Qt::IgnoreAspectRatio);
} }
/** /**
@ -796,9 +790,11 @@ void ConfigRevoWidget::recallBoardRotation()
*/ */
void ConfigRevoWidget::displayPlane(QString elementID) void ConfigRevoWidget::displayPlane(QString elementID)
{ {
paperplane->setElementId(elementID); m_ui->sixPointsHelp->scene()->clear();
m_ui->sixPointsHelp->setSceneRect(paperplane->boundingRect()); QPixmap pixmap = QPixmap(":/configgadget/images/calibration/" + elementID + ".png");
m_ui->sixPointsHelp->fitInView(paperplane, Qt::KeepAspectRatio); m_ui->sixPointsHelp->scene()->addPixmap(pixmap);
m_ui->sixPointsHelp->setSceneRect(pixmap.rect());
//m_ui->sixPointsHelp->fitInView(pixmap, Qt::KeepAspectRatio);
} }

View File

@ -58,7 +58,6 @@ private:
OpenPilot::ThermalCalibrationModel *m_thermalCalibrationModel; OpenPilot::ThermalCalibrationModel *m_thermalCalibrationModel;
Ui_RevoSensorsWidget *m_ui; Ui_RevoSensorsWidget *m_ui;
QGraphicsSvgItem *paperplane;
QMutex sensorsUpdateLock; QMutex sensorsUpdateLock;
double maxBarHeight; double maxBarHeight;
int phaseCounter; int phaseCounter;

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

View File

@ -1,309 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
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="744.09448819"
height="1052.3622047"
id="svg2"
version="1.1"
inkscape:version="0.47 r22583"
sodipodi:docname="paper-plane.svg">
<title
id="title2859">Paper planes</title>
<defs
id="defs4">
<inkscape:path-effect
effect="envelope"
id="path-effect3160"
is_visible="true"
yy="true"
xx="true"
bendpath1="m 447.14285,362.36218 55.71429,0"
bendpath2="m 502.85714,362.36218 0,54.28572"
bendpath3="m 447.14285,416.6479 55.71429,0"
bendpath4="m 447.14285,362.36218 0,54.28572" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 526.18109 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="744.09448 : 526.18109 : 1"
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
id="perspective10" />
<inkscape:perspective
id="perspective3143"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 618.71844 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1486.9843 : 618.71844 : 1"
inkscape:persp3d-origin="743.49213 : 412.47896 : 1"
id="perspective2567" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.60408995"
inkscape:cx="160.9057"
inkscape:cy="659.88675"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
showguides="true"
inkscape:guide-bbox="true"
inkscape:window-width="1366"
inkscape:window-height="693"
inkscape:window-x="0"
inkscape:window-y="24"
inkscape:window-maximized="1" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>Paper planes</dc:title>
<dc:creator>
<cc:Agent>
<dc:title>Edouard Lafargue</dc:title>
</cc:Agent>
</dc:creator>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/3.0/" />
<dc:date>2010.08.29</dc:date>
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/3.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
</cc:License>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<g
id="plane-flip"
inkscape:label="#g4365">
<g
transform="translate(305.77675,-285.13719)"
id="g3972">
<path
sodipodi:nodetypes="ccccccc"
id="path3974"
d="m 185.71429,456.6479 110,0 10,-30 8.57143,30 111.42857,0 L 382.85714,338.07647 185.71429,456.6479 z"
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
id="path3978"
d="m 314.66252,456.62472 68.1853,-118.18785"
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
transform="translate(70,-226)"
id="path3982"
d="m 235.87062,652.34177 76.77159,-88.13581"
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g>
</g>
<g
id="plane-horizontal"
inkscape:label="#g4349">
<g
inkscape:label="#g3946"
transform="translate(-158.56854,-296.98485)"
id="bla">
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 185.71429,456.6479 110,0 10,27.85714 8.57143,-27.85714 111.42857,0 L 382.85714,338.07647 185.71429,456.6479 z"
id="path2822"
sodipodi:nodetypes="ccccccc" />
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 296.42857,456.6479 383.21429,338.43361"
id="path2826" />
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 314.66252,456.62472 68.1853,-118.18785"
id="path2828" />
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 305.57115,485.16153 15.65736,-28.28427"
id="path2830" />
</g>
<path
id="path4065"
d="m 146.38783,182.85785 c -0.32605,-0.90165 -2.2117,-6.11664 -4.19034,-11.58888 -1.97865,-5.47224 -3.49043,-10.36632 -3.35952,-10.87573 0.28104,-1.0936 72.47583,-99.552799 72.77633,-99.252297 0.19834,0.198344 -52.99468,92.816837 -55.68619,96.959537 -0.73197,1.12664 -2.97014,7.44751 -4.97371,14.04639 -2.00356,6.59887 -3.7173,12.07724 -3.8083,12.17415 -0.091,0.0969 -0.43223,-0.56152 -0.75827,-1.46317 l 0,0 z"
style="opacity:1;fill:#666666;fill-opacity:1" />
</g>
<g
id="plane-left"
inkscape:label="#g4357">
<g
transform="matrix(0.00256181,-0.99999672,-0.99999672,-0.00256181,780.50589,449.7941)"
id="g3994">
<path
sodipodi:nodetypes="ccccccc"
id="path3996"
d="m 185.71429,456.6479 110,0 10.14561,-28.97991 8.42582,28.97991 111.42857,0 L 382.85714,338.07647 185.71429,456.6479 z"
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
id="path4000"
d="m 314.66252,456.62472 68.1853,-118.18785"
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
sodipodi:nodetypes="cc"
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 295.91153,456.54311 308.5568,440.11449"
id="path4006" />
<path
sodipodi:nodetypes="cc"
transform="matrix(0.00256181,-0.99999672,-0.99999672,-0.00256181,675.67433,927.38588)"
id="path4008"
d="m 498.79912,370.56922 89.10071,-76.12668"
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g>
<path
id="path4075"
d="m 331.59817,148.54231 c 0.90991,-0.75045 3.69622,-2.88986 6.1918,-4.75425 l 4.53742,-3.3898 3.80262,1.08903 c 2.09145,0.59896 3.80263,1.2469 3.80263,1.43986 0,0.30789 -18.78631,6.9796 -19.65325,6.9796 -0.18458,0 0.40887,-0.614 1.31878,-1.36444 z"
style="opacity:1;fill:#666666;fill-opacity:1" />
</g>
<g
id="plane-right"
inkscape:label="#g4371">
<g
id="g3984"
transform="matrix(0.00256181,-0.99999672,-0.99999672,-0.00256181,1070.5332,666.10797)">
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 185.71429,456.6479 110,0 10,27.85714 8.57143,-27.85714 111.42857,0 L 382.85714,338.07647 185.71429,456.6479 z"
id="path3986"
sodipodi:nodetypes="ccccccc" />
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 296.42857,456.6479 383.21429,338.43361"
id="path3988" />
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 314.66252,456.62472 68.1853,-118.18785"
id="path3990" />
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 305.57115,485.16153 15.65736,-28.28427"
id="path3992" />
</g>
<path
id="path4077"
d="m 602.06162,363.33367 c -6.43591,-2.39032 -11.37138,-4.37774 -10.96771,-4.41647 0.40366,-0.0387 5.79069,-1.627 11.97117,-3.52947 9.393,-2.89135 18.46611,-7.60947 55.28388,-28.74823 24.22566,-13.90905 44.2519,-25.08393 44.50276,-24.83307 0.25087,0.25086 -19.69141,15.17498 -44.31616,33.1647 l -44.77228,32.70858 -11.70166,-4.34604 z"
style="opacity:1;fill:#666666;fill-opacity:1" />
</g>
<g
id="plane-up"
inkscape:label="#g4391">
<g
transform="translate(-158.56854,5.01515)"
id="g4026">
<path
sodipodi:nodetypes="ccccccc"
id="path4012"
d="m 185.71429,456.6479 110,0 10,27.85714 8.57143,-27.85714 111.42857,0 -119.8167,-238.58667 -120.1833,238.58667 z"
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
sodipodi:nodetypes="cc"
id="path4014"
d="m 296.42857,456.6479 9.46902,-235.74646"
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
sodipodi:nodetypes="cc"
id="path4016"
d="M 314.66252,456.62472 305.89759,218.42163"
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
transform="translate(158.56854,-5.01515)"
id="path4022"
d="m 147.32905,489.5321 0,-4.13846 0,-263.20584"
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 185.71429,456.6479 110,0 10,27.85714 8.57143,-27.85714 111.42857,0 -119.8167,-238.58667 -120.1833,238.58667 z"
id="path4024"
sodipodi:nodetypes="ccccccc" />
</g>
<path
id="path4081"
d="m 142.14371,473.11345 -3.82369,-10.68763 0.40417,-5.40719 c 0.22229,-2.97395 1.94295,-44.12254 3.82369,-91.4413 l 3.41951,-86.03413 0.14953,51.06447 c 0.0823,28.08546 0.0823,74.04349 0,102.12894 l -0.14953,51.06447 -3.82368,-10.68763 z"
style="opacity:1;fill:#666666;fill-opacity:1" />
<path
id="path4083"
d="m 148.16566,377.28265 c 0.0301,-58.26325 0.13214,-104.87969 0.22683,-103.59211 0.0947,1.28759 1.67362,43.76715 3.50873,94.39902 l 3.33657,92.05795 -2.16196,7.14466 c -1.18907,3.92956 -2.7926,9.11993 -3.56339,11.53415 l -1.40144,4.3895 0.0547,-105.93317 0,0 z"
style="opacity:1;fill:#666666;fill-opacity:1" />
</g>
<g
id="plane-down"
inkscape:label="#g4401">
<g
id="g4033"
transform="matrix(1,0,0,-1,-158.56854,1000.7047)">
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 185.71429,456.6479 110,0 10,27.85714 8.57143,-27.85714 111.42857,0 -119.8167,-238.58667 -120.1833,238.58667 z"
id="path4035"
sodipodi:nodetypes="ccccccc" />
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 296.42857,456.6479 9.46902,-235.74646"
id="path4037"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 314.66252,456.62472 305.89759,218.42163"
id="path4039"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 147.32905,489.5321 0,-4.13846 0,-263.20584"
id="path4041"
transform="translate(158.56854,-5.01515)" />
<path
sodipodi:nodetypes="ccccccc"
id="path4043"
d="m 185.71429,456.6479 110,0 10,27.85714 8.57143,-27.85714 111.42857,0 -119.8167,-238.58667 -120.1833,238.58667 z"
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g>
<path
id="path4085"
d="m 148.16566,628.36182 -0.0547,-105.93317 1.40144,4.3895 c 0.77079,2.41422 2.37432,7.60459 3.56339,11.53415 l 2.16196,7.14466 -3.33657,92.05795 c -1.83511,50.63187 -3.41404,93.11143 -3.50873,94.39902 -0.0947,1.28758 -0.19676,-45.32887 -0.22683,-103.59211 z"
style="opacity:1;fill:#666666;fill-opacity:1" />
<path
id="path4087"
d="m 142.54602,640.35978 c -1.88175,-47.47972 -3.6008,-88.73996 -3.8201,-91.68942 l -0.39873,-5.36266 3.8201,-10.73216 3.8201,-10.73216 0.14953,51.01814 c 0.0822,28.05998 0.0822,74.14969 0,102.42158 l -0.14953,51.40343 -3.42137,-86.32675 z"
style="opacity:1;fill:#666666;fill-opacity:1" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 14 KiB

View File

@ -65,14 +65,11 @@
<item row="1" column="0"> <item row="1" column="0">
<widget class="QGroupBox" name="groupBox_5"> <widget class="QGroupBox" name="groupBox_5">
<property name="title"> <property name="title">
<string>#2: Magnetometer calibration</string> <string>#2: Accelerometer/Magnetometer calibration</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_sixPointCalib"> <layout class="QVBoxLayout" name="verticalLayout_sixPointCalib">
<item> <item>
<widget class="QGraphicsView" name="sixPointsHelp"> <widget class="QGraphicsView" name="sixPointsHelp">
<property name="toolTip">
<string>Nice paper plane, eh?</string>
</property>
</widget> </widget>
</item> </item>
<item> <item>
@ -297,6 +294,20 @@ p, li { white-space: pre-wrap; }
<string>#3: Board level calibration</string> <string>#3: Board level calibration</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_5"> <layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QGraphicsView" name="levelingHelp">
</widget>
</item>
<item>
<widget class="QProgressBar" name="accelBiasProgress">
<property name="value">
<number>0</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
</widget>
</item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<item> <item>
@ -310,13 +321,13 @@ p, li { white-space: pre-wrap; }
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QProgressBar" name="accelBiasProgress"> <widget class="QPushButton" name="accelBiasSavePos">
<property name="value"> <property name="enabled">
<number>0</number>
</property>
<property name="textVisible">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="text">
<string>Save Position</string>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>