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

Method logic_probes

DSView/pv/dialogs/deviceoptions.cpp:289–426  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

287}
288
289void 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();

Callers

nothing calls this directly

Calls 8

get_work_modeMethod · 0.80
get_config_listMethod · 0.80
get_config_int16Method · 0.80
get_lang_textMethod · 0.80
get_channelsMethod · 0.80
getCheckBoxMethod · 0.80
clearMethod · 0.45
update_fontMethod · 0.45

Tested by

no test coverage detected