Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 13 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,16 @@ node_modules/
.env

# Global binaries
*.exe
*.exe

# Flashing view build artifacts
flashing-view/node_modules/
flashing-view/dist/
flashing-view/dist-ssr/
flashing-view/.cache/
flashing-view/*.tsbuildinfo
flashing-view/.env

# electron modules
electron-app/python
electron-app/logger
8 changes: 8 additions & 0 deletions backend/pkg/adj/validator.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package adj

import (
"os"
"os/exec"
"path"
"strings"
Expand Down Expand Up @@ -62,6 +63,13 @@ func Validate() {
// If none of the candidates are found, an empty string is returned,
// indicating that no Python interpreter is available.
func pythonCommand() string {
// Prefer bundled Python shipped with the Electron app
if bundled := os.Getenv("HYPERLOOP_PYTHON_PATH"); bundled != "" {
if _, err := os.Stat(bundled); err == nil {
return bundled
}
}

candidates := []string{"python3", "python", "py"}

for _, c := range candidates {
Expand Down
Binary file removed common-front/public/pod_simplified.glb
Binary file not shown.
Binary file removed control-station/public/pod_simplified.glb
Binary file not shown.
9 changes: 8 additions & 1 deletion control-station/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ import { ReactComponent as Batteries } from 'assets/svg/battery-filled.svg'
import { SplashScreen, WsHandlerProvider, useLoadBackend } from 'common';
import { useEffect } from 'react';

const FlashIcon = () => (
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
<polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2" />
</svg>
);

export const App = () => {
const isProduction = import.meta.env.PROD;
const loadBackend = useLoadBackend(isProduction);
Expand All @@ -29,7 +35,8 @@ export const App = () => {
{ path: '/vehicle', icon: <Wheel /> },
{ path: '/booster', icon: <Cabinet /> },
{ path: '/batteries', icon: <Batteries /> },
{ path: '/cameras', icon: <Cameras /> }
{ path: '/cameras', icon: <Cameras /> },
{ path: '/flash', icon: <FlashIcon /> }
]}
/>
<Outlet />
Expand Down
2 changes: 2 additions & 0 deletions control-station/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { mainPageRoute } from "pages/VehiclePage/MainPage/mainPageRoute";
import { camerasRoute } from "pages/CamerasPage/camerasRoute";
import { batteriesRoute } from "pages/VehiclePage/BatteriesPage/batteriesRoute";
import { boosterRoute } from "pages/VehiclePage/BoosterPage/boosterRoute";
import { flashRoute } from "pages/FlashPage/flashRoute";
import { ConfigProvider, GlobalTicker } from "common";

const router = createHashRouter([
Expand All @@ -21,6 +22,7 @@ const router = createHashRouter([
boosterRoute,
batteriesRoute,
camerasRoute,
flashRoute,
],
},
]);
Expand Down
22 changes: 22 additions & 0 deletions control-station/src/pages/FlashPage/FlashPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { useEffect } from 'react';

export const FlashPage = () => {
useEffect(() => {
if ((window as any).electronAPI?.switchView) {
(window as any).electronAPI.switchView('flashing-view');
}
}, []);

return (
<div style={{
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
height: '100vh',
width: '100%',
color: 'var(--text-color)'
}}>
<p>Opening flashing view...</p>
</div>
);
};
6 changes: 6 additions & 0 deletions control-station/src/pages/FlashPage/flashRoute.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { FlashPage } from "./FlashPage";

export const flashRoute = {
path: "/flash",
element: <FlashPage/>
};
8 changes: 7 additions & 1 deletion electron-app/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Dependencies
node_modules

# Python
python

# Logger
logger

# Build output
dist
dist-ssr
Expand Down Expand Up @@ -82,4 +88,4 @@ coverage
# Config and config backups
config.toml
config.toml.backup-*
version.toml
version.toml
12 changes: 12 additions & 0 deletions electron-app/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ const CONFIG = {
],
optional: true,
},
"flashing-view": {
type: "frontend",
path: join(ROOT, "flashing-view"),
dest: join(__dirname, "renderer/flashing-view"),
commands: ["npm install", "npm run build"],
},
};

// --- Helpers ---
Expand Down Expand Up @@ -240,6 +246,12 @@ _ __ / _ /_/ /__ /_/ / __/ / _ / / /_/ / /_/ /_ /_/ / / /_/ / _ _
logger.header("Hyperloop Control Station Build");

(async () => {
// Setup bundled Python when building backend
if (targetsToBuild.includes("backend")) {
logger.info("Setting up bundled Python for ADJ validation...");
run("node scripts/setup-python.mjs", __dirname);
}

let frontendBuilt = false;
let allSuccess = true;

Expand Down
Loading
Loading