Skip to content
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,12 @@ 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
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/>
};
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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"level":"fatal","error":"strict mode: fields in the document are missing in the target struct","time":1778432766986946000,"caller":"/Users/lcastel/workspace/hyper/software/backend/cmd/main.go:50","message":"error unmarshaling toml file"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"level":"info","time":1778434677623324000,"caller":"/Users/lcastel/workspace/hyper/software/backend/pkg/adj/git.go:27","message":"Updating local ADJ repository to match remote branch 'main'"}
Loading
Loading