#include "AbstractBlock.h"
ParametersWindow::ParametersWindow(AbstractBlock *_block, Parameters *_params, BlocksToConfigureWidget *btcw, QWidget *parent) :
- QWidget(parent)
-{
+ QWidget(parent) {
block = _block;
confWidget = btcw;
params = _params;
comboBox = new QComboBox;
+ cout << "block has " <<block->getParameters().size() << " params" << endl;
foreach(BlockParameter *param, block->getParameters()){
comboBox->addItem(param->getName());
}
show();
}
-void ParametersWindow::updateData()
-{
+void ParametersWindow::updateData() {
BlockParameter *param = block->getParameters().at(comboBox->currentIndex());
name->setText(param->getName());
value->setText(param->getValue().toString());
type->setText(param->getTypeString());
}
-void ParametersWindow::save()
-{
+void ParametersWindow::save() {
BlockParameter *param = block->getParameters().at(comboBox->currentIndex());
param->setValue(value->text());