| 661 | } |
| 662 | |
| 663 | void 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); |
nothing calls this directly
no test coverage detected