MCPcopy Create free account
hub / github.com/cjcliffe/CubicSDR / DemodulatorPreThread

Method DemodulatorPreThread

src/demod/DemodulatorPreThread.cpp:17–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15#define HEARTBEAT_CHECK_PERIOD_MICROS (50 * 1000)
16
17DemodulatorPreThread::DemodulatorPreThread(DemodulatorInstance* parent) : IOThread(), iqResampler(nullptr), iqResampleRatio(1), cModem(nullptr), cModemKit(nullptr)
18 {
19 initialized.store(false);
20 this->parent = parent;
21
22 freqShifter = nco_crcf_create(LIQUID_VCO);
23 shiftFrequency = 0;
24
25 workerQueue = std::make_shared<DemodulatorThreadWorkerCommandQueue>();
26 workerQueue->set_max_num_items(2);
27
28 workerResults = std::make_shared<DemodulatorThreadWorkerResultQueue>();
29 workerResults->set_max_num_items(100);
30
31 workerThread = new DemodulatorWorkerThread();
32 workerThread->setInputQueue("WorkerCommandQueue",workerQueue);
33 workerThread->setOutputQueue("WorkerResultQueue",workerResults);
34
35 newSampleRate = currentSampleRate = 0;
36 newBandwidth = currentBandwidth = 0;
37 newAudioSampleRate = currentAudioSampleRate = 0;
38 newFrequency = currentFrequency = 0;
39
40 sampleRateChanged.store(false);
41 frequencyChanged.store(false);
42 bandwidthChanged.store(false);
43 audioSampleRateChanged.store(false);
44 modemSettingsChanged.store(false);
45 demodTypeChanged.store(false);
46}
47
48bool DemodulatorPreThread::isInitialized() {
49 return initialized.load();

Callers

nothing calls this directly

Calls 3

set_max_num_itemsMethod · 0.80
setInputQueueMethod · 0.80
setOutputQueueMethod · 0.80

Tested by

no test coverage detected