2023-12-29 18:36:02 +01:00
|
|
|
#
|
|
|
|
/*
|
2025-07-16 20:32:47 +02:00
|
|
|
* Copyright (C) 2015 .. 2023
|
2023-12-29 18:36:02 +01:00
|
|
|
* Jan van Katwijk (J.vanKatwijk@gmail.com)
|
|
|
|
* Lazy Chair Computing
|
|
|
|
*
|
2024-02-25 14:18:27 +01:00
|
|
|
* This file is part of the Qt-DAB
|
2023-12-29 18:36:02 +01:00
|
|
|
*
|
|
|
|
* Qt-DAB is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Qt-DAB is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2024-02-25 14:18:27 +01:00
|
|
|
* along with Qt-DAB; if not, write to the Free Software
|
2023-12-29 18:36:02 +01:00
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2024-02-25 14:18:27 +01:00
|
|
|
//
|
2025-07-16 20:32:47 +02:00
|
|
|
// In case there is access to a database, the elements of
|
2024-02-25 14:18:27 +01:00
|
|
|
// that database are read in and per line converted to am accessible
|
|
|
|
// struct
|
|
|
|
#include <string>
|
|
|
|
#include <QString>
|
2025-07-17 20:49:55 +02:00
|
|
|
#include "distances.h"
|
2024-09-23 10:19:31 +02:00
|
|
|
class cacheElement {
|
|
|
|
public:
|
2025-07-14 17:25:42 +02:00
|
|
|
uint32_t key_1; // Eid + mainId + subId
|
|
|
|
uint16_t key_2; // channel in Hex format
|
2024-09-23 10:19:31 +02:00
|
|
|
bool valid;
|
2025-04-01 19:25:23 +02:00
|
|
|
QString ensemble;
|
2024-02-25 14:18:27 +01:00
|
|
|
QString country;
|
|
|
|
QString channel;
|
2024-11-29 20:31:44 +01:00
|
|
|
QString location;
|
2024-02-25 14:18:27 +01:00
|
|
|
uint16_t Eid;
|
2024-12-11 19:06:03 +01:00
|
|
|
uint8_t mainId;
|
2025-01-04 16:03:58 +01:00
|
|
|
uint16_t pattern;
|
2024-12-11 19:06:03 +01:00
|
|
|
uint8_t subId;
|
2024-02-25 14:18:27 +01:00
|
|
|
QString transmitterName;
|
|
|
|
float latitude;
|
|
|
|
float longitude;
|
|
|
|
float power;
|
2024-11-29 20:31:44 +01:00
|
|
|
float altitude;
|
2024-02-25 14:18:27 +01:00
|
|
|
float height;
|
2024-11-29 20:31:44 +01:00
|
|
|
QString polarization;
|
|
|
|
float frequency;
|
|
|
|
QString direction;
|
|
|
|
//
|
|
|
|
// There are values differing per instance of the
|
|
|
|
// same transmitter
|
|
|
|
float strength;
|
|
|
|
float distance;
|
|
|
|
float azimuth;
|
2024-12-18 20:45:47 +01:00
|
|
|
float phase;
|
|
|
|
bool norm;
|
2025-01-05 13:11:25 +01:00
|
|
|
bool collision;
|
2024-11-29 20:31:44 +01:00
|
|
|
|
2024-09-23 10:19:31 +02:00
|
|
|
cacheElement () {
|
2025-07-14 17:25:42 +02:00
|
|
|
key_1 = 0;
|
|
|
|
key_2 = 0;
|
2024-11-29 20:31:44 +01:00
|
|
|
valid = false;
|
2025-04-01 19:25:23 +02:00
|
|
|
ensemble = "";
|
2024-09-23 10:19:31 +02:00
|
|
|
country = "not known";
|
|
|
|
channel = "";
|
|
|
|
ensemble = "";
|
|
|
|
Eid = 0;
|
2024-12-11 19:06:03 +01:00
|
|
|
mainId = 255;
|
|
|
|
subId = 255;
|
2024-09-23 10:19:31 +02:00
|
|
|
transmitterName = "not in database";
|
|
|
|
latitude = 0;
|
|
|
|
longitude = 0;
|
|
|
|
power = 0;
|
|
|
|
height = 0;
|
2024-11-29 20:31:44 +01:00
|
|
|
power = 0;
|
|
|
|
polarization = "";
|
|
|
|
frequency = 0;
|
|
|
|
direction = "";
|
2024-12-18 20:45:47 +01:00
|
|
|
phase = 0;
|
|
|
|
norm = false;
|
2025-01-05 13:11:25 +01:00
|
|
|
collision = false;
|
2024-09-23 10:19:31 +02:00
|
|
|
}
|
|
|
|
~cacheElement () {}
|
|
|
|
};
|
2023-12-29 18:36:02 +01:00
|
|
|
|
2024-04-03 18:44:52 +02:00
|
|
|
|
|
|
|
struct transmitterDesc {
|
2024-11-29 20:31:44 +01:00
|
|
|
bool isValid;
|
2024-04-03 18:44:52 +02:00
|
|
|
bool isStrongest;
|
2024-10-17 15:44:28 +02:00
|
|
|
bool isFurthest;
|
2024-04-03 18:44:52 +02:00
|
|
|
cacheElement theTransmitter;
|
|
|
|
};
|
|
|
|
|