From d8361352a38c0aaa1dad295bd13b449ff14e835e Mon Sep 17 00:00:00 2001 From: pixhawk Date: Wed, 30 Jun 2010 17:03:40 +0200 Subject: [PATCH] testing params not working --- src/ui/QGCParamWidget.cc | 21 +++++++++++++++++++- waypoints_8_circle.txt | 42 ++++++++++++++++++++-------------------- 2 files changed, 41 insertions(+), 22 deletions(-) diff --git a/src/ui/QGCParamWidget.cc b/src/ui/QGCParamWidget.cc index aaf08d03a..b302f5651 100644 --- a/src/ui/QGCParamWidget.cc +++ b/src/ui/QGCParamWidget.cc @@ -258,7 +258,7 @@ void QGCParamWidget::addParameter(int uas, int component, QString parameterName, parameterItem->setBackground(0, QBrush(QColor(0, 0, 0))); parameterItem->setBackground(1, Qt::NoBrush); //tree->update(); - if (changedValues.contains(component)) changedValues.value(component)->remove(parameterName); +// if (changedValues.contains(component)) changedValues.value(component)->remove(parameterName); } /** @@ -360,30 +360,49 @@ void QGCParamWidget::loadParameters() if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) return; + qDebug() << "PARAM file opened"; // Clear list clear(); QTextStream in(&file); while (!in.atEnd()) { + + qDebug() << "PARAM while"; QString line = in.readLine(); if (!line.startsWith("#")) { + + qDebug() << "PARAM no #"; QStringList wpParams = line.split("\t"); if (wpParams.size() == 4) { + + qDebug() << "PARAM size 4"; // Only load parameters for right mav if (mav->getUASID() == wpParams.at(0).toInt()) { + + qDebug() << "PARAM right uas"; addParameter(wpParams.at(0).toInt(), wpParams.at(1).toInt(), wpParams.at(2), wpParams.at(3).toDouble()); if (changedValues.contains(wpParams.at(1).toInt())) { + + qDebug() << "PARAM changed contains"; if (changedValues.value(wpParams.at(1).toInt())->contains(wpParams.at(1))) { + qDebug() << "PARAM changed remove"; changedValues.value(wpParams.at(1).toInt())->remove(wpParams.at(1)); } changedValues.value(wpParams.at(1).toInt())->insert(wpParams.at(1), (float)wpParams.at(2).toDouble()); + + + + + + // set param to be changed +// QGCParamWidget::parameterItemChanged(QTreeWidgetItem* current, column); } } } diff --git a/waypoints_8_circle.txt b/waypoints_8_circle.txt index a8b925aca..7c8452a82 100644 --- a/waypoints_8_circle.txt +++ b/waypoints_8_circle.txt @@ -1,21 +1,21 @@ - 0 3.7 0.3 -0.8 0 1 1 0.1 2000 - 1 3.1 0.3 -0.8 0 1 0 0.1 2000 - 2 3.1 0.8 -0.8 0 1 0 0.1 2000 - 3 3.1 1.3 -0.8 0 1 0 0.1 2000 - 4 3.1 2 -0.8 0 1 0 0.1 2000 - 5 3.1 2.8 -0.8 0 1 0 0.1 2000 - 6 3.1 3.2 -0.8 0 1 0 0.1 2000 - 7 2.1 3.2 -0.8 0 1 0 0.1 2000 - 8 1.1 3.2 -0.8 0 1 0 0.1 2000 - 9 0.4 3.2 -0.8 0 1 0 0.1 2000 - 10 0.25 3.2 -0.8 0 1 0 0.1 2000 - 11 0.25 2.2 -0.8 0 1 0 0.1 2000 - 12 0.25 1.2 -0.8 0 1 0 0.1 2000 - 13 0.25 0.5 -0.8 0 1 0 0.1 2000 - 14 0.25 0.3 -0.8 0 1 0 0.1 2000 - 15 1.1 0.3 -0.8 0 1 0 0.1 2000 - 16 2.1 0.3 -0.8 0 1 0 0.1 2000 - 17 2.8 0.3 -0.8 0 1 0 0.1 2000 - 18 3.1 0.3 -0.8 0 1 0 0.1 2000 - 19 3.7 0.3 -0.8 0 1 0 0.1 2000 - 20 3.7 0.3 0 0 1 0 0.1 2000 + 0 3.7 0.3 -0.8 0 1 0 0.1 1000 + 1 3.1 0.3 -0.8 0 1 0 0.1 1000 + 2 3.1 0.8 -0.8 0 1 0 0.1 1000 + 3 3.1 1.3 -0.8 0 1 0 0.1 1000 + 4 3.1 2 -0.8 0 1 0 0.1 1000 + 5 3.1 2.8 -0.8 0 1 0 0.1 1000 + 6 3.1 3.2 -0.8 0 1 0 0.1 1000 + 7 2.1 3.2 -0.8 0 1 0 0.1 1000 + 8 1.1 3.2 -0.8 0 1 0 0.1 1000 + 9 0.4 3.2 -0.8 0 1 0 0.1 1000 + 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