1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-31 16:52:10 +01:00

OP-1222 Uncrustify

This commit is contained in:
Laurent Lalanne 2014-09-16 19:27:18 +02:00
parent d0c9e236a1
commit a8f0bb6eb6
15 changed files with 55 additions and 52 deletions

View File

@ -101,7 +101,7 @@ SixPointCalibrationModel::SixPointCalibrationModel(QObject *parent) :
revoCalibration = RevoCalibration::GetInstance(getObjectManager());
Q_ASSERT(revoCalibration);
auxMagSettings = AuxMagSettings::GetInstance(getObjectManager());
auxMagSettings = AuxMagSettings::GetInstance(getObjectManager());
Q_ASSERT(auxMagSettings);
accelGyroSettings = AccelGyroSettings::GetInstance(getObjectManager());
@ -440,7 +440,7 @@ void SixPointCalibrationModel::compute()
double Be_length;
RevoCalibration::DataFields revoCalibrationData = revoCalibration->getData();
AuxMagSettings::DataFields auxCalibrationData = auxMagSettings->getData();
AuxMagSettings::DataFields auxCalibrationData = auxMagSettings->getData();
AccelGyroSettings::DataFields accelGyroSettingsData = accelGyroSettings->getData();
HomeLocation::DataFields homeLocationData = homeLocation->getData();
@ -521,8 +521,8 @@ void SixPointCalibrationModel::compute()
if (good_calibration) {
m_dirty = true;
if (calibratingMag) {
result.revoCalibrationData = revoCalibrationData;
result.auxMagSettingsData = auxCalibrationData;
result.revoCalibrationData = revoCalibrationData;
result.auxMagSettingsData = auxCalibrationData;
displayInstructions(tr("Magnetometer calibration completed successfully."), WizardModel::Success);
}
if (calibratingAccel) {

View File

@ -92,14 +92,14 @@ public:
UAVObject::Metadata accelStateMetadata;
UAVObject::Metadata magSensorMetadata;
UAVObject::Metadata auxMagSensorMetadata;
AuxMagSettings::DataFields auxMagSettings;
AuxMagSettings::DataFields auxMagSettings;
RevoCalibration::DataFields revoCalibrationData;
AccelGyroSettings::DataFields accelGyroSettingsData;
} Memento;
typedef struct {
RevoCalibration::DataFields revoCalibrationData;
AuxMagSettings::DataFields auxMagSettingsData;
AuxMagSettings::DataFields auxMagSettingsData;
AccelGyroSettings::DataFields accelGyroSettingsData;
} Result;

View File

@ -137,7 +137,7 @@ ConfigMultiRotorWidget::ConfigMultiRotorWidget(QWidget *parent) :
m_aircraft->quadShape->setScene(scene);
QStringList multiRotorTypes;
multiRotorTypes << "Tricopter Y" << "Quad +" << "Quad X" << "Quad H" << "Hexacopter" << "Hexacopter X" << "Hexacopter H"
multiRotorTypes << "Tricopter Y" << "Quad +" << "Quad X" << "Quad H" << "Hexacopter" << "Hexacopter X" << "Hexacopter H"
<< "Hexacopter Y6" << "Octocopter" << "Octocopter X" << "Octocopter V" << "Octo Coax +" << "Octo Coax X";
m_aircraft->multirotorFrameType->addItems(multiRotorTypes);

View File

@ -265,7 +265,7 @@ int ConfigVehicleTypeWidget::frameCategory(QString frameType)
|| frameType == "Elevon" || frameType == "FixedWingVtail" || frameType == "Vtail") {
return ConfigVehicleTypeWidget::FIXED_WING;
} else if (frameType == "Tri" || frameType == "Tricopter Y" || frameType == "QuadX" || frameType == "Quad X"
|| frameType == "QuadP" || frameType == "Quad +" || frameType == "Quad H" || frameType == "QuadH"
|| frameType == "QuadP" || frameType == "Quad +" || frameType == "Quad H" || frameType == "QuadH"
|| frameType == "Hexa" || frameType == "Hexacopter"
|| frameType == "HexaX" || frameType == "Hexacopter X" || frameType == "HexaCoax"
|| frameType == "HexaH" || frameType == "Hexacopter H" || frameType == "Hexacopter Y6"

View File

@ -31,7 +31,7 @@
#include "connectiondiagram.h"
#include "ui_connectiondiagram.h"
const char* ConnectionDiagram::FILE_NAME = ":/setupwizard/resources/connection-diagrams.svg";
const char *ConnectionDiagram::FILE_NAME = ":/setupwizard/resources/connection-diagrams.svg";
const int ConnectionDiagram::IMAGE_PADDING = 10;
ConnectionDiagram::ConnectionDiagram(QWidget *parent, VehicleConfigurationSource *configSource) :
@ -50,12 +50,14 @@ ConnectionDiagram::~ConnectionDiagram()
void ConnectionDiagram::resizeEvent(QResizeEvent *event)
{
QWidget::resizeEvent(event);
fitInView();
}
void ConnectionDiagram::showEvent(QShowEvent *event)
{
QWidget::showEvent(event);
fitInView();
}
@ -63,8 +65,8 @@ void ConnectionDiagram::fitInView()
{
ui->connectionDiagram->setSceneRect(m_scene->itemsBoundingRect());
ui->connectionDiagram->fitInView(
m_scene->itemsBoundingRect().adjusted(-IMAGE_PADDING,-IMAGE_PADDING, IMAGE_PADDING, IMAGE_PADDING),
Qt::KeepAspectRatio);
m_scene->itemsBoundingRect().adjusted(-IMAGE_PADDING, -IMAGE_PADDING, IMAGE_PADDING, IMAGE_PADDING),
Qt::KeepAspectRatio);
}
void ConnectionDiagram::setupGraphicsScene()
@ -210,7 +212,7 @@ void ConnectionDiagram::setupGraphicsScene()
}
if (m_configSource->getVehicleType() == VehicleConfigurationSource::VEHICLE_FIXEDWING &&
m_configSource->getAirspeedType() != VehicleConfigurationSource::AIRSPEED_ESTIMATE) {
m_configSource->getAirspeedType() != VehicleConfigurationSource::AIRSPEED_ESTIMATE) {
switch (m_configSource->getAirspeedType()) {
case VehicleConfigurationSource::AIRSPEED_EAGLETREE:
if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_NANO) {

View File

@ -40,14 +40,14 @@ void AirSpeedPage::initializePage(VehicleConfigurationSource *settings)
// Enable all
setItemDisabled(-1, false);
if (settings->getInputType() == VehicleConfigurationSource::INPUT_SBUS ||
settings->getInputType() == VehicleConfigurationSource::INPUT_DSM2 ||
settings->getInputType() == VehicleConfigurationSource::INPUT_DSMX10 ||
settings->getInputType() == VehicleConfigurationSource::INPUT_DSMX11) {
settings->getInputType() == VehicleConfigurationSource::INPUT_DSM2 ||
settings->getInputType() == VehicleConfigurationSource::INPUT_DSMX10 ||
settings->getInputType() == VehicleConfigurationSource::INPUT_DSMX11) {
// Disable non estimated sensors if ports are taken by receivers
setItemDisabled(VehicleConfigurationSource::AIRSPEED_EAGLETREE, true);
setItemDisabled(VehicleConfigurationSource::AIRSPEED_MS4525, true);
if (getSelectedItem()->id() == VehicleConfigurationSource::AIRSPEED_EAGLETREE ||
getSelectedItem()->id() == VehicleConfigurationSource::AIRSPEED_MS4525) {
getSelectedItem()->id() == VehicleConfigurationSource::AIRSPEED_MS4525) {
// If previously selected invalid sensor, reset to estimated
setSelectedItem(VehicleConfigurationSource::AIRSPEED_ESTIMATE);
}
@ -90,4 +90,3 @@ void AirSpeedPage::setupSelection(Selection *selection)
"ms4525-speed-sensor",
SetupWizard::AIRSPEED_MS4525);
}

View File

@ -41,7 +41,6 @@ protected:
void initializePage(VehicleConfigurationSource *settings);
bool validatePage(SelectionItem *selectedItem);
void setupSelection(Selection *selection);
};
#endif // AIRSPEEDPAGE_H

View File

@ -79,7 +79,7 @@ void MultiPage::setupSelection(Selection *selection)
selection->addItem(tr("Quadcopter H"),
tr("Quadcopter H, Blackout miniH"),
"quad-h",
SetupWizard::MULTI_ROTOR_QUAD_H);
SetupWizard::MULTI_ROTOR_QUAD_H);
selection->addItem(tr("Hexacopter"),
tr("A multirotor with six motors, one motor in front."),

View File

@ -58,10 +58,12 @@ public:
{
return m_id;
}
void setDisabled(bool disabled) {
void setDisabled(bool disabled)
{
m_disabled = disabled;
}
bool disabled() {
bool disabled()
{
return m_disabled;
}

View File

@ -26,16 +26,16 @@
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1280"
inkscape:window-height="928"
inkscape:window-width="593"
inkscape:window-height="439"
id="namedview4616"
showgrid="false"
inkscape:zoom="0.54491305"
inkscape:zoom="0.1891554"
inkscape:cx="1013.827"
inkscape:cy="514.92134"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:window-x="331"
inkscape:window-y="337"
inkscape:window-maximized="0"
inkscape:current-layer="layer7"
fit-margin-top="15"
fit-margin-left="15"
@ -29307,7 +29307,8 @@
inkscape:groupmode="layer"
id="layer7"
inkscape:label="quad-h"
style="display:inline">
style="display:inline"
sodipodi:insensitive="true">
<g
style="display:inline"
id="quad-h"

Before

Width:  |  Height:  |  Size: 2.2 MiB

After

Width:  |  Height:  |  Size: 2.2 MiB

View File

@ -191,6 +191,7 @@ int SetupWizard::nextId() const
switch (getVehicleType()) {
case VEHICLE_FIXEDWING:
return PAGE_OUTPUT_CALIBRATION;
default:
return PAGE_BIAS_CALIBRATION;
}

View File

@ -68,9 +68,9 @@ bool SetupWizardPlugin::initialize(const QStringList & args, QString *errMsg)
ac->addAction(cmd, "Wizard");
cmd = am->registerAction(new QAction(this),
"SetupWizardPlugin.ExportJSon",
QList<int>() <<
Core::Constants::C_GLOBAL_ID);
"SetupWizardPlugin.ExportJSon",
QList<int>() <<
Core::Constants::C_GLOBAL_ID);
cmd->action()->setText(tr("Export Stabilization Settings"));
connect(cmd->action(), SIGNAL(triggered(bool)), this, SLOT(exportSettings()));
@ -114,12 +114,11 @@ void SetupWizardPlugin::exportSettings()
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
UAVObjectManager *uavoManager = pm->getObject<UAVObjectManager>();
StabilizationSettings* settings = StabilizationSettings::GetInstance(uavoManager);
StabilizationSettings *settings = StabilizationSettings::GetInstance(uavoManager);
settings->toJson(exportObject);
QJsonDocument saveDoc(exportObject);
saveFile.write(saveDoc.toJson());
}
void SetupWizardPlugin::wizardTerminated()

View File

@ -116,6 +116,7 @@ void VehicleConfigurationHelper::clearModifiedObjects()
void VehicleConfigurationHelper::applyHardwareConfiguration()
{
HwSettings *hwSettings = HwSettings::GetInstance(m_uavoManager);
Q_ASSERT(hwSettings);
HwSettings::DataFields data = hwSettings->getData();
@ -193,7 +194,6 @@ void VehicleConfigurationHelper::applyHardwareConfiguration()
}
if (m_configSource->getGpsType() != VehicleConfigurationSource::GPS_DISABLED) {
GPSSettings *gpsSettings = GPSSettings::GetInstance(m_uavoManager);
Q_ASSERT(gpsSettings);
GPSSettings::DataFields gpsData = gpsSettings->getData();
@ -201,28 +201,28 @@ void VehicleConfigurationHelper::applyHardwareConfiguration()
switch (m_configSource->getGpsType()) {
case VehicleConfigurationSource::GPS_NMEA:
data.OptionalModules[HwSettings::OPTIONALMODULES_GPS] = 1;
data.RM_MainPort = HwSettings::RM_MAINPORT_GPS;
data.GPSSpeed = HwSettings::GPSSPEED_57600;
data.RM_MainPort = HwSettings::RM_MAINPORT_GPS;
data.GPSSpeed = HwSettings::GPSSPEED_57600;
gpsData.DataProtocol = GPSSettings::DATAPROTOCOL_NMEA;
break;
case VehicleConfigurationSource::GPS_UBX:
data.OptionalModules[HwSettings::OPTIONALMODULES_GPS] = 1;
data.RM_MainPort = HwSettings::RM_MAINPORT_GPS;
data.GPSSpeed = HwSettings::GPSSPEED_57600;
data.RM_MainPort = HwSettings::RM_MAINPORT_GPS;
data.GPSSpeed = HwSettings::GPSSPEED_57600;
gpsData.DataProtocol = GPSSettings::DATAPROTOCOL_UBX;
break;
case VehicleConfigurationSource::GPS_PLATINUM:
data.OptionalModules[HwSettings::OPTIONALMODULES_GPS] = 1;
data.RM_MainPort = HwSettings::RM_MAINPORT_GPS;
data.GPSSpeed = HwSettings::GPSSPEED_115200;
data.GPSSpeed = HwSettings::GPSSPEED_115200;
/*
gpsData.DataProtocol = GPSSettings::DATAPROTOCOL_UBLOX;
AuxMagSettings *magSettings = AuxMagSettings::GetInstance(m_uavoManager);
AuxMagSettings::DataFields magsData = magSettings->getData();
magsData.usage = AuxMagSettings::Both;
magSettings->setData(magsData);
addModifiedObject(magSettings, tr("Writing External Mag sensor settings"));
*/
gpsData.DataProtocol = GPSSettings::DATAPROTOCOL_UBLOX;
AuxMagSettings *magSettings = AuxMagSettings::GetInstance(m_uavoManager);
AuxMagSettings::DataFields magsData = magSettings->getData();
magsData.usage = AuxMagSettings::Both;
magSettings->setData(magsData);
addModifiedObject(magSettings, tr("Writing External Mag sensor settings"));
*/
break;
default:
data.OptionalModules[HwSettings::OPTIONALMODULES_GPS] = 0;
@ -234,8 +234,7 @@ void VehicleConfigurationHelper::applyHardwareConfiguration()
}
if (m_configSource->getVehicleType() == VehicleConfigurationSource::VEHICLE_FIXEDWING &&
m_configSource->getAirspeedType() != VehicleConfigurationSource::AIRSPEED_DISABLED) {
m_configSource->getAirspeedType() != VehicleConfigurationSource::AIRSPEED_DISABLED) {
AirspeedSettings *airspeedSettings = AirspeedSettings::GetInstance(m_uavoManager);
Q_ASSERT(airspeedSettings);
AirspeedSettings::DataFields airspeedData = airspeedSettings->getData();

View File

@ -542,7 +542,7 @@ void UAVObject::fromXML(QXmlStreamReader *xmlReader)
Q_ASSERT(xmlReader->attributes().value("name") == getName());
Q_ASSERT(xmlReader->attributes().value("instance") == QString("%1").arg(getInstID()));
QXmlStreamReader::TokenType token = xmlReader->readNext();
if(token == QXmlStreamReader::StartElement && xmlReader->name() == "fields") {
if (token == QXmlStreamReader::StartElement && xmlReader->name() == "fields") {
while (xmlReader->readNextStartElement()) {
if (xmlReader->name() == "field") {
QStringRef fieldName = xmlReader->attributes().value("name");
@ -556,12 +556,13 @@ void UAVObject::fromXML(QXmlStreamReader *xmlReader)
void UAVObject::toJson(QJsonObject &jsonObject)
{
jsonObject["name"] = getName();
jsonObject["id"] = QString("%1").arg(getObjID(), 1, 16).toUpper();
jsonObject["name"] = getName();
jsonObject["id"] = QString("%1").arg(getObjID(), 1, 16).toUpper();
jsonObject["instance"] = (int)getInstID();
QJsonArray jSonFields;
foreach(UAVObjectField * field, fields) {
QJsonObject jSonField;
field->toJson(jSonField);
jSonFields.append(jSonField);
}

View File

@ -698,7 +698,7 @@ void UAVObjectField::toJson(QJsonObject &jsonObject)
QJsonArray values;
for (unsigned int n = 0; n < numElements; ++n) {
QJsonObject value;
value["name"] = getElementNames().at(n);
value["name"] = getElementNames().at(n);
value["value"] = QJsonValue::fromVariant(getValue(n));
values.append(value);
}