Skip to content

Commit

Permalink
gui hex stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-wilson committed Feb 26, 2024
1 parent e561f60 commit fb20a75
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"idf.flashType": "UART",
"idf.portWin": "COM30",
"idf.portWin": "COM49",
"idf.adapterTargetName": "esp32s3",
"idf.openOcdConfigs": [
"interface/ftdi/esp32_devkitj_v1.cfg",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ <h5>Power</h5>
Power
</div>

<div class="col-4">
<p-knob [min]="4.5" [max]="5.5" [readonly]="true" [(ngModel)]="info.voltage"
valueTemplate="{value}V"></p-knob>
<div class="col-4" *ngIf="inputVoltage$ | async as inputVoltage">
<p-knob [min]="inputVoltage.min" [max]="inputVoltage.max" [readonly]="true"
[(ngModel)]="info.voltage" valueTemplate="{value}V"></p-knob>
Input Voltage
<span class="danger" *ngIf="info.voltage < 4.8">&nbsp; Danger: Low voltage</span>

</div>

<div class="col-4">
Expand Down Expand Up @@ -201,4 +201,4 @@ <h5>Pool Information</h5>
</div>


</ng-container>
</ng-container>
19 changes: 15 additions & 4 deletions main/http_server/axe-os/src/app/components/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export class HomeComponent {
public dataData: number[] = [];
public chartData?: any;

public inputVoltage$: Observable<{ min: number, max: number }>;

constructor(
private systemService: SystemService
) {
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit fb20a75

Please sign in to comment.