Skip to content
Snippets Groups Projects
Unverified Commit 9f9011d4 authored by Jake's avatar Jake
Browse files

Added smarts to setpoint choosers

Now they do a good job of defaulting to the right setpoints
parent 52fa2fc9
No related branches found
No related tags found
No related merge requests found
......@@ -143,17 +143,31 @@ void MainWindow::newNodes(QStringList blocks)
void MainWindow::newConstantBlocks(QStringList blocks)
{
QComboBox * select = findChild<QComboBox *>("xSetpointSelect");
select->clear(); /* Hopefully this clears the list */
select->addItems(blocks);
select = findChild<QComboBox *>("ySetpointSelect");
select->clear(); /* Hopefully this clears the list */
select->addItems(blocks);
select = findChild<QComboBox *>("zSetpointSelect");
select->clear(); /* Hopefully this clears the list */
select->addItems(blocks);
QComboBox * xSelect = findChild<QComboBox *>("xSetpointSelect");
xSelect->clear(); /* Hopefully this clears the list */
xSelect->addItems(blocks);
QComboBox * ySelect = findChild<QComboBox *>("ySetpointSelect");
ySelect->clear(); /* Hopefully this clears the list */
ySelect->addItems(blocks);
QComboBox * zSelect = findChild<QComboBox *>("zSetpointSelect");
zSelect->clear(); /* Hopefully this clears the list */
zSelect->addItems(blocks);
for (ssize_t i = 0; i < blocks.size(); i++) {
if (blocks[i].contains("setpoint", Qt::CaseInsensitive) || blocks[i].contains("sp", Qt::CaseInsensitive)) {
if (blocks[i].contains("x ", Qt::CaseInsensitive)) {
xSelect->setCurrentIndex(i);
}
if (blocks[i].contains("y ", Qt::CaseInsensitive)) {
ySelect->setCurrentIndex(i);
}
if (blocks[i].contains("z ", Qt::CaseInsensitive) || blocks[i].contains("alt", Qt::CaseInsensitive)) {
zSelect->setCurrentIndex(i);
}
}
}
}
void MainWindow::newParams(QStringList params)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment