MCPcopy Index your code
hub / github.com/DreamSourceLab/DSView / analog_probes

Method analog_probes

DSView/pv/dialogs/deviceoptions.cpp:663–763  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

661}
662
663void DeviceOptions::analog_probes(QGridLayout &layout)
664{
665 using namespace Qt;
666
667 _probes_checkBox_list.clear();
668 _probe_options_binding_list.clear();
669 _dso_channel_list.clear();
670
671 QTabWidget *tabWidget = new QTabWidget();
672 tabWidget->setTabPosition(QTabWidget::North);
673 tabWidget->setUsesScrollButtons(false);
674
675 QFont font = this->font();
676 font.setPointSizeF(AppConfig::Instance().appOptions.fontSize);
677
678 int ch_dex = 0;
679
680 for (const GSList *l = _device_agent->get_channels(); l; l = l->next) {
681 sr_channel *const probe = (sr_channel*)l->data;
682 assert(probe);
683
684 _dso_channel_list.push_back(probe);
685
686 QWidget *probe_widget = new QWidget(tabWidget);
687 QGridLayout *probe_layout = new QGridLayout(probe_widget);
688 probe_widget->setLayout(probe_layout);
689
690 bool ch_enabled = probe->enabled;
691 if (ch_dex < _lst_probe_enabled_status.size()){
692 ch_enabled = _lst_probe_enabled_status[ch_dex];
693 }
694
695 ch_dex++;
696
697 QCheckBox *probe_checkBox = new QCheckBox(this);
698 QVariant vlayout = QVariant::fromValue((void *)probe_layout);
699 probe_checkBox->setProperty("Layout", vlayout);
700 probe_checkBox->setProperty("Enable", true);
701 probe_checkBox->setChecked(ch_enabled);
702 // probe_checkBox->setCheckState(probe->enabled ? Qt::Checked : Qt::Unchecked);
703 _probes_checkBox_list.push_back(probe_checkBox);
704
705 QLabel *en_label = new QLabel(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_ENABLE), "Enable: "), this);
706 en_label->setFont(font);
707 en_label->setProperty("Enable", true);
708 probe_layout->addWidget(en_label, 0, 0, 1, 1);
709 probe_layout->addWidget(probe_checkBox, 0, 1, 1, 3);
710
711 auto *probe_options_binding = new pv::prop::binding::ProbeOptions(probe);
712 const auto &properties = probe_options_binding->properties();
713 int i = 1;
714
715 for(auto p : properties)
716 {
717 const QString label = p->labeled_widget() ? QString() : p->label();
718 QLabel *lb = new QLabel(label, probe_widget);
719 lb->setFont(font);
720 probe_layout->addWidget(lb, i, 0, 1, 1);

Callers

nothing calls this directly

Calls 8

get_channelsMethod · 0.80
sizeMethod · 0.80
nameMethod · 0.80
get_config_boolMethod · 0.80
clearMethod · 0.45
labeled_widgetMethod · 0.45
get_widgetMethod · 0.45
update_fontMethod · 0.45

Tested by

no test coverage detected