| 285 | |
| 286 | |
| 287 | DsComboBox* DecoderOptionsDlg::create_probe_selector( |
| 288 | QWidget *parent, const data::decode::Decoder *dec, |
| 289 | const srd_channel *const pdch) |
| 290 | { |
| 291 | assert(dec); |
| 292 | |
| 293 | const auto &sigs = AppControl::Instance()->GetSession()->get_signals(); |
| 294 | |
| 295 | data::decode::Decoder *decoder = const_cast<data::decode::Decoder*>(dec); |
| 296 | |
| 297 | DsComboBox *selector = new DsComboBox(parent); |
| 298 | selector->addItem("-", QVariant::fromValue(-1)); |
| 299 | |
| 300 | int dex = 0; |
| 301 | const int binded_index = decoder->binded_probe_index(pdch); |
| 302 | |
| 303 | for(auto s : sigs) |
| 304 | { |
| 305 | dex++; |
| 306 | |
| 307 | if (s->signal_type() == SR_CHANNEL_LOGIC && s->enabled()){ |
| 308 | selector->addItem(s->get_name(),QVariant::fromValue(s->get_index())); |
| 309 | |
| 310 | if (binded_index == s->get_index()){ |
| 311 | selector->setCurrentIndex(dex); |
| 312 | } |
| 313 | } |
| 314 | } |
| 315 | |
| 316 | if (binded_index == -1){ |
| 317 | selector->setCurrentIndex(0); |
| 318 | } |
| 319 | |
| 320 | return selector; |
| 321 | } |
| 322 | |
| 323 | void DecoderOptionsDlg::on_region_set(int index) |
| 324 | { |
nothing calls this directly
no test coverage detected