Commit 0b4c4b5c authored by LM's avatar LM

Reverted to 32bit for OS X to re-enable Google Earth, fixed persistence of command button

parent 14acce6c
......@@ -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 \
......
......@@ -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;
......
......@@ -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;
......
......@@ -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";
}
......@@ -164,6 +164,45 @@
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="editParam5SpinBox">
<property name="prefix">
<string>P5: </string>
</property>
<property name="minimum">
<double>-2147483647.000000000000000</double>
</property>
<property name="maximum">
<double>2147483647.000000000000000</double>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="editParam6SpinBox">
<property name="prefix">
<string>P6: </string>
</property>
<property name="minimum">
<double>-2147483647.000000000000000</double>
</property>
<property name="maximum">
<double>2147483647.000000000000000</double>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="editParam7SpinBox">
<property name="prefix">
<string>P7: </string>
</property>
<property name="minimum">
<double>-2147483647.000000000000000</double>
</property>
<property name="maximum">
<double>2147483647.000000000000000</double>
</property>
</widget>
</item>
</layout>
</item>
<item row="4" column="0" colspan="3">
......
......@@ -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()));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment