- renamed garage to bit_slicer
git-svn-id: http://moon:8086/svn/software/trunk/projects/GnuRadio@416 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -20,6 +20,6 @@
|
||||
install(FILES
|
||||
jay_square_ff.xml
|
||||
jay_square2_ff.xml
|
||||
jay_garage.xml
|
||||
jay_bit_slicer.xml
|
||||
jay_pocsag_decoder.xml DESTINATION share/gnuradio/grc/blocks
|
||||
)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<block>
|
||||
<name>Garage</name>
|
||||
<key>jay_garage</key>
|
||||
<name>Bit Slicer</name>
|
||||
<key>jay_bit_slicer</key>
|
||||
<category>[JAY]</category>
|
||||
<import>import jay</import>
|
||||
<make>jay.garage($sampleRate, $samplesPerSym, $kLoopFilter, $kThreshold)</make>
|
||||
<make>jay.bit_slicer($sampleRate, $samplesPerSym, $kLoopFilter, $kThreshold)</make>
|
||||
<param>
|
||||
<name>Samplerate</name>
|
||||
<key>sampleRate</key>
|
||||
@@ -25,6 +25,6 @@ install(FILES
|
||||
api.h
|
||||
square_ff.h
|
||||
square2_ff.h
|
||||
garage.h
|
||||
bit_slicer.h
|
||||
pocsag_decoder.h DESTINATION include/jay
|
||||
)
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef INCLUDED_JAY_GARAGE_H
|
||||
#define INCLUDED_JAY_GARAGE_H
|
||||
#ifndef INCLUDED_JAY_BIT_SLICER_H
|
||||
#define INCLUDED_JAY_BIT_SLICER_H
|
||||
|
||||
#include <jay/api.h>
|
||||
#include <gnuradio/block.h>
|
||||
@@ -33,17 +33,17 @@ namespace gr {
|
||||
* \ingroup jay
|
||||
*
|
||||
*/
|
||||
class JAY_API garage : virtual public gr::block
|
||||
class JAY_API bit_slicer : virtual public gr::block
|
||||
{
|
||||
public:
|
||||
typedef boost::shared_ptr<garage> sptr;
|
||||
typedef boost::shared_ptr<bit_slicer> sptr;
|
||||
|
||||
/*!
|
||||
* \brief Return a shared_ptr to a new instance of jay::garage.
|
||||
* \brief Return a shared_ptr to a new instance of jay::bit_slicer.
|
||||
*
|
||||
* To avoid accidental use of raw pointers, jay::garage's
|
||||
* To avoid accidental use of raw pointers, jay::bit_slicer's
|
||||
* constructor is in a private implementation
|
||||
* class. jay::garage::make is the public interface for
|
||||
* class. jay::bit_slicer::make is the public interface for
|
||||
* creating new instances.
|
||||
*/
|
||||
static sptr make(int sampleRate, int samplesPerSym, float kLoopfilter, float kThreshold);
|
||||
@@ -52,5 +52,5 @@ namespace gr {
|
||||
} // namespace jay
|
||||
} // namespace gr
|
||||
|
||||
#endif /* INCLUDED_JAY_GARAGE_H */
|
||||
#endif /* INCLUDED_JAY_BIT_SLICER_H */
|
||||
|
||||
@@ -28,7 +28,7 @@ link_directories(${Boost_LIBRARY_DIRS})
|
||||
list(APPEND jay_sources
|
||||
square_ff_impl.cc
|
||||
square2_ff_impl.cc
|
||||
garage_impl.cc
|
||||
bit_slicer_impl.cc
|
||||
PocsagDecoder.cpp
|
||||
pocsag_decoder_impl.cc )
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#endif
|
||||
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include "garage_impl.h"
|
||||
#include "bit_slicer_impl.h"
|
||||
|
||||
#define WITH_PRINT_PACKETS 0
|
||||
#define WITH_DEBUG_MESSAGES 0
|
||||
@@ -34,16 +34,16 @@ namespace gr
|
||||
namespace jay
|
||||
{
|
||||
|
||||
garage::sptr garage::make(int sampleRate, int samplesPerSym, float kLoopFilter, float kThreshold)
|
||||
bit_slicer::sptr bit_slicer::make(int sampleRate, int samplesPerSym, float kLoopFilter, float kThreshold)
|
||||
{
|
||||
return gnuradio::get_initial_sptr(new garage_impl(sampleRate, samplesPerSym, kLoopFilter, kThreshold));
|
||||
return gnuradio::get_initial_sptr(new bit_slicer_impl(sampleRate, samplesPerSym, kLoopFilter, kThreshold));
|
||||
}
|
||||
|
||||
/*
|
||||
* The private constructor
|
||||
*/
|
||||
garage_impl::garage_impl(int sampleRate, int samplesPerSym, float kLoopFilter, float kThreshold)
|
||||
: gr::block("garage", gr::io_signature::make(1, 1, sizeof(float)),
|
||||
bit_slicer_impl::bit_slicer_impl(int sampleRate, int samplesPerSym, float kLoopFilter, float kThreshold)
|
||||
: gr::block("bit_slicer", gr::io_signature::make(1, 1, sizeof(float)),
|
||||
gr::io_signature::make(1, 1, sizeof(float)))
|
||||
, m_sampleRate(sampleRate)
|
||||
, m_samplesPerSym(samplesPerSym)
|
||||
@@ -76,23 +76,23 @@ garage_impl::garage_impl(int sampleRate, int samplesPerSym, float kLoopFilter, f
|
||||
/*
|
||||
* Our virtual destructor.
|
||||
*/
|
||||
garage_impl::~garage_impl()
|
||||
bit_slicer_impl::~bit_slicer_impl()
|
||||
{
|
||||
}
|
||||
|
||||
bool garage_impl::start()
|
||||
bool bit_slicer_impl::start()
|
||||
{
|
||||
fprintf(stderr, "Opening garage\n");
|
||||
fprintf(stderr, "Opening bit_slicer\n");
|
||||
#if WITH_DEBUG_FILE
|
||||
m_pFile_y = fopen("/home/jens/garage_y.dat", "w");
|
||||
m_pFile_bits = fopen("/home/jens/garage_bits.dat", "w");
|
||||
m_pFile_y = fopen("/home/jens/bit_slicer_y.dat", "w");
|
||||
m_pFile_bits = fopen("/home/jens/bit_slicer_bits.dat", "w");
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
bool garage_impl::stop()
|
||||
bool bit_slicer_impl::stop()
|
||||
{
|
||||
fprintf(stderr, "Closing garage\n");
|
||||
fprintf(stderr, "Closing Bit Slicer\n");
|
||||
if (m_pFile_y)
|
||||
{
|
||||
fclose(m_pFile_y);
|
||||
@@ -104,12 +104,12 @@ bool garage_impl::stop()
|
||||
return true;
|
||||
}
|
||||
|
||||
void garage_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required)
|
||||
void bit_slicer_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required)
|
||||
{
|
||||
ninput_items_required[0] = m_samplesPerSym*noutput_items;
|
||||
}
|
||||
|
||||
int garage_impl::general_work (int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
|
||||
int bit_slicer_impl::general_work (int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
|
||||
{
|
||||
const float *in = (const float *) input_items[0];
|
||||
float *out = (float *) output_items[0];
|
||||
@@ -307,7 +307,7 @@ int garage_impl::general_work (int noutput_items, gr_vector_int &ninput_items, g
|
||||
return outCount;
|
||||
}
|
||||
|
||||
void garage_impl::bitsPrint()
|
||||
void bit_slicer_impl::bitsPrint()
|
||||
{
|
||||
for (int k=0; k < m_bitCounter; k++)
|
||||
{
|
||||
@@ -317,7 +317,7 @@ void garage_impl::bitsPrint()
|
||||
printf("Recorded %d bits\n", m_bitCounter);
|
||||
}
|
||||
|
||||
void garage_impl::bitRecord(int bit)
|
||||
void bit_slicer_impl::bitRecord(int bit)
|
||||
{
|
||||
if (m_bitCounter < sizeof(m_bits)/sizeof(*m_bits))
|
||||
{
|
||||
@@ -325,7 +325,7 @@ void garage_impl::bitRecord(int bit)
|
||||
}
|
||||
}
|
||||
|
||||
void garage_impl::bitProcessGap(int bitChg)
|
||||
void bit_slicer_impl::bitProcessGap(int bitChg)
|
||||
{
|
||||
if (bitChg)
|
||||
{
|
||||
@@ -18,17 +18,17 @@
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDED_JAY_GARAGE_IMPL_H
|
||||
#define INCLUDED_JAY_GARAGE_IMPL_H
|
||||
#ifndef INCLUDED_JAY_BIT_SLICER_IMPL_H
|
||||
#define INCLUDED_JAY_BIT_SLICER_IMPL_H
|
||||
|
||||
#include <jay/garage.h>
|
||||
#include <jay/bit_slicer.h>
|
||||
|
||||
namespace gr
|
||||
{
|
||||
namespace jay
|
||||
{
|
||||
|
||||
class garage_impl : public garage
|
||||
class bit_slicer_impl : public bit_slicer
|
||||
{
|
||||
private:
|
||||
int m_sampleRate;
|
||||
@@ -66,8 +66,8 @@ class garage_impl : public garage
|
||||
bool stop() override;
|
||||
|
||||
public:
|
||||
garage_impl(int sampleRate, int samplesPerSym, float kLoopFilter, float kThreshold);
|
||||
~garage_impl();
|
||||
bit_slicer_impl(int sampleRate, int samplesPerSym, float kLoopFilter, float kThreshold);
|
||||
~bit_slicer_impl();
|
||||
|
||||
// Where all the action really happens
|
||||
void forecast (int noutput_items, gr_vector_int &ninput_items_required);
|
||||
@@ -81,5 +81,5 @@ class garage_impl : public garage
|
||||
} // namespace jay
|
||||
} // namespace gr
|
||||
|
||||
#endif /* INCLUDED_JAY_GARAGE_IMPL_H */
|
||||
#endif /* INCLUDED_JAY_BIT_SLICER_IMPL_H */
|
||||
|
||||
@@ -44,5 +44,5 @@ set(GR_TEST_TARGET_DEPS gnuradio-jay)
|
||||
set(GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/swig)
|
||||
GR_ADD_TEST(qa_square_ff ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_square_ff.py)
|
||||
GR_ADD_TEST(qa_square2_ff ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_square2_ff.py)
|
||||
GR_ADD_TEST(qa_garage ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_garage.py)
|
||||
GR_ADD_TEST(qa_bit_slicer ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_bit_slicer.py)
|
||||
GR_ADD_TEST(qa_pocsag_decoder ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_pocsag_decoder.py)
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
%{
|
||||
#include "jay/square_ff.h"
|
||||
#include "jay/square2_ff.h"
|
||||
#include "jay/garage.h"
|
||||
#include "jay/bit_slicer.h"
|
||||
#include "jay/pocsag_decoder.h"
|
||||
%}
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
GR_SWIG_BLOCK_MAGIC2(jay, square_ff);
|
||||
%include "jay/square2_ff.h"
|
||||
GR_SWIG_BLOCK_MAGIC2(jay, square2_ff);
|
||||
%include "jay/garage.h"
|
||||
GR_SWIG_BLOCK_MAGIC2(jay, garage);
|
||||
%include "jay/bit_slicer.h"
|
||||
GR_SWIG_BLOCK_MAGIC2(jay, bit_slicer);
|
||||
|
||||
%include "jay/pocsag_decoder.h"
|
||||
GR_SWIG_BLOCK_MAGIC2(jay, pocsag_decoder);
|
||||
|
||||
Reference in New Issue
Block a user