| 203 | |
| 204 | |
| 205 | QDomElement writePortModel(const QString& port_name, const PortModel& port, QDomDocument& doc) |
| 206 | { |
| 207 | QDomElement port_element; |
| 208 | switch (port.direction) |
| 209 | { |
| 210 | case PortDirection::INPUT: |
| 211 | port_element = doc.createElement("input_port"); |
| 212 | break; |
| 213 | case PortDirection::OUTPUT: |
| 214 | port_element = doc.createElement("output_port"); |
| 215 | break; |
| 216 | case PortDirection::INOUT: |
| 217 | port_element = doc.createElement("inout_port"); |
| 218 | break; |
| 219 | } |
| 220 | |
| 221 | port_element.setAttribute("name", port_name); |
| 222 | if (port.type_name.isEmpty() == false) |
| 223 | { |
| 224 | port_element.setAttribute("type", port.type_name); |
| 225 | } |
| 226 | if (port.default_value.isEmpty() == false) |
| 227 | { |
| 228 | port_element.setAttribute("default", port.default_value); |
| 229 | } |
| 230 | |
| 231 | if (!port.description.isEmpty()) |
| 232 | { |
| 233 | QDomText description = doc.createTextNode(port.description); |
| 234 | port_element.appendChild(description); |
| 235 | } |
| 236 | return port_element; |
| 237 | } |
no outgoing calls
no test coverage detected