forked from Ivasoft/DSView
improve display of dock widget (add scroll bar)
This commit is contained in:
@@ -42,20 +42,22 @@ namespace pv {
|
||||
namespace dock {
|
||||
|
||||
DsoTriggerDock::DsoTriggerDock(QWidget *parent, SigSession &session) :
|
||||
QWidget(parent),
|
||||
QScrollArea(parent),
|
||||
_session(session)
|
||||
{
|
||||
QLabel *position_label = new QLabel(tr("Trigger Position: "), this);
|
||||
position_spinBox = new QSpinBox(this);
|
||||
_widget = new QWidget(this);
|
||||
|
||||
QLabel *position_label = new QLabel(tr("Trigger Position: "), _widget);
|
||||
position_spinBox = new QSpinBox(_widget);
|
||||
position_spinBox->setRange(0, 99);
|
||||
position_spinBox->setButtonSymbols(QAbstractSpinBox::NoButtons);
|
||||
position_slider = new QSlider(Qt::Horizontal, this);
|
||||
position_slider = new QSlider(Qt::Horizontal, _widget);
|
||||
position_slider->setRange(0, 99);
|
||||
connect(position_slider, SIGNAL(valueChanged(int)), position_spinBox, SLOT(setValue(int)));
|
||||
connect(position_spinBox, SIGNAL(valueChanged(int)), position_slider, SLOT(setValue(int)));
|
||||
connect(position_slider, SIGNAL(valueChanged(int)), this, SLOT(pos_changed(int)));
|
||||
connect(position_slider, SIGNAL(valueChanged(int)), _widget, SLOT(pos_changed(int)));
|
||||
|
||||
QLabel *tSource_labe = new QLabel(tr("Trigger Sources: "), this);
|
||||
QLabel *tSource_labe = new QLabel(tr("Trigger Sources: "), _widget);
|
||||
QRadioButton *auto_radioButton = new QRadioButton(tr("Auto"));
|
||||
auto_radioButton->setChecked(true);
|
||||
QRadioButton *ch0_radioButton = new QRadioButton(tr("Channel 0"));
|
||||
@@ -68,15 +70,15 @@ DsoTriggerDock::DsoTriggerDock(QWidget *parent, SigSession &session) :
|
||||
connect(ch0a1_radioButton, SIGNAL(clicked()), this, SLOT(source_changed()));
|
||||
connect(ch0o1_radioButton, SIGNAL(clicked()), this, SLOT(source_changed()));
|
||||
|
||||
QLabel *tType_labe = new QLabel(tr("Trigger Types: "), this);
|
||||
QLabel *tType_labe = new QLabel(tr("Trigger Types: "), _widget);
|
||||
QRadioButton *rising_radioButton = new QRadioButton(tr("Rising Edge"));
|
||||
rising_radioButton->setChecked(true);
|
||||
QRadioButton *falling_radioButton = new QRadioButton(tr("Falling Edge"));
|
||||
connect(rising_radioButton, SIGNAL(clicked()), this, SLOT(type_changed()));
|
||||
connect(falling_radioButton, SIGNAL(clicked()), this, SLOT(type_changed()));
|
||||
|
||||
source_group=new QButtonGroup(this);
|
||||
type_group=new QButtonGroup(this);
|
||||
source_group=new QButtonGroup(_widget);
|
||||
type_group=new QButtonGroup(_widget);
|
||||
|
||||
source_group->addButton(auto_radioButton);
|
||||
source_group->addButton(ch0_radioButton);
|
||||
@@ -94,14 +96,14 @@ DsoTriggerDock::DsoTriggerDock(QWidget *parent, SigSession &session) :
|
||||
type_group->setId(rising_radioButton, DSO_TRIGGER_RISING);
|
||||
type_group->setId(falling_radioButton, DSO_TRIGGER_FALLING);
|
||||
|
||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||
QVBoxLayout *layout = new QVBoxLayout(_widget);
|
||||
QGridLayout *gLayout = new QGridLayout();
|
||||
gLayout->addWidget(position_label, 0, 0);
|
||||
gLayout->addWidget(position_spinBox, 0, 1);
|
||||
gLayout->addWidget(new QLabel(this), 0, 2);
|
||||
gLayout->addWidget(new QLabel(_widget), 0, 2);
|
||||
gLayout->addWidget(position_slider, 1, 0, 1, 3);
|
||||
|
||||
gLayout->addWidget(new QLabel(this), 2, 0);
|
||||
gLayout->addWidget(new QLabel(_widget), 2, 0);
|
||||
gLayout->addWidget(tSource_labe, 3, 0);
|
||||
gLayout->addWidget(auto_radioButton, 4, 0);
|
||||
gLayout->addWidget(ch0_radioButton, 5, 0);
|
||||
@@ -109,7 +111,7 @@ DsoTriggerDock::DsoTriggerDock(QWidget *parent, SigSession &session) :
|
||||
gLayout->addWidget(ch0a1_radioButton, 6, 0);
|
||||
gLayout->addWidget(ch0o1_radioButton, 6, 1);
|
||||
|
||||
gLayout->addWidget(new QLabel(this), 7, 0);
|
||||
gLayout->addWidget(new QLabel(_widget), 7, 0);
|
||||
gLayout->addWidget(tType_labe, 8, 0);
|
||||
gLayout->addWidget(rising_radioButton, 9, 0);
|
||||
gLayout->addWidget(falling_radioButton, 10, 0);
|
||||
@@ -118,7 +120,11 @@ DsoTriggerDock::DsoTriggerDock(QWidget *parent, SigSession &session) :
|
||||
|
||||
layout->addLayout(gLayout);
|
||||
layout->addStretch(1);
|
||||
setLayout(layout);
|
||||
_widget->setLayout(layout);
|
||||
|
||||
this->setWidget(_widget);
|
||||
_widget->setGeometry(0, 0, sizeHint().width(), 500);
|
||||
_widget->setObjectName("dsoTriggerWidget");
|
||||
}
|
||||
|
||||
DsoTriggerDock::~DsoTriggerDock()
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <QSlider>
|
||||
#include <QSpinBox>
|
||||
#include <QButtonGroup>
|
||||
#include <QScrollArea>
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -39,7 +40,7 @@ class SigSession;
|
||||
|
||||
namespace dock {
|
||||
|
||||
class DsoTriggerDock : public QWidget
|
||||
class DsoTriggerDock : public QScrollArea
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -66,6 +67,8 @@ private:
|
||||
private:
|
||||
SigSession &_session;
|
||||
|
||||
QWidget *_widget;
|
||||
|
||||
QSpinBox *position_spinBox;
|
||||
QSlider *position_slider;
|
||||
|
||||
|
||||
@@ -47,92 +47,95 @@ namespace dock {
|
||||
using namespace pv::view;
|
||||
|
||||
MeasureDock::MeasureDock(QWidget *parent, View &view, SigSession &session) :
|
||||
QWidget(parent),
|
||||
QScrollArea(parent),
|
||||
_session(session),
|
||||
_view(view)
|
||||
{
|
||||
|
||||
_mouse_groupBox = new QGroupBox(tr("Mouse measurement"), this);
|
||||
_fen_checkBox = new QCheckBox(tr("Enable floating measurement"), this);
|
||||
_widget = new QWidget(this);
|
||||
//_widget->setSizePolicy();
|
||||
|
||||
_mouse_groupBox = new QGroupBox(tr("Mouse measurement"), _widget);
|
||||
_fen_checkBox = new QCheckBox(tr("Enable floating measurement"), _widget);
|
||||
_fen_checkBox->setChecked(true);
|
||||
_width_label = new QLabel("#####", this);
|
||||
_period_label = new QLabel("#####", this);
|
||||
_freq_label = new QLabel("#####", this);
|
||||
_duty_label = new QLabel("#####", this);
|
||||
_width_label = new QLabel("#####", _widget);
|
||||
_period_label = new QLabel("#####", _widget);
|
||||
_freq_label = new QLabel("#####", _widget);
|
||||
_duty_label = new QLabel("#####", _widget);
|
||||
|
||||
_mouse_layout = new QGridLayout();
|
||||
_mouse_layout->addWidget(_fen_checkBox, 0, 0, 1, 2);
|
||||
_mouse_layout->addWidget(new QLabel(tr("Width: "), this), 1, 0);
|
||||
_mouse_layout->addWidget(new QLabel(tr("Width: "), _widget), 1, 0);
|
||||
_mouse_layout->addWidget(_width_label, 1, 1);
|
||||
_mouse_layout->addWidget(new QLabel(tr("Period: "), this), 2, 0);
|
||||
_mouse_layout->addWidget(new QLabel(tr("Period: "), _widget), 2, 0);
|
||||
_mouse_layout->addWidget(_period_label, 2, 1);
|
||||
_mouse_layout->addWidget(new QLabel(tr("Frequency: "), this), 3, 0);
|
||||
_mouse_layout->addWidget(new QLabel(tr("Frequency: "), _widget), 3, 0);
|
||||
_mouse_layout->addWidget(_freq_label, 3, 1);
|
||||
_mouse_layout->addWidget(new QLabel(tr("Duty Cycle: "), this), 4, 0);
|
||||
_mouse_layout->addWidget(new QLabel(tr("Duty Cycle: "), _widget), 4, 0);
|
||||
_mouse_layout->addWidget(_duty_label, 4, 1);
|
||||
_mouse_layout->addWidget(new QLabel(this), 0, 2);
|
||||
_mouse_layout->addWidget(new QLabel(this), 1, 2);
|
||||
_mouse_layout->addWidget(new QLabel(this), 2, 2);
|
||||
_mouse_layout->addWidget(new QLabel(this), 3, 2);
|
||||
_mouse_layout->addWidget(new QLabel(this), 4, 2);
|
||||
_mouse_layout->addWidget(new QLabel(_widget), 0, 2);
|
||||
_mouse_layout->addWidget(new QLabel(_widget), 1, 2);
|
||||
_mouse_layout->addWidget(new QLabel(_widget), 2, 2);
|
||||
_mouse_layout->addWidget(new QLabel(_widget), 3, 2);
|
||||
_mouse_layout->addWidget(new QLabel(_widget), 4, 2);
|
||||
_mouse_layout->setColumnStretch(2, 1);
|
||||
_mouse_groupBox->setLayout(_mouse_layout);
|
||||
|
||||
|
||||
_cursor_groupBox = new QGroupBox(tr("Cursor measurement"), this);
|
||||
_t1_comboBox = new QComboBox(this);
|
||||
_t2_comboBox = new QComboBox(this);
|
||||
_t3_comboBox = new QComboBox(this);
|
||||
_delta_label_t1t2 = new QLabel("#####", this);
|
||||
_cnt_label_t1t2 = new QLabel("#####", this);
|
||||
_delta_label_t2t3 = new QLabel("#####", this);
|
||||
_cnt_label_t2t3 = new QLabel("#####", this);
|
||||
_delta_label_t1t3 = new QLabel("#####", this);
|
||||
_cnt_label_t1t3 = new QLabel("#####", this);
|
||||
_cursor_groupBox = new QGroupBox(tr("Cursor measurement"), _widget);
|
||||
_t1_comboBox = new QComboBox(_widget);
|
||||
_t2_comboBox = new QComboBox(_widget);
|
||||
_t3_comboBox = new QComboBox(_widget);
|
||||
_delta_label_t1t2 = new QLabel("#####", _widget);
|
||||
_cnt_label_t1t2 = new QLabel("#####", _widget);
|
||||
_delta_label_t2t3 = new QLabel("#####", _widget);
|
||||
_cnt_label_t2t3 = new QLabel("#####", _widget);
|
||||
_delta_label_t1t3 = new QLabel("#####", _widget);
|
||||
_cnt_label_t1t3 = new QLabel("#####", _widget);
|
||||
_t1_last_index = 0;
|
||||
_t2_last_index = 0;
|
||||
_t3_last_index = 0;
|
||||
|
||||
_cursor_layout = new QGridLayout();
|
||||
_cursor_layout->addWidget(new QLabel(tr("T1: "), this), 0, 0);
|
||||
_cursor_layout = new QGridLayout(_widget);
|
||||
_cursor_layout->addWidget(new QLabel(tr("T1: "), _widget), 0, 0);
|
||||
_cursor_layout->addWidget(_t1_comboBox, 0, 1);
|
||||
_cursor_layout->addWidget(new QLabel(tr("T2: "), this), 1, 0);
|
||||
_cursor_layout->addWidget(new QLabel(tr("T2: "), _widget), 1, 0);
|
||||
_cursor_layout->addWidget(_t2_comboBox, 1, 1);
|
||||
_cursor_layout->addWidget(new QLabel(tr("T3: "), this), 2, 0);
|
||||
_cursor_layout->addWidget(new QLabel(tr("T3: "), _widget), 2, 0);
|
||||
_cursor_layout->addWidget(_t3_comboBox, 2, 1);
|
||||
|
||||
_cursor_layout->addWidget(new QLabel(tr("|T2 - T1|: "), this), 3, 0);
|
||||
_cursor_layout->addWidget(new QLabel(tr("|T2 - T1|: "), _widget), 3, 0);
|
||||
_cursor_layout->addWidget(_delta_label_t1t2, 3, 1);
|
||||
_cursor_layout->addWidget(new QLabel(tr("Delta Samples: "), this), 3, 2);
|
||||
_cursor_layout->addWidget(new QLabel(tr("Delta Samples: "), _widget), 3, 2);
|
||||
_cursor_layout->addWidget(_cnt_label_t1t2, 3, 3);
|
||||
|
||||
_cursor_layout->addWidget(new QLabel(tr("|T3 - T2|: "), this), 4, 0);
|
||||
_cursor_layout->addWidget(new QLabel(tr("|T3 - T2|: "), _widget), 4, 0);
|
||||
_cursor_layout->addWidget(_delta_label_t2t3, 4, 1);
|
||||
_cursor_layout->addWidget(new QLabel(tr("Delta Samples: "), this), 4, 2);
|
||||
_cursor_layout->addWidget(new QLabel(tr("Delta Samples: "), _widget), 4, 2);
|
||||
_cursor_layout->addWidget(_cnt_label_t2t3, 4, 3);
|
||||
|
||||
_cursor_layout->addWidget(new QLabel(tr("|T3 - T1|: "), this), 5, 0);
|
||||
_cursor_layout->addWidget(new QLabel(tr("|T3 - T1|: "), _widget), 5, 0);
|
||||
_cursor_layout->addWidget(_delta_label_t1t3, 5, 1);
|
||||
_cursor_layout->addWidget(new QLabel(tr("Delta Samples: "), this), 5, 2);
|
||||
_cursor_layout->addWidget(new QLabel(tr("Delta Samples: "), _widget), 5, 2);
|
||||
_cursor_layout->addWidget(_cnt_label_t1t3, 5, 3);
|
||||
|
||||
_cursor_layout->addWidget(new QLabel(tr("Cursors"), this), 6, 0);
|
||||
_cursor_layout->addWidget(new QLabel(tr("Time/Samples"), this), 6, 1);
|
||||
_cursor_layout->addWidget(new QLabel(tr("Cursors"), _widget), 6, 0);
|
||||
_cursor_layout->addWidget(new QLabel(tr("Time/Samples"), _widget), 6, 1);
|
||||
|
||||
_cursor_layout->addWidget(new QLabel(this), 0, 4);
|
||||
_cursor_layout->addWidget(new QLabel(this), 1, 4);
|
||||
_cursor_layout->addWidget(new QLabel(this), 2, 4);
|
||||
_cursor_layout->addWidget(new QLabel(this), 3, 4);
|
||||
_cursor_layout->addWidget(new QLabel(this), 4, 4);
|
||||
_cursor_layout->addWidget(new QLabel(_widget), 0, 4);
|
||||
_cursor_layout->addWidget(new QLabel(_widget), 1, 4);
|
||||
_cursor_layout->addWidget(new QLabel(_widget), 2, 4);
|
||||
_cursor_layout->addWidget(new QLabel(_widget), 3, 4);
|
||||
_cursor_layout->addWidget(new QLabel(_widget), 4, 4);
|
||||
|
||||
_cursor_layout->setColumnStretch(4, 1);
|
||||
_cursor_groupBox->setLayout(_cursor_layout);
|
||||
|
||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||
QVBoxLayout *layout = new QVBoxLayout(_widget);
|
||||
layout->addWidget(_mouse_groupBox);
|
||||
layout->addWidget(_cursor_groupBox);
|
||||
layout->addStretch(1);
|
||||
setLayout(layout);
|
||||
_widget->setLayout(layout);
|
||||
|
||||
connect(_t1_comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(delta_update()));
|
||||
connect(_t2_comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(delta_update()));
|
||||
@@ -140,6 +143,10 @@ MeasureDock::MeasureDock(QWidget *parent, View &view, SigSession &session) :
|
||||
|
||||
connect(_fen_checkBox, SIGNAL(stateChanged(int)), &_view, SLOT(set_measure_en(int)));
|
||||
connect(_view.get_viewport(), SIGNAL(mouse_measure()), this, SLOT(mouse_measure()));
|
||||
|
||||
this->setWidget(_widget);
|
||||
_widget->setGeometry(0, 0, sizeHint().width(), 2000);
|
||||
_widget->setObjectName("measureWidget");
|
||||
}
|
||||
|
||||
MeasureDock::~MeasureDock()
|
||||
@@ -190,10 +197,10 @@ void MeasureDock::cursor_update()
|
||||
_t2_comboBox->addItem(curCursor);
|
||||
_t3_comboBox->addItem(curCursor);
|
||||
|
||||
QPushButton *_cursor_pushButton = new QPushButton(curCursor, this);
|
||||
QPushButton *_cursor_pushButton = new QPushButton(curCursor, _widget);
|
||||
QString _cur_text = _view.get_cm_time(index - 1) + "/" + QString::number(_view.get_cursor_samples(index - 1));
|
||||
QLabel *_curpos_label = new QLabel(_cur_text, this);
|
||||
QLabel *_space_label = new QLabel(this);
|
||||
QLabel *_curpos_label = new QLabel(_cur_text, _widget);
|
||||
QLabel *_space_label = new QLabel(_widget);
|
||||
_cursor_pushButton_list.push_back(_cursor_pushButton);
|
||||
_curpos_label_list.push_back(_curpos_label);
|
||||
_space_label_list.push_back(_space_label);
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include <QGridLayout>
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QScrollArea>
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -55,7 +56,7 @@ namespace view {
|
||||
|
||||
namespace dock {
|
||||
|
||||
class MeasureDock : public QWidget
|
||||
class MeasureDock : public QScrollArea
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -80,6 +81,7 @@ private:
|
||||
SigSession &_session;
|
||||
view::View &_view;
|
||||
|
||||
QWidget *_widget;
|
||||
QGridLayout *_mouse_layout;
|
||||
QGroupBox *_mouse_groupBox;
|
||||
QCheckBox *_fen_checkBox;
|
||||
|
||||
@@ -38,21 +38,23 @@ namespace pv {
|
||||
namespace dock {
|
||||
|
||||
ProtocolDock::ProtocolDock(QWidget *parent, SigSession &session) :
|
||||
QWidget(parent),
|
||||
QScrollArea(parent),
|
||||
_session(session)
|
||||
{
|
||||
_widget = new QWidget(this);
|
||||
|
||||
QHBoxLayout *hori_layout = new QHBoxLayout();
|
||||
|
||||
_add_button = new QPushButton(this);
|
||||
_add_button = new QPushButton(_widget);
|
||||
_add_button->setFlat(true);
|
||||
_add_button->setIcon(QIcon::fromTheme("protocol",
|
||||
QIcon(":/icons/add.png")));
|
||||
_del_all_button = new QPushButton(this);
|
||||
_del_all_button = new QPushButton(_widget);
|
||||
_del_all_button->setFlat(true);
|
||||
_del_all_button->setIcon(QIcon::fromTheme("protocol",
|
||||
QIcon(":/icons/del.png")));
|
||||
_del_all_button->setCheckable(true);
|
||||
_protocol_combobox = new QComboBox(this);
|
||||
_protocol_combobox = new QComboBox(_widget);
|
||||
|
||||
GSList *l = g_slist_sort(g_slist_copy(
|
||||
(GSList*)srd_decoder_list()), decoder_name_cmp);
|
||||
@@ -82,7 +84,11 @@ ProtocolDock::ProtocolDock(QWidget *parent, SigSession &session) :
|
||||
_layout->addLayout(hori_layout);
|
||||
_layout->addStretch(1);
|
||||
|
||||
setLayout(_layout);
|
||||
_widget->setLayout(_layout);
|
||||
|
||||
this->setWidget(_widget);
|
||||
_widget->setGeometry(0, 0, sizeHint().width(), 500);
|
||||
_widget->setObjectName("protocolWidget");
|
||||
}
|
||||
|
||||
ProtocolDock::~ProtocolDock()
|
||||
@@ -120,15 +126,15 @@ void ProtocolDock::add_protocol()
|
||||
//QMap <QString, QVariant>& _options = dlg.get_options();
|
||||
//QMap <QString, int> _options_index = dlg.get_options_index();
|
||||
|
||||
QPushButton *_del_button = new QPushButton(this);
|
||||
QPushButton *_set_button = new QPushButton(this);
|
||||
QPushButton *_del_button = new QPushButton(_widget);
|
||||
QPushButton *_set_button = new QPushButton(_widget);
|
||||
_del_button->setFlat(true);
|
||||
_del_button->setIcon(QIcon::fromTheme("protocol",
|
||||
QIcon(":/icons/del.png")));
|
||||
_set_button->setFlat(true);
|
||||
_set_button->setIcon(QIcon::fromTheme("protocol",
|
||||
QIcon(":/icons/gear.png")));
|
||||
QLabel *_protocol_label = new QLabel(this);
|
||||
QLabel *_protocol_label = new QLabel(_widget);
|
||||
|
||||
_del_button->setCheckable(true);
|
||||
_protocol_label->setText(_protocol_combobox->currentText());
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <QVector>
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QScrollArea>
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -44,7 +45,7 @@ class SigSession;
|
||||
|
||||
namespace dock {
|
||||
|
||||
class ProtocolDock : public QWidget
|
||||
class ProtocolDock : public QScrollArea
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -69,6 +70,8 @@ private:
|
||||
private:
|
||||
SigSession &_session;
|
||||
|
||||
QWidget *_widget;
|
||||
|
||||
QPushButton *_add_button;
|
||||
QPushButton *_del_all_button;
|
||||
QComboBox *_protocol_combobox;
|
||||
|
||||
@@ -38,84 +38,87 @@ namespace pv {
|
||||
namespace dock {
|
||||
|
||||
TriggerDock::TriggerDock(QWidget *parent, SigSession &session) :
|
||||
QWidget(parent),
|
||||
QScrollArea(parent),
|
||||
_session(session)
|
||||
{
|
||||
int i;
|
||||
|
||||
_widget = new QWidget(this);
|
||||
|
||||
QFont font("Monaco");
|
||||
font.setStyleHint(QFont::Monospace);
|
||||
font.setFixedPitch(true);
|
||||
|
||||
simple_radioButton = new QRadioButton(tr("Simple Trigger"), this);
|
||||
simple_radioButton = new QRadioButton(tr("Simple Trigger"), _widget);
|
||||
simple_radioButton->setChecked(true);
|
||||
adv_radioButton = new QRadioButton(tr("Advanced Trigger"), this);
|
||||
adv_radioButton = new QRadioButton(tr("Advanced Trigger"), _widget);
|
||||
|
||||
position_label = new QLabel(tr("Trigger Position: "), this);
|
||||
position_spinBox = new QSpinBox(this);
|
||||
position_label = new QLabel(tr("Trigger Position: "), _widget);
|
||||
position_spinBox = new QSpinBox(_widget);
|
||||
position_spinBox->setRange(0, 99);
|
||||
position_spinBox->setButtonSymbols(QAbstractSpinBox::NoButtons);
|
||||
position_slider = new QSlider(Qt::Horizontal, this);
|
||||
position_slider = new QSlider(Qt::Horizontal, _widget);
|
||||
position_slider->setRange(0, 99);
|
||||
connect(position_slider, SIGNAL(valueChanged(int)), position_spinBox, SLOT(setValue(int)));
|
||||
connect(position_spinBox, SIGNAL(valueChanged(int)), position_slider, SLOT(setValue(int)));
|
||||
|
||||
stages_label = new QLabel(tr("Total Trigger Stages: "), this);
|
||||
stages_label = new QLabel(tr("Total Trigger Stages: "), _widget);
|
||||
stages_label->setDisabled(true);
|
||||
stages_comboBox = new QComboBox(this);
|
||||
stages_comboBox = new QComboBox(_widget);
|
||||
for (i = 1; i <= TriggerStages; i++)
|
||||
stages_comboBox->addItem(QString::number(i));
|
||||
//stages_comboBox->setCurrentIndex(stages_comboBox->count() - 1);
|
||||
stages_comboBox->setDisabled(true);
|
||||
|
||||
stage_tabWidget = new QTabWidget(this);
|
||||
stage_tabWidget = new QTabWidget(_widget);
|
||||
stage_tabWidget->setTabPosition(QTabWidget::East);
|
||||
//stage_tabWidget->setDisabled(true);
|
||||
stage_tabWidget->setUsesScrollButtons(false);
|
||||
|
||||
QRegExp value_rx("[10XRFCxrfc ]+");
|
||||
QValidator *value_validator = new QRegExpValidator(value_rx, this);
|
||||
QValidator *value_validator = new QRegExpValidator(value_rx, _widget);
|
||||
for (i = 0; i < TriggerStages; i++) {
|
||||
QComboBox *_logic_comboBox = new QComboBox(this);
|
||||
QComboBox *_logic_comboBox = new QComboBox(_widget);
|
||||
_logic_comboBox->addItem(tr("Or"));
|
||||
_logic_comboBox->addItem(tr("And"));
|
||||
_logic_comboBox->setCurrentIndex(1);
|
||||
_logic_comboBox_list.push_back(_logic_comboBox);
|
||||
|
||||
QLineEdit *_value0_lineEdit = new QLineEdit("X X X X X X X X X X X X X X X X", this);
|
||||
QLineEdit *_value0_lineEdit = new QLineEdit("X X X X X X X X X X X X X X X X", _widget);
|
||||
_value0_lineEdit->setFont(font);
|
||||
_value0_lineEdit->setValidator(value_validator);
|
||||
_value0_lineEdit->setMaxLength(TriggerProbes * 2 - 1);
|
||||
_value0_lineEdit->setInputMask("X X X X X X X X X X X X X X X X");
|
||||
_value0_lineEdit->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
||||
_value0_lineEdit_list.push_back(_value0_lineEdit);
|
||||
QSpinBox *_count0_spinBox = new QSpinBox(this);
|
||||
QSpinBox *_count0_spinBox = new QSpinBox(_widget);
|
||||
_count0_spinBox->setRange(1, INT32_MAX);
|
||||
_count0_spinBox->setButtonSymbols(QAbstractSpinBox::NoButtons);
|
||||
_count0_spinBox_list.push_back(_count0_spinBox);
|
||||
QComboBox *_inv0_comboBox = new QComboBox(this);
|
||||
QComboBox *_inv0_comboBox = new QComboBox(_widget);
|
||||
_inv0_comboBox->addItem(tr("=="));
|
||||
_inv0_comboBox->addItem(tr("!="));
|
||||
_inv0_comboBox_list.push_back(_inv0_comboBox);
|
||||
|
||||
QLineEdit *_value1_lineEdit = new QLineEdit("X X X X X X X X X X X X X X X X", this);
|
||||
QLineEdit *_value1_lineEdit = new QLineEdit("X X X X X X X X X X X X X X X X", _widget);
|
||||
_value1_lineEdit->setFont(font);
|
||||
_value1_lineEdit->setValidator(value_validator);
|
||||
_value1_lineEdit->setMaxLength(TriggerProbes * 2 - 1);
|
||||
_value1_lineEdit->setInputMask("X X X X X X X X X X X X X X X X");
|
||||
_value1_lineEdit->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
||||
_value1_lineEdit_list.push_back(_value1_lineEdit);
|
||||
QSpinBox *_count1_spinBox = new QSpinBox(this);
|
||||
QSpinBox *_count1_spinBox = new QSpinBox(_widget);
|
||||
_count1_spinBox->setRange(1, INT32_MAX);
|
||||
_count1_spinBox->setButtonSymbols(QAbstractSpinBox::NoButtons);
|
||||
_count1_spinBox_list.push_back(_count1_spinBox);
|
||||
QComboBox *_inv1_comboBox = new QComboBox(this);
|
||||
QComboBox *_inv1_comboBox = new QComboBox(_widget);
|
||||
_inv1_comboBox->addItem(tr("=="));
|
||||
_inv1_comboBox->addItem(tr("!="));
|
||||
_inv1_comboBox_list.push_back(_inv1_comboBox);
|
||||
|
||||
QLabel *value_exp_label = new QLabel("1 1 1 1 1 1\n5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0", this);
|
||||
QLabel *inv_exp_label = new QLabel("Inv", this);
|
||||
QLabel *count_exp_label = new QLabel("Counter", this);
|
||||
QLabel *value_exp_label = new QLabel("1 1 1 1 1 1\n5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0", _widget);
|
||||
QLabel *inv_exp_label = new QLabel("Inv", _widget);
|
||||
QLabel *count_exp_label = new QLabel("Counter", _widget);
|
||||
value_exp_label->setFont(font);
|
||||
|
||||
QVBoxLayout *stage_layout = new QVBoxLayout();
|
||||
@@ -135,7 +138,7 @@ TriggerDock::TriggerDock(QWidget *parent, SigSession &session) :
|
||||
stage_layout->addWidget(new QLabel(tr("X: Don't care\n0: Low level\n1: High level\nR: Rising edge\nF: Falling edge\nC: Rising/Falling edge")));
|
||||
stage_layout->addStretch(1);
|
||||
|
||||
QGroupBox *_stage_groupBox = new QGroupBox(tr("Stage")+QString::number(i), this);
|
||||
QGroupBox *_stage_groupBox = new QGroupBox(tr("Stage")+QString::number(i), _widget);
|
||||
_stage_groupBox->setFlat(true);
|
||||
_stage_groupBox->setLayout(stage_layout);
|
||||
_stage_groupBox_list.push_back(_stage_groupBox);
|
||||
@@ -151,44 +154,44 @@ TriggerDock::TriggerDock(QWidget *parent, SigSession &session) :
|
||||
connect(_count1_spinBox, SIGNAL(editingFinished()), this, SLOT(count_changed()));
|
||||
}
|
||||
|
||||
_serial_start_label = new QLabel(tr("Start Flag: "), this);
|
||||
_serial_start_lineEdit = new QLineEdit("X X X X X X X X X X X X X X X X", this);
|
||||
_serial_start_label = new QLabel(tr("Start Flag: "), _widget);
|
||||
_serial_start_lineEdit = new QLineEdit("X X X X X X X X X X X X X X X X", _widget);
|
||||
_serial_start_lineEdit->setFont(font);
|
||||
_serial_start_lineEdit->setValidator(value_validator);
|
||||
_serial_start_lineEdit->setMaxLength(TriggerProbes * 2 - 1);
|
||||
_serial_start_lineEdit->setInputMask("X X X X X X X X X X X X X X X X");
|
||||
_serial_start_lineEdit->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
||||
|
||||
_serial_stop_label = new QLabel(tr("Stop Flag: "), this);
|
||||
_serial_stop_lineEdit = new QLineEdit("X X X X X X X X X X X X X X X X", this);
|
||||
_serial_stop_label = new QLabel(tr("Stop Flag: "), _widget);
|
||||
_serial_stop_lineEdit = new QLineEdit("X X X X X X X X X X X X X X X X", _widget);
|
||||
_serial_stop_lineEdit->setFont(font);
|
||||
_serial_stop_lineEdit->setValidator(value_validator);
|
||||
_serial_stop_lineEdit->setMaxLength(TriggerProbes * 2 - 1);
|
||||
_serial_stop_lineEdit->setInputMask("X X X X X X X X X X X X X X X X");
|
||||
_serial_stop_lineEdit->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
||||
|
||||
_serial_edge_label = new QLabel(tr("Clock Flag: "), this);
|
||||
_serial_edge_lineEdit = new QLineEdit("X X X X X X X X X X X X X X X X", this);
|
||||
_serial_edge_label = new QLabel(tr("Clock Flag: "), _widget);
|
||||
_serial_edge_lineEdit = new QLineEdit("X X X X X X X X X X X X X X X X", _widget);
|
||||
_serial_edge_lineEdit->setFont(font);
|
||||
_serial_edge_lineEdit->setValidator(value_validator);
|
||||
_serial_edge_lineEdit->setMaxLength(TriggerProbes * 2 - 1);
|
||||
_serial_edge_lineEdit->setInputMask("X X X X X X X X X X X X X X X X");
|
||||
_serial_edge_lineEdit->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
||||
|
||||
_serial_data_lable = new QLabel(tr("Data Channel: "), this);
|
||||
_serial_data_comboBox = new QComboBox(this);
|
||||
_serial_data_lable = new QLabel(tr("Data Channel: "), _widget);
|
||||
_serial_data_comboBox = new QComboBox(_widget);
|
||||
for(i = 0; i < TriggerProbes; i++)
|
||||
_serial_data_comboBox->addItem(QString::number(i));
|
||||
|
||||
_serial_value_lable = new QLabel(tr("Data Value: "), this);
|
||||
_serial_value_lineEdit = new QLineEdit("X X X X X X X X X X X X X X X X", this);
|
||||
_serial_value_lable = new QLabel(tr("Data Value: "), _widget);
|
||||
_serial_value_lineEdit = new QLineEdit("X X X X X X X X X X X X X X X X", _widget);
|
||||
_serial_value_lineEdit->setFont(font);
|
||||
_serial_value_lineEdit->setValidator(value_validator);
|
||||
_serial_value_lineEdit->setMaxLength(TriggerProbes * 2 - 1);
|
||||
_serial_value_lineEdit->setInputMask("X X X X X X X X X X X X X X X X");
|
||||
_serial_value_lineEdit->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
||||
|
||||
QLabel *serial_value_exp_label = new QLabel("1 1 1 1 1 1\n5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0", this);
|
||||
QLabel *serial_value_exp_label = new QLabel("1 1 1 1 1 1\n5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0", _widget);
|
||||
serial_value_exp_label->setFont(font);
|
||||
|
||||
QVBoxLayout *serial_layout = new QVBoxLayout();
|
||||
@@ -196,7 +199,7 @@ TriggerDock::TriggerDock(QWidget *parent, SigSession &session) :
|
||||
serial_glayout->addWidget(serial_value_exp_label, 1, 1, 1, 4);
|
||||
serial_glayout->addWidget(_serial_start_label, 2, 0);
|
||||
serial_glayout->addWidget(_serial_start_lineEdit, 2, 1, 1, 4);
|
||||
serial_glayout->addWidget(new QLabel(this), 2, 2);
|
||||
serial_glayout->addWidget(new QLabel(_widget), 2, 2);
|
||||
serial_glayout->addWidget(_serial_stop_label, 3, 0);
|
||||
serial_glayout->addWidget(_serial_stop_lineEdit, 3, 1, 1, 4);
|
||||
serial_glayout->addWidget(_serial_edge_label, 4, 0);
|
||||
@@ -210,7 +213,7 @@ TriggerDock::TriggerDock(QWidget *parent, SigSession &session) :
|
||||
serial_layout->addWidget(new QLabel(tr("X: Don't care\n0: Low level\n1: High level\nR: Rising edge\nF: Falling edge\nC: Rising/Falling edge")));
|
||||
serial_layout->addStretch(1);
|
||||
|
||||
_serial_groupBox = new QGroupBox(tr("Serial Trigger"), this);
|
||||
_serial_groupBox = new QGroupBox(tr("Serial Trigger"), _widget);
|
||||
_serial_groupBox->setFlat(true);
|
||||
_serial_groupBox->setLayout(serial_layout);
|
||||
//_serial_groupBox->setDisabled(true);
|
||||
@@ -222,7 +225,7 @@ TriggerDock::TriggerDock(QWidget *parent, SigSession &session) :
|
||||
connect(_serial_value_lineEdit, SIGNAL(editingFinished()), this, SLOT(value_changed()));
|
||||
|
||||
|
||||
_adv_tabWidget = new QTabWidget(this);
|
||||
_adv_tabWidget = new QTabWidget(_widget);
|
||||
_adv_tabWidget->setTabPosition(QTabWidget::North);
|
||||
_adv_tabWidget->setDisabled(true);
|
||||
_adv_tabWidget->addTab((QWidget *)stage_tabWidget, tr("Stage Trigger"));
|
||||
@@ -234,23 +237,27 @@ TriggerDock::TriggerDock(QWidget *parent, SigSession &session) :
|
||||
connect(position_slider, SIGNAL(valueChanged(int)), this, SLOT(pos_changed(int)));
|
||||
connect(_adv_tabWidget, SIGNAL(currentChanged(int)), this, SLOT(adv_tog(int)));
|
||||
|
||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||
QVBoxLayout *layout = new QVBoxLayout(_widget);
|
||||
QGridLayout *gLayout = new QGridLayout();
|
||||
gLayout->addWidget(simple_radioButton, 0, 0);
|
||||
gLayout->addWidget(adv_radioButton, 1, 0);
|
||||
gLayout->addWidget(position_label, 2, 0);
|
||||
gLayout->addWidget(position_spinBox, 2, 1);
|
||||
gLayout->addWidget(new QLabel(this), 2, 2);
|
||||
gLayout->addWidget(new QLabel(_widget), 2, 2);
|
||||
gLayout->addWidget(position_slider, 3, 0, 1, 3);
|
||||
gLayout->addWidget(stages_label, 4, 0);
|
||||
gLayout->addWidget(stages_comboBox, 4, 1);
|
||||
gLayout->addWidget(new QLabel(this), 4, 2);
|
||||
gLayout->addWidget(new QLabel(_widget), 4, 2);
|
||||
gLayout->setColumnStretch(2, 1);
|
||||
|
||||
layout->addLayout(gLayout);
|
||||
layout->addWidget(_adv_tabWidget);
|
||||
layout->addStretch(1);
|
||||
setLayout(layout);
|
||||
_widget->setLayout(layout);
|
||||
|
||||
this->setWidget(_widget);
|
||||
_widget->setGeometry(0, 0, sizeHint().width(), 1000);
|
||||
_widget->setObjectName("triggerWidget");
|
||||
}
|
||||
|
||||
TriggerDock::~TriggerDock()
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include <QVector>
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QScrollArea>
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -50,7 +51,7 @@ class SigSession;
|
||||
|
||||
namespace dock {
|
||||
|
||||
class TriggerDock : public QWidget
|
||||
class TriggerDock : public QScrollArea
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -90,6 +91,8 @@ private:
|
||||
private:
|
||||
SigSession &_session;
|
||||
|
||||
QWidget *_widget;
|
||||
|
||||
QRadioButton *simple_radioButton;
|
||||
QRadioButton *adv_radioButton;
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ void MainWindow::setup_ui()
|
||||
#ifdef ENABLE_DECODE
|
||||
// protocol dock
|
||||
_protocol_dock=new QDockWidget(tr("Protocol"),this);
|
||||
_protocol_dock->setFeatures(QDockWidget::NoDockWidgetFeatures);
|
||||
_protocol_dock->setFeatures(QDockWidget::DockWidgetMovable);
|
||||
_protocol_dock->setAllowedAreas(Qt::RightDockWidgetArea);
|
||||
_protocol_dock->setVisible(false);
|
||||
//dock::ProtocolDock *_protocol_widget = new dock::ProtocolDock(_protocol_dock, _session);
|
||||
@@ -164,14 +164,14 @@ void MainWindow::setup_ui()
|
||||
#endif
|
||||
// trigger dock
|
||||
_trigger_dock=new QDockWidget(tr("Trigger Setting..."),this);
|
||||
_trigger_dock->setFeatures(QDockWidget::NoDockWidgetFeatures);
|
||||
_trigger_dock->setFeatures(QDockWidget::DockWidgetMovable);
|
||||
_trigger_dock->setAllowedAreas(Qt::RightDockWidgetArea);
|
||||
_trigger_dock->setVisible(false);
|
||||
_trigger_widget = new dock::TriggerDock(_trigger_dock, _session);
|
||||
_trigger_dock->setWidget(_trigger_widget);
|
||||
|
||||
_dso_trigger_dock=new QDockWidget(tr("Trigger Setting..."),this);
|
||||
_dso_trigger_dock->setFeatures(QDockWidget::NoDockWidgetFeatures);
|
||||
_dso_trigger_dock->setFeatures(QDockWidget::DockWidgetMovable);
|
||||
_dso_trigger_dock->setAllowedAreas(Qt::RightDockWidgetArea);
|
||||
_dso_trigger_dock->setVisible(false);
|
||||
_dso_trigger_widget = new dock::DsoTriggerDock(_dso_trigger_dock, _session);
|
||||
@@ -203,7 +203,7 @@ void MainWindow::setup_ui()
|
||||
// Setup the dockWidget
|
||||
// measure dock
|
||||
_measure_dock=new QDockWidget(tr("Measurement"),this);
|
||||
_measure_dock->setFeatures(QDockWidget::NoDockWidgetFeatures);
|
||||
_measure_dock->setFeatures(QDockWidget::DockWidgetMovable);
|
||||
_measure_dock->setAllowedAreas(Qt::RightDockWidgetArea);
|
||||
_measure_dock->setVisible(false);
|
||||
dock::MeasureDock *_measure_widget = new dock::MeasureDock(_measure_dock, *_view, _session);
|
||||
|
||||
@@ -59,7 +59,7 @@ FileBar::FileBar(SigSession &session, QWidget *parent) :
|
||||
_action_store->setText(QApplication::translate(
|
||||
"File", "S&tore Session...", 0));
|
||||
_action_store->setIcon(QIcon::fromTheme("file",
|
||||
QIcon(":/icons/open.png")));
|
||||
QIcon(":/icons/save.png")));
|
||||
_action_store->setObjectName(QString::fromUtf8("actionStore"));
|
||||
_file_button.addAction(_action_store);
|
||||
connect(_action_store, SIGNAL(triggered()), this, SLOT(on_actionStore_triggered()));
|
||||
|
||||
@@ -985,15 +985,15 @@ void DsoSignal::paint_type_options(QPainter &p, int right, bool hover, int actio
|
||||
p.setPen(Qt::white);
|
||||
p.setBrush((enabled() && (factor == 100)) ? ((hover && action == X100) ? _colour.darker() : _colour) : ((hover && action == X100) ? _colour.darker() : dsDisable));
|
||||
p.drawRect(x100_rect);
|
||||
p.drawText(x100_rect, Qt::AlignLeft | Qt::AlignVCenter, "x100");
|
||||
p.drawText(x100_rect, Qt::AlignCenter | Qt::AlignVCenter, "x100");
|
||||
|
||||
p.setBrush((enabled() && (factor == 10)) ? ((hover && action == X10) ? _colour.darker() : _colour) : ((hover && action == X10) ? _colour.darker() : dsDisable));
|
||||
p.drawRect(x10_rect);
|
||||
p.drawText(x10_rect, Qt::AlignLeft | Qt::AlignVCenter, "x10");
|
||||
p.drawText(x10_rect, Qt::AlignCenter | Qt::AlignVCenter, "x10");
|
||||
|
||||
p.setBrush((enabled() && (factor == 1)) ? ((hover && action == X1) ? _colour.darker() : _colour) : ((hover && action == X1) ? _colour.darker() : dsDisable));
|
||||
p.drawRect(x1_rect);
|
||||
p.drawText(x1_rect, Qt::AlignLeft | Qt::AlignVCenter, "x1");
|
||||
p.drawText(x1_rect, Qt::AlignCenter | Qt::AlignVCenter, "x1");
|
||||
}
|
||||
|
||||
void DsoSignal::paint_measure(QPainter &p)
|
||||
|
||||
@@ -126,7 +126,7 @@ QDockWidget {
|
||||
border: 0px;
|
||||
padding: 0px;
|
||||
color: rgb(17, 133, 209, 255);
|
||||
font-size: 16px;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
@@ -145,13 +145,23 @@ QDockWidget > QWidget{
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
QScrollArea #measureWidget,
|
||||
QScrollArea #dsoTriggerWidget,
|
||||
QScrollArea #triggerWidget,
|
||||
QScrollArea #protocolWidget{
|
||||
margin: 0px;
|
||||
background-color: rgb(17, 133, 209, 255);
|
||||
border: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
QGroupBox {
|
||||
margin: 0px;
|
||||
background-color: rgb(17, 133, 209, 255);
|
||||
border: 0px;
|
||||
padding: 40px, 10px, 10px, 10px;
|
||||
color: white;
|
||||
font-size: 20px;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
@@ -166,14 +176,14 @@ QGroupBox:disabled
|
||||
color: rgb(200, 200, 200, 255);
|
||||
}
|
||||
|
||||
QDockWidget > QWidget > QTabWidget::pane{
|
||||
#triggerWidget > QTabWidget::pane{
|
||||
margin: 0px;
|
||||
background-color: rgb(17, 133, 209, 255);
|
||||
border: 1px solid rgb(255, 255, 255);
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
QDockWidget > QWidget > QTabWidget::pane:disabled{
|
||||
#triggerWidget > QTabWidget::pane:disabled{
|
||||
border: 1px solid rgb(200, 200, 200, 255);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user