Skip to content

Commit

Permalink
more config options (#11)
Browse files Browse the repository at this point in the history
* more config options

Signed-off-by: swurl <[email protected]>

* fix actions, add images

Signed-off-by: swurl <[email protected]>

* fix versions

Signed-off-by: swurl <[email protected]>

* fix windows arch

Signed-off-by: swurl <[email protected]>

* fix window sarch

Signed-off-by: swurl <[email protected]>

* fix the arches once and fo rall

Signed-off-by: swurl <[email protected]>

---------

Signed-off-by: swurl <[email protected]>
  • Loading branch information
crueter authored Sep 1, 2024
1 parent 257cac5 commit 83316d8
Show file tree
Hide file tree
Showing 37 changed files with 650 additions and 9,485 deletions.
45 changes: 27 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,24 @@ jobs:

- os: ubuntu-20.04
qt_host: linux
qt_version: '6.6.0'
qt_version: '6.8.0'
qt_arch: gcc_64

- os: ubuntu-20.04
qt_host: linux
qt_target: android
qt_arch: android_arm64_v8a
qt_version: '6.6.0'
qt_version: '6.8.0'

- os: ubuntu-20.04
qt_host: linux
qt_version: '6.6.0'
qt_arch: wasm_singlethread
qt_version: '6.6.3'
qt_arch: wasm_multithread

- os: windows-2022
qt_host: windows
qt_version: '6.6.0'
qt_arch: win64_msvc2019_64
qt_version: '6.8.0'
qt_arch: win64_msvc2022_64

runs-on: ${{ matrix.os }}

Expand All @@ -63,7 +63,6 @@ jobs:
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
echo ${{ matrix.qt_arch }}
- name: Install MSVC (Windows)
if: runner.os == 'Windows'
Expand All @@ -72,19 +71,29 @@ jobs:
- name: Install CMake
uses: lukka/[email protected]

- name: Install Qt 6.6.0
- name: Install Qt ${{ matrix.qt_version }} (Windows)
if: runner.os == 'Windows'
uses: jurplel/[email protected]
with:
cache: on
version: ${{ matrix.qt_version }}
aqtversion: ==3.1.*
arch: ${{ matrix.qt_arch }}

- name: Install Qt ${{ matrix.qt_version }} (Linux)
if: runner.os == 'Linux'
uses: jurplel/[email protected]
with:
cache: on
version: 6.6.0
version: ${{ matrix.qt_version }}
aqtversion: ==3.1.*

- name: Install Qt (WASM)
if: matrix.qt_arch == 'wasm_singlethread'
if: matrix.qt_arch == 'wasm_multithread'
uses: jurplel/[email protected]
with:
cache: on
version: 6.6.0
version: ${{ matrix.qt_version }}
aqtversion: ==3.1.*
arch: ${{ matrix.qt_arch }}

Expand All @@ -93,7 +102,7 @@ jobs:
uses: jurplel/[email protected]
with:
cache: on
version: 6.6.0
version: ${{ matrix.qt_version }}
aqtversion: ==3.1.*
target: ${{ matrix.qt_target }}
arch: ${{ matrix.qt_arch }}
Expand All @@ -107,7 +116,7 @@ jobs:
wget "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage"
- name: Prepare Emscripten (Linux)
if: runner.os == 'Linux' && matrix.qt_arch == 'wasm_singlethread'
if: runner.os == 'Linux' && matrix.qt_arch == 'wasm_multithread'
uses: mymindstorm/setup-emsdk@v13
with:
# Version to install
Expand Down Expand Up @@ -171,7 +180,7 @@ jobs:
mkdir -p ${{ env.INSTALL_APPIMAGE_DIR }}/usr/plugins/iconengines
cp -r /home/runner/work/QFRCScouter/Qt/${{ matrix.qt_version }}/gcc_64/plugins/iconengines/* ${{ env.INSTALL_APPIMAGE_DIR }}/usr/plugins/iconengines
cp -r ${{ runner.workspace }}/Qt/${{ matrix.qt_version }}/${{ matrix.qt_arch }}/plugins/ ${{ env.INSTALL_APPIMAGE_DIR }}/usr/
cp /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 ${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib/
cp /usr/lib/x86_64-linux-gnu/libssl.so.1.1 ${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib/
Expand All @@ -183,7 +192,7 @@ jobs:
shell: cmd
run: |
mkdir ${{ env.INSTALL_DIR }}
set PATH=%PATH%;"${{ runner.workspace }}\Qt\6.6.0\msvc2019_64\bin"
set PATH=%PATH%;"${{ runner.workspace }}\Qt\${{ matrix.qt_version }}\${{ matrix.qt_arch }}\bin"
windeployqt ${{ env.BUILD_DIR }}\QFRCScouter.exe --dir ${{ env.INSTALL_DIR }}
cp ${{ env.BUILD_DIR }}\QFRCScouter.exe ${{ env.INSTALL_DIR }}
Expand All @@ -200,21 +209,21 @@ jobs:
##

- name: Wasm funniness
if: matrix.qt_arch == 'wasm_singlethread'
if: matrix.qt_arch == 'wasm_multithread'
shell: bash
run: |
cd ${{ env.BUILD_DIR }}
cp QFRCScouter.html index.html
- name: Upload Pages WASM
if: matrix.qt_arch == 'wasm_singlethread'
if: matrix.qt_arch == 'wasm_multithread'
uses: actions/[email protected]
with:
path: ${{ env.BUILD_DIR }}
retention-days: 14

- name: Deploy Pages WASM
if: matrix.qt_arch == 'wasm_singlethread'
if: matrix.qt_arch == 'wasm_multithread'
uses: actions/[email protected]

- name: Upload Release APK (Linux)
Expand Down
19 changes: 15 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ set(PROJECT_SOURCES

src/WelcomePage.cpp
src/TeamInfo.cpp
src/AutoScouting.cpp
src/MatchPage.cpp

# ================== #
include/MainWindow.h

include/WelcomePage.h
include/TeamInfo.h
include/AutoScouting.h
include/MatchPage.h

# ================== #
ui/MainWindow.ui

ui/WelcomePage.ui
ui/AutoScouting.ui
ui/MatchPage.ui


include/TeleScouting.h src/TeleScouting.cpp ui/TeleScouting.ui
include/QRCode.h src/QRCode.cpp ui/QRCode.ui
include/BetterSpinBox.h src/BetterSpinBox.cpp ui/BetterSpinBox.ui
include/Notes.h src/Notes.cpp ui/Notes.ui
Expand Down Expand Up @@ -146,6 +146,17 @@ if (ANDROID)
set_target_properties(QFRCScouter PROPERTIES
QT_ANDROID_PACKAGE_SOURCE_DIR ${CMAKE_SOURCE_DIR}/android
COMPILE_DEFINITIONS "${COMPILE_DEFINITIONS} MOBILE")

include(FetchContent)
FetchContent_Declare(
android_openssl
DOWNLOAD_EXTRACT_TIMESTAMP true
URL https://github.com/KDAB/android_openssl/archive/refs/heads/master.zip
)
FetchContent_MakeAvailable(android_openssl)
include(${android_openssl_SOURCE_DIR}/android_openssl.cmake)

add_android_openssl_libraries(QFRCScouter)
endif()

if(QT_VERSION_MAJOR EQUAL 6)
Expand Down
93 changes: 86 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,89 @@
# QFRCScouter
Colloquially "Nickbotics.io"
A powerful, cross-platform, QR-based, configurable scouting app for FRC, designed to be simple-to-use for scouters and modular for developers and hosters.

A powerful scouting app for use in the 2024 FRC game, Crescendo, featuring:
## Usage

- High-performance
- Low-footprint
- Cross-platform
- TSV QR Code -- insert directly into a spreadsheet
- Simple, easy-to-use UI
### Team Info
Usage of QFRCScouter begins on the "Team Info" page. There, the scouter must enter their initials. If not on the web app, the user needs to have the schedule downloaded; see "Schedule" below.

The match number is next, which can be incremented and decremented with the plus and minus buttons.

Finally, if the schedule is set up properly, the scouter can set the alliance station they plan to scout. The scouting app will automatically set the team number for each match. The selected station & team number will always be displayed at the bottom.

![TeamInfo](/img/TeamInfo.png?raw=true)

### Auto Data
Scouting for autonomous data begins. Press the plus and minus buttons on each of the relevant fields as needed, and select the checkboxes at the end of the autonomous period as needed.

![Auto](/img/Auto.png?raw=true)

### Teleop Data
Scouting for teleop & endgame data begins. Operation here is identical to Auto scouting.

![Tele](/img/Tele.png?raw=true)

### Notes
Enter any quick thoughts on the team you're scouting. You will be asked to quantify some things later, so don't go into too much detail.

![Notes](/img/Notes.png?raw=true)

### Opinions
Select your opinions on various factors here, ranging from very bad to elite. If the team didn't contribute in that factor, select N/A.

![Scales](/img/Scales.png?raw=true)

### QR Code
You're done! Present your QR code to the scanner to be put into the spreadsheet. Once done, select "next match". This will bring you to the beginning, and increment the match number, selecting the correct team for your alliance station.

If the scan failed and you already selected "next match", OR if you wish to change some data, press "Back to QR Code" on the first page.

![QRCode](/img/QRCode.png?raw=true)

## Self-Hosting

### Schedule
The match schedule can be downloaded at any time and kept offline for native platforms, by entering the relevant event code into the "Event Code" box on the "Team Info" page and pressing Download. Once downloaded once, it doesn't need to be downloaded again on future runs unless it's a different event.

For the web app, the included match schedule is used. This schedule can be updated with the `getSchedule.sh` script. Syntax:

```
./getSchedule.sh <eventCode> <TBA auth key>
```

Then push these changes to your fork and your GitHub pages will have the match schedule built-in.

Once the schedule is all set, scouters can select an alliance station to use. The scouter will automatically select the proper team number for each match depending on your selected station.

### Multi-platform
QFRCScouter has several platforms it can run on:
- Windows
- Linux
- Android
- Web

The web app is available directly through this repo's GitHub pages. If you wish to provide your own config, you can fork this repository, update the config.json (according to the Configuration section below), and GitHub actions will take care of the rest--ensure to enable Pages in the repository settings.

Furthermore, the web app can be downloaded and run locally; go the the [latest actions run](https://github.com/Q-FRC/Scouter/actions), download the `github-pages` artifact, and open `index.html` in your browser. This is completely offline!

Linux, Android, and Windows users are encouraged to use the native options, however.

### Configuration
QFRCScouter is configurable through a simple JSON file. The format is described below.

- `welcome` (str): The welcome notice that shows up on the first page of the app.
- `button` (color): The accent color of most of the buttons present in the app.
- `buttonText` (color): The text color of most of the buttons present in the app.
- `backgroundColor` (color): The color of the background of the application.
- `textColor` (color): The color of most of the text of the application.
- `pages` (obj): Describes the data present in the auto, teleop, and scale pages.
* `auto` (arr) & `tele` (arr): Contains data present in the auto and teleop data pages.
- `type` (str): either `"bool"` or `"int"` for a checkbox or spinbox respectively. Note that spinboxes are always put before any checkboxes.
- `text` (str): The text shown next to the spinbox or checkbox.
- `int` fields have additional configuration options:
* `color`: The accent color of the button, useful for quick differentiation for scouters.
* `textColor`: The color of the text of the button.
* `min`: The minimum value.
* `max`: The maximum value.
* `scales` (arr): Contains data present in the auto and teleop data pages.
- `title` (str): The large text shown next to the scales.
- `desc` (str): Fine print shown below the scales, for additional details.
6 changes: 6 additions & 0 deletions android/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,16 @@
<meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/splashscreen"/>
<meta-data android:name="android.app.splash_screen_drawable_portrait" android:resource="@drawable/splashscreen_port"/>
<meta-data android:name="android.app.splash_screen_drawable_landscape" android:resource="@drawable/splashscreen_land"/>
<meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/splashscreen"/>
<meta-data android:name="android.app.splash_screen_drawable_portrait" android:resource="@drawable/splashscreen_port"/>
<meta-data android:name="android.app.splash_screen_drawable_landscape" android:resource="@drawable/splashscreen_land"/>
</activity>

<provider android:name="androidx.core.content.FileProvider" android:authorities="${applicationId}.qtprovider" android:exported="false" android:grantUriPermissions="true">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/qtprovider_paths"/>
</provider>
</application>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
</manifest>
Loading

0 comments on commit 83316d8

Please sign in to comment.