Skip to content

Commit 4837d34

Browse files
committed
Merge branch 'dev' into alexey/1971/new-test-robot
2 parents 21afe15 + ced0972 commit 4837d34

33 files changed

Lines changed: 1733 additions & 79 deletions

.github/workflows/FissionUnitTest.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,24 @@ jobs:
3838
id: playwright-version
3939
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package-lock.json').dependencies['@playwright/test'].version)")" >> $GITHUB_ENV
4040

41-
- name: Cache downloaded browsers
42-
id: cache-browsers
43-
uses: actions/cache@v3
44-
with:
45-
path: |
46-
~/.cache/ms-playwright/
47-
key: ${{ runner.os }}-assets-playwright-${{ env.PLAYWRIGHT_VERSION }}-v3
41+
# Transition GH-1205:
42+
# Avoiding the cache step for now as it was causing issues.
43+
# Should revisit this later as this is a major speedup that we lost.
44+
# - name: Cache downloaded browsers
45+
# id: cache-browsers
46+
# uses: actions/cache@v3
47+
# with:
48+
# path: |
49+
# ~/.cache/ms-playwright/
50+
# key: ${{ runner.os }}-assets-playwright-${{ env.PLAYWRIGHT_VERSION }}-v3
4851

4952
- name: Install Dependencies
5053
run: |
5154
cd fission
5255
npm install
5356
5457
- name: Download playwright if not cached
55-
if: steps.cache-browsers.outputs.cache-hit != 'true'
58+
# if: steps.cache-browsers.outputs.cache-hit != 'true'
5659
run: |
5760
cd fission
5861
npx playwright install --with-deps

NOTICE.txt

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
This product bundles the following third-party sound assets:
22

3-
* fission/src/assets/sound-files/checkdown.wav
4-
* fission/src/assets/sound-files/checkup.wav
5-
* fission/src/assets/sound-files/clickdown.wav
6-
* fission/src/assets/sound-files/clickup.wav
7-
* fission/src/assets/sound-files/DullClick.wav
8-
9-
All of the above files are licensed under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
10-
License URL: https://creativecommons.org/publicdomain/zero/1.0/
3+
1. Files licensed under the Creative Commons CC0 1.0 Universal Public Domain Dedication:
4+
- fission/src/assets/sound-files/checkdown.wav
5+
- fission/src/assets/sound-files/checkup.wav
6+
- fission/src/assets/sound-files/clickdown.wav
7+
- fission/src/assets/sound-files/clickup.wav
8+
- fission/src/assets/sound-files/DullClick.wav
9+
- fission/src/assets/sound-files/beep.wav
10+
11+
License: CC0 1.0 Universal (Public Domain Dedication)
12+
URL: https://creativecommons.org/publicdomain/zero/1.0/
13+
14+
2. Files licensed from FIRST Robotics:
15+
- fission/src/assets/sound-files/MathStart.wav
16+
- fission/src/assets/sound-files/MatchEnd.wav
17+
- fission/src/assets/sound-files/MatchResume.wav
18+
19+
For more information, contact FIRST Robotics or refer to your licensing agreement.

fission/src/Synthesis.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ import AutoTestPanel from "./ui/panels/simulation/AutoTestPanel.tsx"
7171
import TouchControls from "./ui/components/TouchControls.tsx"
7272
import GraphicsSettings from "./ui/panels/GraphicsSettingsPanel.tsx"
7373
import MainMenuModal from "@/modals/MainMenuModal"
74+
import DeveloperToolPanel from "./ui/panels/DeveloperToolPanel.tsx"
7475

