Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Inital Dashboard #3

Merged
merged 42 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
84e0f17
add node_modules and .parcel-cache to .gitignore
dublUayaychtee Jan 9, 2024
1d97933
add dashboard files
dublUayaychtee Jan 9, 2024
2e8c5e3
Force repair @dublUayaychtee
KenwoodFox Jan 9, 2024
08900b6
makefile build inject networktables
dublUayaychtee Jan 13, 2024
6fb28f3
add d3
dublUayaychtee Jan 13, 2024
d5e6574
add jquery
dublUayaychtee Jan 13, 2024
773e52c
add js files to html
dublUayaychtee Jan 13, 2024
b8ff4b0
copy js code and remove extra, puts networktables values onto <body>
dublUayaychtee Jan 13, 2024
5e63676
Merge branch 'feat/dashboard' of ssh://ssh.github.com:443/FRC-1721/17…
dublUayaychtee Jan 13, 2024
b077c39
put fox version of pynetworktables2js bc fox
dublUayaychtee Jan 13, 2024
77eb1fe
fix dashboard connect networktables
dublUayaychtee Jan 14, 2024
3fa1fb2
npm update
dublUayaychtee Jan 14, 2024
20c47e7
add a canvas
dublUayaychtee Jan 14, 2024
5854504
fix dumb minify breaks js >:(
dublUayaychtee Jan 14, 2024
b918e35
better error message
dublUayaychtee Jan 15, 2024
afcbf20
make a triangle
dublUayaychtee Jan 15, 2024
17537c2
add dashboard.zip to .gitignore
dublUayaychtee Jan 15, 2024
c36a53b
add windows run bat file
dublUayaychtee Jan 15, 2024
b8c3db8
make zip file of dashboard with make
dublUayaychtee Jan 15, 2024
7dadbe2
Merge branch 'feat/magicSwerve' into feat/dashboard
dublUayaychtee Jan 20, 2024
043d9eb
move build edits to seperate file
dublUayaychtee Jan 20, 2024
ea74005
add wheels image
dublUayaychtee Jan 20, 2024
854ffc8
simplify other wheels svg also
dublUayaychtee Jan 20, 2024
f052320
add swerve visual svg
dublUayaychtee Jan 20, 2024
d6982ea
put the correct filenames for the wheels
dublUayaychtee Jan 20, 2024
4890eff
don't crash make if dist/ folder doesn't exist
dublUayaychtee Jan 20, 2024
12cffff
remove make zip from Makefile
dublUayaychtee Jan 20, 2024
53303f7
this might work idk
dublUayaychtee Jan 20, 2024
c8fa136
do class instead of id for wheels
dublUayaychtee Jan 22, 2024
857fda7
add swerve desired too
dublUayaychtee Jan 22, 2024
ca0a41c
do the right thing remove desired from name
dublUayaychtee Jan 22, 2024
7f42c58
remove canvas.js
dublUayaychtee Jan 25, 2024
5a5eb96
add helpful things to Makefile, remove make deploy
dublUayaychtee Jan 25, 2024
2ace52b
do it correctly
dublUayaychtee Jan 25, 2024
be294fa
move wheels into seperate folder
dublUayaychtee Jan 25, 2024
b01eccd
add different wheel image for desired wheels
dublUayaychtee Jan 25, 2024
76d0e18
change the desired wheels to an overlay on top the actual wheels
dublUayaychtee Jan 25, 2024
a7ace37
only reset dist/ in make stage
dublUayaychtee Jan 25, 2024
29ae0aa
spacing? idk
dublUayaychtee Jan 25, 2024
adf0277
limit webpage to available screenspace of drive laptop
dublUayaychtee Jan 25, 2024
22050c5
Update rio/components/drivetrain.py
Kredcool Feb 22, 2024
cd55748
merging
Feb 22, 2024
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
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,11 @@ networktables.json

# Add to tree but only when neccicary (adding a map or smthn)
simgui-window.json

# ===========
# Dashboard
# ===========

.parcel-cache/
node_modules/
dashboard.zip
47 changes: 47 additions & 0 deletions dashboard/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#
# FRC 1721 Tidal Force
# 2023-2024
#

ROOT := $(PWD)
STAGEDIR := $(ROOT)/dist/
DASH_HASH := $(shell git describe --tags --always)

all: help

help: # List all commands and their descriptions
@echo
@cat Makefile | grep ': #' --color=never | sed '/^\t/d' | sed 's/: / /' | column -t -s '#'
@echo

build: # Run `parcel build' and inject NetworkTables
rm -r dist/
npm run build
./build.sh

run: # Run a live server of the dashboard
npm run run
dev: # Automatically run `make build' whenever a file changes in src/ (requires program `entr')
find src/ | entr sh -c 'make build'
clean: # Run `git clean -fdX
git clean -fdX
stage: # Prepares dist/ for deployment
rm -r dist/
make build
cp entrypoint.sh $(STAGEDIR)
cp run.bat $(STAGEDIR)
deploy: # Use scp to deploy the new files to the nuc
make stage
@echo "═══════════════════════════════════════════════════════════════════════════════════════"
@echo "When prompted for a password, type 'dash' and press enter."
@echo "═══════════════════════════════════════════════════════════════════════════════════════"

# Transfer
scp -r $(STAGEDIR)/* [email protected]:/opt/dashboard

# Restart
ssh [email protected] "sudo -S systemctl daemon-reload"
ssh [email protected] "sudo -S systemctl restart dashboard"
zip: # Create zip file of dashboard contents
make stage
zip dashboard.zip dist/*
12 changes: 12 additions & 0 deletions dashboard/Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
pynetworktables2js = {ref = "refs/pull/45/head", git = "git+https://github.com/robotpy/pynetworktables2js.git"}

[dev-packages]

[requires]
python_version = "3.11"
93 changes: 93 additions & 0 deletions dashboard/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions dashboard/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# FRC 1721 Dashboard
## Getting Started
- Make sure you have sed installed
- Make sure Robot sim is running
- Make sure npm is installed

Make sure you are in the dashboard/ folder.

Install deps

``` sh
npm ci
```

Build webpage

``` sh
make build
```

(NOT REQUIRED) You can build automatically when a file changes in src/ (requires 'entr', `paru -S entr` `paman install entr`)

``` sh
make dev
```

Run webpage

``` sh
make run
```

`make run` can be left running when you run `make build`, and doesn't need to be run again to update the webpage
7 changes: 7 additions & 0 deletions dashboard/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sed -i -e 's/<p><\/p>/<script src="\/networktables\/networktables.js"><\/script><p><\/p>/g' dist/index.html
sed -i -e 's/<p><\/p>/<script src="\/networktables\/utils.js"><\/script><p><\/p>/g' dist/index.html
sed -i -e 's/<p><\/p>/<script src="\/networktables\/camera.js"><\/script>/g' dist/index.html
sed -i -e "/<\!--FL-->/rsrc/asset/wheel.svg" dist/index.html
sed -i -e "/<\!--FR-->/rsrc/asset/wheel.svg" dist/index.html
sed -i -e "/<\!--RL-->/rsrc/asset/wheel.svg" dist/index.html
sed -i -e "/<\!--RR-->/rsrc/asset/wheel.svg" dist/index.html
4 changes: 4 additions & 0 deletions dashboard/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh


python -m pynetworktables2js --port=5800 --robot=10.17.21.2
Loading
Loading