gui hex stuff

This commit is contained in:
Ben 2024-02-25 23:37:55 -05:00 committed by Georges Palauqui
parent 9f040b2d95
commit 8c24356765
No known key found for this signature in database
GPG Key ID: 1E45F544CE4D04A5
3 changed files with 17 additions and 6 deletions

View File

@ -1,6 +1,6 @@
{
"idf.flashType": "UART",
"idf.portWin": "COM3",
"idf.portWin": "COM49",
"idf.adapterTargetName": "esp32s3",
"idf.openOcdConfigs": [
"interface/ftdi/esp32_devkitj_v1.cfg",

View File

@ -100,11 +100,11 @@
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">
@ -274,4 +274,4 @@
</div>
</ng-container>
</ng-container>

View File

@ -24,6 +24,8 @@ export class HomeComponent {
public dataData: number[] = [];
public chartData?: any;
public inputVoltage$: Observable<{ min: number, max: number }>;
constructor(
private systemService: SystemService
) {
@ -133,6 +135,15 @@ export class HomeComponent {
this.expectedHashRate$ = this.info$.pipe(map(info => {
return Math.floor(info.frequency * ((info.coreCount * info.asicCount) / 1000))
}));
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(