初步重构
This commit is contained in:
@@ -18,15 +18,15 @@ static double max = 160;
|
||||
QWidget* IntermediateFrequencyWidget::createSpectrogramPowerPlot() {
|
||||
class SpectrumPlot : public YSG::Plot {
|
||||
public:
|
||||
YSG::FrequentAxis *xAxis{};
|
||||
YSG::Frequent_Axis *xAxis{};
|
||||
YSG::Axis *yAxis{};
|
||||
YSG::MutiSelectRect* msr{};
|
||||
YSG::Muti_Select_Rect* msr{};
|
||||
YSG::Spectrum *sp{};
|
||||
QMenu *mMenu{};
|
||||
void init() override {
|
||||
Plot::init();
|
||||
mObjectName = "SpectrumPlot";
|
||||
xAxis = YSG::FrequentAxis::Builder(this, Qt::Horizontal)
|
||||
object_name = "SpectrumPlot";
|
||||
xAxis = YSG::Frequent_Axis::Builder(this, Qt::Horizontal)
|
||||
.set_tick_length(-10)
|
||||
.set_coord_range(frequent_range)
|
||||
.set_tick_length(-10)
|
||||
@@ -46,7 +46,7 @@ QWidget* IntermediateFrequencyWidget::createSpectrogramPowerPlot() {
|
||||
.set_frequent_point_size(1024)
|
||||
.build();
|
||||
|
||||
msr = YSG::MutiSelectRect::Builder(xAxis, yAxis).build();
|
||||
msr = YSG::Muti_Select_Rect::Builder(xAxis, yAxis).build();
|
||||
}
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent* event) override {
|
||||
@@ -83,15 +83,15 @@ QWidget* IntermediateFrequencyWidget::createSpectrogramPowerPlot() {
|
||||
QWidget* IntermediateFrequencyWidget::create_Afterglow_Plot(){
|
||||
class AfterglowPlot : public YSG::Plot {
|
||||
public:
|
||||
YSG::FrequentAxis *xAxis{};
|
||||
YSG::Frequent_Axis *xAxis{};
|
||||
YSG::Axis *yAxis{};
|
||||
YSG::Afterglow *ag{};
|
||||
YSG::MutiSelectRect* msr{};
|
||||
YSG::Muti_Select_Rect* msr{};
|
||||
QMenu *mMenu{};
|
||||
void init() override {
|
||||
Plot::init();
|
||||
mObjectName = "AfterglowPlot";
|
||||
xAxis = YSG::FrequentAxis::Builder(this, Qt::Horizontal)
|
||||
object_name = "AfterglowPlot";
|
||||
xAxis = YSG::Frequent_Axis::Builder(this, Qt::Horizontal)
|
||||
.set_coord_range(frequent_range)
|
||||
.set_tick_length(-10)
|
||||
.set_sub_tick_length(-5)
|
||||
@@ -113,7 +113,7 @@ QWidget* IntermediateFrequencyWidget::create_Afterglow_Plot(){
|
||||
.build();
|
||||
|
||||
|
||||
msr = YSG::MutiSelectRect::Builder(xAxis, yAxis).build();
|
||||
msr = YSG::Muti_Select_Rect::Builder(xAxis, yAxis).build();
|
||||
}
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent* event) override {
|
||||
|
||||
@@ -17,7 +17,7 @@ class QVBoxLayout;
|
||||
class TopMenuBar;
|
||||
class ServerSettingWidget;
|
||||
class FileExplorer;
|
||||
class MainWidget : public QWidget, public YSG::SingletonWidget<MainWidget> {
|
||||
class MainWidget : public QWidget, public YSG::Singleton_Widget<MainWidget> {
|
||||
public:
|
||||
explicit MainWidget(QWidget *parent = nullptr);
|
||||
QVBoxLayout *mMainLayout;
|
||||
|
||||
@@ -16,17 +16,17 @@ static YSG::Range frequent_range = {-12000, 12000};
|
||||
QWidget* RadioWidget::createSpectrogramPowerPlot() {
|
||||
class SpectrumPlot : public YSG::Plot {
|
||||
public:
|
||||
YSG::FrequentAxis *xAxis{};
|
||||
YSG::Frequent_Axis *xAxis{};
|
||||
YSG::Axis *yAxis{};
|
||||
YSG::MutiSelectRect* msr{};
|
||||
YSG::Muti_Select_Rect* msr{};
|
||||
YSG::Spectrum *sp{};
|
||||
QMenu *mMenu{};
|
||||
void init() override {
|
||||
Plot::init();
|
||||
mObjectName = "SpectrumPlot";
|
||||
object_name = "SpectrumPlot";
|
||||
|
||||
|
||||
xAxis = YSG::FrequentAxis::Builder(this, Qt::Horizontal)
|
||||
xAxis = YSG::Frequent_Axis::Builder(this, Qt::Horizontal)
|
||||
.set_coord_range(frequent_range)
|
||||
.set_tick_length(-10)
|
||||
.build();
|
||||
@@ -41,7 +41,7 @@ QWidget* RadioWidget::createSpectrogramPowerPlot() {
|
||||
.set_frequent_range(frequent_range)
|
||||
.set_frequent_point_size(1024)
|
||||
.build();
|
||||
msr = YSG::MutiSelectRect::Builder(xAxis, yAxis).build();
|
||||
msr = YSG::Muti_Select_Rect::Builder(xAxis, yAxis).build();
|
||||
if(use_Performance_shower) set_use_performance_shower(true);
|
||||
}
|
||||
protected:
|
||||
@@ -80,29 +80,29 @@ QWidget* RadioWidget::createSpectrogramPowerPlot() {
|
||||
QWidget* RadioWidget::createWaterFallPlot() {
|
||||
class WaterFallPlot : public YSG::Plot {
|
||||
public:
|
||||
YSG::FrequentAxis *xAxis{};
|
||||
YSG::TimeAxis *yAxis{};
|
||||
YSG::MutiSelectRect *msr{};
|
||||
YSG::WaterFall *wf{};
|
||||
YSG::Frequent_Axis *xAxis{};
|
||||
YSG::Time_Axis *yAxis{};
|
||||
YSG::Muti_Select_Rect *msr{};
|
||||
YSG::Waterfall *wf{};
|
||||
QMenu *mMenu{};
|
||||
void init() override {
|
||||
Plot::init();
|
||||
mObjectName = "WaterFallPlot";
|
||||
xAxis = YSG::FrequentAxis::Builder(this, Qt::Horizontal)
|
||||
object_name = "WaterFallPlot";
|
||||
xAxis = YSG::Frequent_Axis::Builder(this, Qt::Horizontal)
|
||||
.set_tick_length(-10)
|
||||
.set_sub_tick_length(-5)
|
||||
.set_coord_range(frequent_range)
|
||||
.build();
|
||||
yAxis = YSG::TimeAxis::Builder(this, Qt::Vertical)
|
||||
yAxis = YSG::Time_Axis::Builder(this, Qt::Vertical)
|
||||
.set_time_point_size(100)
|
||||
.build();
|
||||
wf = YSG::WaterFall::Builder(xAxis, yAxis)
|
||||
wf = YSG::Waterfall::Builder(xAxis, yAxis)
|
||||
.set_frequent_range(frequent_range)
|
||||
.set_frequent_point_size(1024)
|
||||
.set_power_range({0, max})
|
||||
// .set_time_point_size(100)
|
||||
.build();
|
||||
msr = YSG::MutiSelectRect::Builder(xAxis, yAxis).build();
|
||||
msr = YSG::Muti_Select_Rect::Builder(xAxis, yAxis).build();
|
||||
if(use_Performance_shower) set_use_performance_shower(true);
|
||||
}
|
||||
protected:
|
||||
@@ -136,17 +136,17 @@ QWidget* RadioWidget::createWaterFallPlot() {
|
||||
QWidget* RadioWidget::createAudioSpectrogramPlot() {
|
||||
class SpectrumPlot : public YSG::Plot {
|
||||
public:
|
||||
YSG::FrequentAxis *xAxis{};
|
||||
YSG::Frequent_Axis *xAxis{};
|
||||
YSG::Axis *yAxis{};
|
||||
YSG::MutiSelectRect* msr{};
|
||||
YSG::Muti_Select_Rect* msr{};
|
||||
YSG::Spectrum *sp{};
|
||||
QMenu *mMenu{};
|
||||
void init() override {
|
||||
Plot::init();
|
||||
mObjectName = "SpectrumPlot";
|
||||
object_name = "SpectrumPlot";
|
||||
|
||||
|
||||
xAxis = YSG::FrequentAxis::Builder(this, Qt::Horizontal)
|
||||
xAxis = YSG::Frequent_Axis::Builder(this, Qt::Horizontal)
|
||||
.set_coord_range({-12000 ,12000})
|
||||
.set_tick_length(-10)
|
||||
.set_sub_tick_length(-5)
|
||||
@@ -163,7 +163,7 @@ QWidget* RadioWidget::createAudioSpectrogramPlot() {
|
||||
.set_frequent_point_size(512)
|
||||
.build();
|
||||
|
||||
msr = YSG::MutiSelectRect::Builder(xAxis, yAxis).build();
|
||||
msr = YSG::Muti_Select_Rect::Builder(xAxis, yAxis).build();
|
||||
|
||||
if(use_Performance_shower) set_use_performance_shower(true);
|
||||
}
|
||||
@@ -199,16 +199,16 @@ QWidget* RadioWidget::createAudioSpectrogramPlot() {
|
||||
QWidget* RadioWidget::createTimePowerPlot() {
|
||||
class AudioPlot : public YSG::Plot {
|
||||
public:
|
||||
YSG::TimeAxis *xAxis{};
|
||||
YSG::Time_Axis *xAxis{};
|
||||
YSG::Axis *yAxis{};
|
||||
YSG::AudioFrequent *audio{};
|
||||
YSG::MutiSelectRect* msr{};
|
||||
YSG::Audio_Frequent *audio{};
|
||||
YSG::Muti_Select_Rect* msr{};
|
||||
QMenu *mMenu{};
|
||||
void init() override {
|
||||
Plot::init();
|
||||
mObjectName = "AudioPlot";
|
||||
object_name = "AudioPlot";
|
||||
|
||||
xAxis = YSG::TimeAxis::Builder(this, Qt::Horizontal)
|
||||
xAxis = YSG::Time_Axis::Builder(this, Qt::Horizontal)
|
||||
.set_tick_length(-10)
|
||||
.set_sub_tick_length(-5)
|
||||
.build();
|
||||
@@ -218,9 +218,9 @@ QWidget* RadioWidget::createTimePowerPlot() {
|
||||
.build();
|
||||
|
||||
|
||||
audio = YSG::AudioFrequent::Builder(xAxis, yAxis)
|
||||
audio = YSG::Audio_Frequent::Builder(xAxis, yAxis)
|
||||
.build();
|
||||
msr = YSG::MutiSelectRect::Builder(xAxis, yAxis).build();
|
||||
msr = YSG::Muti_Select_Rect::Builder(xAxis, yAxis).build();
|
||||
|
||||
|
||||
if(use_Performance_shower) set_use_performance_shower(true);
|
||||
|
||||
@@ -27,8 +27,8 @@ public:
|
||||
QWidget* createWaterFallPlot();
|
||||
YSG::Spectrum *mSpectrogramLine{};
|
||||
YSG::Spectrum* mAudioSpectrogramPlot{};
|
||||
YSG::AudioFrequent *mTimePower{};
|
||||
YSG::WaterFall *mWaterFall{};
|
||||
YSG::Audio_Frequent *mTimePower{};
|
||||
YSG::Waterfall *mWaterFall{};
|
||||
protected:
|
||||
void focusInEvent(QFocusEvent *event) override;
|
||||
void keyPressEvent(QKeyEvent *event) override;
|
||||
|
||||
@@ -16,12 +16,12 @@ QWidget* SweepFrequencyWidget::createSpectrogramPowerPlot() {
|
||||
public:
|
||||
YSG::Axis *xAxis{};
|
||||
YSG::Axis *yAxis{};
|
||||
YSG::MutiSelectRect *msr{};
|
||||
YSG::SweepFrequent* sf{};
|
||||
YSG::Muti_Select_Rect *msr{};
|
||||
YSG::Sweep_Frequent* sf{};
|
||||
QMenu *mMenu{};
|
||||
void init() override {
|
||||
Plot::init();
|
||||
mObjectName = "AxisTestPlot";
|
||||
object_name = "AxisTestPlot";
|
||||
|
||||
|
||||
xAxis = YSG::Axis::Builder(this, Qt::Horizontal)
|
||||
@@ -33,14 +33,14 @@ QWidget* SweepFrequencyWidget::createSpectrogramPowerPlot() {
|
||||
.set_tick_length(-10).build();
|
||||
|
||||
|
||||
sf = YSG::SweepFrequent::Builder(xAxis, yAxis)
|
||||
sf = YSG::Sweep_Frequent::Builder(xAxis, yAxis)
|
||||
.set_block_num(200)
|
||||
.set_block_frequent_point_size(20)
|
||||
.set_frequent_range({0 , 100})
|
||||
.build();
|
||||
|
||||
|
||||
msr = YSG::MutiSelectRect::Builder(xAxis, yAxis).build();
|
||||
msr = YSG::Muti_Select_Rect::Builder(xAxis, yAxis).build();
|
||||
}
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent* event) override {
|
||||
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
FrequentShower *mSelectValueWidget;
|
||||
ProgressBar *mProgressBar1, *mProgressBar2;
|
||||
void initMenu();
|
||||
YSG::SweepFrequent *mSweepFrequencyLine{};
|
||||
YSG::Sweep_Frequent *mSweepFrequencyLine{};
|
||||
QWidget* createSpectrogramPowerPlot();
|
||||
protected:
|
||||
void focusInEvent(QFocusEvent *event) override;
|
||||
|
||||
@@ -100,14 +100,14 @@ QPushButton *createButton(const QString& text, int fontSize, const std::functio
|
||||
}
|
||||
|
||||
QPushButton *createClickButton(const QString &text, int fontSize, const std::function<void(void)> &mFunc,
|
||||
YSG::RollObject<QPushButton> *rollObject) {
|
||||
YSG::Roll_Object<QPushButton> *rollObject) {
|
||||
auto button = new QPushButton;
|
||||
initClickButton(button, text, fontSize, mFunc, rollObject);
|
||||
return button;
|
||||
}
|
||||
|
||||
void initClickButton(QPushButton* button, const QString &text, int fontSize, const std::function<void(void)> &mFunc,
|
||||
YSG::RollObject<QPushButton> *rollObject){
|
||||
YSG::Roll_Object<QPushButton> *rollObject){
|
||||
button->setText(text);
|
||||
button->setFocusPolicy(Qt::NoFocus);
|
||||
button->setFlat(true);
|
||||
|
||||
@@ -34,13 +34,13 @@ QPushButton* createButton(const QString& text, int fontSize, const std::function
|
||||
|
||||
namespace YSG{
|
||||
template <typename T>
|
||||
class RollObject;
|
||||
class Roll_Object;
|
||||
}
|
||||
|
||||
class BaseWidgetMenu;
|
||||
|
||||
void initClickButton(QPushButton* button, const QString &text, int fontSize, const std::function<void(void)> &mFunc, YSG::RollObject<QPushButton>*);
|
||||
QPushButton *createClickButton(const QString &text, int fontSize, const std::function<void(void)> &mFunc, YSG::RollObject<QPushButton>*);
|
||||
void initClickButton(QPushButton* button, const QString &text, int fontSize, const std::function<void(void)> &mFunc, YSG::Roll_Object<QPushButton>*);
|
||||
QPushButton *createClickButton(const QString &text, int fontSize, const std::function<void(void)> &mFunc, YSG::Roll_Object<QPushButton>*);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ ExpandInput::ExpandInput(QWidget *parent) : QLineEdit(parent) {
|
||||
setMinimumSize(0, 0);
|
||||
setFrame(false);
|
||||
mFont.setBold(true);
|
||||
YSG::VirtualKeyBoard::instance()->setEdit(this);
|
||||
YSG::Virtual_Keyboard::instance()->set_edit(this);
|
||||
}
|
||||
|
||||
void ExpandInput::paintEvent(QPaintEvent *event) {
|
||||
|
||||
@@ -19,7 +19,7 @@ TopMenuBar::TopMenuBar(QWidget *parent) : QWidget(parent) {
|
||||
mSPL = createButton("SPL", fontSize);
|
||||
mFIL1 = createButton("FIL1", fontSize);
|
||||
mAGC_A = createButton("AGC_A", fontSize);
|
||||
mTextButtonList = new YSG::RollObject<QPushButton>({mAM, mATU, mVSQL, mNB, mNR, mDNF, mPRE, mATT, mSPL, mFIL1, mAGC_A}, [](QPushButton* cur){
|
||||
mTextButtonList = new YSG::Roll_Object<QPushButton>({mAM, mATU, mVSQL, mNB, mNR, mDNF, mPRE, mATT, mSPL, mFIL1, mAGC_A}, [](QPushButton* cur){
|
||||
|
||||
}, [](QPushButton* btn){
|
||||
|
||||
|
||||
@@ -7,12 +7,12 @@ class TopButton;
|
||||
class ShowTime;
|
||||
class Wifi;
|
||||
class QPushButton;
|
||||
class TopMenuBar : public QWidget, public YSG::SingletonWidget<TopMenuBar> {
|
||||
class TopMenuBar : public QWidget, public YSG::Singleton_Widget<TopMenuBar> {
|
||||
public:
|
||||
explicit TopMenuBar(QWidget *parent = nullptr);
|
||||
QPushButton *mAM, *mATU, *mVSQL, *mNB, *mNR, *mDNF, *mPRE, *mATT, *mSPL, *mFIL1, *mAGC_A;
|
||||
Wifi* mWifi;
|
||||
YSG::RollObject<QPushButton> *mTextButtonList;
|
||||
YSG::Roll_Object<QPushButton> *mTextButtonList;
|
||||
int index = 0;
|
||||
ShowTime *mShowTime;
|
||||
protected:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef BaseWidgetMenu_H
|
||||
#define BaseWidgetMenu_H
|
||||
#include "YSGraphic_Core/base/Node.hpp"
|
||||
#include "YSGraphic_Core/base/RollObject.h"
|
||||
#include "YSGraphic_Core/base/Roll_Object.h"
|
||||
#include "YSGraphic_Core/export.h"
|
||||
|
||||
#include <QMap>
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
QHBoxLayout *mFirstLayout;
|
||||
QHBoxLayout *mSecondLayout;
|
||||
AbstractMenuButton *parentBtn{};
|
||||
YSG::RollObject<AbstractMenuButton> mRollObject;
|
||||
YSG::Roll_Object<AbstractMenuButton> mRollObject;
|
||||
BaseWidgetMenu* createSubWidgetMenu(AbstractMenuButton * btn);
|
||||
void esc(BaseWidgetMenu* menu);
|
||||
void confirm();
|
||||
|
||||
@@ -12,7 +12,7 @@ public:
|
||||
QLabel *mRigNameLabel, *mUserNameLabel, *mPasswordLabel, *mCtrlPortLabel, *mCivPortLabel, *mAudioPortLabel;
|
||||
ExpandInput *mRigNameEdit, *mUserNameEdit, *mPasswordEdit, *mCtrlPortEdit, *mCivPortEdit, *mAudioPortEdit;
|
||||
ShowHelpInfo* mShowHelpInfo;
|
||||
YSG::RollObject<QPushButton> mRollObject;
|
||||
YSG::Roll_Object<QPushButton> mRollObject;
|
||||
QPushButton *mStartButton, *mDefaultButton, *mClearButton, *mSaveButton, *mExitButton;
|
||||
static QLabel* createLabel(const QString& text);
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user