Merge branch 'master' into parse
This commit is contained in:
commit
7388a8e910
@ -24,17 +24,18 @@
|
|||||||
#define INCLUDED_AIR_MODES_PREAMBLE_H
|
#define INCLUDED_AIR_MODES_PREAMBLE_H
|
||||||
|
|
||||||
#include <gr_block.h>
|
#include <gr_block.h>
|
||||||
|
#include <air_modes_api.h>
|
||||||
|
|
||||||
class air_modes_preamble;
|
class air_modes_preamble;
|
||||||
typedef boost::shared_ptr<air_modes_preamble> air_modes_preamble_sptr;
|
typedef boost::shared_ptr<air_modes_preamble> air_modes_preamble_sptr;
|
||||||
|
|
||||||
air_modes_preamble_sptr air_make_modes_preamble(int channel_rate, float threshold_db);
|
AIR_MODES_API air_modes_preamble_sptr air_make_modes_preamble(int channel_rate, float threshold_db);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief mode select preamble detection
|
* \brief mode select preamble detection
|
||||||
* \ingroup block
|
* \ingroup block
|
||||||
*/
|
*/
|
||||||
class air_modes_preamble : public gr_block
|
class AIR_MODES_API air_modes_preamble : public gr_block
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
friend air_modes_preamble_sptr air_make_modes_preamble(int channel_rate, float threshold_db);
|
friend air_modes_preamble_sptr air_make_modes_preamble(int channel_rate, float threshold_db);
|
||||||
|
@ -25,17 +25,18 @@
|
|||||||
|
|
||||||
#include <gr_sync_block.h>
|
#include <gr_sync_block.h>
|
||||||
#include <gr_msg_queue.h>
|
#include <gr_msg_queue.h>
|
||||||
|
#include <air_modes_api.h>
|
||||||
|
|
||||||
class air_modes_slicer;
|
class air_modes_slicer;
|
||||||
typedef boost::shared_ptr<air_modes_slicer> air_modes_slicer_sptr;
|
typedef boost::shared_ptr<air_modes_slicer> air_modes_slicer_sptr;
|
||||||
|
|
||||||
air_modes_slicer_sptr air_make_modes_slicer(int channel_rate, gr_msg_queue_sptr queue);
|
AIR_MODES_API air_modes_slicer_sptr air_make_modes_slicer(int channel_rate, gr_msg_queue_sptr queue);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief mode select slicer detection
|
* \brief mode select slicer detection
|
||||||
* \ingroup block
|
* \ingroup block
|
||||||
*/
|
*/
|
||||||
class air_modes_slicer : public gr_sync_block
|
class AIR_MODES_API air_modes_slicer : public gr_sync_block
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
friend air_modes_slicer_sptr air_make_modes_slicer(int channel_rate, gr_msg_queue_sptr queue);
|
friend air_modes_slicer_sptr air_make_modes_slicer(int channel_rate, gr_msg_queue_sptr queue);
|
||||||
|
@ -29,9 +29,8 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <gr_tags.h>
|
#include <gr_tags.h>
|
||||||
#include <air_modes_api.h>
|
|
||||||
|
|
||||||
AIR_MODES_API air_modes_preamble_sptr air_make_modes_preamble(int channel_rate, float threshold_db)
|
air_modes_preamble_sptr air_make_modes_preamble(int channel_rate, float threshold_db)
|
||||||
{
|
{
|
||||||
return air_modes_preamble_sptr (new air_modes_preamble(channel_rate, threshold_db));
|
return air_modes_preamble_sptr (new air_modes_preamble(channel_rate, threshold_db));
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,6 @@
|
|||||||
#include <modes_crc.h>
|
#include <modes_crc.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <gr_tags.h>
|
#include <gr_tags.h>
|
||||||
#include <air_modes_api.h>
|
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
@ -40,7 +39,7 @@ extern "C"
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
}
|
}
|
||||||
|
|
||||||
AIR_MODES_API air_modes_slicer_sptr air_make_modes_slicer(int channel_rate, gr_msg_queue_sptr queue)
|
air_modes_slicer_sptr air_make_modes_slicer(int channel_rate, gr_msg_queue_sptr queue)
|
||||||
{
|
{
|
||||||
return air_modes_slicer_sptr (new air_modes_slicer(channel_rate, queue));
|
return air_modes_slicer_sptr (new air_modes_slicer(channel_rate, queue));
|
||||||
}
|
}
|
||||||
|
@ -64,8 +64,9 @@ class modes_output_sbs1(modes_parse.modes_parse):
|
|||||||
def output(self, msg):
|
def output(self, msg):
|
||||||
try:
|
try:
|
||||||
sbs1_msg = self.parse(msg)
|
sbs1_msg = self.parse(msg)
|
||||||
for conn in self._conns[:]: #iterate over a copy of the list
|
if sbs1_msg is not None:
|
||||||
conn.send(sbs1_msg)
|
for conn in self._conns[:]: #iterate over a copy of the list
|
||||||
|
conn.send(sbs1_msg)
|
||||||
except socket.error:
|
except socket.error:
|
||||||
self._conns.remove(conn)
|
self._conns.remove(conn)
|
||||||
print "Connections: ", len(self._conns)
|
print "Connections: ", len(self._conns)
|
||||||
@ -145,7 +146,7 @@ class modes_output_sbs1(modes_parse.modes_parse):
|
|||||||
def pp5(self, shortdata, ecc):
|
def pp5(self, shortdata, ecc):
|
||||||
# I'm not sure what to do with the identiifcation shortdata & 0x1FFF
|
# I'm not sure what to do with the identiifcation shortdata & 0x1FFF
|
||||||
[datestr, timestr] = self.current_time()
|
[datestr, timestr] = self.current_time()
|
||||||
[fs, dr, um, ident] = self.parse5(shortdata)
|
[fs, dr, um] = self.parse5(shortdata)
|
||||||
aircraft_id = self.get_aircraft_id(ecc)
|
aircraft_id = self.get_aircraft_id(ecc)
|
||||||
retstr = "MSG,6,0,%i,%06X,%i,%s,%s,%s,%s,,,,,,,,," % (aircraft_id, ecc, aircraft_id+100, datestr, timestr, datestr, timestr)
|
retstr = "MSG,6,0,%i,%06X,%i,%s,%s,%s,%s,,,,,,,,," % (aircraft_id, ecc, aircraft_id+100, datestr, timestr, datestr, timestr)
|
||||||
return retstr + self.decode_fs(fs) + "\n"
|
return retstr + self.decode_fs(fs) + "\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user