82 lines
1.6 KiB
C++
82 lines
1.6 KiB
C++
#ifndef SIGNALTRIMWIDGET_H
|
|
#define SIGNALTRIMWIDGET_H
|
|
|
|
#include <QWidget>
|
|
#include <QPushButton>
|
|
#include <QLabel>
|
|
#include <QComboBox>
|
|
#include <QDoubleSpinBox>
|
|
#include <QSlider>
|
|
#include <QGroupBox>
|
|
|
|
/**
|
|
* @brief 信号微调页面
|
|
*
|
|
* 功能说明:
|
|
* - 输出值任意位数微调
|
|
* - 精确调节信号输出
|
|
*/
|
|
class SignalTrimWidget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit SignalTrimWidget(QWidget *parent = nullptr);
|
|
~SignalTrimWidget() = default;
|
|
|
|
signals:
|
|
void backRequested();
|
|
|
|
private slots:
|
|
void onSignalTypeChanged(int index);
|
|
void onCoarseValueChanged(double value);
|
|
void onFineValueChanged(double value);
|
|
void onSliderChanged(int value);
|
|
void onIncrementClicked();
|
|
void onDecrementClicked();
|
|
void onApplyOutput();
|
|
void onResetValue();
|
|
|
|
private:
|
|
void setupUI();
|
|
QWidget *createTitleBar();
|
|
QWidget *createSignalSelectPanel();
|
|
QWidget *createCoarseAdjustPanel();
|
|
QWidget *createFineAdjustPanel();
|
|
QWidget *createOutputPanel();
|
|
void updateTotalValue();
|
|
void updateSliderRange();
|
|
|
|
// 标题栏
|
|
QPushButton *m_backBtn;
|
|
QLabel *m_titleLabel;
|
|
|
|
// 信号选择
|
|
QComboBox *m_signalTypeCombo;
|
|
QComboBox *m_unitCombo;
|
|
|
|
// 粗调
|
|
QDoubleSpinBox *m_coarseValueSpin;
|
|
QLabel *m_coarseUnitLabel;
|
|
|
|
// 微调
|
|
QDoubleSpinBox *m_fineValueSpin;
|
|
QSlider *m_fineSlider;
|
|
QPushButton *m_incrementBtn;
|
|
QPushButton *m_decrementBtn;
|
|
QComboBox *m_stepSizeCombo;
|
|
|
|
// 输出显示
|
|
QLabel *m_totalValueLabel;
|
|
QPushButton *m_applyBtn;
|
|
QPushButton *m_resetBtn;
|
|
|
|
// 当前值
|
|
double m_currentValue;
|
|
double m_minValue;
|
|
double m_maxValue;
|
|
int m_decimals;
|
|
};
|
|
|
|
#endif // SIGNALTRIMWIDGET_H
|