Added the start of varicode
This commit is contained in:
parent
564b93f307
commit
c96522c11b
@ -303,6 +303,7 @@ set (wsjtx_CXXSRCS
|
||||
astro.cpp
|
||||
messageaveraging.cpp
|
||||
WsprTxScheduler.cpp
|
||||
varicode.cpp
|
||||
mainwindow.cpp
|
||||
Configuration.cpp
|
||||
main.cpp
|
||||
|
24
varicode.cpp
Normal file
24
varicode.cpp
Normal file
@ -0,0 +1,24 @@
|
||||
#include "varicode.h"
|
||||
|
||||
QString alphabet = {"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ+-./?"};
|
||||
|
||||
qint16 Varicode::unpack16bits(QString const& triple){
|
||||
int a = alphabet.indexOf(triple.at(0));
|
||||
int b = alphabet.indexOf(triple.at(1));
|
||||
int c = alphabet.indexOf(triple.at(2));
|
||||
return (41*41) * a + 41*b + c;
|
||||
}
|
||||
|
||||
QString Varicode::pack16bits(qint16 packed){
|
||||
QString out;
|
||||
qint16 tmp = packed / (41*41);
|
||||
out.append(alphabet.at(tmp));
|
||||
|
||||
tmp = (packed - (tmp * (41*41))) / 41;
|
||||
out.append(alphabet.at(tmp));
|
||||
|
||||
tmp = packed % 41;
|
||||
out.append(alphabet.at(tmp));
|
||||
|
||||
return out;
|
||||
}
|
15
varicode.h
Normal file
15
varicode.h
Normal file
@ -0,0 +1,15 @@
|
||||
#ifndef VARICODE_H
|
||||
#define VARICODE_H
|
||||
|
||||
#include <QString>
|
||||
|
||||
class Varicode
|
||||
{
|
||||
public:
|
||||
//Varicode();
|
||||
|
||||
qint16 unpack16bits(QString const& triple);
|
||||
QString pack16bits(qint16 packed);
|
||||
};
|
||||
|
||||
#endif // VARICODE_H
|
@ -67,7 +67,8 @@ SOURCES += \
|
||||
echoplot.cpp echograph.cpp fastgraph.cpp fastplot.cpp Modes.cpp \
|
||||
WSPRBandHopping.cpp MessageAggregator.cpp SampleDownloader.cpp qt_helpers.cpp\
|
||||
MultiSettings.cpp PhaseEqualizationDialog.cpp IARURegions.cpp MessageBox.cpp \
|
||||
EqualizationToolsDialog.cpp
|
||||
EqualizationToolsDialog.cpp \
|
||||
varicode.cpp
|
||||
|
||||
HEADERS += qt_helpers.hpp \
|
||||
pimpl_h.hpp pimpl_impl.hpp \
|
||||
@ -84,7 +85,8 @@ HEADERS += qt_helpers.hpp \
|
||||
messageaveraging.h echoplot.h echograph.h fastgraph.h fastplot.h Modes.hpp WSPRBandHopping.hpp \
|
||||
WsprTxScheduler.h SampleDownloader.hpp MultiSettings.hpp PhaseEqualizationDialog.hpp \
|
||||
IARURegions.hpp MessageBox.hpp EqualizationToolsDialog.hpp \
|
||||
qorderedmap.h
|
||||
qorderedmap.h \
|
||||
varicode.h
|
||||
|
||||
|
||||
INCLUDEPATH += qmake_only
|
||||
|
Loading…
Reference in New Issue
Block a user