2
0
forked from Ivasoft/DSView
Files
DSView/DSView/pv/dock/triggerdock.h
2021-11-23 13:35:08 +08:00

159 lines
3.9 KiB
C++
Executable File

/*
* This file is part of the DSView project.
* DSView is based on PulseView.
*
* Copyright (C) 2013 DreamSourceLab <support@dreamsourcelab.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef DSVIEW_PV_TRIGGERDOCK_H
#define DSVIEW_PV_TRIGGERDOCK_H
#include <QDockWidget>
#include <QPushButton>
#include <QLabel>
#include <QRadioButton>
#include <QSlider>
#include <QLineEdit>
#include <QSpinBox>
#include <QGroupBox>
#include <QCheckBox>
#include <QTableWidget>
#include <QJsonObject>
#include <QVector>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QScrollArea>
#include <vector>
#include "../ui/dscombobox.h"
namespace pv {
class SigSession;
namespace dock {
class TriggerDock : public QScrollArea
{
Q_OBJECT
private:
static const int MinTrigPosition;
public:
TriggerDock(QWidget *parent, SigSession *session);
~TriggerDock();
void paintEvent(QPaintEvent *);
void init();
QJsonObject get_session();
void set_session(QJsonObject ses);
/*
* commit trigger setting
* return 0: simple trigger
* 1: advanced trigger
*/
bool commit_trigger();
private:
void changeEvent(QEvent *event);
void retranslateUi();
void reStyle();
void setup_adv_tab();
void lineEdit_highlight(QLineEdit *dst);
signals:
public slots:
void simple_trigger();
void adv_trigger();
void widget_enable(int index);
void value_changed();
void device_updated();
private:
private:
SigSession *_session;
int _cur_ch_num;
QWidget *_widget;
QRadioButton *_simple_radioButton;
QRadioButton *_adv_radioButton;
QLabel *_position_label;
QSpinBox *_position_spinBox;
QSlider *_position_slider;
QLabel *_stages_label;
DsComboBox *stages_comboBox;
QTabWidget *_stage_tabWidget;
QVector <QGroupBox *> _stage_groupBox_list;
QVector <QLabel *> _mu_label_list;
QVector <DsComboBox *> _logic_comboBox_list;
QVector <QLineEdit *> _value0_lineEdit_list;
QVector <QLineEdit *> _value0_ext32_lineEdit_list;
QVector <QSpinBox *> _count_spinBox_list;
QVector <DsComboBox *> _inv0_comboBox_list;
QVector <QLineEdit *> _value1_lineEdit_list;
QVector <QLineEdit *> _value1_ext32_lineEdit_list;
QVector <DsComboBox *> _inv1_comboBox_list;
QVector <QCheckBox *> _contiguous_checkbox_list;
QTabWidget *_adv_tabWidget;
QGroupBox *_serial_groupBox;
QLabel *_serial_start_label;
QLineEdit *_serial_start_lineEdit;
QLineEdit *_serial_start_ext32_lineEdit;
QLabel *_serial_stop_label;
QLineEdit *_serial_stop_lineEdit;
QLineEdit *_serial_stop_ext32_lineEdit;
QLabel *_serial_edge_label;
QLineEdit *_serial_edge_lineEdit;
QLineEdit *_serial_edge_ext32_lineEdit;
QLabel *_serial_data_label;
DsComboBox *_serial_data_comboBox;
QLabel *_serial_value_label;
QLineEdit *_serial_value_lineEdit;
DsComboBox *_serial_bits_comboBox;
QLabel *_serial_note_label;
QLabel *_data_bits_label;
QVector <QLabel *> _inv_exp_label_list;
QVector <QLabel *> _count_exp_label_list;
QVector <QLabel *> _contiguous_label_list;
QVector <QLabel *> _stage_note_label_list;
};
} // namespace dock
} // namespace pv
#endif // DSVIEW_PV_TRIGGERDOCK_H