Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
1d5ba18
new version of the control-station
ariadnatp Jun 25, 2025
13df8c6
some variable changes (LCU: current and orientation)
ariadnatp Jun 25, 2025
276acd2
layout
ariadnatp Jul 2, 2025
5475bf7
changes
ariadnatp Jul 3, 2025
f344d3d
layout controlStation
ariadnatp Jul 4, 2025
27c2d31
Fix things
JFisica Jul 4, 2025
17d7cf9
Spelling
JFisica Jul 4, 2025
a2c08f6
Update .gitignore
JFisica Jul 4, 2025
73cf12a
Merge branch 'develop' into control-station/new-version
JFisica Jul 5, 2025
eb47251
Use StateIndicator for HVSCU
JFisica Jul 5, 2025
8c778b1
update imports
msanlli Jul 5, 2025
71e20e8
refactor: restructure main menu for new packet sending flow
msanlli Jul 6, 2025
84c2568
feat: add ManualMode flag to disable automatic packet generation
msanlli Jul 6, 2025
7226aca
feat: add root command with interactive mode as default
msanlli Jul 6, 2025
c236d1f
feat: add run command for automatic board simulation
msanlli Jul 6, 2025
de3841f
feat: add send command for individual packet sending
msanlli Jul 6, 2025
a044dbc
feat: add list command to explore boards and packets
msanlli Jul 6, 2025
817809f
feat: add logger package with console output
msanlli Jul 6, 2025
158de77
feat: add utils package for ADJ loading and directory operations
msanlli Jul 6, 2025
54b456f
feat: add common types for packet type detection
msanlli Jul 6, 2025
c2ef6ee
feat: add monitoring dashboard for packet statistics
msanlli Jul 6, 2025
96a79f4
feat: add data packet generator with realistic values
msanlli Jul 6, 2025
3549d97
feat: add protection packet generator with fault simulation
msanlli Jul 6, 2025
d5f670a
feat: add state packet generator for state machine transitions
msanlli Jul 6, 2025
1f76dcd
feat: add order acknowledgment packet generator
msanlli Jul 6, 2025
c4cdffd
refactor: simplify main.go to use cobra commands
msanlli Jul 6, 2025
2b5f9f1
chore: update .gitignore for new structure
msanlli Jul 6, 2025
286a6d5
chore: update dependencies for cobra and viper
msanlli Jul 6, 2025
6252789
refactor: remove old packet selector and sender implementations
msanlli Jul 6, 2025
0d190c1
docs: add comprehensive packet sender documentation
msanlli Jul 6, 2025
87694af
chore: add compiled binary to repo
msanlli Jul 6, 2025
3296107
feat: add packet-sender to dev.sh script
msanlli Jul 6, 2025
b3a54c1
feat: add packet-sender to dev.cmd script
msanlli Jul 6, 2025
8867280
feat: add packet-sender to dev.ps1 script
msanlli Jul 6, 2025
6781f6b
feat: add packet-sender to dev-unified.sh script
msanlli Jul 6, 2025
097f0f4
chore: update backend config.toml
msanlli Jul 6, 2025
43aaeae
chore: update go.work.sum
msanlli Jul 6, 2025
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ backend/cmd/cmd
# Claude
CLAUDE*
.claude

packet-sender/packet_sender
packet-sender/adj/

*.exe
1 change: 1 addition & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ downloads
audience_static

cmd/adj/
cmd/config.toml
10 changes: 5 additions & 5 deletions backend/cmd/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@

# Control Station general configuration
[app]
automatic_window_opening = "both" # Leave blank to open no windows (<blank>, ethernet-view, control-station, both)
automatic_window_opening = "" # Leave blank to open no windows (<blank>, ethernet-view, control-station, both)

# Vehicle Configuration
[vehicle]
boards = ["HVSCU", "PCU", "BLCU"]
boards = ["HVSCU-Cabinet", "BCU", "LCU", "OBCCU", "VCU"]

# ADJ (Architecture Description JSON) Configuration
[adj]
branch = "main" # Leave blank when using ADJ as a submodule (like this: "")
test = true # Enable test mode
branch = "software" # Leave blank when using ADJ as a submodule (like this: "")
test = true # Enable test mode

# Network Configuration
[network]
manual = false # Manual network device selection

# Transport Configuration
[transport]
propagate_fault = true
propagate_fault = false

# TCP Configuration
# These settings control how the backend reconnects to boards when connections are lost
Expand Down
2 changes: 1 addition & 1 deletion common-front/lib/components/Connections/useConnections.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useConnectionsStore, useMeasurementsStore, usePodDataStore, useSubscribe } from "../..";
import { useConnectionsStore, useMeasurementsStore, usePodDataStore, useSubscribe } from "../../";

