Skip to content

Commit

Permalink
Merge branch 'develop' into #191-self-closing-tags
Browse files Browse the repository at this point in the history
  • Loading branch information
RChandler234 committed Nov 10, 2024
2 parents fa83451 + 1b17b83 commit 824df39
Show file tree
Hide file tree
Showing 21 changed files with 213 additions and 72 deletions.
21 changes: 13 additions & 8 deletions angular-client/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import Thermometer from 'src/components/thermometer/thermometer.component';
import { FlexLayoutModule } from '@angular/flex-layout';
import HStack from 'src/components/hstack/hstack.component';
import VStack from 'src/components/vstack/vstack.component';
import LatencyDisplay from 'src/components/latency-display/latency-display';
import { ProgressSpinnerModule } from 'primeng/progressspinner';
import { MatIconModule } from '@angular/material/icon';
import { MatGridListModule } from '@angular/material/grid-list';
Expand All @@ -53,8 +52,6 @@ import { DriverComponent } from 'src/components/driver-component/driver-componen
import PieChart from 'src/components/pie-chart/pie-chart.component';
import RasberryPi from 'src/components/raspberry-pi/raspberry-pi.component';
import { AccelerationGraphs } from 'src/components/acceleration-graphs/acceleration-graphs.component';
import ViewerDisplay from 'src/components/viewer-display/viewer-display.component';
import ConnectionDisplay from 'src/components/connection-display/connection-display.component';
import SpeedDisplay from 'src/components/speed-display/speed-display.component';
import SpeedOverTimeDisplay from 'src/components/speed-over-time-display/speed-over-time-display.component';
import TorqueDisplay from 'src/components/torque-display/torque-display.component';
Expand All @@ -73,8 +70,8 @@ import { MatToolbarModule } from '@angular/material/toolbar';
import { MatButtonModule } from '@angular/material/button';
import { MatInputModule } from '@angular/material/input';
import { ReactiveFormsModule } from '@angular/forms';
import { NodeFilterPipe } from 'src/utils/pipes/node-filter-pipe';
import { DataTypeFilterPipe } from 'src/utils/pipes/data-type-filter-pipe';
import { NodeFilterPipe } from 'src/utils/pipes/node-filter.pipe';
import { DataTypeFilterPipe } from 'src/utils/pipes/data-type-filter.pipe';
import { SwitchComponent } from 'src/components/switch/switch.component';
import { DoubleLineGraphComponent } from 'src/components/double-line-graph/double-line-graph.component';
import BatteryInfoDesktop from 'src/pages/charging-page/components/battery-info-display/battery-info-desktop/battery-info-desktop.component';
Expand Down Expand Up @@ -104,6 +101,11 @@ import CombinedStatusMobile from 'src/pages/charging-page/components/combined-st
import PackVoltageMobileDisplay from 'src/pages/charging-page/components/pack-voltage/pack-voltage-display/pack-voltage-mobile/pack-voltage-mobile.component';
import HighLowCellMobile from 'src/pages/charging-page/components/high-low-cell/high-low-cell-display/high-low-cell-mobile/high-low-cell-mobile.component';
import CellTempMobile from 'src/pages/charging-page/components/cell-temp/cell-temp-display/cell-temp-mobile/cell-temp-mobile.component';
import ConnectionDisplay from 'src/pages/landing-page/components/connection-display/connection-display.component';
import { CurrentRunDisplay } from 'src/pages/landing-page/components/current-run-display/current-run-display.component';
import LatencyDisplay from 'src/components/latency-display/latency-display';
import { DateLocation } from 'src/pages/landing-page/components/date-location-display/date-location.component';
import { ViewerDisplay } from 'src/pages/landing-page/components/viewer-display/viewer-display.component';

