From 0b4c4b5c61d6af7f0d9d50f6fc0d2245070ede3d Mon Sep 17 00:00:00 2001 From: LM Date: Tue, 10 Jan 2012 13:23:37 +0100 Subject: [PATCH] Reverted to 32bit for OS X to re-enable Google Earth, fixed persistence of command button --- qgroundcontrol.pri | 10 +++--- src/ui/HUD.cc | 13 +++++--- src/ui/WaypointList.cc | 8 ++--- src/ui/designer/QGCCommandButton.cc | 49 +++++++++++++++++++++++------ src/ui/designer/QGCCommandButton.ui | 39 +++++++++++++++++++++++ src/ui/uas/UASControlWidget.cc | 4 ++- 6 files changed, 97 insertions(+), 26 deletions(-) diff --git a/qgroundcontrol.pri b/qgroundcontrol.pri index 818da225b..1638f810b 100644 --- a/qgroundcontrol.pri +++ b/qgroundcontrol.pri @@ -42,8 +42,8 @@ macx|macx-g++42|macx-g++: { # COMPILER_VERSION = $$system(gcc -v) #message(Using compiler $$COMPILER_VERSION) - CONFIG += x86_64 cocoa phonon - CONFIG -= x86 + CONFIG += x86 cocoa phonon + CONFIG -= x86_64 #HARDWARE_PLATFORM = $$system(uname -a) #contains( $$HARDWARE_PLATFORM, "9.6.0" ) || contains( $$HARDWARE_PLATFORM, "9.7.0" ) || contains( $$HARDWARE_PLATFORM, "9.8.0" ) || contains( $$HARDWARE_PLATFORM, "9.9.0" ) { @@ -94,7 +94,7 @@ macx|macx-g++42|macx-g++: { QMAKE_POST_LINK += && cp -rf $$BASEDIR/files $$TARGETDIR/qgroundcontrol.app/Contents/MacOS # Copy libraries QMAKE_POST_LINK += && mkdir -p $$TARGETDIR/qgroundcontrol.app/Contents/libs - QMAKE_POST_LINK += && cp -rf $$BASEDIR/lib/mac64/lib/* $$TARGETDIR/qgroundcontrol.app/Contents/libs + QMAKE_POST_LINK += && cp -rf $$BASEDIR/lib/mac32/lib/* $$TARGETDIR/qgroundcontrol.app/Contents/libs # Fix library paths inside executable QMAKE_POST_LINK += && install_name_tool -change libOpenThreads.dylib "@executable_path/../libs/libOpenThreads.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/MacOS/qgroundcontrol @@ -164,11 +164,11 @@ macx|macx-g++42|macx-g++: { # Include OpenSceneGraph libraries INCLUDEPATH += -framework GLUT \ -framework Cocoa \ - $$BASEDIR/lib/mac64/include + $$BASEDIR/lib/mac32/include LIBS += -framework GLUT \ -framework Cocoa \ - -L$$BASEDIR/lib/mac64/lib \ + -L$$BASEDIR/lib/mac32/lib \ -lOpenThreads \ -losg \ -losgViewer \ diff --git a/src/ui/HUD.cc b/src/ui/HUD.cc index 1ee2aae30..39e0be4d7 100644 --- a/src/ui/HUD.cc +++ b/src/ui/HUD.cc @@ -1394,18 +1394,23 @@ void HUD::setPixels(int imgid, const unsigned char* imageData, int length, int s Q_UNUSED(imgid); // qDebug() << "at" << __FILE__ << __LINE__ << ": Received startindex" << startIndex << "and length" << length << "(" << startIndex+length << "of" << rawExpectedBytes << "bytes)"; - if (imageStarted) { + if (imageStarted) + { //if (rawLastIndex != startIndex) qDebug() << "PACKET LOSS!"; - if (startIndex+length > rawExpectedBytes) { + if (startIndex+length > rawExpectedBytes) + { qDebug() << "HUD: OVERFLOW! startIndex:" << startIndex << "length:" << length << "image raw size" << ((receivedWidth * receivedHeight * receivedChannels * receivedDepth) / 8) - 1; - } else { + } + else + { memcpy(rawImage+startIndex, imageData, length); rawLastIndex = startIndex+length; // Check if we just reached the end of the image - if (startIndex+length == rawExpectedBytes) { + if (startIndex+length == rawExpectedBytes) + { //qDebug() << "HUD: END OF IMAGE REACHED!"; finishImage(); rawLastIndex = 0; diff --git a/src/ui/WaypointList.cc b/src/ui/WaypointList.cc index 09db4ec4e..8436230ec 100644 --- a/src/ui/WaypointList.cc +++ b/src/ui/WaypointList.cc @@ -99,12 +99,11 @@ WaypointList::WaypointList(QWidget *parent, UASInterface* uas) : // SET UAS AFTER ALL SIGNALS/SLOTS ARE CONNECTED if (uas) { - qDebug() << "setUAS" ; WPM = uas->getWaypointManager(); + setUAS(uas); } else { - qDebug() << "setUAS failed" ; // Hide buttons, which don't make sense without valid UAS m_ui->positionAddButton->hide(); m_ui->transmitButton->hide(); @@ -116,8 +115,6 @@ WaypointList::WaypointList(QWidget *parent, UASInterface* uas) : WPM = new UASWaypointManager(NULL); } - setUAS(uas); - // STATUS LABEL updateStatusLabel(""); @@ -154,8 +151,7 @@ void WaypointList::updateAttitude(UASInterface* uas, double roll, double pitch, void WaypointList::setUAS(UASInterface* uas) { - //if (this->uas == NULL && uas != NULL) - if (this->uas == NULL) + if (this->uas == NULL && uas != NULL) { this->uas = uas; diff --git a/src/ui/designer/QGCCommandButton.cc b/src/ui/designer/QGCCommandButton.cc index c1430175d..ad50897cb 100644 --- a/src/ui/designer/QGCCommandButton.cc +++ b/src/ui/designer/QGCCommandButton.cc @@ -118,6 +118,9 @@ void QGCCommandButton::startEditMode() ui->editParam2SpinBox->show(); ui->editParam3SpinBox->show(); ui->editParam4SpinBox->show(); + ui->editParam5SpinBox->show(); + ui->editParam6SpinBox->show(); + ui->editParam7SpinBox->show(); ui->editLine1->show(); ui->editLine2->show(); //setStyleSheet("QGroupBox { border: 1px solid #66666B; border-radius: 3px; padding: 10px 0px 0px 0px; background: #111122; }"); @@ -135,11 +138,15 @@ void QGCCommandButton::endEditMode() ui->editParamsVisibleCheckBox->hide(); ui->editLine1->hide(); ui->editLine2->hide(); - if (!ui->editParamsVisibleCheckBox->isChecked()) { + if (!ui->editParamsVisibleCheckBox->isChecked()) + { ui->editParam1SpinBox->hide(); ui->editParam2SpinBox->hide(); ui->editParam3SpinBox->hide(); ui->editParam4SpinBox->hide(); + ui->editParam5SpinBox->hide(); + ui->editParam6SpinBox->hide(); + ui->editParam7SpinBox->hide(); } ui->commandButton->show(); @@ -155,23 +162,39 @@ void QGCCommandButton::writeSettings(QSettings& settings) { qDebug() << "COMMAND BUTTON WRITING SETTINGS"; settings.setValue("TYPE", "COMMANDBUTTON"); - settings.setValue("QGC_ACTION_BUTTON_DESCRIPTION", ui->nameLabel->text()); - settings.setValue("QGC_ACTION_BUTTON_BUTTONTEXT", ui->commandButton->text()); - settings.setValue("QGC_ACTION_BUTTON_ACTIONID", ui->editCommandComboBox->itemData(ui->editCommandComboBox->currentIndex()).toInt()); + settings.setValue("QGC_COMMAND_BUTTON_DESCRIPTION", ui->nameLabel->text()); + settings.setValue("QGC_COMMAND_BUTTON_BUTTONTEXT", ui->commandButton->text()); + settings.setValue("QGC_COMMAND_BUTTON_COMMANDID", ui->editCommandComboBox->itemData(ui->editCommandComboBox->currentIndex()).toInt()); settings.setValue("QGC_COMMAND_BUTTON_PARAMS_VISIBLE", ui->editParamsVisibleCheckBox->isChecked()); + settings.setValue("QGC_COMMAND_BUTTON_PARAM1", ui->editParam1SpinBox->value()); + settings.setValue("QGC_COMMAND_BUTTON_PARAM2", ui->editParam2SpinBox->value()); + settings.setValue("QGC_COMMAND_BUTTON_PARAM3", ui->editParam3SpinBox->value()); + settings.setValue("QGC_COMMAND_BUTTON_PARAM4", ui->editParam4SpinBox->value()); + settings.setValue("QGC_COMMAND_BUTTON_PARAM5", ui->editParam5SpinBox->value()); + settings.setValue("QGC_COMMAND_BUTTON_PARAM6", ui->editParam6SpinBox->value()); + settings.setValue("QGC_COMMAND_BUTTON_PARAM7", ui->editParam7SpinBox->value()); settings.sync(); } void QGCCommandButton::readSettings(const QSettings& settings) { - ui->editNameLabel->setText(settings.value("QGC_ACTION_BUTTON_DESCRIPTION", "ERROR LOADING BUTTON").toString()); - ui->editButtonName->setText(settings.value("QGC_ACTION_BUTTON_BUTTONTEXT", "UNKNOWN").toString()); - ui->editCommandComboBox->setCurrentIndex(settings.value("QGC_ACTION_BUTTON_ACTIONID", 0).toInt()); + ui->editNameLabel->setText(settings.value("QGC_COMMAND_BUTTON_DESCRIPTION", "ERROR LOADING BUTTON").toString()); + ui->editButtonName->setText(settings.value("QGC_COMMAND_BUTTON_BUTTONTEXT", "UNKNOWN").toString()); + ui->editCommandComboBox->setCurrentIndex(settings.value("QGC_COMMAND_BUTTON_COMMANDID", 0).toInt()); + + ui->nameLabel->setText(settings.value("QGC_COMMAND_BUTTON_DESCRIPTION", "ERROR LOADING BUTTON").toString()); + ui->commandButton->setText(settings.value("QGC_COMMAND_BUTTON_BUTTONTEXT", "UNKNOWN").toString()); + + int commandId = settings.value("QGC_COMMAND_BUTTON_COMMANDID", 0).toInt(); - ui->nameLabel->setText(settings.value("QGC_ACTION_BUTTON_DESCRIPTION", "ERROR LOADING BUTTON").toString()); - ui->commandButton->setText(settings.value("QGC_ACTION_BUTTON_BUTTONTEXT", "UNKNOWN").toString()); + ui->editParam1SpinBox->setValue(settings.value("QGC_COMMAND_BUTTON_PARAM1", 0.0).toDouble()); + ui->editParam2SpinBox->setValue(settings.value("QGC_COMMAND_BUTTON_PARAM2", 0.0).toDouble()); + ui->editParam3SpinBox->setValue(settings.value("QGC_COMMAND_BUTTON_PARAM3", 0.0).toDouble()); + ui->editParam4SpinBox->setValue(settings.value("QGC_COMMAND_BUTTON_PARAM4", 0.0).toDouble()); + ui->editParam5SpinBox->setValue(settings.value("QGC_COMMAND_BUTTON_PARAM5", 0.0).toDouble()); + ui->editParam6SpinBox->setValue(settings.value("QGC_COMMAND_BUTTON_PARAM6", 0.0).toDouble()); + ui->editParam7SpinBox->setValue(settings.value("QGC_COMMAND_BUTTON_PARAM7", 0.0).toDouble()); - int commandId = settings.value("QGC_ACTION_BUTTON_ACTIONID", 0).toInt(); ui->editCommandComboBox->setCurrentIndex(0); // Find combobox entry for this data @@ -190,6 +213,9 @@ void QGCCommandButton::readSettings(const QSettings& settings) ui->editParam2SpinBox->show(); ui->editParam3SpinBox->show(); ui->editParam4SpinBox->show(); + ui->editParam5SpinBox->show(); + ui->editParam6SpinBox->show(); + ui->editParam7SpinBox->show(); } else { @@ -197,6 +223,9 @@ void QGCCommandButton::readSettings(const QSettings& settings) ui->editParam2SpinBox->hide(); ui->editParam3SpinBox->hide(); ui->editParam4SpinBox->hide(); + ui->editParam5SpinBox->hide(); + ui->editParam6SpinBox->hide(); + ui->editParam7SpinBox->hide(); } qDebug() << "DONE READING SETTINGS"; } diff --git a/src/ui/designer/QGCCommandButton.ui b/src/ui/designer/QGCCommandButton.ui index 5b7e4646c..d1b6ec1e7 100644 --- a/src/ui/designer/QGCCommandButton.ui +++ b/src/ui/designer/QGCCommandButton.ui @@ -164,6 +164,45 @@ + + + + P5: + + + -2147483647.000000000000000 + + + 2147483647.000000000000000 + + + + + + + P6: + + + -2147483647.000000000000000 + + + 2147483647.000000000000000 + + + + + + + P7: + + + -2147483647.000000000000000 + + + 2147483647.000000000000000 + + + diff --git a/src/ui/uas/UASControlWidget.cc b/src/ui/uas/UASControlWidget.cc index 5040497c4..5c13e5222 100644 --- a/src/ui/uas/UASControlWidget.cc +++ b/src/ui/uas/UASControlWidget.cc @@ -171,7 +171,9 @@ void UASControlWidget::transmitMode() if (mav) { mav->setMode(uasMode); - ui.lastActionLabel->setText(QString("Sent new mode cmd to %1").arg(mav->getUASName())); + QString mode = ui.modeComboBox->currentText(); + + ui.lastActionLabel->setText(QString("Sent new mode %1 to %2").arg(mode).arg(mav->getUASName())); } } -- 2.22.0