export function useConnections() {

Expand Down
955 changes: 352 additions & 603 deletions control-station/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion control-station/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@vitejs/plugin-react": "^3.0.0",
"sass": "^1.57.1",
"typescript": "^4.9.3",
"vite": "^4.3.9",
"vite": "^4.5.14",
"vite-plugin-svgr": "^2.4.0",
"vite-tsconfig-paths": "^4.0.3"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
@use 'src/styles/fonts';

.battery_indicator {
position: relative;

height: 6rem;
width: 15%;
overflow: hidden;

padding: 8px;

display: flex;
flex-flow: row;
align-items: center;
justify-content: space-between;
gap: 4px;
}

.range_bar {
position: absolute;
top: 0;
bottom: 0;
left: 0;

height: 100%;

box-shadow: linear-gradient(currentColor);
background-color: currentColor;

transition: width 0.1s ease-in-out;
}

.name_display,
.value_display {
display: flex;
flex-flow: row;
align-items: center;
gap: 4px;
}

.name_display {
width: 100%;
}

.icon {
max-width: 10px;

opacity: 0.8;
}

.name {
width: 100%;

margin: 0;

opacity: 0.8;

font-size: 14px;
font-style: italic;
font-weight: 300;
text-overflow: ellipsis;
}

.value,
.units {
opacity: 0.8;

margin: 0;

font-size: 20px;
font-weight: 400;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
import { useGlobalTicker } from 'common';
import styles from './BatteryIndicator.module.scss';
import {
getPercentageFromRange,
getStateFromRange,
stateToColor,
stateToColorBackground,
} from 'state';
import { memo, useContext, useEffect, useRef, useState } from 'react';
import { LostConnectionContext } from 'services/connections';

interface Props {
icon?: string;
name: string;
getValue: () => number;
safeRangeMin: number;
warningRangeMin: number;
safeRangeMax: number;
warningRangeMax: number;
units?: string;
color?: string;
backgroundColor?: string;
className?: string;
}

export const BatteryIndicator = memo(
({
icon,
name,
getValue,
safeRangeMin,
warningRangeMin,
safeRangeMax,
warningRangeMax,
units,
color,
backgroundColor,
className,
}: Props) => {
const [valueState, setValueState] = useState<number>(0);
const lostConnection = useContext(LostConnectionContext);

const percentage = lostConnection
? 100
: getPercentageFromRange(
valueState,
warningRangeMin,
warningRangeMax
);
const state = lostConnection
? 'fault'
: getStateFromRange(
valueState,
safeRangeMin,
safeRangeMax,
warningRangeMin,
warningRangeMax
);

useGlobalTicker(() => {
setValueState(getValue());
});

return (
<div
className={`${styles.battery_indicator} ${className}`}
style={{
backgroundColor:
backgroundColor != undefined
? backgroundColor
: stateToColorBackground[state],
}}
>
<div
className={styles.range_bar}
style={{
width: percentage + '%',
color: color != undefined ? color : stateToColor[state],
}}
/>

<div className={styles.name_display}>
<img className={styles.icon} src={icon} />
<p className={styles.name}>{name}</p>
</div>
<div className={styles.value_display}>
<p className={styles.value}>
{lostConnection ? '-.--' : valueState?.toFixed(2)}
</p>
<p className={styles.units}>{units}</p>
</div>
</div>
);
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
width: 100%;
display: flex;
gap: 1rem;

> * {
flex: 1;
flex: 1rem;
}
}

Expand All @@ -13,7 +12,6 @@
display: flex;
justify-content: center;
align-items: center;

> img {
width: 60%;
}
Expand Down
24 changes: 12 additions & 12 deletions control-station/src/components/LevitationUnit/LevitationUnit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ export interface Props {
}

export const currentMeasurements = [
LcuMeasurements.coilCurrentHEMS1,
LcuMeasurements.coilCurrentHEMS2,
LcuMeasurements.coilCurrentHEMS3,
LcuMeasurements.coilCurrentHEMS4,
LcuMeasurements.coilCurrentEMS1,
LcuMeasurements.coilCurrentEMS2,
LcuMeasurements.coilCurrentEMS3,
LcuMeasurements.coilCurrentEMS4,
LcuMeasurements.coilCurrentEMS5,
LcuMeasurements.coilCurrentEMS6,
LcuMeasurements.lcu_coil_current_1,
LcuMeasurements.lcu_coil_current_2,
LcuMeasurements.lcu_coil_current_3,
LcuMeasurements.lcu_coil_current_4,
LcuMeasurements.lcu_coil_current_5,
LcuMeasurements.lcu_coil_current_6,
LcuMeasurements.lcu_coil_current_7,
LcuMeasurements.lcu_coil_current_8,
LcuMeasurements.lcu_coil_current_9,
LcuMeasurements.lcu_coil_current_10
];

export const temperatureMeasurements = [
Expand Down Expand Up @@ -110,7 +110,7 @@ export const LevitationUnit = ({ unitIndex, kind, imageSide }: Props) => {
warningRangeMin={current.warningRange[0]!!}
warningRangeMax={current.warningRange[1]!!}
/>
<BarIndicator
{/* <BarIndicator
icon={thermometerFilled}
name="Temperature"
getValue={temperature.getUpdate}
Expand Down Expand Up @@ -161,7 +161,7 @@ export const LevitationUnit = ({ unitIndex, kind, imageSide }: Props) => {
? null!!
: airgap.warningRange[1]!!
}
/>
/> */}
</IndicatorStack>
{imageSide === 'right' &&
(kind == 'ems' ? (
Expand Down
29 changes: 29 additions & 0 deletions control-station/src/components/Window/Window2.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
@use 'src/styles/colors';
@use 'src/styles/fonts';

.window {
display: flex;
flex-flow: column;
border-radius: 0.8rem;
filter: var(--shadow);
overflow: hidden;
width: 100%;
}

.header {
background-color: #D1E3F1;
color: #5894A7;
font-weight: bold;
padding: 0.3rem 0.6rem;
font-size: map-get($map: fonts.$font-sizes, $key: x-small);
}

.content {
display: flex;
justify-content: center;
padding: 0.6rem;
background-color: colors.getColor('primary', 99);
overflow: scroll;
height: 100%;
width: 100%;
}
16 changes: 16 additions & 0 deletions control-station/src/components/Window/Window2.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import styles from 'components/Window/Window2.module.scss';

type Props = {
title: string;
children?: React.ReactNode;
className?: string;
};

export const Window2 = ({ title, children, className }: Props) => {
return (
<article className={`${styles.window} ${className}`}>
<header className={styles.header}>{title}</header>
<div className={styles.content}>{children}</div>
</article>
);
};
Loading
Loading