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

Method MathOptions

DSView/pv/dialogs/mathoptions.cpp:44–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42namespace dialogs {
43
44MathOptions::MathOptions(SigSession *session, QWidget *parent) :
45 DSDialog(parent),
46 _session(session),
47 _button_box(QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
48 Qt::Horizontal, this)
49{
50 setMinimumSize(300, 300);
51
52 _enable = new QCheckBox(this);
53
54 QLabel *lisa_label = new QLabel(this);
55 lisa_label->setPixmap(QPixmap(":/icons/math.svg"));
56
57 _math_group = new QGroupBox(this);
58 QHBoxLayout *type_layout = new QHBoxLayout();
59 QRadioButton *add_radio = new QRadioButton(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_ADD), "Add"), _math_group);
60 add_radio->setProperty("type", data::MathStack::MATH_ADD);
61 type_layout->addWidget(add_radio);
62 QRadioButton *sub_radio = new QRadioButton(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SUBSTRACT), "Substract"), _math_group);
63 sub_radio->setProperty("type", data::MathStack::MATH_SUB);
64 type_layout->addWidget(sub_radio);
65 QRadioButton *mul_radio = new QRadioButton(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_MULTIPLY), "Multiply"), _math_group);
66 mul_radio->setProperty("type", data::MathStack::MATH_MUL);
67 type_layout->addWidget(mul_radio);
68 QRadioButton *div_radio = new QRadioButton(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_DIVIDE), "Divide"), _math_group);
69 div_radio->setProperty("type", data::MathStack::MATH_DIV);
70 type_layout->addWidget(div_radio);
71 _math_radio.append(add_radio);
72 _math_radio.append(sub_radio);
73 _math_radio.append(mul_radio);
74 _math_radio.append(div_radio);
75 _math_group->setLayout(type_layout);
76
77 _src1_group = new QGroupBox(this);
78 _src2_group = new QGroupBox(this);
79 QHBoxLayout *src1_layout = new QHBoxLayout();
80 QHBoxLayout *src2_layout = new QHBoxLayout();
81
82 src1_layout->setContentsMargins(5, 15, 5, 5);
83 src2_layout->setContentsMargins(5, 15, 5, 5);
84 type_layout->setContentsMargins(5, 15, 5, 5);
85
86 for(auto s : _session->get_signals()) {
87 if (s->signal_type() == SR_CHANNEL_DSO) {
88 view::DsoSignal *dsoSig = (view::DsoSignal*)s;
89 QString index_str = QString::number(dsoSig->get_index());
90 QRadioButton *xradio = new QRadioButton(index_str, _src1_group);
91 xradio->setProperty("index", dsoSig->get_index());
92 src1_layout->addWidget(xradio);
93 QRadioButton *yradio = new QRadioButton(index_str, _src2_group);
94 yradio->setProperty("index", dsoSig->get_index());
95 src2_layout->addWidget(yradio);
96 _src1_radio.append(xradio);
97 _src2_radio.append(yradio);
98 }
99 }
100 _src1_group->setLayout(src1_layout);
101 _src2_group->setLayout(src2_layout);

Callers

nothing calls this directly

Calls 9

signal_typeMethod · 0.80
get_math_traceMethod · 0.80
src1Method · 0.80
src2Method · 0.80
get_math_stackMethod · 0.80
get_indexMethod · 0.45
enabledMethod · 0.45
endMethod · 0.45
get_typeMethod · 0.45

Tested by

no test coverage detected