ui: display focus information, too.

This commit is contained in:
Pavel Machek
2024-09-06 12:20:33 +02:00
parent cccfdb18c7
commit 474b2db2c9

View File

@@ -387,6 +387,7 @@ update_control(controlstate *control)
static int focus; static int focus;
static int focus_phase; static int focus_phase;
static const int focus_inf = 200;
static void static void
auto_focus_start(void) auto_focus_start(void)
@@ -426,7 +427,7 @@ auto_focus_step(const struct focus_stats *stats)
} }
if (focus_phase < PH_SWEEP) { if (focus_phase < PH_SWEEP) {
best_sharp = 0; best_sharp = 0;
focus = 200; focus = focus_inf;
focus_phase ++; focus_phase ++;
best_focus = 0; best_focus = 0;
if (debug>1) printf("...prepare\n"); if (debug>1) printf("...prepare\n");
@@ -495,7 +496,7 @@ update_exp(controlstate *control, int direction)
static void static void
summarize() summarize()
{ {
double time, gain; double time, gain, diopt;
bool portrait = (state_proc.device_rotation == 0 || state_proc.device_rotation == 180); bool portrait = (state_proc.device_rotation == 0 || state_proc.device_rotation == 180);
char *sep = portrait ? " " : "\n"; char *sep = portrait ? " " : "\n";
char buf[2048]; char buf[2048];
@@ -510,13 +511,19 @@ summarize()
if (1) /* dgain */ if (1) /* dgain */
gain *= state_proc.dgain.value / ((float) state_proc.dgain.min); gain *= state_proc.dgain.value / ((float) state_proc.dgain.min);
printf("1/%.0f sec, ISO %.0f, t=%f, g=%f %d %d\n", /* Focus */
(float) (1.0/time), (float) (gain*100), diopt = (state_proc.focus.value-focus_inf) / ((float) state_proc.focus.max-focus_inf);
(float) time, (float) gain, state_proc.gain.value, state_proc.dgain.value); diopt *= 30;
sprintf(buf, "1/%s%.0f%sISO%s%.0f", printf("1/%.0f sec, ISO %.0f, t=%f, g=%f %d %d, %.2f m\n",
(float) (1.0/time), (float) (gain*100),
(float) time, (float) gain, state_proc.gain.value, state_proc.dgain.value,
(float) 1/diopt);
sprintf(buf, "1/%s%.0f%sISO%s%.0f%sm%s%.2f",
sep, (float) (1.0/time), sep, sep, (float) (1.0/time), sep,
sep, (float) (gain*100)); sep, (float) (gain*100),
sep, sep, 1/diopt);
notify_auto_status(buf); notify_auto_status(buf);
} }