Skip to content

Commit

Permalink
Fixed compile errors introduced by missing ifdefs
Browse files Browse the repository at this point in the history
  • Loading branch information
pixhawk-students committed Dec 9, 2010
1 parent 91ce554 commit 8f20d17
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion qgroundcontrol.pri
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ macx {

# osg/osgEarth dynamic casts might fail without this compiler option.
# see http://osgearth.org/wiki/FAQ for details.
#QMAKE_CXXFLAGS += -Wl,-E
QMAKE_CXXFLAGS += -Wl,-E
}

# GNU/Linux
Expand Down
20 changes: 18 additions & 2 deletions src/ui/SlugsPIDControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ SlugsPIDControl::SlugsPIDControl(QWidget *parent) :
*/
void SlugsPIDControl::activeUasSet(UASInterface* uas)
{
#ifdef MAVLINK_ENABLED_SLUGS
SlugsMAV* slugsMav = dynamic_cast<SlugsMAV*>(uas);

#ifdef MAVLINK_ENABLED_SLUGS
if (slugsMav != NULL)
{
connect(slugsMav,SIGNAL(slugsActionAck(int,const mavlink_action_ack_t&)),this,SLOT(recibeMensaje(int,mavlink_action_ack_t)));
Expand Down Expand Up @@ -186,6 +186,7 @@ void SlugsPIDControl::changeColor_GREEN_AirSpeed_groupBox()
{

//create the packet
#ifdef MAVLINK_ENABLED_SLUGS
pidMessage.target = activeUAS->getUASID();
pidMessage.idx = 0;
pidMessage.pVal = ui->dT_P_set->text().toFloat();
Expand All @@ -196,6 +197,7 @@ void SlugsPIDControl::changeColor_GREEN_AirSpeed_groupBox()

mavlink_msg_pid_encode(MG::SYSTEM::ID,MG::SYSTEM::COMPID, &msg, &pidMessage);
slugsMav->sendMessage(msg);
#endif

ui->AirSpeedHold_groupBox->setStyleSheet(GREENcolorStyle);
}
Expand Down Expand Up @@ -231,6 +233,7 @@ void SlugsPIDControl::changeColor_GREEN_PitchFollowei_groupBox()

if (slugsMav != NULL)
{
#ifdef MAVLINK_ENABLED_SLUGS
//create the packet
pidMessage.target = activeUAS->getUASID();
pidMessage.idx = 2;
Expand All @@ -242,6 +245,7 @@ void SlugsPIDControl::changeColor_GREEN_PitchFollowei_groupBox()

mavlink_msg_pid_encode(MG::SYSTEM::ID,MG::SYSTEM::COMPID, &msg, &pidMessage);
slugsMav->sendMessage(msg);
#endif

ui->PitchFlowei_groupBox->setStyleSheet(GREENcolorStyle);
}
Expand Down Expand Up @@ -279,6 +283,7 @@ void SlugsPIDControl::changeColor_GREEN_RollControl_groupBox()

if (slugsMav != NULL)
{
#ifdef MAVLINK_ENABLED_SLUGS
//create the packet
pidMessage.target = activeUAS->getUASID();
pidMessage.idx = 4;
Expand All @@ -290,6 +295,7 @@ void SlugsPIDControl::changeColor_GREEN_RollControl_groupBox()

mavlink_msg_pid_encode(MG::SYSTEM::ID,MG::SYSTEM::COMPID, &msg, &pidMessage);
slugsMav->sendMessage(msg);
#endif

ui->RollControl_groupBox->setStyleSheet(GREENcolorStyle);
}
Expand Down Expand Up @@ -339,6 +345,7 @@ void SlugsPIDControl::changeColor_GREEN_HeigthError_groupBox()

if (slugsMav != NULL)
{
#ifdef MAVLINK_ENABLED_SLUGS
//create the packet
pidMessage.target = activeUAS->getUASID();
pidMessage.idx = 1;
Expand All @@ -350,6 +357,7 @@ void SlugsPIDControl::changeColor_GREEN_HeigthError_groupBox()

mavlink_msg_pid_encode(MG::SYSTEM::ID,MG::SYSTEM::COMPID, &msg, &pidMessage);
slugsMav->sendMessage(msg);
#endif

ui->HeightErrorLoPitch_groupBox->setStyleSheet(GREENcolorStyle);
}
Expand Down Expand Up @@ -398,6 +406,7 @@ void SlugsPIDControl::changeColor_GREEN_YawDamper_groupBox()

if (slugsMav != NULL)
{
#ifdef MAVLINK_ENABLED_SLUGS
//create the packet
pidMessage.target = activeUAS->getUASID();
pidMessage.idx = 3;
Expand All @@ -409,6 +418,7 @@ void SlugsPIDControl::changeColor_GREEN_YawDamper_groupBox()

mavlink_msg_pid_encode(MG::SYSTEM::ID,MG::SYSTEM::COMPID, &msg, &pidMessage);
slugsMav->sendMessage(msg);
#endif

ui->YawDamper_groupBox->setStyleSheet(GREENcolorStyle);
}
Expand Down Expand Up @@ -459,6 +469,7 @@ void SlugsPIDControl::changeColor_GREEN_Pitch2dT_groupBox()

if (slugsMav != NULL)
{
#ifdef MAVLINK_ENABLED_SLUGS
//create the packet
pidMessage.target = activeUAS->getUASID();
pidMessage.idx = 8;
Expand All @@ -470,6 +481,7 @@ void SlugsPIDControl::changeColor_GREEN_Pitch2dT_groupBox()

mavlink_msg_pid_encode(MG::SYSTEM::ID,MG::SYSTEM::COMPID, &msg, &pidMessage);
slugsMav->sendMessage(msg);
#endif
ui->Pitch2dTFFterm_groupBox->setStyleSheet(GREENcolorStyle);
}
}
Expand Down Expand Up @@ -539,10 +551,12 @@ void SlugsPIDControl::receivePidValues(int systemId, const mavlink_pid_t &pidVal

}
}
#endif // MAVLINK_ENABLED_SLUG


