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

Merge remote-tracking branch 'origin/rel-14.01' into laurent/OP-1187_allow_french_translations_in_future_releases

This commit is contained in:
Laurent Lalanne 2014-01-22 23:24:45 +01:00 committed by f5soh
commit 15dfec2d70
9 changed files with 35 additions and 81 deletions

View File

@ -48,7 +48,6 @@
#include <math.h>
#include <pid.h>
#include <CoordinateConversions.h>
#include <attitudestate.h>
#include <altitudeholdsettings.h>
#include <altitudeholddesired.h> // object that will be updated by the module
#include <altitudeholdstatus.h>
@ -170,21 +169,6 @@ static void altitudeHoldTask(void)
// velocity control loop
throttle = startThrottle - pid_apply_setpoint(&pid1, 1.0f, altitudeHoldStatus.VelocityDesired, velocityStateDown, 1000.0f / DESIRED_UPDATE_RATE_MS);
// compensate throttle for current attitude
// Rbe[2][2] in the rotation matrix is the rotated down component of a
// 0,0,1 vector
// it is used to scale the throttle, but only up to 4 times the regular
// throttle
AttitudeStateData attitudeState;
AttitudeStateGet(&attitudeState);
float Rbe[3][3];
Quaternion2R(&attitudeState.q1, Rbe);
if (fabsf(Rbe[2][2]) > 0.25f) {
throttle /= Rbe[2][2];
} else {
throttle /= 0.25f;
}
if (throttle >= 1.0f) {
throttle = 1.0f;
}

View File

@ -194,7 +194,6 @@ MODULE_INITCALL(StabilizationInitialize, StabilizationStart);
static void stabilizationTask(__attribute__((unused)) void *parameters)
{
UAVObjEvent ev;
uint32_t timeval = PIOS_DELAY_GetRaw();
ActuatorDesiredData actuatorDesired;
@ -757,13 +756,17 @@ static float stab_powf(float x, uint8_t p)
static void SettingsBankUpdatedCb(__attribute__((unused)) UAVObjEvent *ev)
{
StabilizationBankData bank, oldBank;
StabilizationBankGet(&oldBank);
if (cur_flight_mode < 0 || cur_flight_mode >= NUM_FMS_POSITIONS) {
return;
}
if ((ev) && ((settings.FlightModeMap[cur_flight_mode] == 0 && ev->obj != StabilizationSettingsBank1Handle()) ||
(settings.FlightModeMap[cur_flight_mode] == 1 && ev->obj != StabilizationSettingsBank2Handle()) ||
(settings.FlightModeMap[cur_flight_mode] == 2 && ev->obj != StabilizationSettingsBank3Handle()) ||
settings.FlightModeMap[cur_flight_mode] > 2)) {
return;
}
StabilizationBankData bank;
switch (settings.FlightModeMap[cur_flight_mode]) {
case 0:
@ -777,16 +780,8 @@ static void SettingsBankUpdatedCb(__attribute__((unused)) UAVObjEvent *ev)
case 2:
StabilizationSettingsBank3Get((StabilizationSettingsBank3Data *)&bank);
break;
default:
memset(&bank, 0, sizeof(StabilizationBankDataPacked));
// return; //bank number is invalid. All we can do is ignore it.
}
// Need to do this to prevent an infinite loop
if (memcmp(&oldBank, &bank, sizeof(StabilizationBankDataPacked)) != 0) {
StabilizationBankSet(&bank);
}
StabilizationBankSet(&bank);
}
static void BankUpdatedCb(__attribute__((unused)) UAVObjEvent *ev)

View File

@ -162,7 +162,7 @@
#endif
#define PIOS_STABILIZATION_STACK_SIZE 790
#define PIOS_TELEM_STACK_SIZE 540
#define PIOS_EVENTDISPATCHER_STACK_SIZE 150
#define PIOS_EVENTDISPATCHER_STACK_SIZE 160
/* This can't be too high to stop eventdispatcher thread overflowing */
#define PIOS_EVENTDISAPTCHER_QUEUE 10

View File

@ -84,15 +84,6 @@ GCS_LIBRARY_PATH
data_copy.commands += $(COPY_DIR) $$targetPath(\"$$[QT_INSTALL_QML]/$$dir\") $$targetPath(\"$$GCS_QT_QML_PATH/$$dir\") $$addNewline()
}
# Remove the few unwanted libs after whole dir copy
QT_QUICK2_DELS = QtQuick/Controls/libqtquickcontrolsplugin.so \
QtQuick/Controls/Private/libqtquickcontrolsprivateplugin.so \
QtQuick/Dialogs/libdialogplugin.so
for(delfile, QT_QUICK2_DELS) {
data_copy.commands += $(DEL_FILE) $$targetPath(\"$$GCS_QT_QML_PATH/$${delfile}\") $$addNewline()
}
# Remaining QtQuick plugin libs
QT_QUICK2_DLLS = QtQuick.2/libqtquick2plugin.so \
QtQuick.2/plugins.qmltypes \
@ -210,22 +201,6 @@ GCS_LIBRARY_PATH
data_copy.commands += $(COPY_DIR) $$targetPath(\"$$[QT_INSTALL_QML]/$$dir\") $$targetPath(\"$$GCS_APP_PATH/$$dir\") $$addNewline()
}
# Remove the few unwanted DDLs after whole dir copy
QT_QUICK2_DELS = qtquick/controls/qtquickcontrolsplugin \
qtquick/controls/private/qtquickcontrolsprivateplugin \
qtquick/dialogs/dialogplugin
CONFIG(debug, debug|release) {
for(delfile, QT_QUICK2_DELS) {
data_copy.commands += $(DEL_FILE) $$targetPath(\"$$GCS_APP_PATH/$${delfile}.dll\") $$addNewline()
}
}
CONFIG(release, debug|release) {
for(delfile, QT_QUICK2_DELS) {
data_copy.commands += $(DEL_FILE) $$targetPath(\"$$GCS_APP_PATH/$${delfile}d.dll\") $$addNewline()
}
}
# Remaining QtQuick plugin DLLs
QT_QUICK2_DLLS = QtQuick.2/qtquick2plugin$${DS}.dll \
QtQuick.2/plugins.qmltypes \

View File

@ -91,16 +91,17 @@ void InputChannelForm::minMaxUpdated()
void InputChannelForm::neutralUpdated()
{
int neutralValue = ui->neutralValue->value();
if(ui->channelRev->isChecked()) {
if(neutralValue > ui->channelMin->value()) {
if (ui->channelRev->isChecked()) {
if (neutralValue > ui->channelMin->value()) {
ui->channelMin->setValue(neutralValue);
} else if(neutralValue < ui->channelMax->value()) {
} else if (neutralValue < ui->channelMax->value()) {
ui->channelMax->setValue(neutralValue);
}
} else {
if(neutralValue < ui->channelMin->value()) {
if (neutralValue < ui->channelMin->value()) {
ui->channelMin->setValue(neutralValue);
} else if(neutralValue > ui->channelMax->value()) {
} else if (neutralValue > ui->channelMax->value()) {
ui->channelMax->setValue(neutralValue);
}
}
@ -109,17 +110,17 @@ void InputChannelForm::neutralUpdated()
void InputChannelForm::reversedUpdated()
{
int value = ui->channelNeutral->value();
int min = ui->channelMin->value();
int max = ui->channelMax->value();
int min = ui->channelMin->value();
int max = ui->channelMax->value();
if(ui->channelRev->isChecked()) {
if(min < max) {
if (ui->channelRev->isChecked()) {
if (min < max) {
ui->channelMax->setValue(min);
ui->channelMin->setValue(max);
ui->channelNeutral->setValue(value);
}
} else {
if(min > max) {
if (min > max) {
ui->channelMax->setValue(min);
ui->channelMin->setValue(max);
ui->channelNeutral->setValue(value);

View File

@ -50,8 +50,7 @@ ConnectionManager::ConnectionManager(Internal::MainWindow *mainWindow) :
{
// device list
m_availableDevList = new QComboBox;
m_availableDevList->setMinimumWidth(120);
m_availableDevList->setMaximumWidth(180);
m_availableDevList->setMinimumContentsLength(tr("USB: OPLinkMini").length());
m_availableDevList->setContextMenuPolicy(Qt::CustomContextMenu);
// connect button
@ -60,9 +59,9 @@ ConnectionManager::ConnectionManager(Internal::MainWindow *mainWindow) :
// put everything together
QHBoxLayout *layout = new QHBoxLayout;
layout->setSpacing(5);
layout->setSpacing(6);
// cheat a bit with the margin to "nicely" center things vertically
layout->setContentsMargins(5, 0, 5, 4);
layout->setContentsMargins(6, 0, 4, 2);
setLayout(layout);
layout->addWidget(new QLabel(tr("Connections:")), 0, Qt::AlignVCenter);

View File

@ -98,13 +98,13 @@ QGraphicsTextItem *createTextItem(QGraphicsSvgItem *parent, QString elementId, Q
MonitorWidget::MonitorWidget(QWidget *parent) :
QGraphicsView(parent), aspectRatioMode(Qt::KeepAspectRatio)
{
// setMinimumWidth(180);
setMinimumSize(180, 25);
QGraphicsScene *scene = new QGraphicsScene();
setScene(scene);
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
// no scroll bars
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

View File

@ -469,17 +469,17 @@ bool UAVObjectUtilManager::descriptionToStructure(QByteArray desc, deviceDescrip
struc.uavoHash = desc.mid(60, 20);
/*
qDebug() << __FUNCTION__ << ":description from board:";
foreach(char x, desc) {
qDebug() << __FUNCTION__ << ":description from board:";
foreach(char x, desc) {
qDebug() << QString::number(x, 16);
}
}
qDebug() << __FUNCTION__ << ":uavoHash:";
QByteArray array2 = struc.uavoHash.data();
foreach(char x, array2) {
qDebug() << __FUNCTION__ << ":uavoHash:";
QByteArray array2 = struc.uavoHash.data();
foreach(char x, array2) {
qDebug() << QString::number(x, 16);
}
*/
}
*/
return true;
}
return false;

View File

@ -839,7 +839,7 @@ void ConfigTaskWidget::disconnectWidgetUpdatesToSlot(QWidget *widget, const char
disconnect(cb, SIGNAL(valueChanged(int)), this, function);
} else if (QDoubleSpinBox * cb = qobject_cast<QDoubleSpinBox *>(widget)) {
disconnect(cb, SIGNAL(valueChanged(double)), this, function);
}else if (QLineEdit * cb = qobject_cast<QLineEdit *>(widget)) {
} else if (QLineEdit * cb = qobject_cast<QLineEdit *>(widget)) {
disconnect(cb, SIGNAL(textChanged(double)), this, function);
} else if (QCheckBox * cb = qobject_cast<QCheckBox *>(widget)) {
disconnect(cb, SIGNAL(stateChanged(int)), this, function);