MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / create_probe_selector

Method create_probe_selector

DSView/pv/dialogs/decoderoptionsdlg.cpp:287–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285
286
287DsComboBox* 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
323void DecoderOptionsDlg::on_region_set(int index)
324{

Callers

nothing calls this directly

Calls 6

GetSessionMethod · 0.80
binded_probe_indexMethod · 0.80
signal_typeMethod · 0.80
get_nameMethod · 0.80
enabledMethod · 0.45
get_indexMethod · 0.45

Tested by

no test coverage detected