Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions qml/circle.qml

This file was deleted.

1 change: 1 addition & 0 deletions src/Plotting/Backend/CoreQChart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace VSCL::Plot {
PlotQChart::PlotQChart(QWidget* parent) : QChartView(parent) {
SetWidgetRep(this);

// These heap allocs are parented when they get added to each other
PlotChart = new QChart;

LogTimeAxisQt = new QLogValueAxis;
Expand Down
2 changes: 1 addition & 1 deletion src/Plotting/Container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace VSCL::Plot {

PlotContainer::PlotContainer(QWidget* parent, EmbeddablePlot2D* newPlot)
: QWidget(parent) {
QHBoxLayout* boxlay = new QHBoxLayout;
QHBoxLayout* boxlay = new QHBoxLayout(this);
boxlay->setContentsMargins(5, 5, 5, 5);
setLayout(boxlay);

Expand Down
3 changes: 2 additions & 1 deletion src/Widgets/Dial/Attitude.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

namespace VSCL {

AttitudeDial::AttitudeDial(QWidget* parent) : QWidget(parent) {
AttitudeDial::AttitudeDial(QWidget* parent)
: QWidget(parent) {
SetRangeType(RangeTypeMode);
update();
} // AttitudeDial ctor
Expand Down Expand Up @@ -130,7 +131,7 @@
AttitudeDialPalette AttitudeDial::GetPalette() const { return Palette; }
const AttitudeDialPalette& AttitudeDial::GetPaletteView() const { return Palette; }

void AttitudeDial::paintEvent(QPaintEvent* event) {

Check warning on line 134 in src/Widgets/Dial/Attitude.cpp

View workflow job for this annotation

GitHub Actions / Windows

'event': unreferenced parameter
UpdateRadius();
UpdateOrigin();

Expand Down
46 changes: 21 additions & 25 deletions src/Widgets/Dial/Composite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,41 @@

namespace VSCL {

CompositeDial::CompositeDial(QWidget* parent) : QWidget(parent) {
// Widget setup goes top -> bottom level

// Top-level
MajorOrganizer = new QGridLayout(this);
this->setLayout(MajorOrganizer);
CompositeDial::CompositeDial(QWidget* parent)
: QWidget(parent)
, MajorOrganizer(new QGridLayout(this))
, DialNameLabel(new QLabel(this))
, DialRateDuo(new QWidget(this))
, DuoOrganizer(new QGridLayout(DialRateDuo))
, Dial(new AttitudeDial(DialRateDuo))
, NumericRateLabel(new RateLabel(DialRateDuo)) {

// Setup top-level layout
this->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);

DialNameLabel = new QLabel(this);
DialRateDuo = new QWidget(this);

this->setLayout(MajorOrganizer);
MajorOrganizer->setAlignment(Qt::AlignHCenter);
MajorOrganizer->setAlignment(DialNameLabel, Qt::AlignHCenter | Qt::AlignTop);
MajorOrganizer->addWidget(DialNameLabel, 0, 0, 1, 1);
MajorOrganizer->addWidget(DialRateDuo, 1, 0, 5, 1);

MajorOrganizer->setAlignment(Qt::AlignHCenter);
MajorOrganizer->setAlignment(DialNameLabel, Qt::AlignHCenter | Qt::AlignTop);
// Set dial-rate combo layout
DialRateDuo->setLayout(DuoOrganizer);
DuoOrganizer->addWidget(Dial, 0, 0);
DuoOrganizer->addWidget(NumericRateLabel, 0, 0);
DuoOrganizer->setAlignment(NumericRateLabel, Qt::AlignHCenter | Qt::AlignVCenter);

// Title this
DialNameLabel->setText("Dial");
DialNameLabel->setScaledContents(true);
DialNameLabel->setFont(DialNameFont);
DialNameLabel->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
DialNameLabel->setAlignment(Qt::AlignHCenter | Qt::AlignTop);


// Bottom-level
DuoOrganizer = new QGridLayout(DialRateDuo);
DialRateDuo->setLayout(DuoOrganizer);

Dial = new AttitudeDial(DialRateDuo);
NumericRateLabel = new RateLabel(DialRateDuo);

DuoOrganizer->addWidget(Dial, 0, 0);
DuoOrganizer->addWidget(NumericRateLabel, 0, 0);

// Set how the dial-rate combo resizes
QSizePolicy expandPolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
DuoOrganizer->setAlignment(NumericRateLabel, Qt::AlignHCenter | Qt::AlignVCenter);
DialRateDuo->setSizePolicy(expandPolicy);
Dial->setSizePolicy(expandPolicy);
}
} // CompositeDial(QWidget* parent)

CompositeDial::CompositeDial(const QString& title, QWidget* parent)
: CompositeDial(parent) {
Expand Down
2 changes: 1 addition & 1 deletion src/Widgets/Dial/Composite.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class CompositeDial : public QWidget {
QFont DialNameFont{ };
Util::FontAdjustment TitleAdjustment{ 16, false };

QGridLayout* DuoOrganizer;
QWidget* DialRateDuo;
QGridLayout* DuoOrganizer;
AttitudeDial* Dial;
RateLabel* NumericRateLabel;

Expand Down
5 changes: 3 additions & 2 deletions src/Widgets/Displays/QuantitiesRatesDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@

namespace VSCL {

QtyRateDisplay::QtyRateDisplay(const QString& title, QWidget* parent) : QGroupBox(title, parent) {
Organizer = new QVBoxLayout;
QtyRateDisplay::QtyRateDisplay(const QString& title, QWidget* parent)
: QGroupBox(title, parent)
, Organizer(new QVBoxLayout(this)) {
Organizer->setContentsMargins(10, 10, 10, 10);
setLayout(Organizer);
};
Expand Down
20 changes: 10 additions & 10 deletions src/Widgets/Displays/QuantitiesRatesRow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
#include "QuantitiesRatesDisplay.hpp"

namespace VSCL {
QtyRateRow::QtyRateRow(const QString& title, QtyRateDisplay* parent) : QGroupBox(title, parent) {
QtyRateRow::QtyRateRow(const QString& title, QtyRateDisplay* parent)
: QGroupBox(title, parent)
, Title(title)
, Organizer(new QHBoxLayout(this))
, QuantityLabel(new QLabel(this))
, RateLabel(new QLabel(this)) {

parent->AddRow(this);
Title = title;
setLayout(Organizer);

Organizer = new QHBoxLayout;
Organizer->setContentsMargins(5, 5, 5, 5);
setLayout(Organizer);
Organizer->addWidget(QuantityLabel);
Organizer->addWidget(RateLabel);

QuantityLabel = new QLabel(this);
QuantityLabel->setText(QString::number(Quantity) + QuantityUnits);
Organizer->addWidget(QuantityLabel);
RateLabel = new QLabel(this);
RateLabel->setText(QString::number(Rate) + RateUnits);
Organizer->addWidget(RateLabel);

TitleFont = QFont();
LabelFont = QFont();
AdjustFontSize();
}

Expand Down
7 changes: 4 additions & 3 deletions src/Widgets/Displays/QuantitiesRatesRow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class QtyRateRow : public QGroupBox {
void SetRateUnits(const QString& units);

private:
QHBoxLayout* Organizer;

double Quantity = 0.0;
double Rate = 0.0;
Expand All @@ -32,8 +31,10 @@ class QtyRateRow : public QGroupBox {
QString RateUnits = tr("/s");

QString Title;
QFont TitleFont;
QFont LabelFont;
QFont TitleFont{ };
QFont LabelFont{ };

QHBoxLayout* Organizer;
QLabel* QuantityLabel;
QLabel* RateLabel;

Expand Down
4 changes: 3 additions & 1 deletion src/Widgets/Displays/RateLabel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
#include "Util/FiniteDiff.hpp"

namespace VSCL {
RateLabel::RateLabel(QWidget* parent) : QLabel(parent) {
RateLabel::RateLabel(QWidget* parent)
: QLabel(parent) {

SetTextFrom(0.0);
setFrameStyle(QFrame::StyledPanel | QFrame::Plain);
setStyleSheet("background-color: white;"
Expand Down
20 changes: 11 additions & 9 deletions src/Windowing/DevWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,22 @@
#include "Dial/Attitude.hpp"

namespace VSCL {
DevWindow::DevWindow() {
Stacker = new QStackedWidget;
setCentralWidget(Stacker);

QLayout* layout = Stacker->layout();
layout->setContentsMargins(5, 5, 5, 5);

MainQuick = new QQuickWidget;
Stacker->addWidget(MainQuick);
DevWindow::DevWindow()
: QMainWindow()
, Stacker(new QStackedWidget(this))
, MainQuick(new QQuickWidget(this))
{

AttitudeDial* dial = new AttitudeDial(this);
NumericDisplaysTest = new NumericTestWidget(this, dial, [dial](int newValue) { dial->SetDialAngle(newValue); });

setCentralWidget(Stacker);
Stacker->addWidget(MainQuick);
Stacker->addWidget(NumericDisplaysTest);

QLayout* layout = Stacker->layout();
layout->setContentsMargins(5, 5, 5, 5);

CreateActions();
CreateMenus();

Expand Down
15 changes: 7 additions & 8 deletions src/Windowing/NumericTestWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,26 @@ namespace VSCL {

NumericTestWidget::NumericTestWidget(
QWidget* parent, QWidget* whatToTest,
std::function<void(int)> method) : QWidget(parent) {
std::function<void(int)> method)
: QWidget(parent)
, TesterSpinbox(new QDoubleSpinBox(this))
, WidgetBeingTested(whatToTest) {

setParent(parent);

QGridLayout* grid = new QGridLayout;
QGridLayout* grid = new QGridLayout(this);
grid->setContentsMargins(25, 25, 25, 25);
grid->addWidget(TesterSpinbox, 0, 0);
grid->addWidget(WidgetBeingTested, 0, 1);
setLayout(grid);

TesterSpinbox = new QDoubleSpinBox;
TesterSpinbox->setRange(0.0, 360.0);
TesterSpinbox->setSuffix("°");
TesterSpinbox->setWrapping(true);
grid->addWidget(TesterSpinbox, 0, 0);

QSizePolicy sizePolicy;
sizePolicy.setHorizontalPolicy(QSizePolicy::Expanding);
sizePolicy.setVerticalPolicy(QSizePolicy::Expanding);

WidgetBeingTested = whatToTest;
WidgetBeingTested->setSizePolicy(sizePolicy);
grid->addWidget(WidgetBeingTested, 0, 1);

connect(TesterSpinbox, &QDoubleSpinBox::valueChanged, WidgetBeingTested, method);
} // NumericTestWidget ctor
Expand Down
17 changes: 7 additions & 10 deletions src/Windowing/WidgetsRecreation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ Widgets::Widgets() {
SetupTimeHistoryPlotQChart();
SetupAttQtysRatesDisplay();
SetupButtons();
SetupStatusColumn();
SetGridColumnsMinimums();
SetGridRowsMinimums();

Expand Down Expand Up @@ -152,29 +151,29 @@ void Widgets::SetGridRowsMinimums() {

// Buttons {{{
void Widgets::SetupButtons() {
LoadTestRoutineButton = new QPushButton;
LoadTestRoutineButton = new QPushButton(this);
LoadTestRoutineButton->setText(tr("Load Test Routine"));

QuantityCalculatorButton = new QPushButton;
QuantityCalculatorButton = new QPushButton(this);
QuantityCalculatorButton->setText(tr("Calculate Quantity"));

LogOpenButton = new QPushButton;
LogOpenButton = new QPushButton(this);
LogOpenButton->setText(tr("Open Log"));

AbortButton = new QPushButton;
AbortButton = new QPushButton(this);
AbortButton->setText(tr("Abort"));
AbortButton->setStyleSheet(" QPushButton { background-color: red } ");
} // void Widgets::SetupButtons()

void Widgets::SetupStatusColumn() {
StatusColumn = new QGroupBox(tr("Operate"));
StatusColumn = new QGroupBox(tr("Operate"), this);
MajorLayout->addWidget(StatusColumn, 1, 1);

QSizePolicy vhexpanding;
vhexpanding.setVerticalPolicy(QSizePolicy::MinimumExpanding);
vhexpanding.setHorizontalPolicy(QSizePolicy::MinimumExpanding);

StatusColumnOrganizer = new QVBoxLayout;
StatusColumnOrganizer = new QVBoxLayout(StatusColumn);
LoadTestRoutineButton->setSizePolicy(vhexpanding);
StatusColumnOrganizer->addWidget(LoadTestRoutineButton);

Expand All @@ -191,8 +190,6 @@ void Widgets::SetupStatusColumn() {
} // void Widgets::SetupStatusColumn()

void Widgets::SetAllButtonTextSize() {
// assumes equal button sizing in the layout (which is true as of March 16 2026)
// magic num: 30 pt when at orig and go from there
ButtonFont.setPixelSize(ButtonFontAdjustment.AdjustPxSize(window()));
LoadTestRoutineButton->setFont(ButtonFont);
QuantityCalculatorButton->setFont(ButtonFont);
Expand All @@ -218,7 +215,7 @@ void Widgets::SetupTimeHistoryPlotGR() {
rollInfo.Color = Plot::RGBFromColorGR(Plot::ColorGR::Red);

Plot::SeriesInfo pitchInfo;
pitchInfo.Name = "Pit.hpp";
pitchInfo.Name = "Pitch";
pitchInfo.Color = Plot::RGBFromColorGR(Plot::ColorGR::Blue);

Plot::SeriesInfo yawInfo;
Expand Down
Loading