From fb20a75224dcff70fbd85c5f9096c9485911846e Mon Sep 17 00:00:00 2001 From: Ben Date: Sun, 25 Feb 2024 23:37:55 -0500 Subject: [PATCH] gui hex stuff --- .vscode/settings.json | 2 +- .../app/components/home/home.component.html | 10 +++++----- .../src/app/components/home/home.component.ts | 19 +++++++++++++++---- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 97cf7e5e5..2a53c42a1 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,6 @@ { "idf.flashType": "UART", - "idf.portWin": "COM30", + "idf.portWin": "COM49", "idf.adapterTargetName": "esp32s3", "idf.openOcdConfigs": [ "interface/ftdi/esp32_devkitj_v1.cfg", diff --git a/main/http_server/axe-os/src/app/components/home/home.component.html b/main/http_server/axe-os/src/app/components/home/home.component.html index ba10861f1..b45c1708a 100644 --- a/main/http_server/axe-os/src/app/components/home/home.component.html +++ b/main/http_server/axe-os/src/app/components/home/home.component.html @@ -96,11 +96,11 @@
Power
Power -
- +
+ Input Voltage -   Danger: Low voltage +
@@ -201,4 +201,4 @@
Pool Information
- + \ No newline at end of file diff --git a/main/http_server/axe-os/src/app/components/home/home.component.ts b/main/http_server/axe-os/src/app/components/home/home.component.ts index 8ad062ae0..d11c5c577 100644 --- a/main/http_server/axe-os/src/app/components/home/home.component.ts +++ b/main/http_server/axe-os/src/app/components/home/home.component.ts @@ -24,6 +24,8 @@ export class HomeComponent { public dataData: number[] = []; public chartData?: any; + public inputVoltage$: Observable<{ min: number, max: number }>; + constructor( private systemService: SystemService ) { @@ -134,17 +136,26 @@ export class HomeComponent { this.expectedHashRate$ = this.info$.pipe(map(info => { if (info.ASICModel === eASICModel.BM1366) { const version = parseInt(info.boardVersion); - if (version >= 400 && version < 500) { - return (info.frequency * ((894 * 6) / 1000)) + if (version >= 300 && version < 400) { + return Math.floor((info.frequency * ((894 * 6) / 1000))) } else { - return (info.frequency * (894 / 1000)) + return Math.floor((info.frequency * (894 / 1000))) } } else if (info.ASICModel === eASICModel.BM1397) { - return (info.frequency * (672 / 1000)) + return Math.floor((info.frequency * (672 / 1000))) } return undefined; + })); + + this.inputVoltage$ = this.info$.pipe(map(info => { + const version = parseInt(info.boardVersion); + if (version >= 300 && version < 400) { + return { min: 11, max: 13 }; + } else { + return { min: 4.5, max: 5.5 }; + } })) this.quickLink$ = this.info$.pipe(