GNU Radio's MESA Package
SourceSelector_impl.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2019 ghostop14.
4 *
5 * This is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3, or (at your option)
8 * any later version.
9 *
10 * This software is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this software; see the file COPYING. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street,
18 * Boston, MA 02110-1301, USA.
19 */
20
21#ifndef INCLUDED_MESA_SOURCESELECTOR_IMPL_H
22#define INCLUDED_MESA_SOURCESELECTOR_IMPL_H
23
24#include <chrono>
25#include <ctime>
26#include <mesa/SourceSelector.h>
27
28#include <queue>
29
30using namespace std;
31
32namespace gr {
33namespace mesa {
35protected:
36 boost::mutex d_mutex;
37 boost::mutex d_queuemutex;
43
44 // Data queue management
45 queue<gr_complex> dataQueue;
46 // long maxQueueSize;
48
52
53 // Max Power for each input
54 float maxPower[4];
55
57 std::chrono::time_point<std::chrono::steady_clock> lastShifted;
58
60 void queueData(pmt::pmt_t msg);
61
63
64 void sendNewPortMsg(int port);
65
66 virtual void handleMsg(pmt::pmt_t msg, int port);
67
68public:
69 SourceSelector_impl(float holdTime, int numInputs, int defaultInput,
70 int inputBlockSize);
72 virtual bool stop();
73
74 void handleMsgIn1(pmt::pmt_t msg);
75 void handleMsgIn2(pmt::pmt_t msg);
76 void handleMsgIn3(pmt::pmt_t msg);
77 void handleMsgIn4(pmt::pmt_t msg);
78
79 // Where all the action really happens
80 int work(int noutput_items, gr_vector_const_void_star &input_items,
81 gr_vector_void_star &output_items);
82};
83
84} // namespace mesa
85} // namespace gr
86
87#endif /* INCLUDED_MESA_SOURCESELECTOR_IMPL_H */
bool initialQueueSizeMet
Definition SourceSelector_impl.h:51
boost::mutex d_queuemutex
Definition SourceSelector_impl.h:37
long minQueueLength
Definition SourceSelector_impl.h:49
queue< gr_complex > dataQueue
Definition SourceSelector_impl.h:45
SourceSelector_impl(float holdTime, int numInputs, int defaultInput, int inputBlockSize)
virtual void handleMsg(pmt::pmt_t msg, int port)
int d_defaultInput
Definition SourceSelector_impl.h:40
void handleMsgIn1(pmt::pmt_t msg)
void queueData(pmt::pmt_t msg)
long initialDataQueueRequirement
Definition SourceSelector_impl.h:50
int d_inputBlockSize
Definition SourceSelector_impl.h:41
int d_numInputs
Definition SourceSelector_impl.h:39
float d_holdTime
Definition SourceSelector_impl.h:38
void handleMsgIn2(pmt::pmt_t msg)
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
boost::mutex d_mutex
Definition SourceSelector_impl.h:36
int d_currentInput
Definition SourceSelector_impl.h:42
float maxPower[4]
Definition SourceSelector_impl.h:54
bool limitQueue
Definition SourceSelector_impl.h:47
bool d_startInitialized
Definition SourceSelector_impl.h:56
void handleMsgIn3(pmt::pmt_t msg)
void handleMsgIn4(pmt::pmt_t msg)
std::chrono::time_point< std::chrono::steady_clock > lastShifted
Definition SourceSelector_impl.h:57
<+description of block+>
Definition SourceSelector.h:35
Definition AutoDopplerCorrect.h:28
Definition AutoDopplerCorrect.h:27