2021-03-11 21:38:07 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "module.h"
|
|
|
|
|
#include <complex>
|
|
|
|
|
#include <fstream>
|
2021-05-21 22:29:17 +02:00
|
|
|
#include "common/ccsds/ccsds_1_0_proba/deframer.h"
|
2021-10-22 15:26:17 +02:00
|
|
|
#include "common/dsp/random.h"
|
2021-03-11 21:38:07 +01:00
|
|
|
|
2021-03-22 19:03:08 +01:00
|
|
|
namespace spacex
|
2021-03-11 21:38:07 +01:00
|
|
|
{
|
2021-03-22 19:03:08 +01:00
|
|
|
class SpaceXDecoderModule : public ProcessingModule
|
2021-03-11 21:38:07 +01:00
|
|
|
{
|
|
|
|
|
protected:
|
|
|
|
|
// Read buffer
|
|
|
|
|
int8_t *buffer;
|
|
|
|
|
|
2021-03-14 12:54:55 +01:00
|
|
|
ccsds::ccsds_1_0_proba::CADUDeframer deframer;
|
2021-03-11 21:38:07 +01:00
|
|
|
|
|
|
|
|
uint8_t rsWorkBuffer[255];
|
|
|
|
|
int errors[5];
|
|
|
|
|
|
|
|
|
|
std::ifstream data_in;
|
|
|
|
|
std::ofstream data_out;
|
|
|
|
|
std::atomic<size_t> filesize;
|
|
|
|
|
std::atomic<size_t> progress;
|
|
|
|
|
|
2021-03-22 19:22:09 +01:00
|
|
|
bool qpsk;
|
|
|
|
|
|
2021-03-11 21:38:07 +01:00
|
|
|
// UI Stuff
|
2021-05-04 12:23:22 +02:00
|
|
|
dsp::Random rng;
|
2021-03-11 21:38:07 +01:00
|
|
|
|
|
|
|
|
public:
|
2021-03-22 19:03:08 +01:00
|
|
|
SpaceXDecoderModule(std::string input_file, std::string output_file_hint, std::map<std::string, std::string> parameters);
|
|
|
|
|
~SpaceXDecoderModule();
|
2021-03-11 21:38:07 +01:00
|
|
|
void process();
|
2021-03-31 18:15:26 +02:00
|
|
|
void drawUI(bool window);
|
2021-03-11 21:38:07 +01:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
static std::string getID();
|
2021-07-21 00:54:48 +02:00
|
|
|
virtual std::string getIDM() { return getID(); };
|
2021-03-11 21:38:07 +01:00
|
|
|
static std::vector<std::string> getParameters();
|
|
|
|
|
static std::shared_ptr<ProcessingModule> getInstance(std::string input_file, std::string output_file_hint, std::map<std::string, std::string> parameters);
|
|
|
|
|
};
|
|
|
|
|
} // namespace falcon
|