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 f870d785e..00f47155c 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 @@ -452,10 +452,10 @@

Hashrate R {{ i + 1 }} - {{ normalizeHashrate(domain) | hashSuffix }} + {{ domain | hashSuffix }} 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 40f4b1374..ea385733b 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 @@ -315,7 +315,6 @@ export class HomeComponent implements OnInit, OnDestroy { } stats.statistics.forEach(element => { - element[idxHashrate] = this.normalizeHashrate(element[idxHashrate]); switch (chartLabelValue(chartY1DataLabel)) { case eChartLabel.asicVoltage: case eChartLabel.voltage: @@ -364,8 +363,6 @@ export class HomeComponent implements OnInit, OnDestroy { return this.systemService.getInfo() }), map(info => { - info.hashRate = this.normalizeHashrate(info.hashRate); - info.expectedHashrate = this.normalizeHashrate(info.expectedHashrate); info.voltage = info.voltage / 1000; info.current = info.current / 1000; info.coreVoltageActual = info.coreVoltageActual / 1000; @@ -556,7 +553,7 @@ export class HomeComponent implements OnInit, OnDestroy { const efficiencies = hashrateData.map((hashrate, index) => { const power = powerData[index] || 0; if (hashrate > 0) { - return power / (hashrate / 1_000_000_000_000); // Convert to J/Th + return power / (hashrate / 1_000); // Convert to J/Th } else { return power; // in this case better than infinity or NaN } @@ -592,7 +589,7 @@ export class HomeComponent implements OnInit, OnDestroy { if (info.power_fault || hashrate <= 0) { return 0; } - return info.power / (hashrate / 1_000_000_000_000); + return info.power / (hashrate / 1_000); } public getHashrateAverage(): number { @@ -620,7 +617,7 @@ export class HomeComponent implements OnInit, OnDestroy { } public getDomainErrorPercentage(info: ISystemInfo, asic: { error: number }): number { - return asic.error ? (this.normalizeHashrate(asic.error) * 100 / info.expectedHashrate) : 0; + return asic.error ? (asic.error * 100 / info.expectedHashrate) : 0; } public getDomainErrorColor(info: ISystemInfo, asic: { error: number }): string { @@ -657,10 +654,6 @@ export class HomeComponent implements OnInit, OnDestroy { return `rgb(${finalR}, ${finalG}, ${finalB})`; } - public normalizeHashrate(hashrate: number): number { - return hashrate * 1_000_000_000; - } - public clearDataPoints() { this.dataLabel.length = 0; this.hashrateData.length = 0; diff --git a/main/http_server/axe-os/src/app/components/swarm/swarm.component.html b/main/http_server/axe-os/src/app/components/swarm/swarm.component.html index a9b9c3cbc..ba870ef3e 100644 --- a/main/http_server/axe-os/src/app/components/swarm/swarm.component.html +++ b/main/http_server/axe-os/src/app/components/swarm/swarm.component.html @@ -7,7 +7,7 @@

Swarm

@@ -150,7 +150,7 @@

Swarm

- {{axe.hashRate * 1000000000 | hashSuffix}} + {{axe.hashRate | hashSuffix}}
@@ -237,7 +237,7 @@

Swarm

- {{axe.hashRate * 1000000000 | hashSuffix}} + {{axe.hashRate | hashSuffix}}

{{axe.sharesAccepted | number: '1.0-0'}} diff --git a/main/http_server/axe-os/src/app/pipes/hash-suffix.pipe.ts b/main/http_server/axe-os/src/app/pipes/hash-suffix.pipe.ts index 119c53a1f..389c9933a 100644 --- a/main/http_server/axe-os/src/app/pipes/hash-suffix.pipe.ts +++ b/main/http_server/axe-os/src/app/pipes/hash-suffix.pipe.ts @@ -17,6 +17,9 @@ export class HashSuffixPipe implements PipeTransform { return '0 H/s'; } + // Normalize GH/s to H/s + value = value * 1_000_000_000; + const suffixes = [' H/s', ' Kh/s', ' Mh/s', ' Gh/s', ' Th/s', ' Ph/s', ' Eh/s']; let power = Math.floor(Math.log10(value) / 3);