defmodule MicrowavepropWeb.SubmitLive.AdifUploadComponent do @moduledoc false use MicrowavepropWeb, :html alias Microwaveprop.Radio.AdifImport @doc false @spec adif_upload_form(map()) :: Phoenix.LiveView.Rendered.t() def adif_upload_form(assigns) do assigns = assign(assigns, mode_mapping: AdifImport.mode_mapping_reference()) ~H"""

Upload an ADIF (.adi / .adif) file exported from your logging program.

  • Required fields: CALL, STATION_CALLSIGN (or OPERATOR), GRIDSQUARE, MY_GRIDSQUARE, QSO_DATE, TIME_ON, and FREQ or BAND
  • Contacts on amateur bands from 50 MHz and up will be imported
  • HF contacts (below 50 MHz) are silently skipped
  • Frequencies are fuzzy-matched to the nearest amateur band
  • Operator commentary from NOTES is carried over (falling back to COMMENT)

Mode handling

ADIF modes are normalized to the six modes we track. SUBMODE takes precedence when present (e.g. MODE=MFSK, SUBMODE=FT8 imports as FT8).

ADIF value Stored as
{adif} {mapped}
{entry.client_name} {entry.progress}%
{error_to_string(err)}
{error_to_string(err)}
<%= if @current_user do %> <% end %>
""" end defp error_to_string(:too_large), do: "File is too large" defp error_to_string(:too_many_files), do: "Only one file allowed" defp error_to_string(:not_accepted), do: "File type not accepted" defp error_to_string(other), do: to_string(other) defp uploading?(%{progress: progress}), do: progress > 0 and progress < 100 defp uploading?(_), do: false end