Skip to content

Commit

Permalink
womp womp
Browse files Browse the repository at this point in the history
Signed-off-by: swurl <[email protected]>
  • Loading branch information
crueter committed Jan 9, 2024
1 parent 19f7d81 commit a703a44
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 21 deletions.
2 changes: 2 additions & 0 deletions include/TeamInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class TeamInfo : public QWidget
~TeamInfo();

int teamNumber();
int matchNumber();
QString eventCode();

private:
Ui::TeamInfo *ui;
Expand Down
6 changes: 4 additions & 2 deletions src/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ MainWindow::MainWindow(QWidget *parent)

int currentIdx;

connect(nextButton, &QPushButton::clicked, this, [this, &currentIdx]() {
connect(nextButton, &QPushButton::released, this, [this, &currentIdx]() {
int nextIdx = currentIdx + 1;
if (nextIdx >= stackedWidget->count()) nextIdx = stackedWidget->count() - 1;
currentIdx = nextIdx;
Expand All @@ -27,7 +27,7 @@ MainWindow::MainWindow(QWidget *parent)
}
});

connect(backButton, &QPushButton::clicked, this, [this, &currentIdx]() {
connect(backButton, &QPushButton::released, this, [this, &currentIdx]() {
int nextIdx = currentIdx - 1;
if (nextIdx < 0) nextIdx = 0;
currentIdx = nextIdx;
Expand All @@ -53,6 +53,8 @@ QString MainWindow::serializeData() {
QStringList csv;
csv << "Field,Value";
csv << "Team Number," + QString::number(teamInfo->teamNumber());
csv << "Match Number," + QString::number(teamInfo->matchNumber());
csv << "Event Code," + teamInfo->eventCode();
csv << "Auto Mobility," + QString::number(autoScouting->mobility());
csv << "Auto Amp Pieces," + QString::number(autoScouting->ampPieces());
csv << "Auto Speaker Pieces," + QString::number(autoScouting->speakerPieces());
Expand Down
10 changes: 9 additions & 1 deletion src/TeamInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,13 @@ TeamInfo::~TeamInfo()
}

int TeamInfo::teamNumber() {
return ui->spinBox->value();
return ui->teamNumber->value();
}

int TeamInfo::matchNumber() {
return ui->matchNumber->value();
}

QString TeamInfo::eventCode() {
return ui->eventCode->text();
}
78 changes: 62 additions & 16 deletions ui/TeamInfo.ui
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</font>
</property>
<property name="text">
<string>Team Info</string>
<string>Match Info</string>
</property>
<property name="scaledContents">
<bool>true</bool>
Expand All @@ -55,24 +55,24 @@
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>1</horstretch>
<verstretch>5</verstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Noto Sans</family>
<pointsize>18</pointsize>
<pointsize>16</pointsize>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Enter team info here.</string>
<string>Enter match info here.</string>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignHCenter|Qt::AlignTop</set>
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
Expand All @@ -95,7 +95,7 @@
</font>
</property>
<property name="text">
<string>Number:</string>
<string>Team Number:</string>
</property>
<property name="scaledContents">
<bool>true</bool>
Expand All @@ -109,11 +109,11 @@
</widget>
</item>
<item>
<widget class="BetterSpinBox" name="spinBox">
<widget class="QSpinBox" name="teamNumber">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>1</horstretch>
<verstretch>1</verstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="wrapping">
Expand All @@ -124,15 +124,61 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<family>Noto Sans</family>
<pointsize>16</pointsize>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Match Number:</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="matchNumber"/>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<family>Noto Sans</family>
<pointsize>16</pointsize>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Event Code (e.g. OHMV)</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="eventCode"/>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>BetterSpinBox</class>
<extends>QSpinBox</extends>
<header>BetterSpinBox.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
4 changes: 2 additions & 2 deletions ui/WelcomePage.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>480</width>
<height>640</height>
<height>480</height>
</rect>
</property>
<property name="windowTitle">
Expand All @@ -19,7 +19,7 @@
<property name="font">
<font>
<family>Noto Sans</family>
<pointsize>50</pointsize>
<pointsize>40</pointsize>
<bold>true</bold>
</font>
</property>
Expand Down

0 comments on commit a703a44

Please sign in to comment.