mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-01 09:24:10 +01:00
Use qDebug for all debug output.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1055 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
db1dde5d8c
commit
983588e134
@ -82,11 +82,11 @@ void DialGadgetWidget::connectNeedles(QString object1, QString nfield1,
|
||||
if (!(object1.isEmpty() || nfield1.isEmpty())) {
|
||||
obj1 = dynamic_cast<UAVDataObject*>( objManager->getObject(object1) );
|
||||
if (obj1 != NULL ) {
|
||||
std::cout << "Connected Object 1 (" << object1.toStdString() << ")." << std::endl;
|
||||
qDebug() << "Connected Object 1 (" << object1 << ").";
|
||||
connect(obj1, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(updateNeedle1(UAVObject*)));
|
||||
field1 = nfield1;
|
||||
} else {
|
||||
std::cout << "Error: Object is unknown (" << object1.toStdString() << ")." << std::endl;
|
||||
qDebug() << "Error: Object is unknown (" << object1 << ").";
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,11 +94,11 @@ void DialGadgetWidget::connectNeedles(QString object1, QString nfield1,
|
||||
if (!(object2.isEmpty() || nfield2.isEmpty())) {
|
||||
obj2 = dynamic_cast<UAVDataObject*>( objManager->getObject(object2) );
|
||||
if (obj2 != NULL ) {
|
||||
std::cout << "Connected Object 2 (" << object2.toStdString() << ")." << std::endl;
|
||||
qDebug() << "Connected Object 2 (" << object2 << ").";
|
||||
connect(obj2, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(updateNeedle2(UAVObject*)));
|
||||
field2 = nfield2;
|
||||
} else {
|
||||
std::cout << "Error: Object is unknown (" << object2.toStdString() << ")." << std::endl;
|
||||
qDebug() << "Error: Object is unknown (" << object2 << ").";
|
||||
}
|
||||
}
|
||||
|
||||
@ -106,11 +106,11 @@ void DialGadgetWidget::connectNeedles(QString object1, QString nfield1,
|
||||
if (!(object3.isEmpty() || nfield3.isEmpty())) {
|
||||
obj3 = dynamic_cast<UAVDataObject*>( objManager->getObject(object3) );
|
||||
if (obj3 != NULL ) {
|
||||
std::cout << "Connected Object 3 (" << object3.toStdString() << ")." << std::endl;
|
||||
qDebug() << "Connected Object 3 (" << object3 << ").";
|
||||
connect(obj3, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(updateNeedle3(UAVObject*)));
|
||||
field3 = nfield3;
|
||||
} else {
|
||||
std::cout << "Error: Object is unknown (" << object3.toStdString() << ")." << std::endl;
|
||||
qDebug() << "Error: Object is unknown (" << object3 << ").";
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -124,7 +124,7 @@ void DialGadgetWidget::updateNeedle1(UAVObject *object1) {
|
||||
if (field) {
|
||||
setNeedle1(field->getDouble());
|
||||
} else {
|
||||
std::cout << "Wrong field, maybe an issue with object disconnection ?" << std::endl;
|
||||
qDebug() << "Wrong field, maybe an issue with object disconnection ?";
|
||||
}
|
||||
}
|
||||
|
||||
@ -136,7 +136,7 @@ void DialGadgetWidget::updateNeedle2(UAVObject *object2) {
|
||||
if (field) {
|
||||
setNeedle2(field->getDouble());
|
||||
} else {
|
||||
std::cout << "Wrong field, maybe an issue with object disconnection ?" << std::endl;
|
||||
qDebug() << "Wrong field, maybe an issue with object disconnection ?";
|
||||
}
|
||||
}
|
||||
|
||||
@ -148,7 +148,7 @@ void DialGadgetWidget::updateNeedle3(UAVObject *object3) {
|
||||
if (field) {
|
||||
setNeedle3(field->getDouble());
|
||||
} else {
|
||||
std::cout << "Wrong field, maybe an issue with object disconnection ?" << std::endl;
|
||||
qDebug() << "Wrong field, maybe an issue with object disconnection ?";
|
||||
}
|
||||
}
|
||||
|
||||
@ -339,7 +339,7 @@ void DialGadgetWidget::setDialFile(QString dfn, QString bg, QString fg, QString
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout<<"no file: "<<std::endl;
|
||||
qDebug()<<"no file: display default background.";
|
||||
m_renderer->load(QString(":/dial/images/empty.svg"));
|
||||
l_scene->clear(); // This also deletes all items contained in the scene.
|
||||
m_background = new QGraphicsSvgItem();
|
||||
@ -365,7 +365,7 @@ void DialGadgetWidget::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
// Skip painting until the dial file is loaded
|
||||
if (! m_renderer->isValid()) {
|
||||
std::cout<<"Dial file not loaded, not rendering"<<std::endl;
|
||||
qDebug()<<"Dial file not loaded, not rendering";
|
||||
return;
|
||||
}
|
||||
QGraphicsView::paintEvent(event);
|
||||
|
@ -71,7 +71,7 @@ void LineardialGadgetWidget::connectInput(QString object1, QString nfield1) {
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
UAVObjectManager *objManager = pm->getObject<UAVObjectManager>();
|
||||
|
||||
std::cout << "Lineadial Connect needles - " << object1.toStdString() << "-"<< nfield1.toStdString() << std::endl;
|
||||
qDebug() << "Lineardial Connect needles - " << object1 << "-"<< nfield1;
|
||||
|
||||
// Check validity of arguments first, reject empty args and unknown fields.
|
||||
if (!(object1.isEmpty() || nfield1.isEmpty())) {
|
||||
@ -84,7 +84,7 @@ void LineardialGadgetWidget::connectInput(QString object1, QString nfield1) {
|
||||
updateIndex(obj1);
|
||||
|
||||
} else {
|
||||
std::cout << "Error: Object is unknown (" << object1.toStdString() << ") this should not happen." << std::endl;
|
||||
qDebug() << "Error: Object is unknown (" << object1 << ") this should not happen.";
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -122,7 +122,7 @@ void LineardialGadgetWidget::updateIndex(UAVObject *object1) {
|
||||
if (index && !dialTimer.isActive())
|
||||
dialTimer.start();
|
||||
} else {
|
||||
std::cout << "Wrong field, maybe an issue with object disconnection ?" << std::endl;
|
||||
qDebug() << "Wrong field, maybe an issue with object disconnection ?";
|
||||
}
|
||||
}
|
||||
|
||||
@ -318,7 +318,7 @@ void LineardialGadgetWidget::setDialFile(QString dfn)
|
||||
}
|
||||
}
|
||||
else
|
||||
{ std::cout<<"no file: "<<std::endl; }
|
||||
{ qDebug()<<"no file "; }
|
||||
}
|
||||
|
||||
|
||||
@ -342,7 +342,7 @@ void LineardialGadgetWidget::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
// Skip painting until the dial file is loaded
|
||||
if (! m_renderer->isValid()) {
|
||||
std::cout<<"Dial file not loaded, not rendering"<<std::endl;
|
||||
qDebug()<<"Dial file not loaded, not rendering";
|
||||
return;
|
||||
}
|
||||
QGraphicsView::paintEvent(event);
|
||||
|
@ -84,21 +84,21 @@ void PFDGadgetWidget::connectNeedles() {
|
||||
if (attitudeObj != NULL ) {
|
||||
connect(attitudeObj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(updateAttitude(UAVObject*)));
|
||||
} else {
|
||||
std::cout << "Error: Object is unknown (AttitudeActual)." << std::endl;
|
||||
qDebug() << "Error: Object is unknown (AttitudeActual).";
|
||||
}
|
||||
|
||||
headingObj = dynamic_cast<UAVDataObject*>(objManager->getObject("PositionActual"));
|
||||
if (headingObj != NULL ) {
|
||||
connect(headingObj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(updateHeading(UAVObject*)));
|
||||
} else {
|
||||
std::cout << "Error: Object is unknown (PositionActual)." << std::endl;
|
||||
qDebug() << "Error: Object is unknown (PositionActual).";
|
||||
}
|
||||
|
||||
gcsTelemetryObj = dynamic_cast<UAVDataObject*>(objManager->getObject("GCSTelemetryStats"));
|
||||
if (gcsTelemetryObj != NULL ) {
|
||||
connect(gcsTelemetryObj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(updateLinkStatus(UAVObject*)));
|
||||
} else {
|
||||
std::cout << "Error: Object is unknown (GCSTelemetryStats)." << std::endl;
|
||||
qDebug() << "Error: Object is unknown (GCSTelemetryStats).";
|
||||
}
|
||||
|
||||
}
|
||||
@ -126,7 +126,7 @@ void PFDGadgetWidget::updateLinkStatus(UAVObject *object1) {
|
||||
s.sprintf("%.0f/%.0f",v1,v2);
|
||||
gcsTelemetryStats->setPlainText(s);
|
||||
} else {
|
||||
std::cout << "UpdateLinkStatus: Wrong field, maybe an issue with object disconnection ?" << std::endl;
|
||||
qDebug() << "UpdateLinkStatus: Wrong field, maybe an issue with object disconnection ?";
|
||||
}
|
||||
}
|
||||
|
||||
@ -149,7 +149,7 @@ void PFDGadgetWidget::updateAttitude(UAVObject *object1) {
|
||||
if (!dialTimer.isActive())
|
||||
dialTimer.start(); // Rearm the dial Timer which might be stopped.
|
||||
} else {
|
||||
std::cout << "UpdateAttitude: Wrong field, maybe an issue with object disconnection ?" << std::endl;
|
||||
qDebug() << "UpdateAttitude: Wrong field, maybe an issue with object disconnection ?";
|
||||
}
|
||||
}
|
||||
|
||||
@ -172,7 +172,7 @@ void PFDGadgetWidget::updateHeading(UAVObject *object1) {
|
||||
// - Scale is 540 degrees large
|
||||
headingTarget = field->getDouble()*compassBandWidth/(-540);
|
||||
} else {
|
||||
std::cout << "UpdateHeading: Wrong field, maybe an issue with object disconnection ?" << std::endl;
|
||||
qDebug() << "UpdateHeading: Wrong field, maybe an issue with object disconnection ?";
|
||||
}
|
||||
fieldname = QString("Groundspeed");
|
||||
field = object1->getField(fieldname);
|
||||
@ -552,7 +552,7 @@ void PFDGadgetWidget::setDialFile(QString dfn)
|
||||
}
|
||||
}
|
||||
else
|
||||
{ std::cout<<"no file: "<<std::endl; }
|
||||
{ qDebug()<<"no file."; }
|
||||
}
|
||||
|
||||
void PFDGadgetWidget::paint()
|
||||
@ -564,7 +564,7 @@ void PFDGadgetWidget::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
// Skip painting until the dial file is loaded
|
||||
if (! m_renderer->isValid()) {
|
||||
std::cout<<"Dial file not loaded, not rendering"<<std::endl;
|
||||
qDebug() << "Dial file not loaded, not rendering";
|
||||
return;
|
||||
}
|
||||
QGraphicsView::paintEvent(event);
|
||||
|
Loading…
Reference in New Issue
Block a user