feat(log): the contact time can be set, for transcribing after a pass

The screen stamped System.currentTimeMillis() with no way to change it, which assumes
contacts are typed as they happen. Serious satellite operators do not work that way: the
documented practice from AMSAT and DX Engineering is to record the pass and transcribe it
afterwards, because during eight minutes of a linear transponder there is no spare attention
for a keyboard.

Measured with a probe against a realistic pass - eight minutes, five contacts, twelve
minutes to transcribe: every contact was stamped 10 to 12 minutes late. LoTW wants both
sides within 30 minutes, so that survives a brisk transcription and fails a slow one.

The case that fails outright is a pass crossing midnight UTC. Transcribing 23:58 at 00:05
the next day put the contact a full 24 hours in the future, which can never be confirmed.
PassClock reads an absolute time later than now as belonging to the previous day, because
passes cross midnight routinely and transcription always happens afterwards.

One field takes both forms: an absolute UTC time (14:55 or 1455) or an offset (+3, -2m).
A separate widget for each is more to reach for than an operator wants while holding an
antenna. The parse is deliberately narrow - anything unclear is Unrecognised and the clock
stays put, because a mis-parsed time silently backdates a contact and nothing downstream
would catch it. The field says so while it is being typed rather than after committing.

A held clock is shown in the primary colour, since logging at the wrong time silently is the
failure this exists to prevent. The row is 48dp with Role.Button, like the mode row.

PassClock is pure and lives in core:domain with 15 tests. The day boundary is passed in
rather than computed there, because core:domain holds no calendar.
This commit is contained in:
mckero committed 2026-08-26 06:32:34 +00:00
1 parent a3e3932f73
commit 00b7b25cc1
5 files changed
+346 -1

No files matched your search

@@ -278,6 +278,11 @@
<string name="wavelog_call_hint">对方呼号</string>
<string name="wavelog_mode_hint">模式</string>
<string name="wavelog_mode_edit">修改模式</string>
<string name="wavelog_time_hint">时间</string>
<string name="wavelog_time_live">当前</string>
<string name="wavelog_time_edit">设置记录时间</string>
<string name="wavelog_time_help">UTC 时间如 14:55, 或 +3 / -2 分钟。留空则用当前时间。</string>
<string name="wavelog_time_unrecognised">不是时间 - 将使用当前时间</string>
<string name="wavelog_saved">已存入本地日志</string>
<string name="wavelog_upload_done">已上传 %1$d 条, %2$d 条仍在队列</string>
<string name="wavelog_upload_all_ok">已上传 %1$d 条</string>
@@ -309,6 +309,11 @@
<string name="wavelog_call_hint">Callsign</string>
<string name="wavelog_mode_hint">Mode</string>
<string name="wavelog_mode_edit">Edit the mode</string>
<string name="wavelog_time_hint">Time</string>
<string name="wavelog_time_live">Now</string>
<string name="wavelog_time_edit">Set the logging time</string>
<string name="wavelog_time_help">UTC time such as 14:55, or +3 / -2 minutes. Empty logs at the current time.</string>
<string name="wavelog_time_unrecognised">Not a time - the current time will be used</string>
<string name="wavelog_saved">Saved to local log</string>
<string name="wavelog_upload_done">Uploaded %1$d, %2$d still queued</string>
<string name="wavelog_upload_all_ok">Uploaded %1$d QSO</string>