| 26 | } |
| 27 | |
| 28 | void CLUSTERInstrumentsDecoderModule::process() |
| 29 | { |
| 30 | if (input_data_type == DATA_FILE) |
| 31 | filesize = getFilesize(d_input_file); |
| 32 | std::ifstream data_in; |
| 33 | if (input_data_type == DATA_FILE) |
| 34 | data_in = std::ifstream(d_input_file, std::ios::binary); |
| 35 | |
| 36 | logger->info("Using input frames " + d_input_file); |
| 37 | |
| 38 | time_t lastTime = 0; |
| 39 | uint8_t cadu[1279]; |
| 40 | |
| 41 | // Demuxers |
| 42 | ccsds::ccsds_tm::Demuxer demuxer_vcid1(1101, false); |
| 43 | |
| 44 | std::ofstream output(d_output_file_hint + "_wbd.frm", std::ios::binary); |
| 45 | std::ofstream output_cadu2(d_output_file_hint + "_cadu_bkp.cadu", std::ios::binary); |
| 46 | |
| 47 | def::SimpleDeframer wbddeframer(0xFAF334, 24, 8768, 0); |
| 48 | WBDdecoder wbddecode; |
| 49 | |
| 50 | // Audio stuff |
| 51 | int16_t audio_buffer[4352]; |
| 52 | std::shared_ptr<audio::AudioSink> audio_sink; |
| 53 | if (input_data_type != DATA_FILE && audio::has_sink()) |
| 54 | { |
| 55 | enable_audio = true; |
| 56 | audio_sink = audio::get_default_sink(); |
| 57 | audio_sink->set_samplerate(27443); |
| 58 | audio_sink->start(); |
| 59 | } |
| 60 | |
| 61 | // Buffers to wav...for all the antennas |
| 62 | std::ofstream out_antenna_Ez(d_output_file_hint + "_Ez.wav", std::ios::binary); |
| 63 | uint64_t final_data_size_ant_Ez = 0; |
| 64 | dsp::WavWriter wave_writer_Ez(out_antenna_Ez); |
| 65 | wave_writer_Ez.write_header(27443, 1); |
| 66 | |
| 67 | std::ofstream out_antenna_Bx(d_output_file_hint + "_Bx.wav", std::ios::binary); |
| 68 | uint64_t final_data_size_ant_Bx = 0; |
| 69 | dsp::WavWriter wave_writer_Bx(out_antenna_Bx); |
| 70 | wave_writer_Bx.write_header(27443, 1); |
| 71 | |
| 72 | std::ofstream out_antenna_By(d_output_file_hint + "_By.wav", std::ios::binary); |
| 73 | uint64_t final_data_size_ant_By = 0; |
| 74 | dsp::WavWriter wave_writer_By(out_antenna_By); |
| 75 | wave_writer_By.write_header(27443, 1); |
| 76 | |
| 77 | std::ofstream out_antenna_Ey(d_output_file_hint + "_Ey.wav", std::ios::binary); |
| 78 | uint64_t final_data_size_ant_Ey = 0; |
| 79 | dsp::WavWriter wave_writer_Ey(out_antenna_Ey); |
| 80 | wave_writer_Ey.write_header(27443, 1); |
| 81 | |
| 82 | while (input_data_type == DATA_FILE ? !data_in.eof() : input_active.load()) |
| 83 | { |
| 84 | // Read buffer |
| 85 | if (input_data_type == DATA_FILE) |
nothing calls this directly
no test coverage detected