hide voltage scale in FFT mode

This commit is contained in:
Killorin 2025-04-24 11:11:11 -04:00
parent f798fd6d03
commit 92e1128e5a

31
main.c
View file

@ -313,22 +313,31 @@ void display_waveform(UArg arg1, UArg arg2)
// info
GrContextForegroundSet(&sContext, ClrWheat);
GrStringDraw(&sContext, gVoltageScaleStr[local_options.voltage_scale], /*length*/ -1, /*x*/ 0, /*y*/ 0, /*opaque*/ false);
snprintf(str, sizeof(str), "CPU Load %.1f%%", usage_percent);
GrStringDraw(&sContext, str, /*length*/ -1, /*x*/ 0, /*y*/ HEIGHT - 10, /*opaque*/ false);
switch (local_options.trigger_mode) {
case 1:
GrStringDraw(&sContext, "^", /*length*/ -1, /*x*/ WIDTH - 10, /*y*/ 0, /*opaque*/ false);
break;
case 0:
GrStringDraw(&sContext, "v", /*length*/ -1, /*x*/ WIDTH - 10, /*y*/ 0, /*opaque*/ false);
break;
case 2:
GrStringDraw(&sContext, "-", /*length*/ -1, /*x*/ WIDTH - 10, /*y*/ 0, /*opaque*/ false);
break;
if (local_options.fft) {
GrStringDraw(&sContext, "20 dB" , /*length*/ -1, /*x*/ 0, /*y*/ 0, /*opaque*/ false);
} else {
GrStringDraw(&sContext, gVoltageScaleStr[local_options.voltage_scale], /*length*/ -1, /*x*/ 0, /*y*/ 0, /*opaque*/ false);
switch (local_options.trigger_mode) {
case 1:
GrStringDraw(&sContext, "^", /*length*/ -1, /*x*/ WIDTH - 10, /*y*/ 0, /*opaque*/ false);
break;
case 0:
GrStringDraw(&sContext, "v", /*length*/ -1, /*x*/ WIDTH - 10, /*y*/ 0, /*opaque*/ false);
break;
case 2:
GrStringDraw(&sContext, "-", /*length*/ -1, /*x*/ WIDTH - 10, /*y*/ 0, /*opaque*/ false);
break;
}
}
// display graph
GrContextForegroundSet(&sContext, ClrYellow);
int j;