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 // info
GrContextForegroundSet(&sContext, ClrWheat); 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); snprintf(str, sizeof(str), "CPU Load %.1f%%", usage_percent);
GrStringDraw(&sContext, str, /*length*/ -1, /*x*/ 0, /*y*/ HEIGHT - 10, /*opaque*/ false); GrStringDraw(&sContext, str, /*length*/ -1, /*x*/ 0, /*y*/ HEIGHT - 10, /*opaque*/ false);
switch (local_options.trigger_mode) {
case 1: if (local_options.fft) {
GrStringDraw(&sContext, "^", /*length*/ -1, /*x*/ WIDTH - 10, /*y*/ 0, /*opaque*/ false); GrStringDraw(&sContext, "20 dB" , /*length*/ -1, /*x*/ 0, /*y*/ 0, /*opaque*/ false);
break;
case 0: } else {
GrStringDraw(&sContext, "v", /*length*/ -1, /*x*/ WIDTH - 10, /*y*/ 0, /*opaque*/ false); GrStringDraw(&sContext, gVoltageScaleStr[local_options.voltage_scale], /*length*/ -1, /*x*/ 0, /*y*/ 0, /*opaque*/ false);
break;
case 2: switch (local_options.trigger_mode) {
GrStringDraw(&sContext, "-", /*length*/ -1, /*x*/ WIDTH - 10, /*y*/ 0, /*opaque*/ false); case 1:
break; 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 // display graph
GrContextForegroundSet(&sContext, ClrYellow); GrContextForegroundSet(&sContext, ClrYellow);
int j; int j;