Repository navigation
Better data analysis support #511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
OrenMic
wants to merge
19
commits into
Mechanical-Advantage:main
Choose a base branch
from
OrenMic:issue/#506
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+398
−53
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
a46580a
branch commit
c6ebd85
added button
a4aeb1c
added button to district fileds
b58cf33
made button print hello world
3bc8ba7
made button print the data name
2a7f138
half works, only for right
5cd2dc1
made it not add already exising fields
a4a51f3
button works
0f369a3
Merge branch 'main' into issue/#506
OrenMic 6168a27
removed prints
ab7be90
cleaned up
f31d2b9
formated
0425084
Merge branch 'main' into issue/#506
OrenMic 57c8e61
Merge branch 'main' into issue/#506
OrenMic 392d2bd
Merge branch 'main' into issue/#506
680da49
fixed symbols
b4f0172
removed old points sizing method
fe083f8
made it so when calling add-from-all-logs it will keep the type of th…
e3aa0e0
added tab
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,226 @@ | ||
| // Copyright (c) 2021-2026 Littleton Robotics | ||
| // http://github.com/Mechanical-Advantage | ||
| // | ||
| // Use of this source code is governed by a BSD | ||
| // license that can be found in the LICENSE file | ||
| // at the root directory of this project. | ||
|
|
||
| import { getBabelOutputPlugin } from "@rollup/plugin-babel"; | ||
| import commonjs from "@rollup/plugin-commonjs"; | ||
| import json from "@rollup/plugin-json"; | ||
| import nodeResolve from "@rollup/plugin-node-resolve"; | ||
| import replace from "@rollup/plugin-replace"; | ||
| import terser from "@rollup/plugin-terser"; | ||
| import typescript from "@rollup/plugin-typescript"; | ||
| import fs from "fs"; | ||
| import cleanup from "rollup-plugin-cleanup"; | ||
| import replaceRegEx from "rollup-plugin-re"; | ||
|
|
||
| const isWpilib = process.env.ASCOPE_DISTRIBUTION === "WPILIB"; | ||
| const isLite = process.env.ASCOPE_DISTRIBUTION === "LITE"; | ||
| const licenseHeader = | ||
| "// Copyright (c) 2021-2026 Littleton Robotics\n// http://github.com/Mechanical-Advantage\n//\n// Use of this source code is governed by a BSD\n// license that can be found in the LICENSE file\n// at the resources directory of this application.\n"; | ||
|
|
||
| function bundle(input, output, isMain, isXRClient, external = []) { | ||
| const packageJson = JSON.parse( | ||
| fs.readFileSync("package.json", { | ||
| encoding: "utf-8" | ||
| }) | ||
| ); | ||
| return { | ||
| input: "src/" + input, | ||
| output: { | ||
| file: (isLite ? "lite/static/" : "") + "bundles/" + output, | ||
| format: isMain ? "cjs" : "es", | ||
| banner: licenseHeader | ||
| }, | ||
| context: "this", | ||
| external: external, | ||
| plugins: [ | ||
| typescript(), | ||
| nodeResolve({ | ||
| preferBuiltins: true | ||
| }), | ||
| commonjs(), | ||
| ...(isXRClient | ||
| ? [ | ||
| getBabelOutputPlugin({ | ||
| presets: [["@babel/preset-env", { modules: false }]], | ||
| compact: true, | ||
| targets: "iOS 16" // AdvantageScope XR is built for iOS 16 | ||
| }), | ||
| terser() | ||
| ] | ||
| : isLite | ||
| ? [ | ||
| getBabelOutputPlugin({ | ||
| presets: [["@babel/preset-env", { modules: false }]], | ||
| compact: true, | ||
| targets: "> 0.1%, not dead" | ||
| }), | ||
| terser({ mangle: { reserved: ["Module"] } }) | ||
| ] | ||
| : [cleanup()]), | ||
| json(), | ||
| replace({ | ||
| preventAssignment: true, | ||
| values: { | ||
| __distribution__: isWpilib ? "WPILib" : isLite ? "Lite" : "FRC6328", | ||
| __version__: packageJson.version, | ||
| __build_date__: new Date().toLocaleString("en-US", { | ||
| timeZone: "UTC", | ||
| hour12: false, | ||
| year: "numeric", | ||
| month: "numeric", | ||
| day: "numeric", | ||
| hour: "numeric", | ||
| minute: "numeric", | ||
| second: "numeric", | ||
| timeZoneName: "short" | ||
| }), | ||
| __copyright__: packageJson.build.copyright | ||
| } | ||
| }), | ||
| replaceRegEx({ | ||
| patterns: [ | ||
| // Remove unused eval in protobufjs | ||
| // https://github.com/protobufjs/protobuf.js/issues/593 | ||
| { | ||
| test: /eval.*\(moduleName\);/g, | ||
| replace: "undefined;" | ||
| }, | ||
|
|
||
| // Remove dependency on node:sqlite (not actually | ||
| // used, so just replace with stand-in dependency) | ||
| { | ||
| test: /node:sqlite/g, | ||
| replace: "fs" | ||
| } | ||
| ] | ||
| }) | ||
| ], | ||
| onwarn(message, warn) { | ||
| // Hide warnings about protobufjs circular dependencies | ||
| // https://github.com/protobufjs/protobuf.js/issues/1402 | ||
| if (message.code === "CIRCULAR_DEPENDENCY") return; | ||
| warn(message); | ||
| } | ||
| }; | ||
| } | ||
|
|
||
| const mainBundles = isLite | ||
| ? [bundle("main/lite/main.ts", "main.js", false, false)] | ||
| : [ | ||
| bundle("main/electron/main.ts", "main.js", true, false, [ | ||
| "electron", | ||
| "electron-fetch", | ||
| "fs", | ||
| "jsonfile", | ||
| "net", | ||
| "os", | ||
| "ws", | ||
| "http", | ||
| "path", | ||
| "basic-ftp", | ||
| "download", | ||
| "youtube-dl-exec", | ||
| "tesseract.js", | ||
| "lzma-native", | ||
| "@rev-robotics/revlog-converter" | ||
| ]), | ||
| bundle("preload.ts", "preload.js", true, false, ["electron"]) | ||
| ]; | ||
| const largeRendererBundles = [ | ||
| bundle("hub/hub.ts", "hub.js", false, false), | ||
| bundle("hub/controllers/LineGraphController.ts", "LineGraphController.js", false, false), | ||
| ...(isLite ? [] : [bundle("satellite.ts", "satellite.js", false, false)]) | ||
| ]; | ||
| const smallRendererBundles = [ | ||
| bundle("editRange.ts", "editRange.js", false, false), | ||
| bundle("unitConversion.ts", "unitConversion.js", false, false), | ||
| bundle("renameTab.ts", "renameTab.js", false, false), | ||
| bundle("editFov.ts", "editFov.js", false, false), | ||
| bundle("sourceListHelp.ts", "sourceListHelp.js", false, false), | ||
| bundle("betaWelcome.ts", "betaWelcome.js", false, false), | ||
| bundle("preferences.ts", "preferences.js", false, false), | ||
| bundle("licenses.ts", "licenses.js", false, false), | ||
| bundle("download.ts", "download.js", false, false), | ||
| ...(isLite | ||
| ? [bundle("uploadAsset.ts", "uploadAsset.js", false, false)] | ||
| : [bundle("export.ts", "export.js", false, false)]) | ||
| ]; | ||
| const workerBundles = [ | ||
| bundle("hub/dataSources/csv/csvWorker.ts", "hub$csvWorker.js", false, false), | ||
| bundle("hub/dataSources/rlog/rlogWorker.ts", "hub$rlogWorker.js", false, false), | ||
| bundle("hub/dataSources/roadrunnerlog/roadRunnerWorker.ts", "hub$roadRunnerWorker.js", false, false), | ||
| bundle("hub/dataSources/wpilog/wpilogWorker.ts", "hub$wpilogWorker.js", false, false), | ||
| bundle("hub/dataSources/dslog/dsLogWorker.ts", "hub$dsLogWorker.js", false, false), | ||
| ...(isLite ? [] : [bundle("hub/exportWorker.ts", "hub$exportWorker.js", false, false)]), | ||
| bundle("shared/renderers/field3d/workers/loadField.ts", "shared$loadField.js", false, false), | ||
| bundle("shared/renderers/field3d/workers/loadRobot.ts", "shared$loadRobot.js", false, false) | ||
| ]; | ||
| const xrBundles = [ | ||
| bundle("xrClient/xrClient.ts", "xrClient.js", false, true), | ||
| bundle("xrControls.ts", "xrControls.js", false, false) | ||
| ]; | ||
| const runOwletDownload = { | ||
| input: "src/runOwletDownload.ts", | ||
| output: { | ||
| file: "runOwletDownload.js", | ||
| format: "cjs" | ||
| }, | ||
| context: "this", | ||
| external: ["download"], | ||
| plugins: [ | ||
| typescript(), | ||
| nodeResolve({ | ||
| preferBuiltins: true | ||
| }), | ||
| commonjs(), | ||
| json() | ||
| ], | ||
| onwarn() {} | ||
| }; | ||
|
|
||
| export default (cliArgs) => { | ||
| let bundles = []; | ||
|
|
||
| if (cliArgs.configMain) { | ||
| bundles.push(...mainBundles); | ||
| } | ||
|
|
||
| if (cliArgs.oren) { | ||
| bundles.push(...oren); | ||
| } | ||
|
|
||
| if (cliArgs.configLargeRenderers) { | ||
| bundles.push(...largeRendererBundles); | ||
| } | ||
|
|
||
| if (cliArgs.configSmallRenderers) { | ||
| bundles.push(...smallRendererBundles); | ||
| } | ||
|
|
||
| if (cliArgs.configWorkers) { | ||
| bundles.push(...workerBundles); | ||
| } | ||
|
|
||
| if (cliArgs.configXR) { | ||
| if (!isLite) { | ||
| bundles.push(...xrBundles); | ||
| } | ||
| } | ||
|
|
||
| if (cliArgs.configRunOwletDownload) { | ||
| return runOwletDownload; // assuming this should stay exclusive | ||
| } | ||
|
|
||
| // If no flags were passed, return default behavior | ||
| if (bundles.length === 0) { | ||
| return isLite | ||
| ? [...mainBundles, ...largeRendererBundles, ...smallRendererBundles, ...workerBundles] | ||
| : [...mainBundles, ...largeRendererBundles, ...smallRendererBundles, ...workerBundles, ...xrBundles]; | ||
| } | ||
|
|
||
| return bundles; | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason this had to be changed? Just wanted to ask as it seemed unrelated to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wasn't strictly necessary, but the build was taking longer than I would have liked. I can remove it if you prefer, though I don't see any harm in keeping it since it provides useful functionality during builds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi I just checked, and it looks like #509 made
rollup.config.mjsobsolete. Would you like me to remove the file entirely?