void SlugsPIDControl::sendMessagePIDStatus(int PIDtype)
{
#ifdef MAVLINK_ENABLED_SLUGS
//ToDo remplace actionId values


Expand Down Expand Up @@ -624,6 +638,7 @@ void SlugsPIDControl::sendMessagePIDStatus(int PIDtype)

}
}
#endif // MAVLINK_ENABLED_SLUG
}

void SlugsPIDControl::slugsGetGeneral()
Expand Down Expand Up @@ -693,6 +708,8 @@ void SlugsPIDControl::slugsSetGeneral()
counterRefreshSet++;
valuesMutex.unlock();
}


void SlugsPIDControl::slugsTimerStartSet()
{
counterRefreshSet = 1;
Expand All @@ -712,4 +729,3 @@ void SlugsPIDControl::slugsTimerStop()
// counterRefresh = 1;

}
#endif // MAVLINK_ENABLED_SLUGS
2 changes: 2 additions & 0 deletions src/ui/SlugsPIDControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,10 @@ public slots:
QString ORIGINcolorStyle;

//SlugsMav Message
#ifdef MAVLINK_ENABLED_SLUGS
mavlink_pid_t pidMessage;
mavlink_slugs_action_t actionSlugs;
#endif

QTimer* refreshTimerSet; ///< The main timer, controls the update view
QTimer* refreshTimerGet; ///< The main timer, controls the update view
Expand Down
3 changes: 3 additions & 0 deletions src/ui/slugshilsim.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ void SlugsHilSim::processHilDatagram(const QByteArray* datagram){

// GPS
mavlink_gps_raw_t tmpGpsRaw;

#ifdef MAVLINK_ENABLED_SLUGS
mavlink_gps_date_time_t tmpGpsTime;

tmpGpsTime.year = datagram->at(i++);
Expand All @@ -165,6 +167,7 @@ void SlugsHilSim::processHilDatagram(const QByteArray* datagram){

mavlink_msg_gps_date_time_encode(MG::SYSTEM::ID,MG::SYSTEM::COMPID, &msg, &tmpGpsTime);
activeUas->sendMessage(hilLink, msg);
#endif

memset(&msg, 0, sizeof(mavlink_message_t));

Expand Down

0 comments on commit 8f20d17

Please sign in to comment.