mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-20 10:54:14 +01:00
Merge branch 'next' into LP-194_Hidde_Attitude_Yaw
This commit is contained in:
commit
d858e0d497
@ -209,6 +209,11 @@ inline QString msgSendArgumentFailed()
|
||||
"Unable to send command line arguments to the already running instance. It appears to be not responding.");
|
||||
}
|
||||
|
||||
inline QString msgLogfileOpenFailed(const QString &fileName)
|
||||
{
|
||||
return QCoreApplication::translate("Application", "Failed to open log file %1").arg(fileName);
|
||||
}
|
||||
|
||||
// Prepare a remote argument: If it is a relative file, add the current directory
|
||||
// since the the central instance might be running in a different directory.
|
||||
inline QString prepareRemoteArgument(const QString &arg)
|
||||
@ -313,7 +318,7 @@ void logInit(QString fileName)
|
||||
logStream = new QTextStream(file);
|
||||
qInstallMessageHandler(mainMessageOutput);
|
||||
} else {
|
||||
// TODO error popup
|
||||
displayError(msgLogfileOpenFailed(fileName));
|
||||
}
|
||||
}
|
||||
|
||||
@ -426,16 +431,19 @@ void loadTranslators(QString language, QTranslator &translator, QTranslator &qtT
|
||||
const QString &creatorTrPath = Utils::GetDataPath() + QLatin1String("translations");
|
||||
|
||||
if (translator.load(QLatin1String("gcs_") + language, creatorTrPath)) {
|
||||
// Install gcs_xx.qm translation file
|
||||
QCoreApplication::installTranslator(&translator);
|
||||
|
||||
const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
|
||||
const QString &qtTrFile = QLatin1String("qt_") + language;
|
||||
// Binary installer puts Qt tr files into creatorTrPath
|
||||
if (qtTranslator.load(qtTrFile, qtTrPath) || qtTranslator.load(qtTrFile, creatorTrPath)) {
|
||||
QCoreApplication::installTranslator(&translator);
|
||||
// Install main qt_xx.qm translation file
|
||||
QCoreApplication::installTranslator(&qtTranslator);
|
||||
} else {
|
||||
// unload()
|
||||
translator.load(QString());
|
||||
}
|
||||
} else {
|
||||
// unload(), no gcs translation found
|
||||
translator.load(QString());
|
||||
}
|
||||
}
|
||||
} // namespace anonymous
|
||||
|
@ -289,7 +289,7 @@ void ConfigStabilizationWidget::updateThrottleCurveFromObject()
|
||||
field = stabBank->getField("EnableThrustPIDScaling");
|
||||
Q_ASSERT(field);
|
||||
|
||||
bool enabled = field->getValue() == "TRUE";
|
||||
bool enabled = field->getValue() == "True";
|
||||
ui->enableThrustPIDScalingCheckBox->setChecked(enabled);
|
||||
ui->thrustPIDScalingCurve->setEnabled(enabled);
|
||||
setDirty(dirty);
|
||||
@ -311,7 +311,7 @@ void ConfigStabilizationWidget::updateObjectFromThrottleCurve()
|
||||
|
||||
field = stabBank->getField("EnableThrustPIDScaling");
|
||||
Q_ASSERT(field);
|
||||
field->setValue(ui->enableThrustPIDScalingCheckBox->isChecked() ? "TRUE" : "FALSE");
|
||||
field->setValue(ui->enableThrustPIDScalingCheckBox->isChecked() ? "True" : "False");
|
||||
}
|
||||
|
||||
void ConfigStabilizationWidget::setupExpoPlot()
|
||||
@ -385,7 +385,7 @@ void ConfigStabilizationWidget::resetThrottleCurveToDefault()
|
||||
field = defaultStabBank->getField("EnableThrustPIDScaling");
|
||||
Q_ASSERT(field);
|
||||
|
||||
bool enabled = field->getValue() == "TRUE";
|
||||
bool enabled = field->getValue() == "True";
|
||||
ui->enableThrustPIDScalingCheckBox->setChecked(enabled);
|
||||
ui->thrustPIDScalingCurve->setEnabled(enabled);
|
||||
|
||||
|
@ -64,6 +64,5 @@
|
||||
<file>qml/images/tab.png</file>
|
||||
<file>qml/AboutDialog.qml</file>
|
||||
<file alias="qml/AuthorsModel.qml">../../../../../build/gcs-synthetics/AuthorsModel.qml</file>
|
||||
<file>images/opie_90x120.gif</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 350 KiB |
@ -57,17 +57,6 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
}
|
||||
AnimatedImage {
|
||||
id: opie
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 10
|
||||
anchors.top: logo.bottom
|
||||
anchors.topMargin: 10
|
||||
source: "../images/opie_90x120.gif"
|
||||
z: 100
|
||||
fillMode: Image.PreserveAspectFit
|
||||
visible: false
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.left: logo.right
|
||||
@ -87,15 +76,6 @@ Rectangle {
|
||||
Layout.fillWidth: true
|
||||
font.pixelSize: 14
|
||||
font.bold: true
|
||||
MouseArea {
|
||||
id: easter_egg
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
opie.visible = !opie.visible
|
||||
}
|
||||
}
|
||||
}
|
||||
Text {
|
||||
id: versionLabel
|
||||
|
@ -770,30 +770,30 @@ void VehicleConfigurationHelper::applyMixerConfiguration(mixerChannelSettings ch
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_HEXA:
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_HEXA_H:
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_HEXA_X:
|
||||
mSettings->setMixerValueRoll(100);
|
||||
mSettings->setMixerValuePitch(100);
|
||||
mSettings->setMixerValueYaw(100);
|
||||
mSettings->setMixerValueRoll((qint8) 100);
|
||||
mSettings->setMixerValuePitch((qint8) 100);
|
||||
mSettings->setMixerValueYaw((qint8) 100);
|
||||
break;
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_X:
|
||||
mSettings->setMixerValueRoll(50);
|
||||
mSettings->setMixerValuePitch(50);
|
||||
mSettings->setMixerValueYaw(50);
|
||||
mSettings->setMixerValueRoll((qint8) 50);
|
||||
mSettings->setMixerValuePitch((qint8) 50);
|
||||
mSettings->setMixerValueYaw((qint8) 50);
|
||||
break;
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_PLUS:
|
||||
mSettings->setMixerValueRoll(100);
|
||||
mSettings->setMixerValuePitch(100);
|
||||
mSettings->setMixerValueYaw(50);
|
||||
mSettings->setMixerValueRoll((qint8) 100);
|
||||
mSettings->setMixerValuePitch((qint8) 100);
|
||||
mSettings->setMixerValueYaw((qint8) 50);
|
||||
break;
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_HEXA_COAX_Y:
|
||||
mSettings->setMixerValueRoll(100);
|
||||
mSettings->setMixerValuePitch(50);
|
||||
mSettings->setMixerValueYaw(66);
|
||||
mSettings->setMixerValueRoll((qint8) 100);
|
||||
mSettings->setMixerValuePitch((qint8) 50);
|
||||
mSettings->setMixerValueYaw((qint8) 66);
|
||||
break;
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_OCTO:
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_X:
|
||||
mSettings->setMixerValueRoll(100);
|
||||
mSettings->setMixerValuePitch(100);
|
||||
mSettings->setMixerValueYaw(100);
|
||||
mSettings->setMixerValueRoll((qint8) 100);
|
||||
mSettings->setMixerValuePitch((qint8) 100);
|
||||
mSettings->setMixerValueYaw((qint8) 100);
|
||||
break;
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_X:
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_PLUS:
|
||||
@ -805,9 +805,9 @@ void VehicleConfigurationHelper::applyMixerConfiguration(mixerChannelSettings ch
|
||||
break;
|
||||
}
|
||||
case VehicleConfigurationSource::VEHICLE_FIXEDWING:
|
||||
mSettings->setMixerValueRoll(100);
|
||||
mSettings->setMixerValuePitch(100);
|
||||
mSettings->setMixerValueYaw(100);
|
||||
mSettings->setMixerValueRoll((qint8) 100);
|
||||
mSettings->setMixerValuePitch((qint8) 100);
|
||||
mSettings->setMixerValueYaw((qint8) 100);
|
||||
maxThrottle = 1;
|
||||
break;
|
||||
case VehicleConfigurationSource::VEHICLE_HELI:
|
||||
@ -816,22 +816,22 @@ void VehicleConfigurationHelper::applyMixerConfiguration(mixerChannelSettings ch
|
||||
{
|
||||
switch (m_configSource->getVehicleSubType()) {
|
||||
case VehicleConfigurationSource::GROUNDVEHICLE_MOTORCYCLE:
|
||||
mSettings->setMixerValueRoll(100);
|
||||
mSettings->setMixerValuePitch(100);
|
||||
mSettings->setMixerValueYaw(100);
|
||||
mSettings->setMixerValueRoll((qint8) 100);
|
||||
mSettings->setMixerValuePitch((qint8) 100);
|
||||
mSettings->setMixerValueYaw((qint8) 100);
|
||||
maxThrottle = 1;
|
||||
break;
|
||||
case VehicleConfigurationSource::GROUNDVEHICLE_CAR:
|
||||
mSettings->setMixerValueRoll(100);
|
||||
mSettings->setMixerValuePitch(100);
|
||||
mSettings->setMixerValueYaw(100);
|
||||
mSettings->setMixerValueRoll((qint8) 100);
|
||||
mSettings->setMixerValuePitch((qint8) 100);
|
||||
mSettings->setMixerValueYaw((qint8) 100);
|
||||
maxThrottle = 1;
|
||||
minThrottle = 0;
|
||||
break;
|
||||
case VehicleConfigurationSource::GROUNDVEHICLE_DIFFERENTIAL:
|
||||
mSettings->setMixerValueRoll(100);
|
||||
mSettings->setMixerValuePitch(100);
|
||||
mSettings->setMixerValueYaw(100);
|
||||
mSettings->setMixerValueRoll((qint8) 100);
|
||||
mSettings->setMixerValuePitch((qint8) 100);
|
||||
mSettings->setMixerValueYaw((qint8) 100);
|
||||
maxThrottle = 0.8;
|
||||
minThrottle = 0;
|
||||
break;
|
||||
|
@ -912,7 +912,7 @@ QVariant ConfigTaskWidget::getVariantFromWidget(QWidget *widget, WidgetBinding *
|
||||
} else if (QSlider * cb = qobject_cast<QSlider *>(widget)) {
|
||||
return (double)(cb->value() * scale);
|
||||
} else if (QCheckBox * cb = qobject_cast<QCheckBox *>(widget)) {
|
||||
return (QString)(cb->isChecked() ? "TRUE" : "FALSE");
|
||||
return (QString)(cb->isChecked() ? "True" : "False");
|
||||
} else if (QLineEdit * cb = qobject_cast<QLineEdit *>(widget)) {
|
||||
QString value = (QString)cb->displayText();
|
||||
if (binding->units() == "hex") {
|
||||
@ -955,7 +955,7 @@ bool ConfigTaskWidget::setWidgetFromVariant(QWidget *widget, QVariant value, Wid
|
||||
cb->setValue((int)qRound(value.toDouble() / scale));
|
||||
return true;
|
||||
} else if (QCheckBox * cb = qobject_cast<QCheckBox *>(widget)) {
|
||||
bool bvalue = value.toString() == "TRUE";
|
||||
bool bvalue = value.toString() == "True";
|
||||
cb->setChecked(bvalue);
|
||||
return true;
|
||||
} else if (QLineEdit * cb = qobject_cast<QLineEdit *>(widget)) {
|
||||
|
@ -614,7 +614,7 @@ bool UAVObjectGeneratorGCS::process_object(ObjectInfo *object)
|
||||
ctxt.object = object;
|
||||
|
||||
ctxt.registerImpl += ::generate(ctxt,
|
||||
" qmlRegisterType<:ClassName>(\"%1.:ClassName\", 1, 0, \":ClassName\");\n").arg("UAVTalk");
|
||||
" qmlRegisterType<:ClassName>(\"%1.:ClassName\", 1, 0, \":ClassName\");\n").arg("UAVTalk");
|
||||
|
||||
for (int n = 0; n < object->fields.length(); ++n) {
|
||||
FieldInfo *field = object->fields[n];
|
||||
@ -630,12 +630,18 @@ bool UAVObjectGeneratorGCS::process_object(ObjectInfo *object)
|
||||
fieldCtxt.ucPropName = toPropertyName(field->name);
|
||||
fieldCtxt.propName = toLowerCamelCase(fieldCtxt.ucPropName);
|
||||
fieldCtxt.propType = fieldCtxt.fieldType;
|
||||
fieldCtxt.propRefType = fieldCtxt.fieldType;
|
||||
if (field->type == FIELDTYPE_ENUM) {
|
||||
if (field->type == FIELDTYPE_INT8) {
|
||||
fieldCtxt.propType = fieldTypeStrCPP(FIELDTYPE_INT16);
|
||||
}
|
||||
else if (field->type == FIELDTYPE_UINT8) {
|
||||
fieldCtxt.propType = fieldTypeStrCPP(FIELDTYPE_UINT16);
|
||||
}
|
||||
else if (field->type == FIELDTYPE_ENUM) {
|
||||
QString enumClassName = object->name + "_" + fieldCtxt.ucPropName;
|
||||
fieldCtxt.propType = enumClassName + "::Enum";
|
||||
fieldCtxt.propRefType = fieldCtxt.propType;
|
||||
}
|
||||
// reference type
|
||||
fieldCtxt.propRefType = fieldCtxt.propType;
|
||||
|
||||
// deprecation
|
||||
fieldCtxt.hasDeprecatedProperty = (fieldCtxt.fieldName != fieldCtxt.propName) && DEPRECATED;
|
||||
|
Loading…
x
Reference in New Issue
Block a user