7576
const Synthesis: React.FC = () => {
7677
const { openModal, closeModal, getActiveModalElement, registerModal, activeModalId } =
@@ -252,6 +253,7 @@ const initialPanels: ReactElement[] = [
252253
<WSViewPanel key="ws-view" panelId="ws-view" />,
253254
<DebugPanel key="debug" panelId="debug" />,
254255
<ConfigurePanel key="configure" panelId="configure" />,
256+
<DeveloperToolPanel key="developer" panelId="developer" />,
255257
<WiringPanel key="wiring" panelId="wiring" />,
256258
<CameraSelectionPanel key="camera-select" panelId="camera-select" />,
257259
<InitialConfigPanel key="initial-config" panelId="initial-config" />,

fission/src/aps/APS.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ class APS {
205205
} catch (e) {
206206
console.error(e)
207207
World.analyticsSystem?.exception("APS Login Failure")
208-
globalAddToast?.("error", "Error signing in.", "Please try again.")
208+
globalAddToast("error", "Error signing in.", "Please try again.")
209209
}
210210
})
211211
}
@@ -236,7 +236,7 @@ class APS {
236236
const json = await res.json()
237237
if (!res.ok) {
238238
if (shouldRelog) {
239-
globalAddToast?.("warning", "Must Re-signin.", json.userMessage)
239+
globalAddToast("warning", "Must Re-signin.", json.userMessage)
240240
this._auth = undefined
241241
await this.requestAuthCode()
242242
return false
@@ -249,13 +249,13 @@ class APS {
249249
if (this._auth) {
250250
await this.loadUserInfo(this._auth)
251251
if (APS.userInfo) {
252-
globalAddToast?.("info", "ADSK Login", `Hello, ${APS.userInfo.givenName}`)
252+
globalAddToast("info", "ADSK Login", `Hello, ${APS.userInfo.givenName}`)
253253
}
254254
}
255255
return true
256256
} catch (e) {
257257
World.analyticsSystem?.exception("APS Login Failure")
258-
globalAddToast?.("error", "Error signing in.", "Please try again.")
258+
globalAddToast("error", "Error signing in.", "Please try again.")
259259
this._auth = undefined
260260
await this.requestAuthCode()
261261
return false
@@ -281,7 +281,7 @@ class APS {
281281
const json = await res.json()
282282
if (!res.ok) {
283283
World.analyticsSystem?.exception("APS Login Failure")
284-
globalAddToast?.("error", "Error signing in.", json.userMessage)
284+
globalAddToast("error", "Error signing in.", json.userMessage)
285285
this._auth = undefined
286286
return
287287
}
@@ -293,7 +293,7 @@ class APS {
293293
if (auth) {
294294
await this.loadUserInfo(auth)
295295
if (APS.userInfo) {
296-
globalAddToast?.("info", "ADSK Login", `Hello, ${APS.userInfo.givenName}`)
296+
globalAddToast("info", "ADSK Login", `Hello, ${APS.userInfo.givenName}`)
297297
}
298298
} else {
299299
console.error("Couldn't get auth data.")
@@ -306,7 +306,7 @@ class APS {
306306
if (retryLogin) {
307307
this._auth = undefined
308308
World.analyticsSystem?.exception("APS Login Failure")
309-
globalAddToast?.("error", "Error signing in.", "Please try again.")
309+
globalAddToast("error", "Error signing in.", "Please try again.")
310310
}
311311
}
312312

@@ -327,7 +327,7 @@ class APS {
327327
const json = await res.json()
328328
if (!res.ok) {
329329
World.analyticsSystem?.exception("APS Failure: User Info")
330-
globalAddToast?.("error", "Error fetching user data.", json.userMessage)
330+
globalAddToast("error", "Error fetching user data.", json.userMessage)
331331
this._auth = undefined
332332
await this.requestAuthCode()
333333
return
@@ -343,7 +343,7 @@ class APS {
343343
} catch (e) {
344344
console.error(e)
345345
World.analyticsSystem?.exception("APS Login Failure: User Info")
346-
globalAddToast?.("error", "Error signing in.", "Please try again.")
346+
globalAddToast("error", "Error signing in.", "Please try again.")
347347
this._auth = undefined
348348
}
349349
}
@@ -359,7 +359,7 @@ class APS {
359359
} catch (e) {
360360
console.error(e)
361361
World.analyticsSystem?.exception("APS Login Failure: Code Challenge")
362-
globalAddToast?.("error", "Error signing in.", "Please try again.")
362+
globalAddToast("error", "Error signing in.", "Please try again.")
363363
}
364364
}
365365
}

fission/src/aps/APSDataManagement.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ export async function getHubs(): Promise<Hub[] | undefined> {
140140
console.log(auth)
141141
console.log(APS.userInfo)
142142
if (e instanceof APSDataError) {
143-
globalAddToast?.("error", e.title, e.detail)
143+
globalAddToast("error", e.title, e.detail)
144144
} else if (e instanceof Error) {
145-
globalAddToast?.("error", "Failed to get hubs.", e.message)
145+
globalAddToast("error", "Failed to get hubs.", e.message)
146146
}
147147
return undefined
148148
}
@@ -179,7 +179,7 @@ export async function getProjects(hub: Hub): Promise<Project[] | undefined> {
179179
} catch (e) {
180180
console.error("Failed to get hubs")
181181
if (e instanceof Error) {
182-
globalAddToast?.("error", "Failed to get hubs.", e.message)
182+
globalAddToast("error", "Failed to get hubs.", e.message)
183183
}
184184
return undefined
185185
}
@@ -224,7 +224,7 @@ export async function getFolderData(project: Project, folder: Folder): Promise<D
224224
} catch (e) {
225225
console.error("Failed to get folder data")
226226
if (e instanceof Error) {
227-
globalAddToast?.("error", "Failed to get folder data.", e.message)
227+
globalAddToast("error", "Failed to get folder data.", e.message)
228228
}
229229
return undefined
230230
}
@@ -250,7 +250,7 @@ export async function searchFolder(project: Project, folder: Folder, filters?: F
250250
},
251251
})
252252
if (!res.ok) {
253-
globalAddToast?.("error", "Error getting cloud files.", "Please sign in again.")
253+
globalAddToast("error", "Error getting cloud files.", "Please sign in again.")
254254
return []
255255
}
256256
const json = await res.json()
64.1 KB
Binary file not shown.
69.2 KB
Binary file not shown.
36.9 KB
Binary file not shown.
46.9 KB
Binary file not shown.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import { mirabuf } from "../proto/mirabuf"
2+
3+
interface DevtoolMiraData {
4+
"devtool:scoring_zones": unknown
5+
"devtool:camera_locations": unknown
6+
"devtool:spawn_points": unknown
7+
"devtool:a": unknown
8+
"devtool:b": unknown
9+
"devtool:test": unknown
10+
"devtool:keep": unknown
11+
"devtool:drop": unknown
12+
"devtool:bad": unknown
13+
"devtool:foo": unknown
14+
// additional devtool keys to be added in future
15+
}
16+
17+
/**
18+
* Utility for reading and writing developer tool data in the mira file's UserData field.
19+
* Docs: https://www.mirabuf.dev/#mirabuf.UserData
20+
*/
21+
export default class FieldMiraEditor {
22+
private _parts: mirabuf.IParts
23+
24+
constructor(parts: mirabuf.IParts) {
25+
this._parts = parts
26+
if (!this._parts.userData) {
27+
this._parts.userData = mirabuf.UserData.create({ data: {} })
28+
}
29+
if (!this._parts.userData.data) {
30+
this._parts.userData.data = {}
31+
}
32+
}
33+
34+
/**
35+
* Get parsed data for a devtool key (e.g., 'devtool:scoring_zones').
36+
*/
37+
getUserData<K extends keyof DevtoolMiraData>(key: K): DevtoolMiraData[K] | undefined {
38+
const raw = this._parts.userData!.data![key]
39+
if (!raw) return undefined
40+
try {
41+
return JSON.parse(raw)
42+
} catch {
43+
return undefined
44+
}
45+
}
46+
47+
/**
48+
* Set data for a devtool key. Value will be stringified as JSON.
49+
*/
50+
setUserData<K extends keyof DevtoolMiraData>(key: K, value: DevtoolMiraData[K]): void {
51+
this._parts.userData!.data![key] = JSON.stringify(value)
52+
}
53+
54+
/**
55+
* Remove a devtool key from userData.
56+
*/
57+
removeUserData(key: keyof DevtoolMiraData): void {
58+
delete this._parts.userData!.data![key]
59+
}
60+
61+
/**
62+
* Get all devtool keys currently in userData.
63+
*/
64+
getAllDevtoolKeys(): string[] {
65+
return Object.keys(this._parts.userData!.data!).filter(k => k.startsWith("devtool:"))
66+
}
67+
}

0 commit comments

Comments
 (0)