20enum class Type { ORIGINAL, MODIFIED };
22using Array = std::array<std::array<int, 7>, 3>;
24constexpr auto array = [] {
25 constexpr auto COSTAS =
26 std::array{std::array{std::array{4, 2, 5, 6, 1, 3, 0},
27 std::array{4, 2, 5, 6, 1, 3, 0},
28 std::array{4, 2, 5, 6, 1, 3, 0}},
29 std::array{std::array{0, 6, 2, 3, 5, 4, 1},
30 std::array{1, 5, 0, 2, 3, 6, 4},
31 std::array{2, 5, 0, 6, 4, 1, 3}}};
33 return [COSTAS](Type type) -> Array
const & {
34 return COSTAS[
static_cast<std::underlying_type_t<Type>
>(type)];
39void encode(
int type, Costas::Array
const &costas,
const char *message,
53 enum class Type { CANDIDATE, DECODED } type;
79 std::variant<DecodeStarted, SyncStart, SyncState, Decoded, DecodeFinished>;
81using Emitter = std::function<void(Variant
const &)>;
86class Decoder :
public QObject {
89 QSemaphore m_semaphore;
94 Decoder(QObject *parent =
nullptr);
98 void decodeEvent(Event::Variant
const &);
102 void start(QThread::Priority priority);