Skip to content

Commit 74f8b89

Browse files
authored
Merge branch 'develop' into Uploadable-Playbackable-Videos
2 parents e5d6024 + ae08fab commit 74f8b89

82 files changed

Lines changed: 1874 additions & 330 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ updates:
33
- package-ecosystem: "cargo"
44
directory: "/scylla-server/"
55
schedule:
6-
interval: "weekly"
6+
interval: "monthly"
77
# Enable version updates for GitHub Actions
88
- package-ecosystem: "github-actions"
99
# Workflow files stored in the default location of `.github/workflows`
1010
# You don't need to specify `/.github/workflows` for `directory`. You can use `directory: "/"`.
1111
directory: "/"
1212
schedule:
13-
interval: "weekly"
13+
interval: "monthly"

angular-client/src/app/app-nav-bar/app-nav-bar.component.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { interval, map, Observable, startWith } from 'rxjs';
55
import { startNewRun } from 'src/api/run.api';
66
import APIService from 'src/services/api.service';
77
import SidebarService from 'src/services/sidebar.service';
8+
import { appRoutes } from '../app-routing.module';
89

910
interface NavItem {
1011
label: string;
@@ -57,13 +58,14 @@ export class AppNavBarComponent implements OnInit {
5758
};
5859

5960
navItems: NavItem[] = [
60-
{ label: 'Home', route: '/landing', icon: 'home' },
61-
{ label: 'Charging', route: '/charging', icon: 'ev_station' },
62-
{ label: 'Graph', route: '/graph', icon: 'bar_chart' },
63-
{ label: 'Map', route: '/map', icon: 'map' },
64-
{ label: 'BMS', route: '/bms', icon: 'action_key' },
65-
{ label: 'Faults', route: '/faults', icon: 'error' },
66-
{ label: 'Camera', route: '/camera', icon: 'linked_camera' }
61+
{ label: 'Home', route: appRoutes.landingRoute(), icon: 'home' },
62+
{ label: 'Charging', route: appRoutes.chargingRoute(), icon: 'ev_station' },
63+
{ label: 'Graph', route: appRoutes.graphRoute(), icon: 'bar_chart' },
64+
// TODO: fix map
65+
// { label: 'Map', route: appRoutes.mapRoute(), icon: 'map' },
66+
{ label: 'BMS', route: appRoutes.bmsRoute(), icon: 'action_key' },
67+
{ label: 'Faults', route: appRoutes.faultsRoute(), icon: 'error' },
68+
{ label: 'Camera', route: appRoutes.cameraRoute(), icon: 'linked_camera' }
6769
];
6870

6971
navigateTo(route: string): void {

angular-client/src/app/app-routing.module.ts

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,47 @@
11
import { NgModule } from '@angular/core';
22
import { RouterModule, Routes } from '@angular/router';
33
import { BmsDebugPageComponent } from 'src/pages/bms-debug-page/bms-debug-page.component';
4+
import { BmsSegmentViewComponent } from 'src/pages/bms-debug-page/bms-segment-view/bms-segment-view.component';
45
import { CameraPageComponent } from 'src/pages/camera-page/camera-page.component';
56
import ChargingPageComponent from 'src/pages/charging-page/charging-page.component';
67
import FaultPageComponent from 'src/pages/fault-page/fault-page.component';
78
import GraphPageComponent from 'src/pages/graph-page/graph-page.component';
89
import LandingPageComponent from 'src/pages/landing-page/landing-page.component';
910
import MapComponent from 'src/pages/map/map.component';
11+
import { Segment } from 'src/utils/bms.utils';
1012

13+
const landingRoute = () => `/landing`;
14+
const graphRoute = () => `/graph`;
15+
const mapRoute = () => `/map`;
16+
const chargingRoute = () => `/charging`;
17+
const bmsRoute = () => `/bms`;
18+
const bmsSegmentViewRoute = (id: Segment) => `/bms/segment/${id + 1}`;
19+
const cameraRoute = () => `/camera`;
20+
const faultsRoute = () => `/faults`;
21+
const faultsGraphRoute = () => `/faults/fault-graph`;
22+
23+
export const appRoutes = {
24+
landingRoute,
25+
graphRoute,
26+
mapRoute,
27+
chargingRoute,
28+
bmsRoute,
29+
bmsSegmentViewRoute,
30+
cameraRoute,
31+
faultsRoute,
32+
faultsGraphRoute
33+
};
34+
35+
// Routes should be defined carefully in accordance with the appRoutes
1136
const routes: Routes = [
1237
{ path: 'landing', component: LandingPageComponent },
1338
{ path: 'graph', component: GraphPageComponent },
14-
{ path: '', redirectTo: '/landing', pathMatch: 'full' },
39+
{ path: '', redirectTo: appRoutes.landingRoute(), pathMatch: 'full' },
1540
{ path: 'map', component: MapComponent },
1641
{ path: 'charging', component: ChargingPageComponent },
1742
{ path: 'bms', component: BmsDebugPageComponent },
43+
// NOTE: paramaterized routes should be even more carefully defined in accordance with the appRoutes
44+
{ path: 'bms/segment/:id', component: BmsSegmentViewComponent },
1845
{ path: 'faults', component: FaultPageComponent },
1946
{ path: 'faults/fault-graph', component: GraphPageComponent },
2047
{ path: 'camera', component: CameraPageComponent }

angular-client/src/app/app.module.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,14 @@ import { FaultDisplayInfoComponent } from 'src/pages/graph-page/graph-caption/fa
135135
import { FaultButtonsComponent } from 'src/pages/graph-page/graph-caption/fault-buttons/fault-buttons.component';
136136
import { GeneralDisplayInfoComponent } from 'src/pages/graph-page/graph-caption/general-display-info/general-display-info.component';
137137
import { CameraPageComponent } from 'src/pages/camera-page/camera-page.component';
138+
import { BmsSegmentViewComponent } from 'src/pages/bms-debug-page/bms-segment-view/bms-segment-view.component';
139+
import { SegmentAtAGlanceComponent } from 'src/pages/bms-debug-page/components/segment-at-a-glance/segment-at-a-glance.component';
140+
import { CellByCellHeatMapComponent } from 'src/pages/bms-debug-page/components/cell-by-cell-heat-map/cell-by-cell-heat-map.component';
141+
import { CellViewComponent } from 'src/pages/bms-debug-page/components/cell-view/cell-view.component';
142+
import { ChipDiagnosticsComponent } from 'src/pages/bms-debug-page/components/chip-diagnostics/chip-diagnostics.component';
143+
import { ChipFaultsComponent } from 'src/pages/bms-debug-page/components/chip-faults/chip-faults.component';
144+
import { CellTileComponent } from 'src/pages/bms-debug-page/components/cell-by-cell-heat-map/cell-tile/cell-tile.component';
145+
import { ChipFaultPipe } from 'src/utils/pipes/chip-fault.pipe';
138146

139147
@NgModule({
140148
declarations: [
@@ -193,6 +201,7 @@ import { CameraPageComponent } from 'src/pages/camera-page/camera-page.component
193201
BatteryInfoDesktopComponent,
194202
BatteryInfoMobileComponent,
195203
NodeFilterPipe,
204+
ChipFaultPipe,
196205
CombinedStatusDisplayComponent,
197206
StateOfChargeDisplayComponent,
198207
PackTempComponent,
@@ -243,7 +252,14 @@ import { CameraPageComponent } from 'src/pages/camera-page/camera-page.component
243252
FaultButtonsComponent,
244253
GeneralDisplayInfoComponent,
245254
FaultDisplayInfoComponent,
246-
CameraPageComponent
255+
CameraPageComponent,
256+
BmsSegmentViewComponent,
257+
SegmentAtAGlanceComponent,
258+
CellViewComponent,
259+
CellByCellHeatMapComponent,
260+
ChipDiagnosticsComponent,
261+
ChipFaultsComponent,
262+
CellTileComponent
247263
],
248264
bootstrap: [AppContextComponent],
249265
imports: [
@@ -279,6 +295,7 @@ import { CameraPageComponent } from 'src/pages/camera-page/camera-page.component
279295
providers: [
280296
DialogService,
281297
MessageService,
298+
ChipFaultPipe,
282299
provideHttpClient(withInterceptorsFromDi()),
283300
provideClientHydration(),
284301
provideAnimationsAsync(),

angular-client/src/app/context/app-context.component.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { Component, OnInit, inject } from '@angular/core';
22
import { io } from 'socket.io-client';
33
import { environment } from 'src/environment/environment';
4+
import { CellService } from 'src/services/cell.service';
5+
import { HeatMapService } from 'src/services/heat-map.service';
46
import { FaultService } from 'src/services/fault.service';
57
import SocketService from 'src/services/socket.service';
68
import Storage from 'src/services/storage.service';
@@ -14,12 +16,16 @@ import Storage from 'src/services/storage.service';
1416
})
1517
export default class AppContextComponent implements OnInit {
1618
private storage = inject(Storage);
19+
private cellService = new CellService(this.storage);
20+
private heatmapService = inject(HeatMapService);
1721
private faultService = inject(FaultService);
22+
private chipFaultPipe = inject(FaultService);
1823
// eslint-disable-next-line @typescript-eslint/no-explicit-any
1924
socket = io((environment as any).url || 'http://localhost:8000');
2025
socketService = new SocketService(this.socket);
2126

2227
ngOnInit(): void {
28+
this.cellService.updateCellInfo();
2329
this.socketService.receiveData(this.storage, this.faultService);
2430
}
2531
}

angular-client/src/components/info-background/info-background.component.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,22 @@ mat-icon {
1111
width: 100%;
1212
}
1313

14+
.container.sliced-left-corner {
15+
padding: 15px 12px 12px 15px;
16+
clip-path: polygon(125px 0, 100% 0, 100% 100%, 0 100%, 0 145px);
17+
}
18+
1419
.title-container {
1520
display: flex;
1621
flex-direction: row;
1722
align-items: center;
1823
justify-content: space-between;
1924
}
2025

26+
.title.sliced-left-corner {
27+
padding-left: 120px;
28+
}
29+
2130
.title {
2231
display: flex;
2332
flex-direction: row;

angular-client/src/components/info-background/info-background.component.html

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
<div class="container" (click)="onClick ? onClick() : undefined" [style]="{ 'background-color': backgroundColor }">
2-
@if (title) {
1+
<div
2+
class="container"
3+
(click)="onClick()?.()"
4+
[style]="{ 'background-color': this.backgroundColor() }"
5+
[class.sliced-left-corner]="this.slicedLeftCorner()"
6+
>
7+
@if (this.title(); as title) {
38
<div class="title-container">
4-
<div class="title">
5-
@if (icon) {
9+
<div class="title" [class.sliced-left-corner]="this.slicedLeftCorner()">
10+
@if (this.icon(); as icon) {
611
<mat-icon aria-hidden="false" [fontIcon]="icon" />
712
}
8-
@if (svgIcon) {
13+
@if (this.svgIcon(); as svgIcon) {
914
<mat-icon aria-hidden="false" [svgIcon]="svgIcon" />
1015
}
1116
<typography variant="info-title" content="{{ title }}" />
@@ -22,9 +27,17 @@
2227
}
2328
</div>
2429
}
30+
@if (this.selectorConfig(); as selectorConfig) {
31+
<select-dropdown [options]="selectorConfig.options" [placeholder]="selectorConfig.placeholder"></select-dropdown>
32+
}
33+
@if (this.topRightInfo(); as topRightInfo) {
34+
<div class="top-right-info">
35+
<typography variant="info-subtitle" [content]="topRightInfo" additionalStyles="fontSize: 19px;" />
36+
</div>
37+
}
2538
</div>
2639
}
27-
@if (onClick) {
40+
@if (this.onClick(); as onClick) {
2841
<typography additionalStyles="text-align: left;" variant="info-subtitle" content="Click for more details" />
2942
}
3043
<ng-content />

angular-client/src/components/info-background/info-background.component.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { Component, Input } from '@angular/core';
1+
import { Component, input, Input } from '@angular/core';
22
import Theme from 'src/services/theme.service';
3+
import { SelectorConfig } from '../select-dropdown/select-dropdown.component';
34

45
/**
56
* Component that is essentially the template/background for
@@ -17,10 +18,14 @@ interface ButtonInputs {
1718
styleUrls: ['./info-background.component.css']
1819
})
1920
export class InfoBackgroundComponent {
20-
@Input() icon?: string;
21-
@Input() svgIcon?: string;
22-
@Input() backgroundColor?: string = Theme.infoBackground;
23-
@Input() title!: string;
24-
@Input() onClick!: (() => void) | undefined;
21+
icon = input<string>();
22+
svgIcon = input<string>();
23+
backgroundColor = input<Theme>(Theme.infoBackground);
24+
title = input<string>();
25+
onClick = input<(() => void) | undefined>(undefined);
2526
@Input() button?: ButtonInputs;
27+
selectorConfig = input<SelectorConfig | undefined>(undefined);
28+
topRightInfo = input<string | undefined>(undefined);
29+
30+
slicedLeftCorner = input<boolean>(false); // slice out the upper left corner
2631
}

angular-client/src/components/info-value-dispaly/info-value-display.component.html

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
<vstack spacing="0px" [style]="containerStyle()">
22
<hstack spacing="5px" [style]="valueUnitContainerStyle()">
3-
<typography variant="info-value" [content]="formattedValue" />
4-
<typography variant="info-unit" [content]="unit()" />
3+
@if (this.boolValue() !== undefined) {
4+
<typography variant="info-value" [content]="this.boolValue() ? 'YES' : 'NO'" />
5+
<typography variant="info-unit" [content]="this.unit()" />
6+
} @else {
7+
<typography variant="info-value" [content]="this.formattedValue" style="margin-bottom: -10px" />
8+
<typography variant="info-unit" [content]="this.unit()" />
9+
}
510

611
@if (this.enableWidget() && this.widget(); as widget) {
712
@switch (widget.type) {
@@ -24,7 +29,7 @@
2429
}
2530
</hstack>
2631

27-
@if (subtitle() !== '') {
28-
<typography variant="info-subtitle" [content]="subtitle()" [additionalStyles]="subtitleStyle()" />
32+
@if (this.subtitle() !== '') {
33+
<typography variant="info-subtitle" [content]="subtitle()" [additionalStyles]="this.getSubtitleStyle()" />
2934
}
3035
</vstack>

angular-client/src/components/info-value-dispaly/info-value-display.component.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export class InfoValueDisplayComponent implements OnInit, OnChanges {
3434
containerStyle = input<string>('');
3535
valueUnitContainerStyle = input<string>('');
3636
value = input<number>();
37+
boolValue = input<boolean>();
3738
precision = input<number>(1);
3839
subtitle = input<string>('');
3940
subtitleStyle = input<string>('');
@@ -51,4 +52,11 @@ export class InfoValueDisplayComponent implements OnInit, OnChanges {
5152
getStatusMessage = (connectDotConfig: ConnectionDotConfig): (() => string) => {
5253
return connectDotConfig.getStatusMessage ? connectDotConfig.getStatusMessage : () => '';
5354
};
55+
56+
getSubtitleStyle = (): string => {
57+
if (this.unit() === '' && this.boolValue() === undefined) {
58+
return this.subtitleStyle() + 'margin-top: 1vh';
59+
}
60+
return this.subtitleStyle();
61+
};
5462
}

0 commit comments

Comments
 (0)