Skip to content

Commit

Permalink
#172 - small clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
bracyw committed Sep 19, 2024
1 parent 23033b7 commit 02e7141
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { floatPipe } from 'src/utils/pipes.utils';
export default class ActiveStatus {
isActive: boolean = false;
currentSeconds: number = 0;
totalSeconds: number = Number(sessionStorage.getItem('active total seconds')) || 0;
totalSeconds: number = Number(sessionStorage.getItem('active-total-seconds')) || 0;
intervalId!: NodeJS.Timeout;
constructor(private storage: Storage) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { floatPipe } from 'src/utils/pipes.utils';
export default class BalancingStatus {
isBalancing: boolean = false;
currentSeconds: number = 0;
totalSeconds: number = Number(sessionStorage.getItem('balancing total seconds')) || 0;
totalSeconds: number = Number(sessionStorage.getItem('balancing-total-seconds')) || 0;
intervalId!: NodeJS.Timeout;
constructor(private storage: Storage) {}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, HostListener } from '@angular/core';
import Storage from 'src/services/storage.service';
import { IdentifierDataType } from 'src/utils/enumerations/identifier-data-type';
import { floatPipe } from 'src/utils/pipes.utils';
import { decimalPipe, floatPipe } from 'src/utils/pipes.utils';
import { GraphData } from 'src/utils/types.utils';

@Component({
Expand Down Expand Up @@ -32,7 +32,7 @@ export default class CellTempDisplay {
ngOnInit() {
this.storage.get(IdentifierDataType.CELL_TEMP_HIGH).subscribe((value) => {
this.maxTemp = floatPipe(value.values[0]);
this.cellTempData.push({ x: new Date().getTime(), y: this.maxTemp });
this.cellTempData.push({ x: decimalPipe(value.time), y: this.maxTemp });
});
this.storage.get(IdentifierDataType.CELL_TEMP_AVG).subscribe((value) => {
this.avgTemp = floatPipe(value.values[0]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { floatPipe } from 'src/utils/pipes.utils';
export default class ChargingStatusComponent {
isCharging: boolean = false;
currentSeconds: number = 0;
totalSeconds: number = Number(sessionStorage.getItem('charging total seconds')) || 0;
totalSeconds: number = Number(sessionStorage.getItem('charging-total-seconds')) || 0;
intervalId!: NodeJS.Timeout;

constructor(private storage: Storage) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { floatPipe } from 'src/utils/pipes.utils';
export default class FaultedStatus {
isFaulted: boolean = false;
currentSeconds: number = 0;
totalSeconds: number = Number(sessionStorage.getItem('faulted total seconds')) || 0;
totalSeconds: number = Number(sessionStorage.getItem('faulted-total-seconds')) || 0;
intervalId!: NodeJS.Timeout;
constructor(private storage: Storage) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ export default class HighLowCellDisplay {
this.storage.get(IdentifierDataType.VOLTS_LOW).subscribe((value) => {
this.lowCellVoltage = decimalPipe(value.values[0], 3);
this.delta = decimalPipe((this.highCellVoltage - this.lowCellVoltage).toFixed(3), 3);
this.lowVoltsData.push({ x: new Date().getTime(), y: this.lowCellVoltage });
this.lowVoltsData.push({ x: decimalPipe(value.time), y: this.lowCellVoltage });
});
this.storage.get(IdentifierDataType.VOLTS_HIGH).subscribe((value) => {
this.highCellVoltage = decimalPipe(value.values[0], 3);
this.delta = decimalPipe((this.highCellVoltage - this.lowCellVoltage).toFixed(3), 3);
this.highVoltsData.push({ x: new Date().getTime(), y: this.highCellVoltage });
this.highVoltsData.push({ x: decimalPipe(value.time), y: this.highCellVoltage });
});
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, HostListener } from '@angular/core';
import Storage from 'src/services/storage.service';
import { IdentifierDataType } from 'src/utils/enumerations/identifier-data-type';
import { floatPipe } from 'src/utils/pipes.utils';
import { decimalPipe, floatPipe } from 'src/utils/pipes.utils';
import { GraphData } from 'src/utils/types.utils';

@Component({
Expand Down Expand Up @@ -31,7 +31,7 @@ export default class PackVoltageDisplay {
ngOnInit() {
this.storage.get(IdentifierDataType.PACK_VOLTAGE).subscribe((value) => {
this.voltage = floatPipe(value.values[0]);
this.packVoltData.push({ x: new Date().getTime(), y: this.voltage });
this.packVoltData.push({ x: decimalPipe(value.time), y: this.voltage });
});
}
}

0 comments on commit 02e7141

Please sign in to comment.