-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
269 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
22 changes: 22 additions & 0 deletions
22
angular-client/src/components/current-total-timer/current-total-timer.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<info-background svgIcon="timer" title="Timer"> | ||
<div style="display: flex; justify-content: center; align-items: center; height: 80%; padding-top: 20px"> | ||
<vstack spacing="20px" style="padding-left: 20px"> | ||
<hstack> | ||
<typography variant="info-subtitle" content="CURRENT:" /> | ||
<typography | ||
variant="info-subtitle" | ||
[content]="getCurrentTime()" | ||
additionalStyles="color: #fbf7f5; text-shadow: 0 0 5px rgba(217,217,214, 0.3);" | ||
/> | ||
</hstack> | ||
<hstack spacing="42px"> | ||
<typography variant="info-subtitle" content="TOTAL:" /> | ||
<typography | ||
variant="info-subtitle" | ||
[content]="getTotalTime()" | ||
additionalStyles="color: #fbf7f5; text-shadow: 0 0 5px rgba(217,217,214, 0.3);" | ||
/> | ||
</hstack> | ||
</vstack> | ||
</div> | ||
</info-background> |
35 changes: 35 additions & 0 deletions
35
angular-client/src/components/current-total-timer/current-total-timer.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Component, Input } from '@angular/core'; | ||
import Storage from 'src/services/storage.service'; | ||
|
||
@Component({ | ||
selector: 'current-total-timer', | ||
templateUrl: './current-total-timer.component.html', | ||
styleUrls: ['./current-total-timer.component.css'] | ||
}) | ||
export default class CurrentTotalTimer { | ||
@Input() currentTime: number = 0; | ||
@Input() totalTime: number = 0; | ||
|
||
constructor(private storage: Storage) {} | ||
|
||
getCurrentTime() { | ||
return this.formatTime(this.currentTime); | ||
} | ||
|
||
getTotalTime() { | ||
return this.formatTime(this.totalTime); | ||
} | ||
|
||
/** | ||
* Formats the given time. | ||
* | ||
* @param time the time to format. | ||
* @returns the time as a string in the given format: 00:00 (leading zeros included). | ||
*/ | ||
formatTime(time: number) { | ||
const minutes = Math.floor(time / 60); | ||
const seconds = time % 60; | ||
|
||
return `${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
angular-client/src/pages/charging-page/components/active-status/active-status.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.connection-dot { | ||
background-color: #2c2c2c; | ||
border: 3px solid; | ||
width: 40px; | ||
height: 40px; | ||
border-radius: 50%; | ||
} |
12 changes: 12 additions & 0 deletions
12
angular-client/src/pages/charging-page/components/active-status/active-status.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<info-background title="ACTIVE"> | ||
<hstack> | ||
<current-total-timer style="padding-left: 20px; min-height: 100px" /> | ||
<div style="padding-top: 40px"> | ||
<div | ||
class="connection-dot" | ||
[style.background-color]="getStatusColor(isActive)" | ||
[style.border-color]="isActive ? getStatusColor(isActive) : 'white'" | ||
></div> | ||
</div> | ||
</hstack> | ||
</info-background> |
25 changes: 25 additions & 0 deletions
25
angular-client/src/pages/charging-page/components/active-status/active-status.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Component } from '@angular/core'; | ||
import Storage from 'src/services/storage.service'; | ||
import Theme from 'src/services/theme.service'; | ||
import { IdentifierDataType } from 'src/utils/enumerations/identifier-data-type'; | ||
import { floatPipe } from 'src/utils/pipes.utils'; | ||
|
||
@Component({ | ||
selector: 'active-status', | ||
templateUrl: './active-status.component.html', | ||
styleUrls: ['./active-status.component.css'] | ||
}) | ||
export default class ActiveStatus { | ||
isActive: boolean = false; | ||
constructor(private storage: Storage) {} | ||
|
||
ngOnInit() { | ||
this.storage.get(IdentifierDataType.BMS_MODE).subscribe((value) => { | ||
this.isActive = floatPipe(value.values[0]) === 2; | ||
}); | ||
} | ||
|
||
getStatusColor(isActive: boolean) { | ||
return isActive ? 'green' : Theme.infoBackground; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...client/src/pages/charging-page/components/balancing-status/balancing-status.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.connection-dot { | ||
background-color: #2c2c2c; | ||
border: 3px solid; | ||
width: 40px; | ||
height: 40px; | ||
border-radius: 50%; | ||
} |
12 changes: 12 additions & 0 deletions
12
...lient/src/pages/charging-page/components/balancing-status/balancing-status.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<info-background title="BALANCING"> | ||
<hstack> | ||
<current-total-timer style="padding-left: 20px; min-height: 100px" /> | ||
<div style="padding-top: 40px"> | ||
<div | ||
class="connection-dot" | ||
[style.background-color]="getStatusColor(isBalancing)" | ||
[style.border-color]="isBalancing ? getStatusColor(isBalancing) : 'white'" | ||
></div> | ||
</div> | ||
</hstack> | ||
</info-background> |
29 changes: 29 additions & 0 deletions
29
...-client/src/pages/charging-page/components/balancing-status/balancing-status.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Component } from '@angular/core'; | ||
import Storage from 'src/services/storage.service'; | ||
import Theme from 'src/services/theme.service'; | ||
import { IdentifierDataType } from 'src/utils/enumerations/identifier-data-type'; | ||
import { floatPipe } from 'src/utils/pipes.utils'; | ||
|
||
@Component({ | ||
selector: 'balancing-status', | ||
templateUrl: './balancing-status.component.html', | ||
styleUrls: ['./balancing-status.component.css'] | ||
}) | ||
export default class BalancingStatus { | ||
isBalancing: boolean = false; | ||
constructor(private storage: Storage) {} | ||
|
||
ngOnInit() { | ||
this.storage.get(IdentifierDataType.STATUS_BALANCING).subscribe((value) => { | ||
this.isBalancing = floatPipe(value.values[0]) === 1; | ||
}); | ||
} | ||
|
||
getBatteryStatus(connected: boolean) { | ||
return connected ? 'BALANCING' : 'NOT BALANCING'; | ||
} | ||
|
||
getStatusColor(isBalancing: boolean) { | ||
return isBalancing ? 'blue' : Theme.infoBackground; | ||
} | ||
} |
7 changes: 4 additions & 3 deletions
7
...ages/charging-page/components/battery-status-display/battery-status-display.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
.connection-dot { | ||
width: 50px; | ||
height: 50px; | ||
background-color: #2c2c2c; | ||
border: 3px solid; | ||
width: 40px; | ||
height: 40px; | ||
border-radius: 50%; | ||
margin-top: 20px; | ||
} |
13 changes: 9 additions & 4 deletions
13
...ges/charging-page/components/battery-status-display/battery-status-display.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
<info-background svgIcon="quickreply" title="Status"> | ||
<div style="display: flex; justify-content: center; align-items: center; height: 80%"> | ||
<vstack> | ||
<div class="connection-dot" [style.background-color]="getStatusColor(isBalancing)"></div> | ||
<typography variant="info-subtitle" [content]="getBatteryStatus(isBalancing)" /> | ||
<div style="display: flex; justify-content: left; align-items: flex-start; height: 80%"> | ||
<vstack style="padding-top: 30px" align="start"> | ||
<active-status /> | ||
<divider style="width: 250px" /> | ||
<charging-state /> | ||
<divider style="width: 250px" /> | ||
<balancing-status /> | ||
<divider style="width: 250px" /> | ||
<faulted-status /> | ||
</vstack> | ||
</div> | ||
</info-background> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
...lar-client/src/pages/charging-page/components/charging-state/charging-state.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 11 additions & 7 deletions
18
...ar-client/src/pages/charging-page/components/charging-state/charging-state.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
<info-background svgIcon="electrical_services" title="Charging"> | ||
<div style="display: flex; justify-content: center; align-items: center; height: 80%"> | ||
<vstack> | ||
<div class="connection-dot" [style.background-color]="getStateColor(isCharging)"></div> | ||
<typography variant="info-subtitle" [content]="getChargingState(isCharging) + ' FOR: ' + getTimerInfo()" /> | ||
</vstack> | ||
</div> | ||
<info-background title="CHARGING"> | ||
<hstack> | ||
<current-total-timer style="padding-left: 20px; min-height: 100px" /> | ||
<div style="padding-top: 40px"> | ||
<div | ||
class="connection-dot" | ||
[style.background-color]="getStateColor(isCharging)" | ||
[style.border-color]="isCharging ? getStateColor(isCharging) : 'white'" | ||
></div> | ||
</div> | ||
</hstack> | ||
</info-background> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...lar-client/src/pages/charging-page/components/faulted-status/faulted-status.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.connection-dot { | ||
background-color: #2c2c2c; | ||
border: 3px solid; | ||
width: 40px; | ||
height: 40px; | ||
border-radius: 50%; | ||
} |
12 changes: 12 additions & 0 deletions
12
...ar-client/src/pages/charging-page/components/faulted-status/faulted-status.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<info-background title="FAULTED"> | ||
<hstack> | ||
<current-total-timer style="padding-left: 20px; min-height: 100px" /> | ||
<div style="padding-top: 40px"> | ||
<div | ||
class="connection-dot" | ||
[style.background-color]="getStatusColor(isFaulted)" | ||
[style.border-color]="isFaulted ? getStatusColor(isFaulted) : 'white'" | ||
></div> | ||
</div> | ||
</hstack> | ||
</info-background> |
25 changes: 25 additions & 0 deletions
25
angular-client/src/pages/charging-page/components/faulted-status/faulted-status.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Component } from '@angular/core'; | ||
import Storage from 'src/services/storage.service'; | ||
import Theme from 'src/services/theme.service'; | ||
import { IdentifierDataType } from 'src/utils/enumerations/identifier-data-type'; | ||
import { floatPipe } from 'src/utils/pipes.utils'; | ||
|
||
@Component({ | ||
selector: 'faulted-status', | ||
templateUrl: './faulted-status.component.html', | ||
styleUrls: ['./faulted-status.component.css'] | ||
}) | ||
export default class FaultedStatus { | ||
isFaulted: boolean = false; | ||
constructor(private storage: Storage) {} | ||
|
||
ngOnInit() { | ||
this.storage.get(IdentifierDataType.BMS_MODE).subscribe((value) => { | ||
this.isFaulted = floatPipe(value.values[0]) === 3; | ||
}); | ||
} | ||
|
||
getStatusColor(isFaulted: boolean) { | ||
return isFaulted ? 'red' : Theme.infoBackground; | ||
} | ||
} |
Empty file.
4 changes: 4 additions & 0 deletions
4
...-client/src/pages/charging-page/components/starting-soc/starting-soc-timer.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<info-background> | ||
<typography content="Starting Soc Value: "></typography> | ||
<typography [content]="startingSoc.toString()"></typography> | ||
</info-background> |
Oops, something went wrong.