2023-01-08 13:03:29 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
2023-11-18 23:24:06 -05:00
|
|
|
// Copyright (C) 2012 maintech GmbH, Otto-Hahn-Str. 15, 97204 Hoechberg, Germany //
|
|
|
|
// written by Christian Daniel //
|
|
|
|
// Copyright (C) 2015-2016, 2018-2019, 2023 Edouard Griffiths, F4EXB <f4exb06@gmail.com> //
|
2023-01-08 13:03:29 -05:00
|
|
|
// //
|
|
|
|
// This is the code from ft8mon: https://github.com/rtmrtmrtmrtm/ft8mon //
|
|
|
|
// reformatted and adapted to Qt and SDRangel context //
|
|
|
|
// //
|
|
|
|
// This program 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 as version 3 of the License, or //
|
|
|
|
// (at your option) any later version. //
|
|
|
|
// //
|
|
|
|
// This program 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 V3 for more details. //
|
|
|
|
// //
|
|
|
|
// You should have received a copy of the GNU General Public License //
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#ifndef unpack_h
|
|
|
|
#define unpack_h
|
|
|
|
|
2023-01-10 18:21:47 -05:00
|
|
|
#include <string>
|
2023-01-10 22:49:16 -05:00
|
|
|
#include <map>
|
|
|
|
|
2023-01-29 13:27:45 -05:00
|
|
|
#include <QMutex>
|
2023-01-10 18:21:47 -05:00
|
|
|
|
2023-01-12 16:25:42 -05:00
|
|
|
#include "export.h"
|
|
|
|
|
2023-01-08 13:03:29 -05:00
|
|
|
namespace FT8 {
|
|
|
|
|
2023-01-12 16:25:42 -05:00
|
|
|
class FT8_API Packing
|
2023-01-10 22:49:16 -05:00
|
|
|
{
|
|
|
|
public:
|
2023-01-28 05:39:44 -05:00
|
|
|
std::string unpack(int a91[], std::string& call1str, std::string& call2str, std::string& locstr, std::string& type);
|
2024-03-28 10:15:48 -04:00
|
|
|
static std::string unpack_0_0(int a77[], std::string& call1str, std::string& call2str, std::string& locstr);
|
|
|
|
std::string unpack_1(int a77[], std::string& call1str, std::string& call2str, std::string& locstr);
|
|
|
|
static bool packcall_std(int& c28, const std::string& callstr);
|
|
|
|
static bool packgrid(int& g15, const std::string& locstr);
|
|
|
|
static bool packfree(int a77[], const std::string& msg);
|
2023-01-10 22:49:16 -05:00
|
|
|
|
|
|
|
private:
|
2023-01-19 17:51:43 -05:00
|
|
|
static int ihashcall(std::string call, int m);
|
2023-01-10 22:49:16 -05:00
|
|
|
std::string unpackcall(int x);
|
2023-01-28 16:45:07 -05:00
|
|
|
std::string unpackgrid15(int ng, int ir);
|
|
|
|
std::string unpackgrid25(int ng);
|
2023-01-10 22:49:16 -05:00
|
|
|
void remember_call(std::string call);
|
2023-01-28 05:39:44 -05:00
|
|
|
std::string unpack_0_1(int a77[], std::string& call1str, std::string& call2str, std::string& locstr);
|
2023-01-28 06:29:58 -05:00
|
|
|
// 0.3 and 0.4
|
2023-01-10 22:49:16 -05:00
|
|
|
std::string unpack_0_3(int a77[], int n3, std::string& call1str, std::string& call2str, std::string& locstr);
|
2023-01-28 16:45:07 -05:00
|
|
|
std::string unpack_0_5(int a77[], std::string& call1str, std::string& call2str, std::string& locstr);
|
2023-01-28 06:29:58 -05:00
|
|
|
// 1 and 2
|
|
|
|
std::string unpack_3(int a77[], std::string& call1str, std::string& call2str, std::string& locstr);
|
|
|
|
std::string unpack_4(int a77[], std::string& call1str, std::string& call2str, std::string& locstr);
|
2023-01-28 16:45:07 -05:00
|
|
|
std::string unpack_5(int a77[], std::string& call1str, std::string& call2str, std::string& locstr);
|
2023-01-10 22:49:16 -05:00
|
|
|
|
2024-03-28 10:15:48 -04:00
|
|
|
|
2023-01-29 13:27:45 -05:00
|
|
|
QMutex hashes_mu;
|
2023-01-28 05:39:44 -05:00
|
|
|
std::map<int, std::string> hashes10;
|
2023-01-10 22:49:16 -05:00
|
|
|
std::map<int, std::string> hashes12;
|
|
|
|
std::map<int, std::string> hashes22;
|
|
|
|
|
|
|
|
static const int NGBASE = (180 * 180);
|
|
|
|
static const int NTOKENS = 2063592;
|
|
|
|
static const int MAX22 = 4194304;
|
|
|
|
static const char *ru_states[];
|
|
|
|
static const char *sections[];
|
|
|
|
};
|
|
|
|
|
2023-01-08 13:03:29 -05:00
|
|
|
|
|
|
|
} // namespace FT8
|
|
|
|
|
|
|
|
#endif
|