From 45fe15a46e7c01dca159050115b0517683eba99d Mon Sep 17 00:00:00 2001 From: RChandler234 <29521172+RChandler234@users.noreply.github.com> Date: Sun, 15 Dec 2024 01:03:37 -0600 Subject: [PATCH] run prettier --- angular-client/src/app/app.module.ts | 205 +++--------------- .../acceleration-graphs.component.html | 38 +--- .../brake-pressure-display.component.html | 9 +- .../carousel/carousel.component.html | 28 +-- .../double-line-graph.component.ts | 85 ++++---- .../src/components/graph/graph.component.ts | 80 +++---- .../motor-info/motor-info.component.css | 2 +- .../motor-info/motor-info.component.html | 10 +- .../motor-info/motor-info.component.ts | 4 +- .../pie-chart/pie-chart.component.ts | 33 +-- .../raspberry-pi-desktop.component.html | 12 +- .../raspberry-pi-mobile.component.html | 12 +- .../charging-page-mobile.component.html | 18 +- .../battery-info-desktop.component.html | 21 +- .../battery-info-mobile.component.html | 31 +-- .../cell-temp-display.component.html | 17 +- .../cell-temp-mobile.component.html | 35 +-- .../fault-display.component.html | 27 +-- .../fault-display/fault-display.component.ts | 81 +++---- .../high-low-cell-display.component.html | 60 +---- .../high-low-cell-mobile.component.html | 60 +---- .../graph-caption.component.html | 22 +- .../pages/graph-page/graph/graph.component.ts | 70 +++--- .../connection-display.component.html | 11 +- .../landing-page-mobile.component.html | 5 +- .../landing-page/landing-page.component.html | 14 +- .../enumerations/identifier-data-type.ts | 2 +- angular-client/src/utils/types.utils.ts | 3 +- 28 files changed, 258 insertions(+), 737 deletions(-) diff --git a/angular-client/src/app/app.module.ts b/angular-client/src/app/app.module.ts index d07ebee4..960ea6b7 100644 --- a/angular-client/src/app/app.module.ts +++ b/angular-client/src/app/app.module.ts @@ -45,10 +45,7 @@ import { GraphDialog } from 'src/components/graph-dialog/graph-dialog.component' import { SteeringAngleDisplay } from 'src/components/steering-angle-display/steering-angle-display.component'; import { MatIconRegistry } from '@angular/material/icon'; import { DomSanitizer } from '@angular/platform-browser'; -import { - provideHttpClient, - withInterceptorsFromDi, -} from '@angular/common/http'; +import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import HalfGauge from 'src/components/half-gauge/half-gauge.component'; import { Divider } from 'src/components/divider/divider'; import { DriverComponent } from 'src/components/driver-component/driver-component'; @@ -197,7 +194,7 @@ import { ViewerDisplay } from 'src/pages/landing-page/components/viewer-display/ LatencyDisplay, DateLocation, CurrentRunDisplay, - ViewerDisplay, + ViewerDisplay ], bootstrap: [AppContext], imports: [ @@ -220,193 +217,59 @@ import { ViewerDisplay } from 'src/pages/landing-page/components/viewer-display/ MatToolbarModule, MatButtonModule, MatInputModule, - ReactiveFormsModule, - ], - providers: [ - DialogService, - MessageService, - provideHttpClient(withInterceptorsFromDi()), + ReactiveFormsModule ], + providers: [DialogService, MessageService, provideHttpClient(withInterceptorsFromDi())] }) export class AppModule { constructor( private matIconRegistry: MatIconRegistry, - private domSanitizer: DomSanitizer, + private domSanitizer: DomSanitizer ) { this.matIconRegistry .addSvgIcon( 'steering_wheel', - this.domSanitizer.bypassSecurityTrustResourceUrl( - '../assets/icons/search_hands_free.svg', - ), - ) - .addSvgIcon( - 'wifi', - this.domSanitizer.bypassSecurityTrustResourceUrl( - '../assets/icons/wifi.svg', - ), - ) - .addSvgIcon( - 'speed', - this.domSanitizer.bypassSecurityTrustResourceUrl( - '../assets/icons/speed.svg', - ), - ) - .addSvgIcon( - 'person', - this.domSanitizer.bypassSecurityTrustResourceUrl( - '../assets/icons/person.svg', - ), - ) - .addSvgIcon( - 'eye', - this.domSanitizer.bypassSecurityTrustResourceUrl( - '../assets/icons/eye_tracking.svg', - ), - ) - .addSvgIcon( - 'timelapse', - this.domSanitizer.bypassSecurityTrustResourceUrl( - '../assets/icons/timelapse.svg', - ), - ) - .addSvgIcon( - 'cell_tower', - this.domSanitizer.bypassSecurityTrustResourceUrl( - '../assets/icons/cell_tower.svg', - ), - ) - .addSvgIcon( - 'map', - this.domSanitizer.bypassSecurityTrustResourceUrl( - '../assets/icons/map.svg', - ), - ) - .addSvgIcon( - '360', - this.domSanitizer.bypassSecurityTrustResourceUrl( - '../assets/icons/360.svg', - ), - ) - .addSvgIcon( - 'electric_car', - this.domSanitizer.bypassSecurityTrustResourceUrl( - '../assets/icons/electric_car.svg', - ), - ) - .addSvgIcon( - 'memory', - this.domSanitizer.bypassSecurityTrustResourceUrl( - '../assets/icons/memory.svg', - ), - ) - .addSvgIcon( - 'back_hand', - this.domSanitizer.bypassSecurityTrustResourceUrl( - '../assets/icons/back_hand.svg', - ), + this.domSanitizer.bypassSecurityTrustResourceUrl('../assets/icons/search_hands_free.svg') ) + .addSvgIcon('wifi', this.domSanitizer.bypassSecurityTrustResourceUrl('../assets/icons/wifi.svg')) + .addSvgIcon('speed', this.domSanitizer.bypassSecurityTrustResourceUrl('../assets/icons/speed.svg')) + .addSvgIcon('person', this.domSanitizer.bypassSecurityTrustResourceUrl('../assets/icons/person.svg')) + .addSvgIcon('eye', this.domSanitizer.bypassSecurityTrustResourceUrl('../assets/icons/eye_tracking.svg')) + .addSvgIcon('timelapse', this.domSanitizer.bypassSecurityTrustResourceUrl('../assets/icons/timelapse.svg')) + .addSvgIcon('cell_tower', this.domSanitizer.bypassSecurityTrustResourceUrl('../assets/icons/cell_tower.svg')) + .addSvgIcon('map', this.domSanitizer.bypassSecurityTrustResourceUrl('../assets/icons/map.svg')) + .addSvgIcon('360', this.domSanitizer.bypassSecurityTrustResourceUrl('../assets/icons/360.svg')) + .addSvgIcon('electric_car', this.domSanitizer.bypassSecurityTrustResourceUrl('../assets/icons/electric_car.svg')) + .addSvgIcon('memory', this.domSanitizer.bypassSecurityTrustResourceUrl('../assets/icons/memory.svg')) + .addSvgIcon('back_hand', this.domSanitizer.bypassSecurityTrustResourceUrl('../assets/icons/back_hand.svg')) .addSvgIcon( 'battery_charging_full', - this.domSanitizer.bypassSecurityTrustResourceUrl( - '../assets/icons/battery_charging_full.svg', - ), - ) - .addSvgIcon( - 'menu', - this.domSanitizer.bypassSecurityTrustResourceUrl( - '../assets/icons/menu.svg', - ), - ) - .addSvgIcon( - 'home', - this.domSanitizer.bypassSecurityTrustResourceUrl( - '../assets/icons/home.svg', - ), - ) - .addSvgIcon( - 'bar_chart', - this.domSanitizer.bypassSecurityTrustResourceUrl( - '../assets/icons/bar_chart.svg', - ), - ) - .addSvgIcon( - 'search', - this.domSanitizer.bypassSecurityTrustResourceUrl( - '../assets/icons/search.svg', - ), - ) - .addSvgIcon( - 'arrow_right', - this.domSanitizer.bypassSecurityTrustResourceUrl( - '../assets/icons/arrow_right.svg', - ), - ) - .addSvgIcon( - 'ev_station', - this.domSanitizer.bypassSecurityTrustResourceUrl( - '../assets/icons/ev_station.svg', - ), + this.domSanitizer.bypassSecurityTrustResourceUrl('../assets/icons/battery_charging_full.svg') ) + .addSvgIcon('menu', this.domSanitizer.bypassSecurityTrustResourceUrl('../assets/icons/menu.svg')) + .addSvgIcon('home', this.domSanitizer.bypassSecurityTrustResourceUrl('../assets/icons/home.svg')) + .addSvgIcon('bar_chart', this.domSanitizer.bypassSecurityTrustResourceUrl('../assets/icons/bar_chart.svg')) + .addSvgIcon('search', this.domSanitizer.bypassSecurityTrustResourceUrl('../assets/icons/search.svg')) + .addSvgIcon('arrow_right', this.domSanitizer.bypassSecurityTrustResourceUrl('../assets/icons/arrow_right.svg')) + .addSvgIcon('ev_station', this.domSanitizer.bypassSecurityTrustResourceUrl('../assets/icons/ev_station.svg')) .addSvgIcon( 'device_thermostat', - this.domSanitizer.bypassSecurityTrustResourceUrl( - '../assets/icons/device_thermostat.svg', - ), - ) - .addSvgIcon( - 'electric_meter', - this.domSanitizer.bypassSecurityTrustResourceUrl( - '../assets/icons/electric_meter.svg', - ), - ) - .addSvgIcon( - 'warning', - this.domSanitizer.bypassSecurityTrustResourceUrl( - '../assets/icons/warning.svg', - ), + this.domSanitizer.bypassSecurityTrustResourceUrl('../assets/icons/device_thermostat.svg') ) + .addSvgIcon('electric_meter', this.domSanitizer.bypassSecurityTrustResourceUrl('../assets/icons/electric_meter.svg')) + .addSvgIcon('warning', this.domSanitizer.bypassSecurityTrustResourceUrl('../assets/icons/warning.svg')) .addSvgIcon( 'electrical_services', - this.domSanitizer.bypassSecurityTrustResourceUrl( - '../assets/icons/electrical_services.svg', - ), - ) - .addSvgIcon( - 'thermostat', - this.domSanitizer.bypassSecurityTrustResourceUrl( - '../assets/icons/thermostat.svg', - ), - ) - .addSvgIcon( - 'model_training', - this.domSanitizer.bypassSecurityTrustResourceUrl( - '../assets/icons/model_training.svg', - ), - ) - .addSvgIcon( - 'quickreply', - this.domSanitizer.bypassSecurityTrustResourceUrl( - '../assets/icons/quickreply.svg', - ), - ) - .addSvgIcon( - 'bolt', - this.domSanitizer.bypassSecurityTrustResourceUrl( - '../assets/icons/bolt.svg', - ), - ) - .addSvgIcon( - 'timer', - this.domSanitizer.bypassSecurityTrustResourceUrl( - '../assets/icons/timer.svg', - ), + this.domSanitizer.bypassSecurityTrustResourceUrl('../assets/icons/electrical_services.svg') ) + .addSvgIcon('thermostat', this.domSanitizer.bypassSecurityTrustResourceUrl('../assets/icons/thermostat.svg')) + .addSvgIcon('model_training', this.domSanitizer.bypassSecurityTrustResourceUrl('../assets/icons/model_training.svg')) + .addSvgIcon('quickreply', this.domSanitizer.bypassSecurityTrustResourceUrl('../assets/icons/quickreply.svg')) + .addSvgIcon('bolt', this.domSanitizer.bypassSecurityTrustResourceUrl('../assets/icons/bolt.svg')) + .addSvgIcon('timer', this.domSanitizer.bypassSecurityTrustResourceUrl('../assets/icons/timer.svg')) .addSvgIcon( 'arrow_drop_down_circle', - this.domSanitizer.bypassSecurityTrustResourceUrl( - '../assests/icons/arrow_drop_down_circle.svg', - ), + this.domSanitizer.bypassSecurityTrustResourceUrl('../assests/icons/arrow_drop_down_circle.svg') ); } } diff --git a/angular-client/src/components/acceleration-graphs/acceleration-graphs.component.html b/angular-client/src/components/acceleration-graphs/acceleration-graphs.component.html index 957dcb92..505c1df6 100644 --- a/angular-client/src/components/acceleration-graphs/acceleration-graphs.component.html +++ b/angular-client/src/components/acceleration-graphs/acceleration-graphs.component.html @@ -2,17 +2,8 @@
- - + +
@@ -29,28 +20,15 @@ additionalStyles="fontSize: 20px; margin-bottom: 10px; color: #797a7a" />
- +
- - + +
@@ -67,11 +45,7 @@ additionalStyles="fontSize: 20px; margin-bottom: 10px; color: #797a7a" />
- +
diff --git a/angular-client/src/components/brake-pressure-display/brake-pressure-display.component.html b/angular-client/src/components/brake-pressure-display/brake-pressure-display.component.html index 90b476d9..86911c98 100644 --- a/angular-client/src/components/brake-pressure-display/brake-pressure-display.component.html +++ b/angular-client/src/components/brake-pressure-display/brake-pressure-display.component.html @@ -1,12 +1,5 @@ -
+
diff --git a/angular-client/src/components/carousel/carousel.component.html b/angular-client/src/components/carousel/carousel.component.html index 919b15b5..93987a87 100644 --- a/angular-client/src/components/carousel/carousel.component.html +++ b/angular-client/src/components/carousel/carousel.component.html @@ -11,39 +11,21 @@
- + - + - + - +
- Select this Run + Select this Run
diff --git a/angular-client/src/components/double-line-graph/double-line-graph.component.ts b/angular-client/src/components/double-line-graph/double-line-graph.component.ts index b884426c..0ea38fc2 100644 --- a/angular-client/src/components/double-line-graph/double-line-graph.component.ts +++ b/angular-client/src/components/double-line-graph/double-line-graph.component.ts @@ -11,7 +11,7 @@ import { ApexTooltip, ApexFill, ApexStroke, - ApexLegend, + ApexLegend } from 'ng-apexcharts'; import { DialogService } from 'primeng/dynamicdialog'; import { GraphDialog } from '../graph-dialog/graph-dialog.component'; @@ -36,7 +36,7 @@ type ChartOptions = { selector: 'double-line-graph', templateUrl: './double-line-graph.component.html', styleUrls: ['./double-line-graph.component.css'], - providers: [DialogService], + providers: [DialogService] }) export class DoubleLineGraphComponent implements OnInit { @Input() data1!: GraphData[]; @@ -63,8 +63,8 @@ export class DoubleLineGraphComponent implements OnInit { data: { data: this.data1, color: this.color1, - title: this.title1, - }, + title: this.title1 + } }); }; @@ -72,12 +72,12 @@ export class DoubleLineGraphComponent implements OnInit { this.series = [ { name: this.title1, - data: Array.from(this.data1), + data: Array.from(this.data1) }, { name: this.title2, - data: Array.from(this.data2), - }, + data: Array.from(this.data2) + } ]; // temp fix, for now just basing change on data1 length... // even though probably should check data1 also @@ -91,8 +91,8 @@ export class DoubleLineGraphComponent implements OnInit { ...this.options, xaxis: { ...this.options.xaxis, - range: this.timeRangeMs, - }, + range: this.timeRangeMs + } }); } @@ -108,12 +108,12 @@ export class DoubleLineGraphComponent implements OnInit { this.series = [ { name: this.title1, - data: this.data1, + data: this.data1 }, { name: this.title2, - data: this.data2, - }, + data: this.data2 + } ]; this.options = { @@ -123,30 +123,30 @@ export class DoubleLineGraphComponent implements OnInit { type: 'line', height: '100%', zoom: { - autoScaleYaxis: true, + autoScaleYaxis: true }, animations: { enabled: true, easing: 'linear', dynamicAnimation: { - speed: 1000, - }, + speed: 1000 + } }, toolbar: { - show: false, - }, + show: false + } // background: '#5A5A5A' }, colors: [this.color1, this.color2], // Set series colors here dataLabels: { - enabled: false, + enabled: false }, stroke: { curve: 'straight', - width: 2, + width: 2 }, markers: { - size: 0, + size: 0 }, xaxis: { type: 'category', @@ -154,40 +154,33 @@ export class DoubleLineGraphComponent implements OnInit { labels: { show: true, style: { - colors: '#FFFFFF', + colors: '#FFFFFF' }, formatter: (value) => { - return ( - '' + - new Date(value).getHours() + - ':' + - new Date(value).getMinutes() + - ':' + - new Date(value).getSeconds() - ); - }, + return '' + new Date(value).getHours() + ':' + new Date(value).getMinutes() + ':' + new Date(value).getSeconds(); + } }, axisBorder: { - show: false, + show: false }, axisTicks: { - show: false, - }, + show: false + } }, yaxis: { tickAmount: 2, labels: { style: { - colors: '#FFFFFF', - }, - }, + colors: '#FFFFFF' + } + } }, tooltip: { theme: 'dark', x: { // format by hours and minutes and seconds - format: 'M/d/yy, h:mm:ss', - }, + format: 'M/d/yy, h:mm:ss' + } }, fill: { type: 'linear', @@ -195,26 +188,24 @@ export class DoubleLineGraphComponent implements OnInit { shadeIntensity: 1, opacityFrom: 1, opacityTo: 1, - stops: [0, 100, 0, 100], - }, + stops: [0, 100, 0, 100] + } }, grid: { - show: false, + show: false }, legend: { labels: { - colors: '#fffff4', // Set legend label color to black - }, - }, + colors: '#fffff4' // Set legend label color to black + } + } }; // Delay rendering to ensure the container is available setTimeout(() => { const chartContainer = document.getElementById(this.graphContainerId); if (!chartContainer) { - console.log( - 'Container with id ' + this.graphContainerId + ' not found', - ); + console.log('Container with id ' + this.graphContainerId + ' not found'); return; } diff --git a/angular-client/src/components/graph/graph.component.ts b/angular-client/src/components/graph/graph.component.ts index 77c9be0f..8759ffce 100644 --- a/angular-client/src/components/graph/graph.component.ts +++ b/angular-client/src/components/graph/graph.component.ts @@ -1,14 +1,6 @@ import { Component, Input, OnInit } from '@angular/core'; import ApexCharts from 'apexcharts'; -import { - ApexXAxis, - ApexDataLabels, - ApexChart, - ApexMarkers, - ApexGrid, - ApexTooltip, - ApexFill, -} from 'ng-apexcharts'; +import { ApexXAxis, ApexDataLabels, ApexChart, ApexMarkers, ApexGrid, ApexTooltip, ApexFill } from 'ng-apexcharts'; import { DialogService } from 'primeng/dynamicdialog'; import { GraphDialog } from '../graph-dialog/graph-dialog.component'; import { GraphData } from 'src/utils/types.utils'; @@ -29,7 +21,7 @@ type ChartOptions = { selector: 'graph-component', templateUrl: './graph.component.html', styleUrls: ['./graph.component.css'], - providers: [DialogService], + providers: [DialogService] }) export class GraphComponent implements OnInit { @Input() data!: GraphData[]; @@ -51,8 +43,8 @@ export class GraphComponent implements OnInit { data: { data: this.data, color: this.color, - title: this.title, - }, + title: this.title + } }); }; @@ -60,8 +52,8 @@ export class GraphComponent implements OnInit { this.chart.updateSeries([ { name: this.title, - data: Array.from(this.data), - }, + data: Array.from(this.data) + } ]); if (!this.isSliding && this.data.length > 2) { @@ -74,8 +66,8 @@ export class GraphComponent implements OnInit { ...this.options, xaxis: { ...this.options.xaxis, - range: this.timeRangeMs, - }, + range: this.timeRangeMs + } }); } @@ -93,29 +85,29 @@ export class GraphComponent implements OnInit { type: 'line', height: '100%', zoom: { - autoScaleYaxis: true, + autoScaleYaxis: true }, animations: { enabled: true, easing: 'linear', dynamicAnimation: { - speed: 1000, - }, + speed: 1000 + } }, toolbar: { - show: false, - }, + show: false + } // background: '#5A5A5A' }, dataLabels: { - enabled: false, + enabled: false }, stroke: { curve: 'straight', - colors: [this.color], + colors: [this.color] }, markers: { - size: 0, + size: 0 }, xaxis: { type: 'category', @@ -123,42 +115,40 @@ export class GraphComponent implements OnInit { labels: { show: true, style: { - colors: '#FFFFFF', + colors: '#FFFFFF' }, formatter: (value) => { return ( '' + new Date(value).getHours() + ':' + - ((new Date(value).getMinutes() < 10 ? '0' : '') + - new Date(value).getMinutes()) + + ((new Date(value).getMinutes() < 10 ? '0' : '') + new Date(value).getMinutes()) + ':' + - ((new Date(value).getSeconds() < 10 ? '0' : '') + - new Date(value).getSeconds()) + ((new Date(value).getSeconds() < 10 ? '0' : '') + new Date(value).getSeconds()) ); - }, + } }, axisBorder: { - show: false, + show: false }, axisTicks: { - show: false, - }, + show: false + } }, yaxis: { tickAmount: 2, labels: { style: { - colors: '#FFFFFF', - }, - }, + colors: '#FFFFFF' + } + } }, tooltip: { theme: 'dark', x: { //format by hours and minutes and seconds - format: 'M/d/yy, h:mm:ss', - }, + format: 'M/d/yy, h:mm:ss' + } }, fill: { type: 'linear', @@ -166,27 +156,25 @@ export class GraphComponent implements OnInit { shadeIntensity: 1, opacityFrom: 0.7, opacityTo: 0.9, - stops: [0, 100], - }, + stops: [0, 100] + } }, grid: { - show: false, - }, + show: false + } }; //Weird rendering stuff with apex charts, view link to see why https://github.com/apexcharts/react-apexcharts/issues/187 setTimeout(() => { const chartContainer = document.getElementById(this.graphContainerId); if (!chartContainer) { - console.log( - 'Container with id ' + this.graphContainerId + ' not found', - ); + console.log('Container with id ' + this.graphContainerId + ' not found'); return; } this.chart = new ApexCharts(chartContainer, { series: [{ data: [] }], - ...this.options, + ...this.options }); this.chart.render(); diff --git a/angular-client/src/components/motor-info/motor-info.component.css b/angular-client/src/components/motor-info/motor-info.component.css index abd7dea5..68985ec1 100644 --- a/angular-client/src/components/motor-info/motor-info.component.css +++ b/angular-client/src/components/motor-info/motor-info.component.css @@ -14,7 +14,7 @@ } .subsubtitle { - font-family: "Roboto"; + font-family: 'Roboto'; font-size: 12px; color: #cacaca; -webkit-touch-callout: none; diff --git a/angular-client/src/components/motor-info/motor-info.component.html b/angular-client/src/components/motor-info/motor-info.component.html index 39c4c64a..71fae4a7 100644 --- a/angular-client/src/components/motor-info/motor-info.component.html +++ b/angular-client/src/components/motor-info/motor-info.component.html @@ -3,10 +3,7 @@ - +
@@ -20,10 +17,7 @@
- +
Total Consumption diff --git a/angular-client/src/components/motor-info/motor-info.component.ts b/angular-client/src/components/motor-info/motor-info.component.ts index 0a40de59..6235dbdd 100644 --- a/angular-client/src/components/motor-info/motor-info.component.ts +++ b/angular-client/src/components/motor-info/motor-info.component.ts @@ -8,7 +8,7 @@ import { floatPipe } from 'src/utils/pipes.utils'; @Component({ selector: 'motor-info', templateUrl: './motor-info.component.html', - styleUrls: ['./motor-info.component.css'], + styleUrls: ['./motor-info.component.css'] }) export default class MotorInfo { motorUsage: number = 100; @@ -30,7 +30,7 @@ export default class MotorInfo { }); this.piechartData = [ { value: this.motorUsage, name: 'Motor' }, - { value: this.coolUsage, name: 'Cooling' }, + { value: this.coolUsage, name: 'Cooling' } ]; } diff --git a/angular-client/src/components/pie-chart/pie-chart.component.ts b/angular-client/src/components/pie-chart/pie-chart.component.ts index 321149d7..1b13c129 100644 --- a/angular-client/src/components/pie-chart/pie-chart.component.ts +++ b/angular-client/src/components/pie-chart/pie-chart.component.ts @@ -1,11 +1,6 @@ import { Component, ElementRef, Input, Renderer2 } from '@angular/core'; -import { - ApexNonAxisChartSeries, - ApexPlotOptions, - ApexChart, - ApexFill, -} from 'ng-apexcharts'; +import { ApexNonAxisChartSeries, ApexPlotOptions, ApexChart, ApexFill } from 'ng-apexcharts'; import Theme from 'src/services/theme.service'; export type ChartOptions = { @@ -19,7 +14,7 @@ export type ChartOptions = { @Component({ selector: 'pie-chart', templateUrl: 'pie-chart.component.html', - styleUrls: ['pie-chart.component.css'], + styleUrls: ['pie-chart.component.css'] }) export default class PieChart { public chartOptions!: Partial | any; @@ -29,7 +24,7 @@ export default class PieChart { constructor( private renderer: Renderer2, - private el: ElementRef, + private el: ElementRef ) {} ngOnInit() { @@ -52,9 +47,9 @@ export default class PieChart { plotOptions: { pie: { dataLabels: { - offset: -10, - }, - }, + offset: -10 + } + } }, colors: ['#ce2727', '#2799ce', '#3cba40', '#ba3cb4', '#efce29'], chart: { @@ -62,26 +57,22 @@ export default class PieChart { type: 'pie', background: this.backgroundColor, redrawOnParentResize: true, - foreColor: '#ffffff', + foreColor: '#ffffff' }, dataLabels: { style: { - offset: -10, - }, + offset: -10 + } }, labels, legend: { - offsetX: 10, - }, + offsetX: 10 + } }; } private setChartWidth() { const containerWidth = this.el.nativeElement.offsetWidth; - this.renderer.setStyle( - this.el.nativeElement.querySelector('apx-chart'), - 'width', - containerWidth + 'px', - ); + this.renderer.setStyle(this.el.nativeElement.querySelector('apx-chart'), 'width', containerWidth + 'px'); } } diff --git a/angular-client/src/components/raspberry-pi/raspberry-pi-desktop-content/raspberry-pi-desktop.component.html b/angular-client/src/components/raspberry-pi/raspberry-pi-desktop-content/raspberry-pi-desktop.component.html index 763fb235..7fa20d22 100644 --- a/angular-client/src/components/raspberry-pi/raspberry-pi-desktop-content/raspberry-pi-desktop.component.html +++ b/angular-client/src/components/raspberry-pi/raspberry-pi-desktop-content/raspberry-pi-desktop.component.html @@ -1,10 +1,6 @@ - + @@ -23,11 +19,7 @@ - +
diff --git a/angular-client/src/components/raspberry-pi/raspberry-pi-mobile-content/raspberry-pi-mobile.component.html b/angular-client/src/components/raspberry-pi/raspberry-pi-mobile-content/raspberry-pi-mobile.component.html index 7a0c25f8..ddf2b6e4 100644 --- a/angular-client/src/components/raspberry-pi/raspberry-pi-mobile-content/raspberry-pi-mobile.component.html +++ b/angular-client/src/components/raspberry-pi/raspberry-pi-mobile-content/raspberry-pi-mobile.component.html @@ -1,11 +1,7 @@ - + @@ -33,11 +29,7 @@ - +
diff --git a/angular-client/src/pages/charging-page/charging-page-mobile/charging-page-mobile.component.html b/angular-client/src/pages/charging-page/charging-page-mobile/charging-page-mobile.component.html index afea3fb4..b7cc30c5 100644 --- a/angular-client/src/pages/charging-page/charging-page-mobile/charging-page-mobile.component.html +++ b/angular-client/src/pages/charging-page/charging-page-mobile/charging-page-mobile.component.html @@ -1,21 +1,9 @@ - + - + - + diff --git a/angular-client/src/pages/charging-page/components/battery-info-display/battery-info-desktop/battery-info-desktop.component.html b/angular-client/src/pages/charging-page/components/battery-info-display/battery-info-desktop/battery-info-desktop.component.html index 761b7b35..1d0cd85c 100644 --- a/angular-client/src/pages/charging-page/components/battery-info-display/battery-info-desktop/battery-info-desktop.component.html +++ b/angular-client/src/pages/charging-page/components/battery-info-display/battery-info-desktop/battery-info-desktop.component.html @@ -1,15 +1,8 @@ - - + + @@ -36,10 +29,7 @@ - + @@ -47,10 +37,7 @@ - + diff --git a/angular-client/src/pages/charging-page/components/battery-info-display/battery-info-mobile/battery-info-mobile.component.html b/angular-client/src/pages/charging-page/components/battery-info-display/battery-info-mobile/battery-info-mobile.component.html index aab793fe..6dc1ca5f 100644 --- a/angular-client/src/pages/charging-page/components/battery-info-display/battery-info-mobile/battery-info-mobile.component.html +++ b/angular-client/src/pages/charging-page/components/battery-info-display/battery-info-mobile/battery-info-mobile.component.html @@ -1,15 +1,8 @@ - - + + @@ -17,10 +10,7 @@ - +
@@ -32,26 +22,17 @@ - + - + - +
diff --git a/angular-client/src/pages/charging-page/components/cell-temp/cell-temp-display/cell-temp-display.component.html b/angular-client/src/pages/charging-page/components/cell-temp/cell-temp-display/cell-temp-display.component.html index f59d5f48..da9cccbf 100644 --- a/angular-client/src/pages/charging-page/components/cell-temp/cell-temp-display/cell-temp-display.component.html +++ b/angular-client/src/pages/charging-page/components/cell-temp/cell-temp-display/cell-temp-display.component.html @@ -1,9 +1,5 @@ @if (isDesktop) { - + @@ -18,17 +14,10 @@ - + } @if (!isDesktop) { - + } diff --git a/angular-client/src/pages/charging-page/components/cell-temp/cell-temp-display/cell-temp-mobile/cell-temp-mobile.component.html b/angular-client/src/pages/charging-page/components/cell-temp/cell-temp-display/cell-temp-mobile/cell-temp-mobile.component.html index 52bb1e43..948b1952 100644 --- a/angular-client/src/pages/charging-page/components/cell-temp/cell-temp-display/cell-temp-mobile/cell-temp-mobile.component.html +++ b/angular-client/src/pages/charging-page/components/cell-temp/cell-temp-display/cell-temp-mobile/cell-temp-mobile.component.html @@ -1,22 +1,10 @@ - +
- - + +
@@ -25,21 +13,10 @@
- - + +
- +
diff --git a/angular-client/src/pages/charging-page/components/fault-display/fault-display.component.html b/angular-client/src/pages/charging-page/components/fault-display/fault-display.component.html index d2bad6ec..2ad05f4d 100644 --- a/angular-client/src/pages/charging-page/components/fault-display/fault-display.component.html +++ b/angular-client/src/pages/charging-page/components/fault-display/fault-display.component.html @@ -1,8 +1,5 @@ -
+
@for (fault of faults; track fault; let i = $index) { @@ -13,31 +10,15 @@ : 'background-color: #4d453c; width: 100%; border-radius: 2px' " > -
- +
+ - +
diff --git a/angular-client/src/pages/charging-page/components/fault-display/fault-display.component.ts b/angular-client/src/pages/charging-page/components/fault-display/fault-display.component.ts index 4be63047..6bca188e 100644 --- a/angular-client/src/pages/charging-page/components/fault-display/fault-display.component.ts +++ b/angular-client/src/pages/charging-page/components/fault-display/fault-display.component.ts @@ -5,13 +5,13 @@ import { IdentifierDataType } from 'src/utils/enumerations/identifier-data-type' enum FaultType { BMS = 'BMS', - Charger = 'Charger', + Charger = 'Charger' } @Component({ selector: 'fault-display', templateUrl: './fault-display.component.html', - styleUrls: ['./fault-display.component.css'], + styleUrls: ['./fault-display.component.css'] }) export default class FaultDisplay { faults: { type: string; name: string; time: string }[] = []; @@ -20,7 +20,7 @@ export default class FaultDisplay { onClick: () => { this.faults = []; }, - icon: 'restart_alt', + icon: 'restart_alt' }; constructor(private storage: Storage) {} @@ -29,112 +29,104 @@ export default class FaultDisplay { const chargerFaultAndDisplayNames = [ { displayName: 'Comm Timeout', - faultIdentifier: IdentifierDataType.COMM_TIMEOUT_FAULT, + faultIdentifier: IdentifierDataType.COMM_TIMEOUT_FAULT }, { displayName: 'Hardware Failure', - faultIdentifier: IdentifierDataType.HARDWARE_FAILURE_FAULT, + faultIdentifier: IdentifierDataType.HARDWARE_FAILURE_FAULT }, { displayName: 'Over Temp', - faultIdentifier: IdentifierDataType.OVER_TEMP_FAULT, + faultIdentifier: IdentifierDataType.OVER_TEMP_FAULT }, { displayName: 'Over Voltage Fault', - faultIdentifier: IdentifierDataType.OVER_VOLTAGE_FAULT, + faultIdentifier: IdentifierDataType.OVER_VOLTAGE_FAULT }, { displayName: 'Wrong Battery Connect', - faultIdentifier: IdentifierDataType.WRONG_BAT_CONNECT_FAULT, - }, + faultIdentifier: IdentifierDataType.WRONG_BAT_CONNECT_FAULT + } ]; // Subscribe to each charger fault, with a display name (to display when the fault is triggered) chargerFaultAndDisplayNames.forEach((faultAndDisplayName) => { - this.faultSubcribe( - faultAndDisplayName.displayName, - faultAndDisplayName.faultIdentifier, - FaultType.Charger, - ); + this.faultSubcribe(faultAndDisplayName.displayName, faultAndDisplayName.faultIdentifier, FaultType.Charger); }); const bmsFaultAndDisplayNames = [ { displayName: 'Open Wire', - faultIdentifier: IdentifierDataType.OPEN_WIRE, + faultIdentifier: IdentifierDataType.OPEN_WIRE }, { displayName: 'Charger Limit Enforcement', - faultIdentifier: IdentifierDataType.CHARGER_LIMIT_ENFORCEMENT_FAULT, + faultIdentifier: IdentifierDataType.CHARGER_LIMIT_ENFORCEMENT_FAULT }, { displayName: 'Charger Can Fault', - faultIdentifier: IdentifierDataType.CHARGER_CAN_FAULT, + faultIdentifier: IdentifierDataType.CHARGER_CAN_FAULT }, { displayName: 'Battery Thermistor', - faultIdentifier: IdentifierDataType.BATTERY_THERMISTOR, + faultIdentifier: IdentifierDataType.BATTERY_THERMISTOR }, { displayName: 'Charger Safety Relay', - faultIdentifier: IdentifierDataType.CHARGER_SAFETY_RELAY, + faultIdentifier: IdentifierDataType.CHARGER_SAFETY_RELAY }, { displayName: 'Discharge Limit Enforcement', - faultIdentifier: IdentifierDataType.DISCHARGE_LIMIT_ENFORCEMENT_FAULT, + faultIdentifier: IdentifierDataType.DISCHARGE_LIMIT_ENFORCEMENT_FAULT }, { displayName: 'External Can Fault', - faultIdentifier: IdentifierDataType.EXTERNAL_CAN_FAULT, + faultIdentifier: IdentifierDataType.EXTERNAL_CAN_FAULT }, { displayName: 'Weak Pack Fault', - faultIdentifier: IdentifierDataType.WEAK_PACK_FAULT, + faultIdentifier: IdentifierDataType.WEAK_PACK_FAULT }, { displayName: 'Low Cell Voltage', - faultIdentifier: IdentifierDataType.LOW_CELL_VOLTAGE, + faultIdentifier: IdentifierDataType.LOW_CELL_VOLTAGE }, { displayName: 'Charge Reading Mismatch', - faultIdentifier: IdentifierDataType.CHARGE_READING_MISMATCH, + faultIdentifier: IdentifierDataType.CHARGE_READING_MISMATCH }, { displayName: 'Current Sensor Fault', - faultIdentifier: IdentifierDataType.CURRENT_SENSOR_FAULT, + faultIdentifier: IdentifierDataType.CURRENT_SENSOR_FAULT }, { displayName: 'Internal Cell Comm Fault', - faultIdentifier: IdentifierDataType.INTERNAL_CELL_COMM_FAULT, + faultIdentifier: IdentifierDataType.INTERNAL_CELL_COMM_FAULT }, { displayName: 'Internal Software Fault', - faultIdentifier: IdentifierDataType.INTERNAL_SOFTWARE_FAULT, + faultIdentifier: IdentifierDataType.INTERNAL_SOFTWARE_FAULT }, { displayName: 'Pack Overheat', - faultIdentifier: IdentifierDataType.PACK_OVERHEAT, + faultIdentifier: IdentifierDataType.PACK_OVERHEAT }, { displayName: 'Cell Undervoltage', - faultIdentifier: IdentifierDataType.CELL_UNDERVOLTAGE, + faultIdentifier: IdentifierDataType.CELL_UNDERVOLTAGE }, { displayName: 'Cell Overvoltage', - faultIdentifier: IdentifierDataType.CELL_OVERVOLTAGE, + faultIdentifier: IdentifierDataType.CELL_OVERVOLTAGE }, { displayName: 'Cells Not Balancing', - faultIdentifier: IdentifierDataType.CELLS_NOT_BALANCING, - }, + faultIdentifier: IdentifierDataType.CELLS_NOT_BALANCING + } ]; // Subscribe to each BMS fault, with a display name (to display when the fault is triggered) bmsFaultAndDisplayNames.forEach((faultAndDisplayName) => { - this.faultSubcribe( - faultAndDisplayName.displayName, - faultAndDisplayName.faultIdentifier, - FaultType.BMS, - ); + this.faultSubcribe(faultAndDisplayName.displayName, faultAndDisplayName.faultIdentifier, FaultType.BMS); }); } @@ -146,11 +138,7 @@ export default class FaultDisplay { * @param faultIdentifier the identifier for the fault. * @param faultType the type of the fault. */ - private faultSubcribe( - displayName: string, - faultIdentifier: IdentifierDataType, - faultType: FaultType, - ) { + private faultSubcribe(displayName: string, faultIdentifier: IdentifierDataType, faultType: FaultType) { let lastFaultValue = 0; this.storage.get(faultIdentifier).subscribe((value) => { let newValue = parseInt(value.values[0]); @@ -167,12 +155,7 @@ export default class FaultDisplay { * @param faultValue an string with an integer value. * @param faultName the name of the fault, to be displayed. */ - private addFault( - faultValue: number, - faultName: string, - faultType: FaultType, - lastFaultValue: number, - ) { + private addFault(faultValue: number, faultName: string, faultType: FaultType, lastFaultValue: number) { // only add fault if it is positve for a fault and the last value for this fault was not a fault if (faultValue !== 0 && lastFaultValue === 0) { if (this.faults.length >= 50) { @@ -183,7 +166,7 @@ export default class FaultDisplay { this.faults.unshift({ type: faultType, name: faultName, - time: new Date().toLocaleTimeString(), + time: new Date().toLocaleTimeString() }); } } diff --git a/angular-client/src/pages/charging-page/components/high-low-cell/high-low-cell-display/high-low-cell-display.component.html b/angular-client/src/pages/charging-page/components/high-low-cell/high-low-cell-display/high-low-cell-display.component.html index 83516ec3..36c3c29a 100644 --- a/angular-client/src/pages/charging-page/components/high-low-cell/high-low-cell-display/high-low-cell-display.component.html +++ b/angular-client/src/pages/charging-page/components/high-low-cell/high-low-cell-display/high-low-cell-display.component.html @@ -1,77 +1,37 @@ @if (isDesktop) { - + @if (isDesktop) { - + } @else { - + } - + @if (isDesktop) { - + } @else { - + } - + @if (isDesktop) { - + } @else { - + } - + + @if (isDesktop) { - + } @else { - + } - + @@ -33,23 +17,11 @@ @if (isDesktop) { - + } @else { - + } - + @@ -58,24 +30,12 @@ @if (isDesktop) { - + } @else { - + } - + @if (!isDesktop) { diff --git a/angular-client/src/pages/graph-page/graph-caption/graph-caption.component.html b/angular-client/src/pages/graph-page/graph-caption/graph-caption.component.html index ed18238d..60a92def 100644 --- a/angular-client/src/pages/graph-page/graph-caption/graph-caption.component.html +++ b/angular-client/src/pages/graph-page/graph-caption/graph-caption.component.html @@ -4,11 +4,7 @@ @if (dataTypeName) {
- +
} @else { - + }
- +
- +
diff --git a/angular-client/src/pages/graph-page/graph/graph.component.ts b/angular-client/src/pages/graph-page/graph/graph.component.ts index afa30de3..f9d9b929 100644 --- a/angular-client/src/pages/graph-page/graph/graph.component.ts +++ b/angular-client/src/pages/graph-page/graph/graph.component.ts @@ -1,14 +1,6 @@ import { Component, Input, OnChanges, SimpleChanges } from '@angular/core'; import ApexCharts from 'apexcharts'; -import { - ApexXAxis, - ApexDataLabels, - ApexChart, - ApexMarkers, - ApexGrid, - ApexTooltip, - ApexFill, -} from 'ng-apexcharts'; +import { ApexXAxis, ApexDataLabels, ApexChart, ApexMarkers, ApexGrid, ApexTooltip, ApexFill } from 'ng-apexcharts'; import { BehaviorSubject } from 'rxjs'; import { GraphData } from 'src/utils/types.utils'; @@ -27,7 +19,7 @@ type ChartOptions = { @Component({ selector: 'graph', templateUrl: './graph.component.html', - styleUrls: ['./graph.component.css'], + styleUrls: ['./graph.component.css'] }) export default class Graph implements OnChanges { @Input() valuesSubject!: BehaviorSubject; @@ -45,8 +37,8 @@ export default class Graph implements OnChanges { this.chart.updateSeries([ { name: 'Data Series', - data: Array.from(this.data), - }, + data: Array.from(this.data) + } ]); if (!this.isSliding && this.timeDiffMs > this.timeRangeMs) { @@ -55,8 +47,8 @@ export default class Graph implements OnChanges { ...this.options, xaxis: { ...this.options.xaxis, - range: this.timeRangeMs, - }, + range: this.timeRangeMs + } }); } } @@ -92,58 +84,56 @@ export default class Graph implements OnChanges { type: 'line', height: '100%', zoom: { - autoScaleYaxis: true, + autoScaleYaxis: true }, animations: { enabled: true, easing: 'linear', dynamicAnimation: { - speed: 1000, - }, - }, + speed: 1000 + } + } }, dataLabels: { - enabled: false, + enabled: false }, stroke: { - curve: 'straight', + curve: 'straight' }, markers: { - size: 0, + size: 0 }, xaxis: { type: 'category', tickAmount: 6, labels: { style: { - colors: '#fff', + colors: '#fff' }, formatter: (value) => { return ( '' + new Date(value).getHours() + ':' + - ((new Date(value).getMinutes() < 10 ? '0' : '') + - new Date(value).getMinutes()) + + ((new Date(value).getMinutes() < 10 ? '0' : '') + new Date(value).getMinutes()) + ':' + - ((new Date(value).getSeconds() < 10 ? '0' : '') + - new Date(value).getSeconds()) + ((new Date(value).getSeconds() < 10 ? '0' : '') + new Date(value).getSeconds()) ); - }, - }, + } + } }, yaxis: { labels: { style: { - colors: '#fff', - }, - }, + colors: '#fff' + } + } }, tooltip: { x: { //format by hours and minutes and seconds - format: 'M/d/yy, h:mm:ss', - }, + format: 'M/d/yy, h:mm:ss' + } }, fill: { type: 'linear', @@ -151,19 +141,19 @@ export default class Graph implements OnChanges { shadeIntensity: 1, opacityFrom: 0.7, opacityTo: 0.9, - stops: [0, 100], - }, + stops: [0, 100] + } }, grid: { - show: false, - }, + show: false + } }; // Weird rendering stuff with apex charts, view link to see why https://github.com/apexcharts/react-apexcharts/issues/187 setTimeout(() => { this.chart = new ApexCharts(chartContainer, { series: [{ data: [] }], - ...this.options, + ...this.options }); this.chart.render(); @@ -180,8 +170,8 @@ export default class Graph implements OnChanges { ...this.options, xaxis: { ...this.options.xaxis, - range: undefined, - }, + range: undefined + } }); this.valuesSubject.subscribe((values: GraphData[]) => { diff --git a/angular-client/src/pages/landing-page/components/connection-display/connection-display.component.html b/angular-client/src/pages/landing-page/components/connection-display/connection-display.component.html index c8165fa6..dcd0765b 100644 --- a/angular-client/src/pages/landing-page/components/connection-display/connection-display.component.html +++ b/angular-client/src/pages/landing-page/components/connection-display/connection-display.component.html @@ -1,11 +1,7 @@
- +
@@ -14,10 +10,7 @@ [style.background-color]="getConnectedColor(connected)" additionalStyles="height: 15px;" >
- +
diff --git a/angular-client/src/pages/landing-page/landing-page-mobile/landing-page-mobile.component.html b/angular-client/src/pages/landing-page/landing-page-mobile/landing-page-mobile.component.html index 79c470ad..92b8f8b1 100644 --- a/angular-client/src/pages/landing-page/landing-page-mobile/landing-page-mobile.component.html +++ b/angular-client/src/pages/landing-page/landing-page-mobile/landing-page-mobile.component.html @@ -1,10 +1,7 @@ - + diff --git a/angular-client/src/pages/landing-page/landing-page.component.html b/angular-client/src/pages/landing-page/landing-page.component.html index 5af2b693..ff578311 100644 --- a/angular-client/src/pages/landing-page/landing-page.component.html +++ b/angular-client/src/pages/landing-page/landing-page.component.html @@ -1,21 +1,11 @@
- + @if (isMobile) { } @else {
-
+
diff --git a/angular-client/src/utils/enumerations/identifier-data-type.ts b/angular-client/src/utils/enumerations/identifier-data-type.ts index e10f18fe..97e3392b 100644 --- a/angular-client/src/utils/enumerations/identifier-data-type.ts +++ b/angular-client/src/utils/enumerations/identifier-data-type.ts @@ -57,5 +57,5 @@ export enum IdentifierDataType { CHARGING = 'Charging/Control', PACK_VOLTAGE = 'Pack/Voltage', CELL_TEMP_HIGH = 'Cells/Temp_High_Value', - CELL_TEMP_AVG = 'Cells/Temp_Avg_Value', + CELL_TEMP_AVG = 'Cells/Temp_Avg_Value' } diff --git a/angular-client/src/utils/types.utils.ts b/angular-client/src/utils/types.utils.ts index 8c36c5e8..fe908f37 100644 --- a/angular-client/src/utils/types.utils.ts +++ b/angular-client/src/utils/types.utils.ts @@ -15,8 +15,7 @@ export interface NodeWithVisibilityToggle extends Node { dataTypesAreVisible: boolean; } -export interface NodeWithVisibilityToggleObservable - extends NodeWithVisibilityToggle { +export interface NodeWithVisibilityToggleObservable extends NodeWithVisibilityToggle { dataTypesObservable: Observable; }