This commit is contained in:
2026-05-28 21:32:46 +02:00
parent e8cac569e3
commit e82e30dd02
29 changed files with 2485 additions and 97 deletions
@@ -0,0 +1,33 @@
-- UDP integrations: each row is one inbound or outbound UDP socket the
-- user wants HamLog to maintain. Direction is split so a single record
-- can describe either side without nullable destination_ip oddities.
--
-- service_type drives the parser/emitter chosen at runtime:
-- inbound:
-- 'wsjt' - WSJT-X / JTDX / MSHV binary protocol (status + logged QSO)
-- 'adif' - text ADIF payload (JTAlert, GridTracker)
-- 'n1mm' - N1MM Logger+ XML (contests)
-- 'remote_call' - plain text callsign, fills the entry field
-- outbound:
-- 'db_updated' - emits the just-logged QSO as ADIF
--
-- Multicast is the only way to share a port with another listener; when
-- the flag is set the manager joins the group instead of binding the
-- unicast socket.
CREATE TABLE integrations_udp (
id INTEGER PRIMARY KEY AUTOINCREMENT,
direction TEXT NOT NULL CHECK(direction IN ('inbound','outbound')),
name TEXT NOT NULL,
port INTEGER NOT NULL,
service_type TEXT NOT NULL,
multicast INTEGER NOT NULL DEFAULT 0,
multicast_group TEXT NOT NULL DEFAULT '',
destination_ip TEXT NOT NULL DEFAULT '',
enabled INTEGER NOT NULL DEFAULT 1,
sort_order INTEGER NOT NULL DEFAULT 0,
created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ','now')),
updated_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ','now'))
);
CREATE INDEX idx_integrations_udp_dir ON integrations_udp(direction, enabled, sort_order);
@@ -0,0 +1,19 @@
-- The UDP auto-log path was filling the non-standard `rig` and `ant`
-- columns (intended for the contacted station's rig/antenna, rarely
-- used) instead of `my_rig` / `my_antenna` (the official ADIF MY_RIG /
-- MY_ANTENNA fields). Move any data that's already there to the right
-- column when the standard one is empty — then clear the non-standard
-- fields so the QSOs match what should have been logged.
UPDATE qso
SET my_rig = rig
WHERE (my_rig IS NULL OR my_rig = '')
AND rig IS NOT NULL AND rig != '';
UPDATE qso
SET my_antenna = ant
WHERE (my_antenna IS NULL OR my_antenna = '')
AND ant IS NOT NULL AND ant != '';
UPDATE qso SET rig = '' WHERE rig IS NOT NULL AND rig != '';
UPDATE qso SET ant = '' WHERE ant IS NOT NULL AND ant != '';
@@ -0,0 +1,7 @@
-- The profile already stores the station callsign (callsign — what's
-- transmitted) and the operator callsign (operator — who is actually
-- working the radio). Some setups need a third: owner_callsign, the
-- legal owner of the station. This matters at a club station or a
-- remote setup where the operator and owner aren't the same person.
-- ADIF maps this to STATION_OWNER.
ALTER TABLE station_profiles ADD COLUMN owner_callsign TEXT NOT NULL DEFAULT '';