| 42 | namespace dialogs { |
| 43 | |
| 44 | LissajousOptions::LissajousOptions(SigSession *session, QWidget *parent) : |
| 45 | DSDialog(parent), |
| 46 | _session(session), |
| 47 | _button_box(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, |
| 48 | Qt::Horizontal, this) |
| 49 | { |
| 50 | _enable = NULL; |
| 51 | _x_group = NULL; |
| 52 | _y_group = NULL; |
| 53 | _percent = NULL; |
| 54 | _layout = NULL; |
| 55 | |
| 56 | setMinimumSize(300, 300); |
| 57 | |
| 58 | _enable = new QCheckBox(this); |
| 59 | |
| 60 | QLabel *lisa_label = new QLabel(this); |
| 61 | lisa_label->setPixmap(QPixmap(":/icons/lissajous.svg")); |
| 62 | |
| 63 | _percent = new QSlider(Qt::Horizontal, this); |
| 64 | _percent->setRange(100, 100); |
| 65 | _percent->setEnabled(false); |
| 66 | if (_session->cur_samplelimits() > WellLen) { |
| 67 | int min = ceil(WellLen*100.0/_session->cur_samplelimits()); |
| 68 | _percent->setEnabled(true); |
| 69 | _percent->setRange(min, 100); |
| 70 | _percent->setValue(min); |
| 71 | } |
| 72 | |
| 73 | _x_group = new QGroupBox(this); |
| 74 | _y_group = new QGroupBox(this); |
| 75 | QHBoxLayout *xlayout = new QHBoxLayout(); |
| 76 | QHBoxLayout *ylayout = new QHBoxLayout(); |
| 77 | |
| 78 | xlayout->setContentsMargins(5, 15, 5, 5); |
| 79 | ylayout->setContentsMargins(5, 15, 5, 5); |
| 80 | |
| 81 | for(auto s : _session->get_signals()) { |
| 82 | if (s->signal_type() == SR_CHANNEL_DSO) { |
| 83 | view::DsoSignal *dsoSig = (view::DsoSignal*)s; |
| 84 | QString index_str = QString::number(dsoSig->get_index()); |
| 85 | QRadioButton *xradio = new QRadioButton(index_str, _x_group); |
| 86 | xradio->setProperty("index", dsoSig->get_index()); |
| 87 | xlayout->addWidget(xradio); |
| 88 | QRadioButton *yradio = new QRadioButton(index_str, _y_group); |
| 89 | yradio->setProperty("index", dsoSig->get_index()); |
| 90 | ylayout->addWidget(yradio); |
| 91 | _x_radio.append(xradio); |
| 92 | _y_radio.append(yradio); |
| 93 | } |
| 94 | } |
| 95 | _x_group->setLayout(xlayout); |
| 96 | _y_group->setLayout(ylayout); |
| 97 | |
| 98 | |
| 99 | auto lissajous = _session->get_lissajous_trace(); |
| 100 | if (lissajous) { |
| 101 | _enable->setChecked(lissajous->enabled()); |
nothing calls this directly
no test coverage detected