@NgModule({
declarations: [
Expand Down Expand Up @@ -134,7 +136,6 @@ import CellTempMobile from 'src/pages/charging-page/components/cell-temp/cell-te
Thermometer,
VStack,
HStack,
LatencyDisplay,
BatteryInfoDisplay,
GraphComponent,
InfoGraph,
Expand All @@ -147,7 +148,6 @@ import CellTempMobile from 'src/pages/charging-page/components/cell-temp/cell-te
PieChart,
AccelerationGraphs,
ViewerDisplay,
ConnectionDisplay,
SpeedDisplay,
SpeedOverTimeDisplay,
TorqueDisplay,
Expand Down Expand Up @@ -191,7 +191,12 @@ import CellTempMobile from 'src/pages/charging-page/components/cell-temp/cell-te
CombinedStatusMobile,
PackVoltageMobileDisplay,
HighLowCellMobile,
CellTempMobile
CellTempMobile,
ConnectionDisplay,
LatencyDisplay,
DateLocation,
CurrentRunDisplay,
ViewerDisplay
],
bootstrap: [AppContext],
imports: [
Expand Down

This file was deleted.

This file was deleted.

Empty file.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.connection-display {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100%;
}

.connection-display-data {
display: flex;
justify-content: center;
}

.connection-dot {
display: flex;
justify-content: center;
width: 20px;
height: 20px;
border-radius: 50%;
margin-right: 5px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<info-background>
<div class="connection-display">
<div class="connection-display-title">
<typography variant="header" content="Connection" additionalStyles="margin: 0px;"></typography>
</div>

<div class="connection-display-data">
<div
class="connection-dot"
[style.background-color]="getConnectedColor(connected)"
additionalStyles="height: 15px;"
></div>
<typography variant="info-subtitle" [content]="getConnectedStatus(connected)" />
</div>
</div>
</info-background>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Storage from 'src/services/storage.service';
@Component({
selector: 'connection-display',
templateUrl: './connection-display.component.html',
styleUrls: ['./connection-display.component.css']
styleUrl: './connection-display.component.css'
})
export default class ConnectionDisplay {
connected: boolean = false;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.current-run-display {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100%;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<info-background>
<div class="current-run-display">
<typography variant="header" content="Current Run" additionalStyles="margin: 0px" />
<typography variant="info-subtitle" content="#{{ currentRun }}" additionalStyles="margin: 0px" />
</div>
</info-background>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Component } from '@angular/core';
import Storage from 'src/services/storage.service';

@Component({
selector: 'current-run-display',
templateUrl: './current-run-display.component.html',
styleUrl: './current-run-display.component.css'
})
export class CurrentRunDisplay {
currentRun: number = 0;
constructor(private storage: Storage) {}

ngOnInit() {
this.storage.getCurrentRunId().subscribe((runId) => {
if (runId) {
this.currentRun = runId;
}
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.date-location-display {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100%;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<info-background>
<div class="date-location-display">
<typography variant="header" content="{{ time | date: 'MM/dd/yyyy' }}" additionalStyles="margin: 0px" />
<typography variant="info-subtitle" content="{{ location }}" />
</div>
</info-background>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { Component, HostListener } from '@angular/core';
import { MessageService } from 'primeng/api';

Check warning on line 2 in angular-client/src/pages/landing-page/components/date-location-display/date-location.component.ts

View workflow job for this annotation

GitHub Actions / run-linting-check

'MessageService' is defined but never used
import { startNewRun } from 'src/api/run.api';

Check warning on line 3 in angular-client/src/pages/landing-page/components/date-location-display/date-location.component.ts

View workflow job for this annotation

GitHub Actions / run-linting-check

'startNewRun' is defined but never used
import APIService from 'src/services/api.service';

Check warning on line 4 in angular-client/src/pages/landing-page/components/date-location-display/date-location.component.ts

View workflow job for this annotation

GitHub Actions / run-linting-check

'APIService' is defined but never used
import Storage from 'src/services/storage.service';
import { IdentifierDataType } from 'src/utils/enumerations/identifier-data-type';

@Component({
selector: 'date-location',
templateUrl: './date-location.component.html',
styleUrl: './date-location.component.css'
})
export class DateLocation {
time = new Date();
location: string = 'Boston, MA';
mobileThreshold = 1070;
isMobile = window.innerWidth < this.mobileThreshold;

constructor(private storage: Storage) {}

ngOnInit() {
setInterval(() => {
this.time = new Date();
}, 1000);

this.storage.get(IdentifierDataType.LOCATION).subscribe((value) => {
[this.location] = value.values || ['No Location Set'];
});
}

@HostListener('window:resize', ['$event'])
onResize() {
this.isMobile = window.innerWidth <= this.mobileThreshold;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.viewer-display {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100%;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<info-background>
<div class="viewer-display">
<typography variant="header" content="Viewers" additionalStyles="margin: 0px" />
<typography variant="info-subtitle" [content]="numViewers.toString()" />
</div>
</info-background>
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { IdentifierDataType } from 'src/utils/enumerations/identifier-data-type'
@Component({
selector: 'viewer-display',
templateUrl: './viewer-display.component.html',
styleUrls: ['./viewer-display.component.css']
styleUrl: './viewer-display.component.css'
})
export default class ViewerDisplay implements OnInit {
export class ViewerDisplay implements OnInit {
numViewers: number = 0;
constructor(private storage: Storage) {}

Expand Down
101 changes: 66 additions & 35 deletions angular-client/src/pages/landing-page/landing-page.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,73 @@
@if (isMobile) {
<landing-page-mobile style="width: 100%" [time]="time" />
} @else {
<vstack style="width: 100%" spacing="40px">
<hstack style="width: 100%">
<vstack style="width: 50%">
<typography style="width: 100%; text-align: center" variant="xx-large-title" [content]="time | date: 'HH:mm:ss'" />
<driver-component style="width: 100%" />
</vstack>
<vstack style="width: 50%">
<hstack style="width: 100%"
><typography variant="header" content="{{ time | date: 'MM/dd/yyyy' }} | {{ location }} " />
<latency-display style="width: 40%" />
<toast-button [onClick]="this.onStartNewRun" label="Start New Run" />
</hstack>
<hstack style="width: 100%">
<viewer-display style="height: 200px; width: 33%" />
<torque-display style="height: 200px; width: 33%" />
<connection-display style="height: 200px; width: 33%" />
</hstack>
</vstack>
</hstack>
<hstack style="width: 100%">
<vstack style="width: 50%" spacing="20px">
<div style="display: flex; flex-direction: column">
<div style="width: 100%; padding-bottom: 0px; padding-top: 10px; display: flex; justify-content: flex-end">
<toast-button [onClick]="this.onStartNewRun" label="Start New Run" />
</div>

<div style="width: 100%; display: grid; column-gap: 10px; row-gap: 10px">
<div style="display: flex; justify-content: center; grid-column-start: 1; grid-column-end: 3; height: 100%">
<typography
variant="xx-large-title"
[content]="time | date: 'HH:mm:ss'"
additionalStyles="font-size: 7rem; text-align: center-bottom"
/>
</div>
<div style="display: flex; grid-column-start: 3; grid-column-end: 4">
<date-location style="height: 100%; width: 100%" />
</div>
<div style="display: flex; grid-column-start: 4; grid-column-end: 5">
<connection-display style="height: 100%; width: 100%" />
</div>

<div style="display: flex; grid-column-start: 5; grid-column-end: 6">
<current-run-display style="height: 100%; width: 100%" />
</div>

<div style="display: flex; grid-column-start: 6; grid-column-end: 7">
<viewer-display style="width: 100%; height: 100%" />
</div>

<div style="display: flex; grid-column-start: 1; grid-column-end: 3">
<driver-component style="width: 100%; height: 250px" />
</div>
<div style="display: flex; grid-column-start: 3; grid-column-end: 4">
<torque-display style="width: 100%; height: 250px" />
</div>
<div style="display: flex; grid-column-start: 4; grid-column-end: 7">
<motor-info style="width: 100%; height: 100%" />
</div>

<div
style="
display: flex;
flex-direction: column;
height: 550px;
justify-content: space-between;
grid-column-start: 1;
grid-column-end: 4;
"
>
<speed-over-time-display style="width: 100%" />
<acceleration-over-time-display style="width: 100%" />
</vstack>
<acceleration-graphs style="width: 60%; height: 550px" />
</hstack>
<hstack style="width: 100%">
<map-info-display style="width: 50%" />
<vstack style="width: 50%">
<motor-info style="width: 100%; height: 250px" />
</vstack>
</hstack>
<hstack style="width: 100%">
<raspberry-pi style="width: 80%" />
<brake-pressure-display style="height: 180px; width: 20%" />
</hstack>
</vstack>
</div>

<div style="display: flex; grid-column-start: 4; grid-column-end: 7">
<acceleration-graphs style="width: 100%; height: 550px" />
</div>

<div style="display: flex; grid-column-start: 1; grid-column-end: 6">
<raspberry-pi style="width: 100%" />
</div>
<div style="display: flex; grid-column-start: 6; grid-column-end: 7">
<brake-pressure-display style="width: 100%" />
</div>

<div style="display: flex; grid-column-start: 1; grid-column-end: 7">
<map-info-display style="width: 100%" />
</div>
</div>
</div>
}
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { IdentifierDataType } from 'src/utils/enumerations/identifier-data-type'
})
export default class LandingPage implements OnInit {
time = new Date();
location: string = 'No Location Set';
newRunIsLoading = false;
mobileThreshold = 1070;
isMobile = window.innerWidth < this.mobileThreshold;
Expand All @@ -40,10 +39,6 @@ export default class LandingPage implements OnInit {
setInterval(() => {
this.time = new Date();
}, 1000);

this.storage.get(IdentifierDataType.LOCATION).subscribe((value) => {
[this.location] = value.values || ['No Location Set'];
});
}

onStartNewRun!: () => void;
Expand Down

0 comments on commit 824df39

Please sign in to comment.