LibreVNA/Software/PC_Application/CustomWidgets/tilewidget.h

72 lines
1.7 KiB
C
Raw Normal View History

#ifndef TILEWIDGET_H
#define TILEWIDGET_H
#include <QWidget>
#include "Traces/traceplot.h"
#include "Traces/tracemodel.h"
2020-12-05 06:49:52 +08:00
#include "savable.h"
2021-10-21 19:00:34 +08:00
#include <QSplitter>
namespace Ui {
class TileWidget;
}
2020-12-05 06:49:52 +08:00
class TileWidget : public QWidget, public Savable
{
Q_OBJECT
public:
explicit TileWidget(TraceModel &model, QWidget *parent = nullptr);
~TileWidget();
2022-07-09 19:39:31 +08:00
TileWidget *Child1() { return child1; }
TileWidget *Child2() { return child2; }
2020-12-05 06:49:52 +08:00
// closes all plots/childs, leaving only the tilewidget at the top
void clear();
virtual nlohmann::json toJSON() override;
virtual void fromJSON(nlohmann::json j) override;
2022-04-22 19:46:46 +08:00
// check potential trace limits on graphs, only returns true if all traces in all graphs are within limits
bool allLimitsPassing();
2022-07-09 19:39:31 +08:00
public slots:
2022-07-09 19:39:31 +08:00
void splitVertically(bool moveContentToSecondChild = false);
void splitHorizontally(bool moveContentToSecondChild = false);
void closeTile();
void setPlot(TracePlot *plot);
private slots:
void on_bSmithchart_clicked();
void on_bXYplot_clicked();
void on_plotDoubleClicked();
2022-07-09 19:39:31 +08:00
void plotDeleted();
2022-03-15 23:59:52 +08:00
void on_bWaterfall_clicked();
void on_bPolarchart_clicked();
2022-03-15 23:59:52 +08:00
private:
TileWidget(TraceModel &model, TileWidget &parent);
2022-07-09 19:39:31 +08:00
void split(bool moveContentToSecondChild = false);
void setContent(TracePlot *plot);
2022-07-09 19:39:31 +08:00
void removeContent();
void setChild();
TileWidget* findRootTile();
void setFullScreen();
void tryMinimize();
TracePlot *fullScreenPlot;
Ui::TileWidget *ui;
QSplitter *splitter;
bool isSplit;
TileWidget *parent;
TileWidget *child1, *child2;
bool hasContent;
bool isFullScreen;
TracePlot *content;
TraceModel &model;
};
#endif // TILEWIDGET_H