first commit
This commit is contained in:
78
widgets/dualchannelwidget.h
Normal file
78
widgets/dualchannelwidget.h
Normal file
@@ -0,0 +1,78 @@
|
||||
#ifndef DUALCHANNELWIDGET_H
|
||||
#define DUALCHANNELWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QPushButton>
|
||||
#include <QLabel>
|
||||
#include <QComboBox>
|
||||
#include <QDoubleSpinBox>
|
||||
#include <QGroupBox>
|
||||
#include <QCheckBox>
|
||||
|
||||
/**
|
||||
* @brief 双通道页面
|
||||
*
|
||||
* 功能说明:
|
||||
* - 同时输出2路信号
|
||||
* - 同时采集2路信号
|
||||
*/
|
||||
class DualChannelWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DualChannelWidget(QWidget *parent = nullptr);
|
||||
~DualChannelWidget() = default;
|
||||
|
||||
signals:
|
||||
void backRequested();
|
||||
|
||||
private slots:
|
||||
void onChannel1OutputChanged();
|
||||
void onChannel2OutputChanged();
|
||||
void onSyncToggled(bool checked);
|
||||
void onStartOutput();
|
||||
void onStopOutput();
|
||||
void updateMeasurement();
|
||||
|
||||
private:
|
||||
void setupUI();
|
||||
QWidget *createTitleBar();
|
||||
QWidget *createChannel1Panel();
|
||||
QWidget *createChannel2Panel();
|
||||
QWidget *createMeasurementPanel();
|
||||
QWidget *createControlPanel();
|
||||
|
||||
// 标题栏
|
||||
QPushButton *m_backBtn;
|
||||
QLabel *m_titleLabel;
|
||||
|
||||
// 通道1控制
|
||||
QComboBox *m_ch1TypeCombo;
|
||||
QDoubleSpinBox *m_ch1ValueSpin;
|
||||
QLabel *m_ch1MeasureLabel;
|
||||
QCheckBox *m_ch1EnableCheck;
|
||||
|
||||
// 通道2控制
|
||||
QComboBox *m_ch2TypeCombo;
|
||||
QDoubleSpinBox *m_ch2ValueSpin;
|
||||
QLabel *m_ch2MeasureLabel;
|
||||
QCheckBox *m_ch2EnableCheck;
|
||||
|
||||
// 同步控制
|
||||
QCheckBox *m_syncCheck;
|
||||
|
||||
// 控制按钮
|
||||
QPushButton *m_startBtn;
|
||||
QPushButton *m_stopBtn;
|
||||
|
||||
// 测量显示
|
||||
QLabel *m_ch1InputLabel;
|
||||
QLabel *m_ch2InputLabel;
|
||||
|
||||
// 状态
|
||||
bool m_isOutputting;
|
||||
QTimer *m_measureTimer;
|
||||
};
|
||||
|
||||
#endif // DUALCHANNELWIDGET_H
|
||||
Reference in New Issue
Block a user