| 98 | |
| 99 | |
| 100 | NodeModel CustomNodeDialog::getTreeNodeModel() const |
| 101 | { |
| 102 | QString ID = ui->lineEdit->text(); |
| 103 | NodeType type = NodeType::UNDEFINED; |
| 104 | PortModels ports; |
| 105 | |
| 106 | switch( ui->comboBox->currentIndex() ) |
| 107 | { |
| 108 | case 0: type = NodeType::ACTION; break; |
| 109 | case 1: type = NodeType::CONDITION; break; |
| 110 | case 2: type = NodeType::SUBTREE; break; |
| 111 | case 3: type = NodeType::DECORATOR; break; |
| 112 | } |
| 113 | for (int row=0; row < ui->tableWidget->rowCount(); row++ ) |
| 114 | { |
| 115 | const QString key = ui->tableWidget->item(row,0)->text(); |
| 116 | auto combo = static_cast<QComboBox*>(ui->tableWidget->cellWidget(row,1)); |
| 117 | const QString direction = combo->currentText(); |
| 118 | |
| 119 | PortModel port_model; |
| 120 | port_model.direction = BT::convertFromString<PortDirection>(direction.toStdString()); |
| 121 | port_model.default_value = ui->tableWidget->item(row,2)->text(); |
| 122 | port_model.description = ui->tableWidget->item(row,3)->text(); |
| 123 | ports.insert( {key, port_model} ); |
| 124 | } |
| 125 | return { type, ID, ports }; |
| 126 | } |
| 127 | |
| 128 | |
| 129 | void CustomNodeDialog::checkValid() |
no outgoing calls
no test coverage detected