| 287 | } |
| 288 | |
| 289 | void DeviceOptions::logic_probes(QVBoxLayout &layout) |
| 290 | { |
| 291 | using namespace Qt; |
| 292 | |
| 293 | layout.setSpacing(2); |
| 294 | |
| 295 | int row1 = 0; |
| 296 | int row2 = 0; |
| 297 | int vld_ch_num = 0; |
| 298 | int cur_ch_num = 0; |
| 299 | int contentHeight = 0; |
| 300 | |
| 301 | _probes_checkBox_list.clear(); |
| 302 | |
| 303 | QFont font = this->font(); |
| 304 | font.setPointSizeF(AppConfig::Instance().appOptions.fontSize); |
| 305 | |
| 306 | //channel count checked |
| 307 | if (_device_agent->get_work_mode()== LOGIC) { |
| 308 | GVariant * gvar_opts = _device_agent->get_config_list(NULL, SR_CONF_CHANNEL_MODE); |
| 309 | |
| 310 | if (gvar_opts != NULL) |
| 311 | { |
| 312 | struct sr_list_item *plist = (struct sr_list_item*)g_variant_get_uint64(gvar_opts); |
| 313 | g_variant_unref(gvar_opts); |
| 314 | |
| 315 | int ch_mode = 0; |
| 316 | _device_agent->get_config_int16(SR_CONF_CHANNEL_MODE, ch_mode); |
| 317 | _channel_mode_indexs.clear(); |
| 318 | |
| 319 | while (plist != NULL && plist->id >= 0) |
| 320 | { |
| 321 | row1++; |
| 322 | QString mode_bt_text = LangResource::Instance()->get_lang_text(STR_PAGE_DSL, plist->name, plist->name); |
| 323 | QRadioButton *mode_button = new QRadioButton(mode_bt_text); |
| 324 | mode_button->setFont(font); |
| 325 | ChannelModePair mode_index; |
| 326 | mode_index.key = mode_button; |
| 327 | mode_index.value = plist->id; |
| 328 | _channel_mode_indexs.push_back(mode_index); |
| 329 | |
| 330 | layout.addWidget(mode_button); |
| 331 | contentHeight += mode_button->sizeHint().height(); //radio button height |
| 332 | |
| 333 | connect(mode_button, SIGNAL(pressed()), this, SLOT(channel_check())); |
| 334 | |
| 335 | if (plist->id == ch_mode) |
| 336 | mode_button->setChecked(true); |
| 337 | |
| 338 | plist++; |
| 339 | } |
| 340 | } |
| 341 | } |
| 342 | |
| 343 | _device_agent->get_config_int16(SR_CONF_VLD_CH_NUM, vld_ch_num); |
| 344 | |
| 345 | // channels |
| 346 | QWidget *channel_pannel = new QWidget(); |
nothing calls this directly
no test coverage detected