Commit d8361352 authored by pixhawk's avatar pixhawk

testing params not working

parent dc492f13
......@@ -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);
}
}
}
......
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
10 0.2 3.2 -0.8 0 1 0 0.1 1000
11 0.2 2.2 -0.8 0 1 0 0.1 1000
12 0.2 1.2 -0.8 0 1 0 0.1 1000
13 0.2 0.5 -0.8 0 1 0 0.1 1000
14 0.2 0.3 -0.8 0 1 0 0.1 1000
15 1.1 0.3 -0.8 0 1 0 0.1 1000
16 2.1 0.3 -0.8 0 1 0 0.1 1000
17 2.8 0.3 -0.8 0 1 0 0.1 1000
18 3.1 0.3 -0.8 0 1 0 0.1 1000
19 3.7 0.3 -0.8 0 1 0 0.1 1000
20 3.7 0.3 0 0 1 0 0.1 1000
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