1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-29 07:24:13 +01:00

Merged in f5soh/librepilot/LP-461_Kill_Jerry_save (pull request #372)

LP-461 Heli tab : Get rid of Jerry save
This commit is contained in:
Philippe Renon 2017-01-11 21:56:44 +01:00
commit c28b91d847
2 changed files with 33 additions and 45 deletions

View File

@ -2,7 +2,7 @@
******************************************************************************
*
* @file configccpmwidget.cpp
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015.
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015-2016.
* E. Lafargue & The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @addtogroup GCSPlugins GCS Plugins
* @{
@ -31,6 +31,7 @@
#include <extensionsystem/pluginmanager.h>
#include <uavobjectutilmanager.h>
#include <uavobjecthelper.h>
#include "mixersettings.h"
#include "systemsettings.h"
@ -169,13 +170,13 @@ ConfigCcpmWidget::ConfigCcpmWidget(QWidget *parent) :
pen.setCapStyle(Qt::RoundCap);
pen.setJoinStyle(Qt::RoundJoin);
QBrush brush(Qt::darkBlue);
QBrush brush(Qt::darkYellow);
// creates a default pen
QPen pen2;
// pen2.setStyle(Qt::DotLine);
pen2.setWidth(1);
pen2.setBrush(Qt::blue);
pen2.setBrush(Qt::yellow);
// pen2.setCapStyle(Qt::RoundCap);
// pen2.setJoinStyle(Qt::RoundJoin);
@ -246,8 +247,6 @@ ConfigCcpmWidget::ConfigCcpmWidget(QWidget *parent) :
// refreshWidgetsValues(QString("HeliCP"));
UpdateType();
connect(m_aircraft->ccpmAngleW, SIGNAL(valueChanged(double)), this, SLOT(ccpmSwashplateUpdate()));
connect(m_aircraft->ccpmAngleX, SIGNAL(valueChanged(double)), this, SLOT(ccpmSwashplateUpdate()));
connect(m_aircraft->ccpmAngleY, SIGNAL(valueChanged(double)), this, SLOT(ccpmSwashplateUpdate()));
@ -277,7 +276,7 @@ ConfigCcpmWidget::ConfigCcpmWidget(QWidget *parent) :
connect(m_aircraft->ccpmLinkCyclic, SIGNAL(clicked()), this, SLOT(SetUIComponentVisibilities()));
connect(m_aircraft->ccpmLinkRoll, SIGNAL(clicked()), this, SLOT(SetUIComponentVisibilities()));
ccpmSwashplateRedraw();
UpdateType();
}
ConfigCcpmWidget::~ConfigCcpmWidget()
@ -398,8 +397,6 @@ void ConfigCcpmWidget::UpdateType()
int SingleServoIndex, NumServosDefined;
double AdjustmentAngle = 0;
SetUIComponentVisibilities();
typeText = m_aircraft->ccpmType->currentText();
SingleServoIndex = m_aircraft->ccpmSingleServo->currentIndex();
@ -977,27 +974,19 @@ void ConfigCcpmWidget::setMixer()
int typeInt = m_aircraft->ccpmType->count() - m_aircraft->ccpmType->currentIndex() - 1;
// Exit if currently updatingToHardware or ConfigError
// Exit if currently updatingToHardware, ConfigError or LevelConfigInProgress
// Avoid mixer changes if something wrong in config
if (throwConfigError(typeInt) || updatingToHardware) {
return;
}
if (SwashLvlConfigurationInProgress) {
return;
}
if (updatingToHardware == true) {
if (throwConfigError(typeInt) || updatingToHardware || SwashLvlConfigurationInProgress) {
return;
}
UpdateMixer();
updatingToHardware = true;
MixerSettings *mixerSettings = MixerSettings::GetInstance(getObjectManager());
Q_ASSERT(mixerSettings);
MixerSettings::DataFields mixerSettingsData = mixerSettings->getData();
UpdateMixer();
// Set up some helper pointers
qint8 *mixers[12] = { mixerSettingsData.Mixer1Vector,
mixerSettingsData.Mixer2Vector,
@ -1069,8 +1058,11 @@ void ConfigCcpmWidget::setMixer()
mixerSettingsData.Curve2Source = MixerSettings::CURVE2SOURCE_THROTTLE;
}
mixerSettings->setData(mixerSettingsData);
mixerSettings->updated();
UAVObjectUpdaterHelper updateHelper;
mixerSettings->setData(mixerSettingsData, false);
updateHelper.doObjectAndWait(mixerSettings);
updatingToHardware = false;
}
@ -1541,8 +1533,10 @@ void ConfigCcpmWidget::setSwashplateLevel(int percent)
SwashLvlSpinBoxes[i]->setValue(value);
}
actuatorCommand->setData(actuatorCommandData);
actuatorCommand->updated();
UAVObjectUpdaterHelper updateHelper;
actuatorCommand->setData(actuatorCommandData, false);
updateHelper.doObjectAndWait(actuatorCommand);
SwashLvlServoInterlock = 0;
}
@ -1588,8 +1582,10 @@ void ConfigCcpmWidget::SwashLvlSpinBoxChanged(int value)
actuatorCommandData.Channel[newSwashLvlConfiguration.ServoChannels[i]] = value;
}
actuatorCommand->setData(actuatorCommandData);
actuatorCommand->updated();
UAVObjectUpdaterHelper updateHelper;
actuatorCommand->setData(actuatorCommandData, false);
updateHelper.doObjectAndWait(actuatorCommand);
}
/**

View File

@ -13,7 +13,7 @@
height="400"
id="svg2816"
version="1.1"
inkscape:version="0.48.5 r10040"
inkscape:version="0.91 r13725"
sodipodi:docname="ccpm_setup.svg">
<defs
id="defs2818">
@ -32,14 +32,6 @@
stdDeviation="2.4480407"
id="feGaussianBlur4113" />
</filter>
<filter
inkscape:collect="always"
id="filter4149">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="1.990099"
id="feGaussianBlur4151" />
</filter>
<filter
color-interpolation-filters="sRGB"
inkscape:collect="always"
@ -56,17 +48,17 @@
borderopacity="1.0"
inkscape:pageopacity="1"
inkscape:pageshadow="0"
inkscape:zoom="0.93625"
inkscape:cx="329.50243"
inkscape:cy="22.483153"
inkscape:zoom="2.6481149"
inkscape:cx="128.94767"
inkscape:cy="47.906303"
inkscape:document-units="px"
inkscape:current-layer="g4008"
id="namedview2820"
showgrid="false"
showguides="false"
inkscape:snap-global="true"
inkscape:window-width="1280"
inkscape:window-height="928"
inkscape:window-width="1920"
inkscape:window-height="1016"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@ -121,7 +113,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@ -148,7 +140,7 @@
inkscape:connector-curvature="0"
transform="matrix(1.0083769,0,0,1.0083769,2.0000001e-6,-3.35076)" />
<path
style="fill:#2f82f4;fill-opacity:1;stroke:#0000ff;stroke-width:3.96039605;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;display:inline"
style="fill:#feb103;fill-opacity:1;stroke:#48adc6;stroke-width:3.96039605;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:0.40392157;display:inline"
d="M 198.01981,400 C 198.01981,509.36332 109.36332,598.0198 0,598.0198 C -109.36332,598.0198 -198.0198,509.36332 -198.0198,400 C -198.0198,290.63669 -109.36332,201.9802 0,201.9802 C 109.36332,201.9802 198.01981,290.63669 198.01981,400 z"
id="Ring"
inkscape:connector-curvature="0" />
@ -176,7 +168,7 @@
style="display:inline">
<path
sodipodi:type="arc"
style="color:#000000;fill:#d86415;fill-opacity:1;fill-rule:evenodd;stroke:#00ff00;stroke-width:1.0002594;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:3;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
style="color:#000000;fill:#ff6000;fill-opacity:1;fill-rule:evenodd;stroke:#47adc5;stroke-width:1.0002594;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:3;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="ServoW"
sodipodi:cx="0"
sodipodi:cy="397.5"
@ -210,7 +202,7 @@
sodipodi:cy="397.5"
sodipodi:cx="0"
id="ServoX"
style="color:#000000;fill:#d89615;fill-opacity:1;fill-rule:evenodd;stroke:#00ff00;stroke-width:1.0002594;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:3;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
style="color:#000000;fill:#ff6000;fill-opacity:1;fill-rule:evenodd;stroke:#47adc5;stroke-width:1.0002594;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:3;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
sodipodi:type="arc"
inkscape:label="#path3927" />
<text
@ -232,7 +224,7 @@
style="display:inline">
<path
sodipodi:type="arc"
style="color:#000000;fill:#d8c815;fill-opacity:1;fill-rule:evenodd;stroke:#00ff00;stroke-width:1.0002594;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:3;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
style="color:#000000;fill:#ff6000;fill-opacity:1;fill-rule:evenodd;stroke:#47adc5;stroke-width:1.0002594;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:3;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="ServoY"
sodipodi:cx="0"
sodipodi:cy="397.5"
@ -266,7 +258,7 @@
sodipodi:cy="397.5"
sodipodi:cx="0"
id="ServoZ"
style="color:#000000;fill:#d8f915;fill-opacity:1;fill-rule:evenodd;stroke:#00ff00;stroke-width:1.0002594;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:3;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
style="color:#000000;fill:#ff6000;fill-opacity:1;fill-rule:evenodd;stroke:#47adc5;stroke-width:1.0002594;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:3;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
sodipodi:type="arc"
inkscape:label="#path3957" />
<text

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB