kopia lustrzana https://github.com/proto17/dji_droneid
Porównaj commity
3 Commity
33cbb9c0e1
...
bd365928ea
Autor | SHA1 | Data |
---|---|---|
proto17 | bd365928ea | |
proto17 | ddb32d5358 | |
Bjoern Kerler | e310b3c9dc |
|
@ -18,6 +18,11 @@ Update(15 April 2022): **The main script (matlab/updated_scripts/process_file.m)
|
|||
|
||||
The IQ file used in this example will not be made available publicly as it likely contains GPS information about where the drone was when the recording was taken. The drone used in testing is the DJI Mini 2 with no modifications. Recordings were taken with an Ettus B205-mini at a sampling rate of 30.72 MSPS. The signal of interest is in 2.4 GHz and will show up every 600 ms or so. It will be 10 MHz wide (15.56 MHz with guard carriers).
|
||||
|
||||
# GNU Radio OOT Module
|
||||
This branch has the original GNU Radio OOT module for GNU Radio 3.10. This OOT module should not be used in most cases. Please use `gr-droneid-update` or `gr-droneid-update-3.10`
|
||||
|
||||
The best use of this module is to collect bursts for processing in MATLAB/Octave with `process_file.m`
|
||||
|
||||
# How to Process Samples
|
||||
You will need to record DroneID bursts with an SDR, save the samples as 32-bit floating point IQ data, and then edit the `matlab/updated_scripts/process_file.m` script to read your file. If there is a major frequency offset (say you recorded 7 MHz off center) you will need to specify that in the script.
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
options:
|
||||
parameters:
|
||||
author: main
|
||||
catch_exceptions: 'True'
|
||||
category: '[GRC Hier Blocks]'
|
||||
cmake_opt: ''
|
||||
comment: ''
|
||||
|
@ -45,6 +46,7 @@ blocks:
|
|||
label4: Ch 5
|
||||
labels: '[]'
|
||||
num_opts: '5'
|
||||
option0: '0'
|
||||
option1: 2.4145e9
|
||||
option2: 2.4295e9
|
||||
option3: 2.4445e9
|
||||
|
@ -68,8 +70,10 @@ blocks:
|
|||
gui_hint: ''
|
||||
label: Correlation Scaler
|
||||
min_len: '200'
|
||||
orient: Qt.Horizontal
|
||||
orient: QtCore.Qt.Horizontal
|
||||
outputmsgname: value
|
||||
rangeType: float
|
||||
showports: 'False'
|
||||
start: '0'
|
||||
step: '0.01'
|
||||
stop: '10'
|
||||
|
@ -101,8 +105,10 @@ blocks:
|
|||
gui_hint: ''
|
||||
label: Delay
|
||||
min_len: '200'
|
||||
orient: Qt.Horizontal
|
||||
orient: QtCore.Qt.Horizontal
|
||||
outputmsgname: value
|
||||
rangeType: int
|
||||
showports: 'False'
|
||||
start: '0'
|
||||
step: '1'
|
||||
stop: '100000'
|
||||
|
@ -135,8 +141,9 @@ blocks:
|
|||
cutoff_freq: 5e6
|
||||
gain: '1.0'
|
||||
samp_rate: samp_rate
|
||||
value: ''
|
||||
width: 750e3
|
||||
win: firdes.WIN_HAMMING
|
||||
win: window.WIN_HAMMING
|
||||
states:
|
||||
bus_sink: false
|
||||
bus_source: false
|
||||
|
@ -151,8 +158,10 @@ blocks:
|
|||
gui_hint: ''
|
||||
label: Freq
|
||||
min_len: '200'
|
||||
orient: Qt.Horizontal
|
||||
orient: QtCore.Qt.Horizontal
|
||||
outputmsgname: value
|
||||
rangeType: float
|
||||
showports: 'False'
|
||||
start: 60e6
|
||||
step: .5e6
|
||||
stop: 6e9
|
||||
|
@ -172,8 +181,10 @@ blocks:
|
|||
gui_hint: ''
|
||||
label: Gain
|
||||
min_len: '200'
|
||||
orient: Qt.Horizontal
|
||||
orient: QtCore.Qt.Horizontal
|
||||
outputmsgname: value
|
||||
rangeType: float
|
||||
showports: 'False'
|
||||
start: '0'
|
||||
step: '0.05'
|
||||
stop: '1'
|
||||
|
@ -205,8 +216,10 @@ blocks:
|
|||
gui_hint: ''
|
||||
label: Offset
|
||||
min_len: '200'
|
||||
orient: Qt.Horizontal
|
||||
orient: QtCore.Qt.Horizontal
|
||||
outputmsgname: value
|
||||
rangeType: float
|
||||
showports: 'False'
|
||||
start: -samp_rate/2
|
||||
step: .5e6
|
||||
stop: samp_rate/2
|
||||
|
@ -226,8 +239,10 @@ blocks:
|
|||
gui_hint: ''
|
||||
label: Sample Rate
|
||||
min_len: '200'
|
||||
orient: Qt.Horizontal
|
||||
orient: QtCore.Qt.Horizontal
|
||||
outputmsgname: value
|
||||
rangeType: float
|
||||
showports: 'False'
|
||||
start: 10e6
|
||||
step: 1e6
|
||||
stop: 56e6
|
||||
|
@ -259,8 +274,10 @@ blocks:
|
|||
gui_hint: ''
|
||||
label: Time Domain Mag^2 Offset
|
||||
min_len: '200'
|
||||
orient: Qt.Horizontal
|
||||
orient: QtCore.Qt.Horizontal
|
||||
outputmsgname: value
|
||||
rangeType: float
|
||||
showports: 'False'
|
||||
start: '-100'
|
||||
step: '0.1'
|
||||
stop: '100'
|
||||
|
@ -280,8 +297,10 @@ blocks:
|
|||
gui_hint: ''
|
||||
label: Time Domain Mag^2 Scaler
|
||||
min_len: '200'
|
||||
orient: Qt.Horizontal
|
||||
orient: QtCore.Qt.Horizontal
|
||||
outputmsgname: value
|
||||
rangeType: float
|
||||
showports: 'False'
|
||||
start: '0'
|
||||
step: '0.01'
|
||||
stop: '100'
|
||||
|
@ -528,7 +547,9 @@ blocks:
|
|||
comment: ''
|
||||
freq_center: '0'
|
||||
freq_span: samp_rate
|
||||
wintype: firdes.WIN_BLACKMAN_hARRIS
|
||||
maxoutbuf: '0'
|
||||
minoutbuf: '0'
|
||||
wintype: window.WIN_BLACKMAN_hARRIS
|
||||
states:
|
||||
bus_sink: false
|
||||
bus_source: false
|
||||
|
@ -744,38 +765,70 @@ blocks:
|
|||
clock_source6: ''
|
||||
clock_source7: ''
|
||||
comment: ''
|
||||
dc_offs_enb0: '""'
|
||||
dc_offs_enb1: '""'
|
||||
dc_offs_enb10: '""'
|
||||
dc_offs_enb11: '""'
|
||||
dc_offs_enb12: '""'
|
||||
dc_offs_enb13: '""'
|
||||
dc_offs_enb14: '""'
|
||||
dc_offs_enb15: '""'
|
||||
dc_offs_enb16: '""'
|
||||
dc_offs_enb17: '""'
|
||||
dc_offs_enb18: '""'
|
||||
dc_offs_enb19: '""'
|
||||
dc_offs_enb2: '""'
|
||||
dc_offs_enb20: '""'
|
||||
dc_offs_enb21: '""'
|
||||
dc_offs_enb22: '""'
|
||||
dc_offs_enb23: '""'
|
||||
dc_offs_enb24: '""'
|
||||
dc_offs_enb25: '""'
|
||||
dc_offs_enb26: '""'
|
||||
dc_offs_enb27: '""'
|
||||
dc_offs_enb28: '""'
|
||||
dc_offs_enb29: '""'
|
||||
dc_offs_enb3: '""'
|
||||
dc_offs_enb30: '""'
|
||||
dc_offs_enb31: '""'
|
||||
dc_offs_enb4: '""'
|
||||
dc_offs_enb5: '""'
|
||||
dc_offs_enb6: '""'
|
||||
dc_offs_enb7: '""'
|
||||
dc_offs_enb8: '""'
|
||||
dc_offs_enb9: '""'
|
||||
dc_offs0: 0+0j
|
||||
dc_offs1: 0+0j
|
||||
dc_offs10: 0+0j
|
||||
dc_offs11: 0+0j
|
||||
dc_offs12: 0+0j
|
||||
dc_offs13: 0+0j
|
||||
dc_offs14: 0+0j
|
||||
dc_offs15: 0+0j
|
||||
dc_offs16: 0+0j
|
||||
dc_offs17: 0+0j
|
||||
dc_offs18: 0+0j
|
||||
dc_offs19: 0+0j
|
||||
dc_offs2: 0+0j
|
||||
dc_offs20: 0+0j
|
||||
dc_offs21: 0+0j
|
||||
dc_offs22: 0+0j
|
||||
dc_offs23: 0+0j
|
||||
dc_offs24: 0+0j
|
||||
dc_offs25: 0+0j
|
||||
dc_offs26: 0+0j
|
||||
dc_offs27: 0+0j
|
||||
dc_offs28: 0+0j
|
||||
dc_offs29: 0+0j
|
||||
dc_offs3: 0+0j
|
||||
dc_offs30: 0+0j
|
||||
dc_offs31: 0+0j
|
||||
dc_offs4: 0+0j
|
||||
dc_offs5: 0+0j
|
||||
dc_offs6: 0+0j
|
||||
dc_offs7: 0+0j
|
||||
dc_offs8: 0+0j
|
||||
dc_offs9: 0+0j
|
||||
dc_offs_enb0: default
|
||||
dc_offs_enb1: default
|
||||
dc_offs_enb10: default
|
||||
dc_offs_enb11: default
|
||||
dc_offs_enb12: default
|
||||
dc_offs_enb13: default
|
||||
dc_offs_enb14: default
|
||||
dc_offs_enb15: default
|
||||
dc_offs_enb16: default
|
||||
dc_offs_enb17: default
|
||||
dc_offs_enb18: default
|
||||
dc_offs_enb19: default
|
||||
dc_offs_enb2: default
|
||||
dc_offs_enb20: default
|
||||
dc_offs_enb21: default
|
||||
dc_offs_enb22: default
|
||||
dc_offs_enb23: default
|
||||
dc_offs_enb24: default
|
||||
dc_offs_enb25: default
|
||||
dc_offs_enb26: default
|
||||
dc_offs_enb27: default
|
||||
dc_offs_enb28: default
|
||||
dc_offs_enb29: default
|
||||
dc_offs_enb3: default
|
||||
dc_offs_enb30: default
|
||||
dc_offs_enb31: default
|
||||
dc_offs_enb4: default
|
||||
dc_offs_enb5: default
|
||||
dc_offs_enb6: default
|
||||
dc_offs_enb7: default
|
||||
dc_offs_enb8: default
|
||||
dc_offs_enb9: default
|
||||
dev_addr: '""'
|
||||
dev_args: '""'
|
||||
gain0: gain
|
||||
|
@ -810,38 +863,102 @@ blocks:
|
|||
gain7: '0'
|
||||
gain8: '0'
|
||||
gain9: '0'
|
||||
iq_imbal_enb0: '""'
|
||||
iq_imbal_enb1: '""'
|
||||
iq_imbal_enb10: '""'
|
||||
iq_imbal_enb11: '""'
|
||||
iq_imbal_enb12: '""'
|
||||
iq_imbal_enb13: '""'
|
||||
iq_imbal_enb14: '""'
|
||||
iq_imbal_enb15: '""'
|
||||
iq_imbal_enb16: '""'
|
||||
iq_imbal_enb17: '""'
|
||||
iq_imbal_enb18: '""'
|
||||
iq_imbal_enb19: '""'
|
||||
iq_imbal_enb2: '""'
|
||||
iq_imbal_enb20: '""'
|
||||
iq_imbal_enb21: '""'
|
||||
iq_imbal_enb22: '""'
|
||||
iq_imbal_enb23: '""'
|
||||
iq_imbal_enb24: '""'
|
||||
iq_imbal_enb25: '""'
|
||||
iq_imbal_enb26: '""'
|
||||
iq_imbal_enb27: '""'
|
||||
iq_imbal_enb28: '""'
|
||||
iq_imbal_enb29: '""'
|
||||
iq_imbal_enb3: '""'
|
||||
iq_imbal_enb30: '""'
|
||||
iq_imbal_enb31: '""'
|
||||
iq_imbal_enb4: '""'
|
||||
iq_imbal_enb5: '""'
|
||||
iq_imbal_enb6: '""'
|
||||
iq_imbal_enb7: '""'
|
||||
iq_imbal_enb8: '""'
|
||||
iq_imbal_enb9: '""'
|
||||
gain_type0: default
|
||||
gain_type1: default
|
||||
gain_type10: default
|
||||
gain_type11: default
|
||||
gain_type12: default
|
||||
gain_type13: default
|
||||
gain_type14: default
|
||||
gain_type15: default
|
||||
gain_type16: default
|
||||
gain_type17: default
|
||||
gain_type18: default
|
||||
gain_type19: default
|
||||
gain_type2: default
|
||||
gain_type20: default
|
||||
gain_type21: default
|
||||
gain_type22: default
|
||||
gain_type23: default
|
||||
gain_type24: default
|
||||
gain_type25: default
|
||||
gain_type26: default
|
||||
gain_type27: default
|
||||
gain_type28: default
|
||||
gain_type29: default
|
||||
gain_type3: default
|
||||
gain_type30: default
|
||||
gain_type31: default
|
||||
gain_type4: default
|
||||
gain_type5: default
|
||||
gain_type6: default
|
||||
gain_type7: default
|
||||
gain_type8: default
|
||||
gain_type9: default
|
||||
iq_imbal0: 0+0j
|
||||
iq_imbal1: 0+0j
|
||||
iq_imbal10: 0+0j
|
||||
iq_imbal11: 0+0j
|
||||
iq_imbal12: 0+0j
|
||||
iq_imbal13: 0+0j
|
||||
iq_imbal14: 0+0j
|
||||
iq_imbal15: 0+0j
|
||||
iq_imbal16: 0+0j
|
||||
iq_imbal17: 0+0j
|
||||
iq_imbal18: 0+0j
|
||||
iq_imbal19: 0+0j
|
||||
iq_imbal2: 0+0j
|
||||
iq_imbal20: 0+0j
|
||||
iq_imbal21: 0+0j
|
||||
iq_imbal22: 0+0j
|
||||
iq_imbal23: 0+0j
|
||||
iq_imbal24: 0+0j
|
||||
iq_imbal25: 0+0j
|
||||
iq_imbal26: 0+0j
|
||||
iq_imbal27: 0+0j
|
||||
iq_imbal28: 0+0j
|
||||
iq_imbal29: 0+0j
|
||||
iq_imbal3: 0+0j
|
||||
iq_imbal30: 0+0j
|
||||
iq_imbal31: 0+0j
|
||||
iq_imbal4: 0+0j
|
||||
iq_imbal5: 0+0j
|
||||
iq_imbal6: 0+0j
|
||||
iq_imbal7: 0+0j
|
||||
iq_imbal8: 0+0j
|
||||
iq_imbal9: 0+0j
|
||||
iq_imbal_enb0: default
|
||||
iq_imbal_enb1: default
|
||||
iq_imbal_enb10: default
|
||||
iq_imbal_enb11: default
|
||||
iq_imbal_enb12: default
|
||||
iq_imbal_enb13: default
|
||||
iq_imbal_enb14: default
|
||||
iq_imbal_enb15: default
|
||||
iq_imbal_enb16: default
|
||||
iq_imbal_enb17: default
|
||||
iq_imbal_enb18: default
|
||||
iq_imbal_enb19: default
|
||||
iq_imbal_enb2: default
|
||||
iq_imbal_enb20: default
|
||||
iq_imbal_enb21: default
|
||||
iq_imbal_enb22: default
|
||||
iq_imbal_enb23: default
|
||||
iq_imbal_enb24: default
|
||||
iq_imbal_enb25: default
|
||||
iq_imbal_enb26: default
|
||||
iq_imbal_enb27: default
|
||||
iq_imbal_enb28: default
|
||||
iq_imbal_enb29: default
|
||||
iq_imbal_enb3: default
|
||||
iq_imbal_enb30: default
|
||||
iq_imbal_enb31: default
|
||||
iq_imbal_enb4: default
|
||||
iq_imbal_enb5: default
|
||||
iq_imbal_enb6: default
|
||||
iq_imbal_enb7: default
|
||||
iq_imbal_enb8: default
|
||||
iq_imbal_enb9: default
|
||||
lo_export0: 'False'
|
||||
lo_export1: 'False'
|
||||
lo_export10: 'False'
|
||||
|
@ -909,38 +1026,6 @@ blocks:
|
|||
maxoutbuf: '0'
|
||||
minoutbuf: '0'
|
||||
nchan: '1'
|
||||
norm_gain0: 'True'
|
||||
norm_gain1: 'False'
|
||||
norm_gain10: 'False'
|
||||
norm_gain11: 'False'
|
||||
norm_gain12: 'False'
|
||||
norm_gain13: 'False'
|
||||
norm_gain14: 'False'
|
||||
norm_gain15: 'False'
|
||||
norm_gain16: 'False'
|
||||
norm_gain17: 'False'
|
||||
norm_gain18: 'False'
|
||||
norm_gain19: 'False'
|
||||
norm_gain2: 'False'
|
||||
norm_gain20: 'False'
|
||||
norm_gain21: 'False'
|
||||
norm_gain22: 'False'
|
||||
norm_gain23: 'False'
|
||||
norm_gain24: 'False'
|
||||
norm_gain25: 'False'
|
||||
norm_gain26: 'False'
|
||||
norm_gain27: 'False'
|
||||
norm_gain28: 'False'
|
||||
norm_gain29: 'False'
|
||||
norm_gain3: 'False'
|
||||
norm_gain30: 'False'
|
||||
norm_gain31: 'False'
|
||||
norm_gain4: 'False'
|
||||
norm_gain5: 'False'
|
||||
norm_gain6: 'False'
|
||||
norm_gain7: 'False'
|
||||
norm_gain8: 'False'
|
||||
norm_gain9: 'False'
|
||||
num_mboards: '1'
|
||||
otw: ''
|
||||
rx_agc0: Default
|
||||
|
@ -985,6 +1070,7 @@ blocks:
|
|||
sd_spec6: ''
|
||||
sd_spec7: ''
|
||||
show_lo_controls: 'False'
|
||||
start_time: '-1.0'
|
||||
stream_args: ''
|
||||
stream_chans: '[]'
|
||||
sync: sync
|
||||
|
@ -1024,3 +1110,4 @@ connections:
|
|||
|
||||
metadata:
|
||||
file_format: 1
|
||||
grc_version: v3.11.0.0git-205-g0427b2a6
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
options:
|
||||
parameters:
|
||||
author: David Protzman
|
||||
catch_exceptions: 'True'
|
||||
category: '[GRC Hier Blocks]'
|
||||
cmake_opt: ''
|
||||
comment: ''
|
||||
|
@ -51,8 +52,10 @@ blocks:
|
|||
gui_hint: ''
|
||||
label: Delay
|
||||
min_len: '200'
|
||||
orient: Qt.Horizontal
|
||||
orient: QtCore.Qt.Horizontal
|
||||
outputmsgname: value
|
||||
rangeType: int
|
||||
showports: 'False'
|
||||
start: '0'
|
||||
step: '1'
|
||||
stop: '100000'
|
||||
|
@ -85,8 +88,9 @@ blocks:
|
|||
cutoff_freq: 5e6
|
||||
gain: '1.0'
|
||||
samp_rate: samp_rate
|
||||
value: ''
|
||||
width: 750e3
|
||||
win: firdes.WIN_HAMMING
|
||||
win: window.WIN_HAMMING
|
||||
states:
|
||||
bus_sink: false
|
||||
bus_source: false
|
||||
|
@ -101,8 +105,10 @@ blocks:
|
|||
gui_hint: ''
|
||||
label: Freq
|
||||
min_len: '200'
|
||||
orient: Qt.Horizontal
|
||||
orient: QtCore.Qt.Horizontal
|
||||
outputmsgname: value
|
||||
rangeType: float
|
||||
showports: 'False'
|
||||
start: 60e6
|
||||
step: .5e6
|
||||
stop: 6e9
|
||||
|
@ -122,8 +128,10 @@ blocks:
|
|||
gui_hint: ''
|
||||
label: Gain
|
||||
min_len: '200'
|
||||
orient: Qt.Horizontal
|
||||
orient: QtCore.Qt.Horizontal
|
||||
outputmsgname: value
|
||||
rangeType: float
|
||||
showports: 'False'
|
||||
start: '0'
|
||||
step: '0.05'
|
||||
stop: '1'
|
||||
|
@ -155,8 +163,10 @@ blocks:
|
|||
gui_hint: ''
|
||||
label: Offset
|
||||
min_len: '200'
|
||||
orient: Qt.Horizontal
|
||||
orient: QtCore.Qt.Horizontal
|
||||
outputmsgname: value
|
||||
rangeType: float
|
||||
showports: 'False'
|
||||
start: -samp_rate/2
|
||||
step: .5e6
|
||||
stop: samp_rate/2
|
||||
|
@ -176,8 +186,10 @@ blocks:
|
|||
gui_hint: ''
|
||||
label: Sample Rate
|
||||
min_len: '200'
|
||||
orient: Qt.Horizontal
|
||||
orient: QtCore.Qt.Horizontal
|
||||
outputmsgname: value
|
||||
rangeType: float
|
||||
showports: 'False'
|
||||
start: 10e6
|
||||
step: 1e6
|
||||
stop: 56e6
|
||||
|
@ -414,7 +426,9 @@ blocks:
|
|||
comment: ''
|
||||
freq_center: '0'
|
||||
freq_span: samp_rate
|
||||
wintype: firdes.WIN_BLACKMAN_hARRIS
|
||||
maxoutbuf: '0'
|
||||
minoutbuf: '0'
|
||||
wintype: window.WIN_BLACKMAN_hARRIS
|
||||
states:
|
||||
bus_sink: false
|
||||
bus_source: false
|
||||
|
@ -735,38 +749,70 @@ blocks:
|
|||
clock_source6: ''
|
||||
clock_source7: ''
|
||||
comment: ''
|
||||
dc_offs_enb0: '""'
|
||||
dc_offs_enb1: '""'
|
||||
dc_offs_enb10: '""'
|
||||
dc_offs_enb11: '""'
|
||||
dc_offs_enb12: '""'
|
||||
dc_offs_enb13: '""'
|
||||
dc_offs_enb14: '""'
|
||||
dc_offs_enb15: '""'
|
||||
dc_offs_enb16: '""'
|
||||
dc_offs_enb17: '""'
|
||||
dc_offs_enb18: '""'
|
||||
dc_offs_enb19: '""'
|
||||
dc_offs_enb2: '""'
|
||||
dc_offs_enb20: '""'
|
||||
dc_offs_enb21: '""'
|
||||
dc_offs_enb22: '""'
|
||||
dc_offs_enb23: '""'
|
||||
dc_offs_enb24: '""'
|
||||
dc_offs_enb25: '""'
|
||||
dc_offs_enb26: '""'
|
||||
dc_offs_enb27: '""'
|
||||
dc_offs_enb28: '""'
|
||||
dc_offs_enb29: '""'
|
||||
dc_offs_enb3: '""'
|
||||
dc_offs_enb30: '""'
|
||||
dc_offs_enb31: '""'
|
||||
dc_offs_enb4: '""'
|
||||
dc_offs_enb5: '""'
|
||||
dc_offs_enb6: '""'
|
||||
dc_offs_enb7: '""'
|
||||
dc_offs_enb8: '""'
|
||||
dc_offs_enb9: '""'
|
||||
dc_offs0: 0+0j
|
||||
dc_offs1: 0+0j
|
||||
dc_offs10: 0+0j
|
||||
dc_offs11: 0+0j
|
||||
dc_offs12: 0+0j
|
||||
dc_offs13: 0+0j
|
||||
dc_offs14: 0+0j
|
||||
dc_offs15: 0+0j
|
||||
dc_offs16: 0+0j
|
||||
dc_offs17: 0+0j
|
||||
dc_offs18: 0+0j
|
||||
dc_offs19: 0+0j
|
||||
dc_offs2: 0+0j
|
||||
dc_offs20: 0+0j
|
||||
dc_offs21: 0+0j
|
||||
dc_offs22: 0+0j
|
||||
dc_offs23: 0+0j
|
||||
dc_offs24: 0+0j
|
||||
dc_offs25: 0+0j
|
||||
dc_offs26: 0+0j
|
||||
dc_offs27: 0+0j
|
||||
dc_offs28: 0+0j
|
||||
dc_offs29: 0+0j
|
||||
dc_offs3: 0+0j
|
||||
dc_offs30: 0+0j
|
||||
dc_offs31: 0+0j
|
||||
dc_offs4: 0+0j
|
||||
dc_offs5: 0+0j
|
||||
dc_offs6: 0+0j
|
||||
dc_offs7: 0+0j
|
||||
dc_offs8: 0+0j
|
||||
dc_offs9: 0+0j
|
||||
dc_offs_enb0: default
|
||||
dc_offs_enb1: default
|
||||
dc_offs_enb10: default
|
||||
dc_offs_enb11: default
|
||||
dc_offs_enb12: default
|
||||
dc_offs_enb13: default
|
||||
dc_offs_enb14: default
|
||||
dc_offs_enb15: default
|
||||
dc_offs_enb16: default
|
||||
dc_offs_enb17: default
|
||||
dc_offs_enb18: default
|
||||
dc_offs_enb19: default
|
||||
dc_offs_enb2: default
|
||||
dc_offs_enb20: default
|
||||
dc_offs_enb21: default
|
||||
dc_offs_enb22: default
|
||||
dc_offs_enb23: default
|
||||
dc_offs_enb24: default
|
||||
dc_offs_enb25: default
|
||||
dc_offs_enb26: default
|
||||
dc_offs_enb27: default
|
||||
dc_offs_enb28: default
|
||||
dc_offs_enb29: default
|
||||
dc_offs_enb3: default
|
||||
dc_offs_enb30: default
|
||||
dc_offs_enb31: default
|
||||
dc_offs_enb4: default
|
||||
dc_offs_enb5: default
|
||||
dc_offs_enb6: default
|
||||
dc_offs_enb7: default
|
||||
dc_offs_enb8: default
|
||||
dc_offs_enb9: default
|
||||
dev_addr: '""'
|
||||
dev_args: '""'
|
||||
gain0: gain
|
||||
|
@ -801,38 +847,102 @@ blocks:
|
|||
gain7: '0'
|
||||
gain8: '0'
|
||||
gain9: '0'
|
||||
iq_imbal_enb0: '""'
|
||||
iq_imbal_enb1: '""'
|
||||
iq_imbal_enb10: '""'
|
||||
iq_imbal_enb11: '""'
|
||||
iq_imbal_enb12: '""'
|
||||
iq_imbal_enb13: '""'
|
||||
iq_imbal_enb14: '""'
|
||||
iq_imbal_enb15: '""'
|
||||
iq_imbal_enb16: '""'
|
||||
iq_imbal_enb17: '""'
|
||||
iq_imbal_enb18: '""'
|
||||
iq_imbal_enb19: '""'
|
||||
iq_imbal_enb2: '""'
|
||||
iq_imbal_enb20: '""'
|
||||
iq_imbal_enb21: '""'
|
||||
iq_imbal_enb22: '""'
|
||||
iq_imbal_enb23: '""'
|
||||
iq_imbal_enb24: '""'
|
||||
iq_imbal_enb25: '""'
|
||||
iq_imbal_enb26: '""'
|
||||
iq_imbal_enb27: '""'
|
||||
iq_imbal_enb28: '""'
|
||||
iq_imbal_enb29: '""'
|
||||
iq_imbal_enb3: '""'
|
||||
iq_imbal_enb30: '""'
|
||||
iq_imbal_enb31: '""'
|
||||
iq_imbal_enb4: '""'
|
||||
iq_imbal_enb5: '""'
|
||||
iq_imbal_enb6: '""'
|
||||
iq_imbal_enb7: '""'
|
||||
iq_imbal_enb8: '""'
|
||||
iq_imbal_enb9: '""'
|
||||
gain_type0: default
|
||||
gain_type1: default
|
||||
gain_type10: default
|
||||
gain_type11: default
|
||||
gain_type12: default
|
||||
gain_type13: default
|
||||
gain_type14: default
|
||||
gain_type15: default
|
||||
gain_type16: default
|
||||
gain_type17: default
|
||||
gain_type18: default
|
||||
gain_type19: default
|
||||
gain_type2: default
|
||||
gain_type20: default
|
||||
gain_type21: default
|
||||
gain_type22: default
|
||||
gain_type23: default
|
||||
gain_type24: default
|
||||
gain_type25: default
|
||||
gain_type26: default
|
||||
gain_type27: default
|
||||
gain_type28: default
|
||||
gain_type29: default
|
||||
gain_type3: default
|
||||
gain_type30: default
|
||||
gain_type31: default
|
||||
gain_type4: default
|
||||
gain_type5: default
|
||||
gain_type6: default
|
||||
gain_type7: default
|
||||
gain_type8: default
|
||||
gain_type9: default
|
||||
iq_imbal0: 0+0j
|
||||
iq_imbal1: 0+0j
|
||||
iq_imbal10: 0+0j
|
||||
iq_imbal11: 0+0j
|
||||
iq_imbal12: 0+0j
|
||||
iq_imbal13: 0+0j
|
||||
iq_imbal14: 0+0j
|
||||
iq_imbal15: 0+0j
|
||||
iq_imbal16: 0+0j
|
||||
iq_imbal17: 0+0j
|
||||
iq_imbal18: 0+0j
|
||||
iq_imbal19: 0+0j
|
||||
iq_imbal2: 0+0j
|
||||
iq_imbal20: 0+0j
|
||||
iq_imbal21: 0+0j
|
||||
iq_imbal22: 0+0j
|
||||
iq_imbal23: 0+0j
|
||||
iq_imbal24: 0+0j
|
||||
iq_imbal25: 0+0j
|
||||
iq_imbal26: 0+0j
|
||||
iq_imbal27: 0+0j
|
||||
iq_imbal28: 0+0j
|
||||
iq_imbal29: 0+0j
|
||||
iq_imbal3: 0+0j
|
||||
iq_imbal30: 0+0j
|
||||
iq_imbal31: 0+0j
|
||||
iq_imbal4: 0+0j
|
||||
iq_imbal5: 0+0j
|
||||
iq_imbal6: 0+0j
|
||||
iq_imbal7: 0+0j
|
||||
iq_imbal8: 0+0j
|
||||
iq_imbal9: 0+0j
|
||||
iq_imbal_enb0: default
|
||||
iq_imbal_enb1: default
|
||||
iq_imbal_enb10: default
|
||||
iq_imbal_enb11: default
|
||||
iq_imbal_enb12: default
|
||||
iq_imbal_enb13: default
|
||||
iq_imbal_enb14: default
|
||||
iq_imbal_enb15: default
|
||||
iq_imbal_enb16: default
|
||||
iq_imbal_enb17: default
|
||||
iq_imbal_enb18: default
|
||||
iq_imbal_enb19: default
|
||||
iq_imbal_enb2: default
|
||||
iq_imbal_enb20: default
|
||||
iq_imbal_enb21: default
|
||||
iq_imbal_enb22: default
|
||||
iq_imbal_enb23: default
|
||||
iq_imbal_enb24: default
|
||||
iq_imbal_enb25: default
|
||||
iq_imbal_enb26: default
|
||||
iq_imbal_enb27: default
|
||||
iq_imbal_enb28: default
|
||||
iq_imbal_enb29: default
|
||||
iq_imbal_enb3: default
|
||||
iq_imbal_enb30: default
|
||||
iq_imbal_enb31: default
|
||||
iq_imbal_enb4: default
|
||||
iq_imbal_enb5: default
|
||||
iq_imbal_enb6: default
|
||||
iq_imbal_enb7: default
|
||||
iq_imbal_enb8: default
|
||||
iq_imbal_enb9: default
|
||||
lo_export0: 'False'
|
||||
lo_export1: 'False'
|
||||
lo_export10: 'False'
|
||||
|
@ -900,38 +1010,6 @@ blocks:
|
|||
maxoutbuf: '0'
|
||||
minoutbuf: '0'
|
||||
nchan: '1'
|
||||
norm_gain0: 'True'
|
||||
norm_gain1: 'False'
|
||||
norm_gain10: 'False'
|
||||
norm_gain11: 'False'
|
||||
norm_gain12: 'False'
|
||||
norm_gain13: 'False'
|
||||
norm_gain14: 'False'
|
||||
norm_gain15: 'False'
|
||||
norm_gain16: 'False'
|
||||
norm_gain17: 'False'
|
||||
norm_gain18: 'False'
|
||||
norm_gain19: 'False'
|
||||
norm_gain2: 'False'
|
||||
norm_gain20: 'False'
|
||||
norm_gain21: 'False'
|
||||
norm_gain22: 'False'
|
||||
norm_gain23: 'False'
|
||||
norm_gain24: 'False'
|
||||
norm_gain25: 'False'
|
||||
norm_gain26: 'False'
|
||||
norm_gain27: 'False'
|
||||
norm_gain28: 'False'
|
||||
norm_gain29: 'False'
|
||||
norm_gain3: 'False'
|
||||
norm_gain30: 'False'
|
||||
norm_gain31: 'False'
|
||||
norm_gain4: 'False'
|
||||
norm_gain5: 'False'
|
||||
norm_gain6: 'False'
|
||||
norm_gain7: 'False'
|
||||
norm_gain8: 'False'
|
||||
norm_gain9: 'False'
|
||||
num_mboards: '1'
|
||||
otw: ''
|
||||
rx_agc0: Default
|
||||
|
@ -976,6 +1054,7 @@ blocks:
|
|||
sd_spec6: ''
|
||||
sd_spec7: ''
|
||||
show_lo_controls: 'False'
|
||||
start_time: '-1.0'
|
||||
stream_args: ''
|
||||
stream_chans: '[]'
|
||||
sync: sync
|
||||
|
@ -1015,3 +1094,4 @@ connections:
|
|||
|
||||
metadata:
|
||||
file_format: 1
|
||||
grc_version: v3.11.0.0git-205-g0427b2a6
|
||||
|
|
|
@ -0,0 +1,104 @@
|
|||
---
|
||||
Language: Cpp
|
||||
# BasedOnStyle: LLVM
|
||||
AccessModifierOffset: -4
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: false
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignEscapedNewlinesLeft: true
|
||||
AlignOperands: true
|
||||
AlignTrailingComments: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: true
|
||||
AllowShortBlocksOnASingleLine: false
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: All
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
AlwaysBreakTemplateDeclarations: true
|
||||
BinPackArguments: false
|
||||
BinPackParameters: false
|
||||
BreakBeforeBraces: Custom
|
||||
BraceWrapping:
|
||||
AfterClass: true
|
||||
AfterControlStatement: false
|
||||
AfterEnum: false
|
||||
AfterFunction: true
|
||||
AfterNamespace: false
|
||||
AfterObjCDeclaration: false
|
||||
AfterStruct: false
|
||||
AfterUnion: false
|
||||
BeforeCatch: false
|
||||
BeforeElse: false
|
||||
IndentBraces: false
|
||||
BreakBeforeBinaryOperators: None
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializersBeforeComma: false
|
||||
BreakAfterJavaFieldAnnotations: false
|
||||
BreakStringLiterals: true
|
||||
ColumnLimit: 90
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
ContinuationIndentWidth: 4
|
||||
Cpp11BracedListStyle: false
|
||||
DerivePointerAlignment: false
|
||||
DisableFormat: false
|
||||
ExperimentalAutoDetectBinPacking: false
|
||||
ForEachMacros:
|
||||
- foreach
|
||||
- Q_FOREACH
|
||||
- BOOST_FOREACH
|
||||
IncludeCategories:
|
||||
- Regex: '^"(gnuradio)/'
|
||||
Priority: 1
|
||||
- Regex: '^<(gnuradio)/'
|
||||
Priority: 2
|
||||
- Regex: '^<(boost)/'
|
||||
Priority: 98
|
||||
- Regex: '^<[a-z]*>$'
|
||||
Priority: 99
|
||||
- Regex: '^".*"$'
|
||||
Priority: 0
|
||||
- Regex: '.*'
|
||||
Priority: 10
|
||||
|
||||
IncludeIsMainRegex: '(Test)?$'
|
||||
IndentCaseLabels: false
|
||||
IndentWidth: 4
|
||||
IndentWrappedFunctionNames: false
|
||||
JavaScriptQuotes: Leave
|
||||
JavaScriptWrapImports: true
|
||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||
MacroBlockBegin: ''
|
||||
MacroBlockEnd: ''
|
||||
MaxEmptyLinesToKeep: 2
|
||||
NamespaceIndentation: None
|
||||
ObjCBlockIndentWidth: 2
|
||||
ObjCSpaceAfterProperty: false
|
||||
ObjCSpaceBeforeProtocolList: true
|
||||
PenaltyBreakBeforeFirstCallParameter: 19
|
||||
PenaltyBreakComment: 300
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
PenaltyBreakString: 1000
|
||||
PenaltyExcessCharacter: 1000000
|
||||
PenaltyReturnTypeOnItsOwnLine: 60
|
||||
PointerAlignment: Left
|
||||
ReflowComments: true
|
||||
SortIncludes: true
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceAfterTemplateKeyword: true
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 1
|
||||
SpacesInAngles: false
|
||||
SpacesInContainerLiterals: true
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
Standard: Cpp11
|
||||
TabWidth: 8
|
||||
UseTab: Never
|
|
@ -0,0 +1,110 @@
|
|||
# gr-droneid conda recipe
|
||||
|
||||
This recipe is for creating a package that can be installed into a [conda](https://docs.conda.io/en/latest/) environment. See the [Conda GNU Radio Guide](https://wiki.gnuradio.org/index.php/CondaInstall) for more information on using GNU Radio with conda.
|
||||
|
||||
Packages for GNU Radio and some out-of-tree (OOT) modules are available through the [`conda-forge` channel](https://conda-forge.org/). If this OOT module is already available (search "gnuradio" on [anaconda.org](https://anaconda.org)), it is preferable to use that existing package rather than this recipe.
|
||||
|
||||
#### Users
|
||||
|
||||
- [Building the package](#building-the-package)
|
||||
|
||||
#### Developers
|
||||
|
||||
- [Modifying the recipe](#modifying-the-recipe)
|
||||
- [Continuous integration](#continuous-integration)
|
||||
|
||||
|
||||
## Building the package
|
||||
|
||||
(See the [Conda GNU Radio Guide](https://wiki.gnuradio.org/index.php/CondaInstall) if you are unfamiliar with how to use conda.)
|
||||
|
||||
1. Make sure that have `conda-build` and `conda-forge-pinning` installed and updated in your base environment:
|
||||
|
||||
conda activate base
|
||||
conda install -n base conda-build conda-forge-pinning
|
||||
conda upgrade -n base conda-build conda-forge-pinning
|
||||
|
||||
**Windows users only**: you will also need to have Microsoft's Visual C++ build tools installed. Usually you can do this by installing the [Community edition of Visual Studio](https://visualstudio.microsoft.com/free-developer-offers/) and then selecting a MSVC C++ x64/x86 build tools component under the list of "Individual Components". As of this writing, you will specifically need MSVC v141, i.e. the "MSVC v141 - VS2017 C++ x64/x86 build tools (v14.16)" component. If the build fails to find the version of MSVC it is looking for, try installing other (newer) versions.
|
||||
|
||||
2. Download the source code for this OOT module (which includes this recipe). Typically, this is done by using `git` and cloning the module's repository:
|
||||
|
||||
git clone <repository_url>
|
||||
cd <repository_name>
|
||||
|
||||
3. Run `conda-build` on the recipe to create the package:
|
||||
|
||||
(Linux and macOS)
|
||||
|
||||
conda build .conda/recipe/ -m ${CONDA_PREFIX}/conda_build_config.yaml
|
||||
|
||||
(Windows)
|
||||
|
||||
conda build .conda\recipe\ -m %CONDA_PREFIX%\conda_build_config.yaml
|
||||
|
||||
If you plan on using this package within an existing environment which uses a specific version of Python, specify the version of Python using the `--python` flag. You must use a version string that matches one of the strings listed under `python` in the `${CONDA_PREFIX}/conda_build_config.yaml` file, e.g:
|
||||
|
||||
(Linux and macOS)
|
||||
|
||||
conda build .conda/recipe/ -m ${CONDA_PREFIX}/conda_build_config.yaml --python="3.9.* *_cpython"
|
||||
|
||||
(Windows)
|
||||
|
||||
conda build .conda\recipe\ -m %CONDA_PREFIX%\conda_build_config.yaml --python="3.9.* *_cpython"
|
||||
|
||||
If you encounter errors, consult with the OOT module maintainer or the maintainers of the [gnuradio feedstock](https://github.com/conda-forge/gnuradio-feedstock). It is possible that the recipe will need to be updated.
|
||||
|
||||
4. Install the package into an existing environment
|
||||
|
||||
conda install --use-local -n <environment_name> gnuradio-EXAMPLE
|
||||
|
||||
or create a new environment that includes the package:
|
||||
|
||||
conda create -n test_env gnuradio-EXAMPLE
|
||||
|
||||
|
||||
## Modifying the recipe
|
||||
|
||||
This recipe is derived from a template, and so it is best to check it and make any necessary modifications. Likely changes include:
|
||||
|
||||
- Populating metadata near the bottom of the `recipe/meta.yaml` file
|
||||
- Adding "host" (build-time) and "run" (run-time) dependencies specific to your module in `recipe/meta.yaml`
|
||||
- Adding special configuration flags or steps are necessary to carry out the build to the build scripts (`recipe/build.sh` for Linux/macOS and `recipe/bld.bat` for Windows)
|
||||
|
||||
Specifying the versions of GNU Radio that your OOT is compatible with is one of the most important modifications. Following the instructions below, the module will be built against the conda-forge "pinned" version of GNU Radio, which is usually the latest version.
|
||||
|
||||
- To override the pinned version of GNU Radio (e.g. for a branch that builds against an older version), specify the `gnuradio_core` key as instructed in `recipe/conda_build_config.yaml`.
|
||||
- If the module is compatible with multiple major versions of GNU Radio, and you want to build against multiple of them, you can also add extra versions to `recipe/conda_build_config.yaml` to expand the default build matrix.
|
||||
|
||||
See the [conda-build documentation](https://docs.conda.io/projects/conda-build/en/latest/index.html) for details on how to write a conda recipe.
|
||||
|
||||
|
||||
## Continuous integration
|
||||
|
||||
Only a few steps are needed to use this recipe to build and test this OOT module using CI services. It can also be used to upload packages to [anaconda.org](https://anaconda.org) for others to download and use.
|
||||
|
||||
1. Make sure that have `conda-smithy` installed in your base conda environment:
|
||||
|
||||
conda activate base
|
||||
conda install -n base conda-smithy
|
||||
conda upgrade -n base conda-smithy
|
||||
|
||||
2. Make any changes to the recipe and `conda-forge.yml` that are necessary. For example, if you plan on uploading packages to your own [anaconda.org](https://anaconda.org) channel, specify the channel name and label as the `channel_targets` key in `recipe/conda_build_config.yaml`. Commit the changes to your repository:
|
||||
|
||||
git commit -a
|
||||
|
||||
3. "Re-render" the CI scripts by running conda-smithy from the root of your repository:
|
||||
|
||||
conda-smithy rerender --feedstock_config .conda/conda-forge.yml -c auto
|
||||
|
||||
This will create a commit that adds or updates the CI scripts that have been configured with `conda-forge.yml`. If you want to minimize extraneous files, you can remove some of the newly-created files that are not necessary outside of a typical conda-forge feedstock:
|
||||
|
||||
git rm -f .github/workflows/automerge.yml .github/workflows/webservices.yml .circleci/config.yml
|
||||
git commit --amend -s
|
||||
|
||||
When the CI is executed (on a pull request or commit), it will run one job per configuration file in `.ci_support` to build packages for various platforms, Python versions, and optionally `gnuradio` versions (by adding to `gnuradio_extra_pin` in `recipe/conda_build_config.yaml`).
|
||||
|
||||
**You should repeat this step whenever the recipe is updated or when changes to the conda-forge infrastructure require all CI scripts to be updated.**
|
||||
|
||||
Since the newly created files will be rewritten whenever conda-smithy is run, you should not edit any of the automatically-generated files in e.g. `.ci_support`, `.scripts`, or `.github/workflows/conda-build.yml`.
|
||||
|
||||
4. (optional) If you want to enable uploads of the packages to [anaconda.org](https://anaconda.org) whenever the CI is run from a commit on the branch specified in `conda-forge.yml`, you need to set an Anaconda Cloud API token to the `BINSTAR_TOKEN` environment variable. To generate a token, follow the instructions [here](https://docs.anaconda.com/anacondaorg/user-guide/tasks/work-with-accounts/#creating-access-tokens). To populate the `BINSTAR_TOKEN` environment variable for CI jobs, add the token as a secret by following, for example, the [Github docs](https://docs.github.com/en/actions/reference/encrypted-secrets).
|
|
@ -0,0 +1,30 @@
|
|||
# See https://conda-forge.org/docs/maintainer/conda_forge_yml.html for
|
||||
# documentation on possible keys and values.
|
||||
|
||||
# uncomment to enable cross-compiled osx-arm64 builds
|
||||
#build_platform:
|
||||
# osx_arm64: osx_64
|
||||
clone_depth: 0
|
||||
github_actions:
|
||||
store_build_artifacts: true
|
||||
os_version:
|
||||
linux_64: cos7
|
||||
provider:
|
||||
linux: github_actions
|
||||
osx: github_actions
|
||||
win: github_actions
|
||||
# uncomment to enable additional linux platforms
|
||||
#linux_aarch64: github_actions
|
||||
#linux_ppc64le: github_actions
|
||||
recipe_dir: .conda/recipe
|
||||
# skip unnecessary files since this is not a full-fledged conda-forge feedstock
|
||||
skip_render:
|
||||
- README.md
|
||||
- LICENSE.txt
|
||||
- .gitattributes
|
||||
- .gitignore
|
||||
- build-locally.py
|
||||
- LICENSE
|
||||
test: native_and_emulated
|
||||
# enable uploads to Anaconda Cloud from specified branches only
|
||||
upload_on_branch: main
|
|
@ -0,0 +1,29 @@
|
|||
setlocal EnableDelayedExpansion
|
||||
@echo on
|
||||
|
||||
:: Make a build folder and change to it
|
||||
cmake -E make_directory buildconda
|
||||
cd buildconda
|
||||
|
||||
:: configure
|
||||
cmake -G "Ninja" ^
|
||||
-DCMAKE_BUILD_TYPE:STRING=Release ^
|
||||
-DCMAKE_INSTALL_PREFIX:PATH="%LIBRARY_PREFIX%" ^
|
||||
-DCMAKE_PREFIX_PATH:PATH="%LIBRARY_PREFIX%" ^
|
||||
-DGR_PYTHON_DIR:PATH="%SP_DIR%" ^
|
||||
-DENABLE_DOXYGEN=OFF ^
|
||||
-DENABLE_TESTING=ON ^
|
||||
..
|
||||
if errorlevel 1 exit 1
|
||||
|
||||
:: build
|
||||
cmake --build . --config Release -- -j%CPU_COUNT%
|
||||
if errorlevel 1 exit 1
|
||||
|
||||
:: install
|
||||
cmake --build . --config Release --target install
|
||||
if errorlevel 1 exit 1
|
||||
|
||||
:: test
|
||||
ctest --build-config Release --output-on-failure --timeout 120 -j%CPU_COUNT%
|
||||
if errorlevel 1 exit 1
|
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -ex
|
||||
|
||||
cmake -E make_directory buildconda
|
||||
cd buildconda
|
||||
|
||||
cmake_config_args=(
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
-DCMAKE_INSTALL_PREFIX=$PREFIX
|
||||
-DLIB_SUFFIX=""
|
||||
-DENABLE_DOXYGEN=OFF
|
||||
-DENABLE_TESTING=ON
|
||||
)
|
||||
|
||||
cmake ${CMAKE_ARGS} -G "Ninja" .. "${cmake_config_args[@]}"
|
||||
cmake --build . --config Release -- -j${CPU_COUNT}
|
||||
cmake --build . --config Release --target install
|
||||
|
||||
if [[ "${CONDA_BUILD_CROSS_COMPILATION:-}" != "1" || "${CROSSCOMPILING_EMULATOR}" != "" ]]; then
|
||||
ctest --build-config Release --output-on-failure --timeout 120 -j${CPU_COUNT}
|
||||
fi
|
|
@ -0,0 +1,14 @@
|
|||
# this is the channel and label where packages will be uploaded to if enabled
|
||||
# (see ../README.md)
|
||||
channel_targets:
|
||||
- gnuradio main
|
||||
# override the conda-forge pin for gnuradio-core by uncommenting
|
||||
# and specifying a different version here
|
||||
#gnuradio_core:
|
||||
#- "3.10.1"
|
||||
gnuradio_extra_pin:
|
||||
# always leave one entry with the empty string
|
||||
- ""
|
||||
# add version strings here like to get builds for versions other than
|
||||
# the conda-forge-wide default or version specified above for gnuradio_core
|
||||
#- "3.9.5"
|
|
@ -0,0 +1,88 @@
|
|||
{% set oot_name = "droneid" %}
|
||||
{% set name = "gnuradio-" + oot_name %}
|
||||
{% set version = (environ.get("GIT_DESCRIBE_TAG_PEP440", "0.0.0." + datetime.datetime.now().strftime("%Y%m%d") + ".dev+" + environ.get("GIT_DESCRIBE_HASH", "local"))|string) %}
|
||||
|
||||
package:
|
||||
name: {{ name|lower }}
|
||||
version: {{ version }}
|
||||
|
||||
source:
|
||||
# use local path or git repository depending on if the build is local or done on CI
|
||||
path: "../.." # [not os.environ.get("CI")]
|
||||
git_url: {{ environ.get('FEEDSTOCK_ROOT', "../..") }} # [os.environ.get("CI")]
|
||||
|
||||
build:
|
||||
number: 0
|
||||
|
||||
requirements:
|
||||
build:
|
||||
- {{ compiler("c") }}
|
||||
- {{ compiler("cxx") }}
|
||||
- cmake
|
||||
- git
|
||||
- ninja
|
||||
- pkg-config
|
||||
# cross-compilation requirements
|
||||
- python # [build_platform != target_platform]
|
||||
- cross-python_{{ target_platform }} # [build_platform != target_platform]
|
||||
- numpy # [build_platform != target_platform]
|
||||
- pybind11 # [build_platform != target_platform]
|
||||
# Add extra build tool dependencies here
|
||||
|
||||
host:
|
||||
- gmp # [linux]
|
||||
# the following two entries are for generating builds against specific GR versions
|
||||
- gnuradio-core # [not gnuradio_extra_pin]
|
||||
- gnuradio-core {{ gnuradio_extra_pin }}.* # [gnuradio_extra_pin]
|
||||
- pip # [win]
|
||||
- pybind11
|
||||
- python
|
||||
- numpy
|
||||
- volk
|
||||
# Add/remove library dependencies here
|
||||
|
||||
run:
|
||||
- numpy
|
||||
- python
|
||||
# Add/remove runtime dependencies here
|
||||
|
||||
test:
|
||||
commands:
|
||||
# Add a list of commands to run to check that the package works. Examples below.
|
||||
|
||||
## verify that commands run
|
||||
#- COMMAND --help
|
||||
|
||||
# verify that (some) headers get installed
|
||||
- test -f $PREFIX/include/gnuradio/{{ oot_name }}/api.h # [not win]
|
||||
- if not exist %PREFIX%\\Library\\include\\gnuradio\\{{ oot_name }}\\api.h exit 1 # [win]
|
||||
|
||||
## verify that libraries get installed
|
||||
#- test -f $PREFIX/lib/lib{{ name }}${SHLIB_EXT} # [not win]
|
||||
#- if not exist %PREFIX%\\Library\\bin\\{{ name }}.dll exit 1 # [win]
|
||||
#- if not exist %PREFIX%\\Library\\lib\\{{ name }}.lib exit 1 # [win]
|
||||
|
||||
## verify that (some) GRC blocks get installed
|
||||
#{% set blocks = ["LIST", "OF", "GRC", "BLOCK", "NAMES"] %}
|
||||
#{% for block in blocks %}
|
||||
#- test -f $PREFIX/share/gnuradio/grc/blocks/{{ block }}.block.yml # [not win]
|
||||
#- if not exist %PREFIX%\\Library\\share\\gnuradio\\grc\\blocks\\{{ block }}.block.yml exit 1 # [win]
|
||||
#{% endfor %}
|
||||
|
||||
imports:
|
||||
# verify that the python module imports
|
||||
- gnuradio.{{ oot_name }}
|
||||
|
||||
about:
|
||||
# For licenses, use the SPDX identifier, e.g: "GPL-2.0-only" instead of
|
||||
# "GNU General Public License version 2.0". See https://spdx.org/licenses/.
|
||||
# Include the license text by using the license_file entry set to the path
|
||||
# of the license text file within the source directory, e.g. "LICENSE".
|
||||
# See https://docs.conda.io/projects/conda-build/en/latest/resources/define-metadata.html#license-file
|
||||
|
||||
#home: https://github.com/<username>/gr-droneid
|
||||
#license: GPL-3.0-or-later
|
||||
#license_file: LICENSE
|
||||
#summary: GNU Radio droneid module
|
||||
#description: >
|
||||
# Short description of the gr-droneid module.
|
|
@ -1,3 +0,0 @@
|
|||
.idea/
|
||||
build/
|
||||
cmake-build-*/
|
|
@ -1,22 +1,15 @@
|
|||
# Copyright 2011,2012,2014,2016,2018 Free Software Foundation, Inc.
|
||||
# Copyright 2011-2020 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file was generated by gr_modtool, a tool from the GNU Radio framework
|
||||
# This file is a part of gr-droneid
|
||||
#
|
||||
# GNU Radio is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3, or (at your option)
|
||||
# any later version.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# GNU Radio is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU Radio; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
|
||||
# Select the release build type by default to get optimization flags.
|
||||
# This has to come before project() which otherwise initializes it.
|
||||
# Build type can still be overridden by setting -DCMAKE_BUILD_TYPE=
|
||||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "")
|
||||
|
||||
########################################################################
|
||||
# Project setup
|
||||
|
@ -31,21 +24,16 @@ if(DEFINED ENV{PYBOMBS_PREFIX})
|
|||
message(STATUS "PyBOMBS installed GNU Radio. Setting CMAKE_INSTALL_PREFIX to $ENV{PYBOMBS_PREFIX}")
|
||||
endif()
|
||||
|
||||
# Select the release build type by default to get optimization flags
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE "Release")
|
||||
message(STATUS "Build type not specified: defaulting to release.")
|
||||
endif(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "")
|
||||
|
||||
# Make sure our local CMake Modules path comes first
|
||||
list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules)
|
||||
# Find gnuradio to get access to the cmake modules
|
||||
find_package(Gnuradio "3.10" REQUIRED fft filter blocks)
|
||||
|
||||
# Set the version information here
|
||||
set(VERSION_MAJOR 1)
|
||||
set(VERSION_API 0)
|
||||
set(VERSION_ABI 0)
|
||||
set(VERSION_PATCH git)
|
||||
set(VERSION_PATCH 0)
|
||||
|
||||
cmake_policy(SET CMP0011 NEW)
|
||||
|
||||
|
@ -53,39 +41,20 @@ cmake_policy(SET CMP0011 NEW)
|
|||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
########################################################################
|
||||
# Compiler specific setup
|
||||
# Minimum Version Requirements
|
||||
########################################################################
|
||||
if((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR
|
||||
CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
AND NOT WIN32)
|
||||
#http://gcc.gnu.org/wiki/Visibility
|
||||
add_definitions(-fvisibility=hidden)
|
||||
endif()
|
||||
|
||||
IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
SET(CMAKE_CXX_STANDARD 11)
|
||||
ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
SET(CMAKE_CXX_STANDARD 11)
|
||||
ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
SET(CMAKE_CXX_STANDARD 11)
|
||||
ELSE()
|
||||
message(WARNING "C++ standard could not be set because compiler is not GNU, Clang or MSVC.")
|
||||
ENDIF()
|
||||
include(GrMinReq)
|
||||
|
||||
IF(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
SET(CMAKE_C_STANDARD 11)
|
||||
ELSEIF(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
SET(CMAKE_C_STANDARD 11)
|
||||
ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
|
||||
SET(CMAKE_C_STANDARD 11)
|
||||
ELSE()
|
||||
message(WARNING "C standard could not be set because compiler is not GNU, Clang or MSVC.")
|
||||
ENDIF()
|
||||
########################################################################
|
||||
# Compiler settings
|
||||
########################################################################
|
||||
|
||||
include(GrCompilerSettings)
|
||||
|
||||
########################################################################
|
||||
# Install directories
|
||||
########################################################################
|
||||
find_package(Gnuradio "3.8" REQUIRED fft filter blocks)
|
||||
include(GrVersion)
|
||||
|
||||
include(GrPlatform) #define LIB_SUFFIX
|
||||
|
@ -94,8 +63,8 @@ if(NOT CMAKE_MODULES_DIR)
|
|||
set(CMAKE_MODULES_DIR lib${LIB_SUFFIX}/cmake)
|
||||
endif(NOT CMAKE_MODULES_DIR)
|
||||
|
||||
set(GR_INCLUDE_DIR include/droneid)
|
||||
set(GR_CMAKE_DIR ${CMAKE_MODULES_DIR}/droneid)
|
||||
set(GR_INCLUDE_DIR include/gnuradio/droneid)
|
||||
set(GR_CMAKE_DIR ${CMAKE_MODULES_DIR}/gnuradio-droneid)
|
||||
set(GR_PKG_DATA_DIR ${GR_DATA_DIR}/${CMAKE_PROJECT_NAME})
|
||||
set(GR_PKG_DOC_DIR ${GR_DOC_DIR}/${CMAKE_PROJECT_NAME})
|
||||
set(GR_PKG_CONF_DIR ${GR_CONF_DIR}/${CMAKE_PROJECT_NAME}/conf.d)
|
||||
|
@ -147,22 +116,34 @@ add_custom_target(uninstall
|
|||
${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
|
||||
)
|
||||
|
||||
|
||||
########################################################################
|
||||
# Add subdirectories
|
||||
########################################################################
|
||||
add_subdirectory(include/droneid)
|
||||
add_subdirectory(include/gnuradio/droneid)
|
||||
add_subdirectory(lib)
|
||||
add_subdirectory(apps)
|
||||
add_subdirectory(docs)
|
||||
add_subdirectory(swig)
|
||||
add_subdirectory(python)
|
||||
add_subdirectory(grc)
|
||||
# NOTE: manually update below to use GRC to generate C++ flowgraphs w/o python
|
||||
if(ENABLE_PYTHON)
|
||||
message(STATUS "PYTHON and GRC components are enabled")
|
||||
add_subdirectory(python/droneid)
|
||||
add_subdirectory(grc)
|
||||
else(ENABLE_PYTHON)
|
||||
message(STATUS "PYTHON and GRC components are disabled")
|
||||
endif(ENABLE_PYTHON)
|
||||
|
||||
########################################################################
|
||||
# Install cmake search helper for this library
|
||||
########################################################################
|
||||
|
||||
install(FILES cmake/Modules/droneidConfig.cmake
|
||||
DESTINATION ${CMAKE_MODULES_DIR}/droneid
|
||||
install(FILES cmake/Modules/gnuradio-droneidConfig.cmake
|
||||
DESTINATION ${GR_CMAKE_DIR}
|
||||
)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
configure_package_config_file(
|
||||
${PROJECT_SOURCE_DIR}/cmake/Modules/targetConfig.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/cmake/Modules/${target}Config.cmake
|
||||
INSTALL_DESTINATION ${GR_CMAKE_DIR}
|
||||
)
|
||||
|
||||
|
|
|
@ -3,20 +3,8 @@
|
|||
# This file was generated by gr_modtool, a tool from the GNU Radio framework
|
||||
# This file is a part of gr-droneid
|
||||
#
|
||||
# GNU Radio is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3, or (at your option)
|
||||
# any later version.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# GNU Radio is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU Radio; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
|
||||
include(GrPython)
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
INCLUDE(FindPkgConfig)
|
||||
PKG_CHECK_MODULES(PC_DRONEID droneid)
|
||||
find_package(PkgConfig)
|
||||
|
||||
PKG_CHECK_MODULES(PC_GR_DRONEID gnuradio-droneid)
|
||||
|
||||
FIND_PATH(
|
||||
DRONEID_INCLUDE_DIRS
|
||||
NAMES droneid/api.h
|
||||
GR_DRONEID_INCLUDE_DIRS
|
||||
NAMES gnuradio/droneid/api.h
|
||||
HINTS $ENV{DRONEID_DIR}/include
|
||||
${PC_DRONEID_INCLUDEDIR}
|
||||
PATHS ${CMAKE_INSTALL_PREFIX}/include
|
||||
|
@ -12,7 +13,7 @@ FIND_PATH(
|
|||
)
|
||||
|
||||
FIND_LIBRARY(
|
||||
DRONEID_LIBRARIES
|
||||
GR_DRONEID_LIBRARIES
|
||||
NAMES gnuradio-droneid
|
||||
HINTS $ENV{DRONEID_DIR}/lib
|
||||
${PC_DRONEID_LIBDIR}
|
||||
|
@ -24,8 +25,8 @@ FIND_LIBRARY(
|
|||
/usr/lib64
|
||||
)
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/droneidTarget.cmake")
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/gnuradio-droneidTarget.cmake")
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(DRONEID DEFAULT_MSG DRONEID_LIBRARIES DRONEID_INCLUDE_DIRS)
|
||||
MARK_AS_ADVANCED(DRONEID_LIBRARIES DRONEID_INCLUDE_DIRS)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GR_DRONEID DEFAULT_MSG GR_DRONEID_LIBRARIES GR_DRONEID_INCLUDE_DIRS)
|
||||
MARK_AS_ADVANCED(GR_DRONEID_LIBRARIES GR_DRONEID_INCLUDE_DIRS)
|
|
@ -2,20 +2,8 @@
|
|||
#
|
||||
# This file is part of GNU Radio
|
||||
#
|
||||
# GNU Radio is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3, or (at your option)
|
||||
# any later version.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# GNU Radio is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU Radio; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
|
|
|
@ -3,20 +3,8 @@
|
|||
# This file was generated by gr_modtool, a tool from the GNU Radio framework
|
||||
# This file is a part of gr-droneid
|
||||
#
|
||||
# GNU Radio is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3, or (at your option)
|
||||
# any later version.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# GNU Radio is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU Radio; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
|
||||
########################################################################
|
||||
# Setup dependencies
|
||||
|
|
|
@ -3,20 +3,8 @@
|
|||
# This file was generated by gr_modtool, a tool from the GNU Radio framework
|
||||
# This file is a part of gr-droneid
|
||||
#
|
||||
# GNU Radio is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3, or (at your option)
|
||||
# any later version.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# GNU Radio is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU Radio; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
|
||||
########################################################################
|
||||
# Create the doxygen configuration file
|
||||
|
@ -29,6 +17,7 @@ file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR} abs_top_builddir)
|
|||
set(HAVE_DOT ${DOXYGEN_DOT_FOUND})
|
||||
set(enable_html_docs YES)
|
||||
set(enable_latex_docs NO)
|
||||
set(enable_mathjax NO)
|
||||
set(enable_xml_docs YES)
|
||||
|
||||
configure_file(
|
||||
|
|
|
@ -199,13 +199,6 @@ TAB_SIZE = 8
|
|||
|
||||
ALIASES =
|
||||
|
||||
# This tag can be used to specify a number of word-keyword mappings (TCL only).
|
||||
# A mapping has the form "name=value". For example adding
|
||||
# "class=itcl::class" will allow you to use the command class in the
|
||||
# itcl::class meaning.
|
||||
|
||||
TCL_SUBST =
|
||||
|
||||
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
|
||||
# sources only. Doxygen will then generate output that is more tailored for C.
|
||||
# For instance, some of the names that are used will be different. The list
|
||||
|
@ -723,8 +716,6 @@ EXCLUDE_PATTERNS = */.deps/* \
|
|||
|
||||
EXCLUDE_SYMBOLS = ad9862 \
|
||||
numpy \
|
||||
*swig* \
|
||||
*Swig* \
|
||||
*my_top_block* \
|
||||
*my_graph* \
|
||||
*app_top_block* \
|
||||
|
@ -790,7 +781,7 @@ INPUT_FILTER =
|
|||
# info on how filters are used. If FILTER_PATTERNS is empty or if
|
||||
# non of the patterns match the file name, INPUT_FILTER is applied.
|
||||
|
||||
FILTER_PATTERNS = *.py="@top_srcdir@"/doc/doxygen/other/doxypy.py
|
||||
FILTER_PATTERNS = *.py=@top_srcdir@/docs/doxygen/other/doxypy.py
|
||||
|
||||
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
|
||||
# INPUT_FILTER) will be used to filter the input files when producing source
|
||||
|
@ -879,12 +870,6 @@ VERBATIM_HEADERS = YES
|
|||
|
||||
ALPHABETICAL_INDEX = YES
|
||||
|
||||
# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
|
||||
# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
|
||||
# in which this list will be split (can be a number in the range [1..20])
|
||||
|
||||
COLS_IN_ALPHA_INDEX = 5
|
||||
|
||||
# In case all classes in a project start with a common prefix, all
|
||||
# classes will be put under the same header in the alphabetical index.
|
||||
# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
|
||||
|
@ -1220,14 +1205,14 @@ FORMULA_TRANSPARENT = YES
|
|||
# output. When enabled you may also need to install MathJax separately and
|
||||
# configure the path to it using the MATHJAX_RELPATH option.
|
||||
|
||||
USE_MATHJAX = NO
|
||||
USE_MATHJAX = @enable_mathjax@
|
||||
|
||||
# When MathJax is enabled you can set the default output format to be used for
|
||||
# the MathJax output. Supported types are HTML-CSS, NativeMML (i.e. MathML) and
|
||||
# SVG. The default value is HTML-CSS, which is slower, but has the best
|
||||
# compatibility.
|
||||
|
||||
MATHJAX_FORMAT = HTML-CSS
|
||||
MATHJAX_FORMAT = SVG
|
||||
|
||||
# When MathJax is enabled you need to specify the location relative to the
|
||||
# HTML output directory using the MATHJAX_RELPATH option. The destination
|
||||
|
@ -1239,12 +1224,12 @@ MATHJAX_FORMAT = HTML-CSS
|
|||
# However, it is strongly recommended to install a local
|
||||
# copy of MathJax from http://www.mathjax.org before deployment.
|
||||
|
||||
MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
|
||||
MATHJAX_RELPATH = @MATHJAX2_PATH@
|
||||
|
||||
# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
|
||||
# names that should be enabled during MathJax rendering.
|
||||
|
||||
MATHJAX_EXTENSIONS =
|
||||
MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
|
||||
|
||||
# The MATHJAX_CODEFILE tag can be used to specify a file with javascript
|
||||
# pieces of code that will be used on startup of the MathJax code.
|
||||
|
@ -1680,11 +1665,6 @@ EXTERNAL_GROUPS = YES
|
|||
|
||||
EXTERNAL_PAGES = YES
|
||||
|
||||
# The PERL_PATH should be the absolute path and name of the perl script
|
||||
# interpreter (i.e. the result of `which perl').
|
||||
|
||||
PERL_PATH = /usr/bin/perl
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
#---------------------------------------------------------------------------
|
||||
|
@ -1697,15 +1677,6 @@ PERL_PATH = /usr/bin/perl
|
|||
|
||||
CLASS_DIAGRAMS = YES
|
||||
|
||||
# You can define message sequence charts within doxygen comments using the \msc
|
||||
# command. Doxygen will then run the mscgen tool (see
|
||||
# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
|
||||
# documentation. The MSCGEN_PATH tag allows you to specify the directory where
|
||||
# the mscgen tool resides. If left empty the tool is assumed to be found in the
|
||||
# default search path.
|
||||
|
||||
MSCGEN_PATH =
|
||||
|
||||
# If set to YES, the inheritance and collaboration graphs will hide
|
||||
# inheritance and usage relations if the target is undocumented
|
||||
# or is not a class.
|
||||
|
@ -1834,7 +1805,7 @@ DIRECTORY_GRAPH = YES
|
|||
# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
|
||||
# visible in IE 9+ (other browsers do not have this requirement).
|
||||
|
||||
DOT_IMAGE_FORMAT = png
|
||||
DOT_IMAGE_FORMAT = svg
|
||||
|
||||
# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
|
||||
# enable generation of interactive SVG images that allow zooming and panning.
|
||||
|
|
Plik diff jest za duży
Load Diff
|
@ -4,20 +4,8 @@
|
|||
# This file was generated by gr_modtool, a tool from the GNU Radio framework
|
||||
# This file is a part of gr-droneid
|
||||
#
|
||||
# GNU Radio is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3, or (at your option)
|
||||
# any later version.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# GNU Radio is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU Radio; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
"""
|
||||
Python interface to contents of doxygen xml documentation.
|
||||
|
@ -64,10 +52,10 @@ This line is uninformative and is only to test line breaks in the comments.
|
|||
u'Outputs the vital aadvark statistics.'
|
||||
|
||||
"""
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .doxyindex import DoxyIndex, DoxyFunction, DoxyParam, DoxyClass, DoxyFile, DoxyNamespace, DoxyGroup, DoxyFriend, DoxyOther
|
||||
|
||||
|
||||
def _test():
|
||||
import os
|
||||
this_dir = os.path.dirname(globals()['__file__'])
|
||||
|
@ -79,6 +67,6 @@ def _test():
|
|||
import doctest
|
||||
return doctest.testmod()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
_test()
|
||||
|
||||
|
|
|
@ -4,20 +4,8 @@
|
|||
# This file was generated by gr_modtool, a tool from the GNU Radio framework
|
||||
# This file is a part of gr-droneid
|
||||
#
|
||||
# GNU Radio is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3, or (at your option)
|
||||
# any later version.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# GNU Radio is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU Radio; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
"""
|
||||
A base class is created.
|
||||
|
@ -25,8 +13,6 @@ A base class is created.
|
|||
Classes based upon this are used to make more user-friendly interfaces
|
||||
to the doxygen xml docs than the generated classes provide.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import os
|
||||
import pdb
|
||||
|
@ -97,8 +83,8 @@ class Base(object):
|
|||
for cls in self.mem_classes:
|
||||
if cls.can_parse(mem):
|
||||
return cls
|
||||
raise Exception(("Did not find a class for object '%s'." \
|
||||
% (mem.get_name())))
|
||||
raise Exception(("Did not find a class for object '%s'."
|
||||
% (mem.get_name())))
|
||||
|
||||
def convert_mem(self, mem):
|
||||
try:
|
||||
|
|
|
@ -4,27 +4,13 @@
|
|||
# This file was generated by gr_modtool, a tool from the GNU Radio framework
|
||||
# This file is a part of gr-droneid
|
||||
#
|
||||
# GNU Radio is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3, or (at your option)
|
||||
# any later version.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# GNU Radio is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU Radio; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
"""
|
||||
Classes providing more user-friendly interfaces to the doxygen xml
|
||||
docs than the generated classes provide.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import os
|
||||
|
||||
|
@ -32,6 +18,7 @@ from .generated import index
|
|||
from .base import Base
|
||||
from .text import description
|
||||
|
||||
|
||||
class DoxyIndex(Base):
|
||||
"""
|
||||
Parses a doxygen xml directory.
|
||||
|
@ -60,17 +47,8 @@ class DoxyIndex(Base):
|
|||
self._members.append(converted)
|
||||
|
||||
|
||||
def generate_swig_doc_i(self):
|
||||
"""
|
||||
%feature("docstring") gr_make_align_on_samplenumbers_ss::align_state "
|
||||
Wraps the C++: gr_align_on_samplenumbers_ss::align_state";
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class DoxyCompMem(Base):
|
||||
|
||||
|
||||
kind = None
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
@ -106,9 +84,11 @@ class DoxyCompMem(Base):
|
|||
class DoxyCompound(DoxyCompMem):
|
||||
pass
|
||||
|
||||
|
||||
class DoxyMember(DoxyCompMem):
|
||||
pass
|
||||
|
||||
|
||||
class DoxyFunction(DoxyMember):
|
||||
|
||||
__module__ = "gnuradio.utils.doxyxml"
|
||||
|
@ -129,9 +109,11 @@ class DoxyFunction(DoxyMember):
|
|||
self._data['params'].append(DoxyParam(prm))
|
||||
|
||||
brief_description = property(lambda self: self.data()['brief_description'])
|
||||
detailed_description = property(lambda self: self.data()['detailed_description'])
|
||||
detailed_description = property(
|
||||
lambda self: self.data()['detailed_description'])
|
||||
params = property(lambda self: self.data()['params'])
|
||||
|
||||
|
||||
Base.mem_classes.append(DoxyFunction)
|
||||
|
||||
|
||||
|
@ -156,9 +138,11 @@ class DoxyParam(DoxyMember):
|
|||
return '\n\n'.join(descriptions)
|
||||
|
||||
brief_description = property(lambda self: self.data()['brief_description'])
|
||||
detailed_description = property(lambda self: self.data()['detailed_description'])
|
||||
detailed_description = property(
|
||||
lambda self: self.data()['detailed_description'])
|
||||
name = property(lambda self: self.data()['declname'])
|
||||
|
||||
|
||||
class DoxyParameterItem(DoxyMember):
|
||||
"""A different representation of a parameter in Doxygen."""
|
||||
|
||||
|
@ -200,9 +184,11 @@ class DoxyClass(DoxyCompound):
|
|||
self.process_memberdefs()
|
||||
|
||||
brief_description = property(lambda self: self.data()['brief_description'])
|
||||
detailed_description = property(lambda self: self.data()['detailed_description'])
|
||||
detailed_description = property(
|
||||
lambda self: self.data()['detailed_description'])
|
||||
params = property(lambda self: self.data()['params'])
|
||||
|
||||
|
||||
Base.mem_classes.append(DoxyClass)
|
||||
|
||||
|
||||
|
@ -223,7 +209,9 @@ class DoxyFile(DoxyCompound):
|
|||
self.process_memberdefs()
|
||||
|
||||
brief_description = property(lambda self: self.data()['brief_description'])
|
||||
detailed_description = property(lambda self: self.data()['detailed_description'])
|
||||
detailed_description = property(
|
||||
lambda self: self.data()['detailed_description'])
|
||||
|
||||
|
||||
Base.mem_classes.append(DoxyFile)
|
||||
|
||||
|
@ -244,6 +232,7 @@ class DoxyNamespace(DoxyCompound):
|
|||
return
|
||||
self.process_memberdefs()
|
||||
|
||||
|
||||
Base.mem_classes.append(DoxyNamespace)
|
||||
|
||||
|
||||
|
@ -287,6 +276,7 @@ class DoxyFriend(DoxyMember):
|
|||
|
||||
kind = 'friend'
|
||||
|
||||
|
||||
Base.mem_classes.append(DoxyFriend)
|
||||
|
||||
|
||||
|
@ -301,4 +291,5 @@ class DoxyOther(Base):
|
|||
def can_parse(cls, obj):
|
||||
return obj.kind in cls.kinds
|
||||
|
||||
|
||||
Base.mem_classes.append(DoxyOther)
|
||||
|
|
|
@ -5,4 +5,3 @@ These do the real work of parsing the doxygen xml files but the
|
|||
resultant classes are not very friendly to navigate so the rest of the
|
||||
doxyxml module processes them further.
|
||||
"""
|
||||
from __future__ import unicode_literals
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
"""
|
||||
Generated Mon Feb 9 19:08:05 2009 by generateDS.py.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
from __future__ import unicode_literals
|
||||
|
||||
|
||||
from xml.dom import minidom
|
||||
|
@ -24,13 +22,15 @@ class DoxygenTypeSub(supermod.DoxygenType):
|
|||
|
||||
return self.compounddef.find(details)
|
||||
|
||||
|
||||
supermod.DoxygenType.subclass = DoxygenTypeSub
|
||||
# end class DoxygenTypeSub
|
||||
|
||||
|
||||
class compounddefTypeSub(supermod.compounddefType):
|
||||
def __init__(self, kind=None, prot=None, id=None, compoundname='', title='', basecompoundref=None, derivedcompoundref=None, includes=None, includedby=None, incdepgraph=None, invincdepgraph=None, innerdir=None, innerfile=None, innerclass=None, innernamespace=None, innerpage=None, innergroup=None, templateparamlist=None, sectiondef=None, briefdescription=None, detaileddescription=None, inheritancegraph=None, collaborationgraph=None, programlisting=None, location=None, listofallmembers=None):
|
||||
supermod.compounddefType.__init__(self, kind, prot, id, compoundname, title, basecompoundref, derivedcompoundref, includes, includedby, incdepgraph, invincdepgraph, innerdir, innerfile, innerclass, innernamespace, innerpage, innergroup, templateparamlist, sectiondef, briefdescription, detaileddescription, inheritancegraph, collaborationgraph, programlisting, location, listofallmembers)
|
||||
supermod.compounddefType.__init__(self, kind, prot, id, compoundname, title, basecompoundref, derivedcompoundref, includes, includedby, incdepgraph, invincdepgraph, innerdir, innerfile, innerclass,
|
||||
innernamespace, innerpage, innergroup, templateparamlist, sectiondef, briefdescription, detaileddescription, inheritancegraph, collaborationgraph, programlisting, location, listofallmembers)
|
||||
|
||||
def find(self, details):
|
||||
|
||||
|
@ -50,13 +50,18 @@ supermod.compounddefType.subclass = compounddefTypeSub
|
|||
class listofallmembersTypeSub(supermod.listofallmembersType):
|
||||
def __init__(self, member=None):
|
||||
supermod.listofallmembersType.__init__(self, member)
|
||||
|
||||
|
||||
supermod.listofallmembersType.subclass = listofallmembersTypeSub
|
||||
# end class listofallmembersTypeSub
|
||||
|
||||
|
||||
class memberRefTypeSub(supermod.memberRefType):
|
||||
def __init__(self, virt=None, prot=None, refid=None, ambiguityscope=None, scope='', name=''):
|
||||
supermod.memberRefType.__init__(self, virt, prot, refid, ambiguityscope, scope, name)
|
||||
supermod.memberRefType.__init__(
|
||||
self, virt, prot, refid, ambiguityscope, scope, name)
|
||||
|
||||
|
||||
supermod.memberRefType.subclass = memberRefTypeSub
|
||||
# end class memberRefTypeSub
|
||||
|
||||
|
@ -64,6 +69,8 @@ supermod.memberRefType.subclass = memberRefTypeSub
|
|||
class compoundRefTypeSub(supermod.compoundRefType):
|
||||
def __init__(self, virt=None, prot=None, refid=None, valueOf_='', mixedclass_=None, content_=None):
|
||||
supermod.compoundRefType.__init__(self, mixedclass_, content_)
|
||||
|
||||
|
||||
supermod.compoundRefType.subclass = compoundRefTypeSub
|
||||
# end class compoundRefTypeSub
|
||||
|
||||
|
@ -71,6 +78,8 @@ supermod.compoundRefType.subclass = compoundRefTypeSub
|
|||
class reimplementTypeSub(supermod.reimplementType):
|
||||
def __init__(self, refid=None, valueOf_='', mixedclass_=None, content_=None):
|
||||
supermod.reimplementType.__init__(self, mixedclass_, content_)
|
||||
|
||||
|
||||
supermod.reimplementType.subclass = reimplementTypeSub
|
||||
# end class reimplementTypeSub
|
||||
|
||||
|
@ -78,6 +87,8 @@ supermod.reimplementType.subclass = reimplementTypeSub
|
|||
class incTypeSub(supermod.incType):
|
||||
def __init__(self, local=None, refid=None, valueOf_='', mixedclass_=None, content_=None):
|
||||
supermod.incType.__init__(self, mixedclass_, content_)
|
||||
|
||||
|
||||
supermod.incType.subclass = incTypeSub
|
||||
# end class incTypeSub
|
||||
|
||||
|
@ -85,23 +96,26 @@ supermod.incType.subclass = incTypeSub
|
|||
class refTypeSub(supermod.refType):
|
||||
def __init__(self, prot=None, refid=None, valueOf_='', mixedclass_=None, content_=None):
|
||||
supermod.refType.__init__(self, mixedclass_, content_)
|
||||
|
||||
|
||||
supermod.refType.subclass = refTypeSub
|
||||
# end class refTypeSub
|
||||
|
||||
|
||||
|
||||
class refTextTypeSub(supermod.refTextType):
|
||||
def __init__(self, refid=None, kindref=None, external=None, valueOf_='', mixedclass_=None, content_=None):
|
||||
supermod.refTextType.__init__(self, mixedclass_, content_)
|
||||
|
||||
|
||||
supermod.refTextType.subclass = refTextTypeSub
|
||||
# end class refTextTypeSub
|
||||
|
||||
|
||||
class sectiondefTypeSub(supermod.sectiondefType):
|
||||
|
||||
|
||||
def __init__(self, kind=None, header='', description=None, memberdef=None):
|
||||
supermod.sectiondefType.__init__(self, kind, header, description, memberdef)
|
||||
supermod.sectiondefType.__init__(
|
||||
self, kind, header, description, memberdef)
|
||||
|
||||
def find(self, details):
|
||||
|
||||
|
@ -118,7 +132,10 @@ supermod.sectiondefType.subclass = sectiondefTypeSub
|
|||
|
||||
class memberdefTypeSub(supermod.memberdefType):
|
||||
def __init__(self, initonly=None, kind=None, volatile=None, const=None, raise_=None, virt=None, readable=None, prot=None, explicit=None, new=None, final=None, writable=None, add=None, static=None, remove=None, sealed=None, mutable=None, gettable=None, inline=None, settable=None, id=None, templateparamlist=None, type_=None, definition='', argsstring='', name='', read='', write='', bitfield='', reimplements=None, reimplementedby=None, param=None, enumvalue=None, initializer=None, exceptions=None, briefdescription=None, detaileddescription=None, inbodydescription=None, location=None, references=None, referencedby=None):
|
||||
supermod.memberdefType.__init__(self, initonly, kind, volatile, const, raise_, virt, readable, prot, explicit, new, final, writable, add, static, remove, sealed, mutable, gettable, inline, settable, id, templateparamlist, type_, definition, argsstring, name, read, write, bitfield, reimplements, reimplementedby, param, enumvalue, initializer, exceptions, briefdescription, detaileddescription, inbodydescription, location, references, referencedby)
|
||||
supermod.memberdefType.__init__(self, initonly, kind, volatile, const, raise_, virt, readable, prot, explicit, new, final, writable, add, static, remove, sealed, mutable, gettable, inline, settable, id, templateparamlist, type_,
|
||||
definition, argsstring, name, read, write, bitfield, reimplements, reimplementedby, param, enumvalue, initializer, exceptions, briefdescription, detaileddescription, inbodydescription, location, references, referencedby)
|
||||
|
||||
|
||||
supermod.memberdefType.subclass = memberdefTypeSub
|
||||
# end class memberdefTypeSub
|
||||
|
||||
|
@ -126,6 +143,8 @@ supermod.memberdefType.subclass = memberdefTypeSub
|
|||
class descriptionTypeSub(supermod.descriptionType):
|
||||
def __init__(self, title='', para=None, sect1=None, internal=None, mixedclass_=None, content_=None):
|
||||
supermod.descriptionType.__init__(self, mixedclass_, content_)
|
||||
|
||||
|
||||
supermod.descriptionType.subclass = descriptionTypeSub
|
||||
# end class descriptionTypeSub
|
||||
|
||||
|
@ -133,6 +152,8 @@ supermod.descriptionType.subclass = descriptionTypeSub
|
|||
class enumvalueTypeSub(supermod.enumvalueType):
|
||||
def __init__(self, prot=None, id=None, name='', initializer=None, briefdescription=None, detaileddescription=None, mixedclass_=None, content_=None):
|
||||
supermod.enumvalueType.__init__(self, mixedclass_, content_)
|
||||
|
||||
|
||||
supermod.enumvalueType.subclass = enumvalueTypeSub
|
||||
# end class enumvalueTypeSub
|
||||
|
||||
|
@ -140,13 +161,18 @@ supermod.enumvalueType.subclass = enumvalueTypeSub
|
|||
class templateparamlistTypeSub(supermod.templateparamlistType):
|
||||
def __init__(self, param=None):
|
||||
supermod.templateparamlistType.__init__(self, param)
|
||||
|
||||
|
||||
supermod.templateparamlistType.subclass = templateparamlistTypeSub
|
||||
# end class templateparamlistTypeSub
|
||||
|
||||
|
||||
class paramTypeSub(supermod.paramType):
|
||||
def __init__(self, type_=None, declname='', defname='', array='', defval=None, briefdescription=None):
|
||||
supermod.paramType.__init__(self, type_, declname, defname, array, defval, briefdescription)
|
||||
supermod.paramType.__init__(
|
||||
self, type_, declname, defname, array, defval, briefdescription)
|
||||
|
||||
|
||||
supermod.paramType.subclass = paramTypeSub
|
||||
# end class paramTypeSub
|
||||
|
||||
|
@ -154,6 +180,8 @@ supermod.paramType.subclass = paramTypeSub
|
|||
class linkedTextTypeSub(supermod.linkedTextType):
|
||||
def __init__(self, ref=None, mixedclass_=None, content_=None):
|
||||
supermod.linkedTextType.__init__(self, mixedclass_, content_)
|
||||
|
||||
|
||||
supermod.linkedTextType.subclass = linkedTextTypeSub
|
||||
# end class linkedTextTypeSub
|
||||
|
||||
|
@ -161,6 +189,8 @@ supermod.linkedTextType.subclass = linkedTextTypeSub
|
|||
class graphTypeSub(supermod.graphType):
|
||||
def __init__(self, node=None):
|
||||
supermod.graphType.__init__(self, node)
|
||||
|
||||
|
||||
supermod.graphType.subclass = graphTypeSub
|
||||
# end class graphTypeSub
|
||||
|
||||
|
@ -168,6 +198,8 @@ supermod.graphType.subclass = graphTypeSub
|
|||
class nodeTypeSub(supermod.nodeType):
|
||||
def __init__(self, id=None, label='', link=None, childnode=None):
|
||||
supermod.nodeType.__init__(self, id, label, link, childnode)
|
||||
|
||||
|
||||
supermod.nodeType.subclass = nodeTypeSub
|
||||
# end class nodeTypeSub
|
||||
|
||||
|
@ -175,6 +207,8 @@ supermod.nodeType.subclass = nodeTypeSub
|
|||
class childnodeTypeSub(supermod.childnodeType):
|
||||
def __init__(self, relation=None, refid=None, edgelabel=None):
|
||||
supermod.childnodeType.__init__(self, relation, refid, edgelabel)
|
||||
|
||||
|
||||
supermod.childnodeType.subclass = childnodeTypeSub
|
||||
# end class childnodeTypeSub
|
||||
|
||||
|
@ -182,6 +216,8 @@ supermod.childnodeType.subclass = childnodeTypeSub
|
|||
class linkTypeSub(supermod.linkType):
|
||||
def __init__(self, refid=None, external=None, valueOf_=''):
|
||||
supermod.linkType.__init__(self, refid, external)
|
||||
|
||||
|
||||
supermod.linkType.subclass = linkTypeSub
|
||||
# end class linkTypeSub
|
||||
|
||||
|
@ -189,13 +225,18 @@ supermod.linkType.subclass = linkTypeSub
|
|||
class listingTypeSub(supermod.listingType):
|
||||
def __init__(self, codeline=None):
|
||||
supermod.listingType.__init__(self, codeline)
|
||||
|
||||
|
||||
supermod.listingType.subclass = listingTypeSub
|
||||
# end class listingTypeSub
|
||||
|
||||
|
||||
class codelineTypeSub(supermod.codelineType):
|
||||
def __init__(self, external=None, lineno=None, refkind=None, refid=None, highlight=None):
|
||||
supermod.codelineType.__init__(self, external, lineno, refkind, refid, highlight)
|
||||
supermod.codelineType.__init__(
|
||||
self, external, lineno, refkind, refid, highlight)
|
||||
|
||||
|
||||
supermod.codelineType.subclass = codelineTypeSub
|
||||
# end class codelineTypeSub
|
||||
|
||||
|
@ -203,6 +244,8 @@ supermod.codelineType.subclass = codelineTypeSub
|
|||
class highlightTypeSub(supermod.highlightType):
|
||||
def __init__(self, class_=None, sp=None, ref=None, mixedclass_=None, content_=None):
|
||||
supermod.highlightType.__init__(self, mixedclass_, content_)
|
||||
|
||||
|
||||
supermod.highlightType.subclass = highlightTypeSub
|
||||
# end class highlightTypeSub
|
||||
|
||||
|
@ -210,13 +253,18 @@ supermod.highlightType.subclass = highlightTypeSub
|
|||
class referenceTypeSub(supermod.referenceType):
|
||||
def __init__(self, endline=None, startline=None, refid=None, compoundref=None, valueOf_='', mixedclass_=None, content_=None):
|
||||
supermod.referenceType.__init__(self, mixedclass_, content_)
|
||||
|
||||
|
||||
supermod.referenceType.subclass = referenceTypeSub
|
||||
# end class referenceTypeSub
|
||||
|
||||
|
||||
class locationTypeSub(supermod.locationType):
|
||||
def __init__(self, bodystart=None, line=None, bodyend=None, bodyfile=None, file=None, valueOf_=''):
|
||||
supermod.locationType.__init__(self, bodystart, line, bodyend, bodyfile, file)
|
||||
supermod.locationType.__init__(
|
||||
self, bodystart, line, bodyend, bodyfile, file)
|
||||
|
||||
|
||||
supermod.locationType.subclass = locationTypeSub
|
||||
# end class locationTypeSub
|
||||
|
||||
|
@ -224,6 +272,8 @@ supermod.locationType.subclass = locationTypeSub
|
|||
class docSect1TypeSub(supermod.docSect1Type):
|
||||
def __init__(self, id=None, title='', para=None, sect2=None, internal=None, mixedclass_=None, content_=None):
|
||||
supermod.docSect1Type.__init__(self, mixedclass_, content_)
|
||||
|
||||
|
||||
supermod.docSect1Type.subclass = docSect1TypeSub
|
||||
# end class docSect1TypeSub
|
||||
|
||||
|
@ -231,6 +281,8 @@ supermod.docSect1Type.subclass = docSect1TypeSub
|
|||
class docSect2TypeSub(supermod.docSect2Type):
|
||||
def __init__(self, id=None, title='', para=None, sect3=None, internal=None, mixedclass_=None, content_=None):
|
||||
supermod.docSect2Type.__init__(self, mixedclass_, content_)
|
||||
|
||||
|
||||
supermod.docSect2Type.subclass = docSect2TypeSub
|
||||
# end class docSect2TypeSub
|
||||
|
||||
|
@ -238,6 +290,8 @@ supermod.docSect2Type.subclass = docSect2TypeSub
|
|||
class docSect3TypeSub(supermod.docSect3Type):
|
||||
def __init__(self, id=None, title='', para=None, sect4=None, internal=None, mixedclass_=None, content_=None):
|
||||
supermod.docSect3Type.__init__(self, mixedclass_, content_)
|
||||
|
||||
|
||||
supermod.docSect3Type.subclass = docSect3TypeSub
|
||||
# end class docSect3TypeSub
|
||||
|
||||
|
@ -245,6 +299,8 @@ supermod.docSect3Type.subclass = docSect3TypeSub
|
|||
class docSect4TypeSub(supermod.docSect4Type):
|
||||
def __init__(self, id=None, title='', para=None, internal=None, mixedclass_=None, content_=None):
|
||||
supermod.docSect4Type.__init__(self, mixedclass_, content_)
|
||||
|
||||
|
||||
supermod.docSect4Type.subclass = docSect4TypeSub
|
||||
# end class docSect4TypeSub
|
||||
|
||||
|
@ -252,6 +308,8 @@ supermod.docSect4Type.subclass = docSect4TypeSub
|
|||
class docInternalTypeSub(supermod.docInternalType):
|
||||
def __init__(self, para=None, sect1=None, mixedclass_=None, content_=None):
|
||||
supermod.docInternalType.__init__(self, mixedclass_, content_)
|
||||
|
||||
|
||||
supermod.docInternalType.subclass = docInternalTypeSub
|
||||
# end class docInternalTypeSub
|
||||
|
||||
|
@ -259,6 +317,8 @@ supermod.docInternalType.subclass = docInternalTypeSub
|
|||
class docInternalS1TypeSub(supermod.docInternalS1Type):
|
||||
def __init__(self, para=None, sect2=None, mixedclass_=None, content_=None):
|
||||
supermod.docInternalS1Type.__init__(self, mixedclass_, content_)
|
||||
|
||||
|
||||
supermod.docInternalS1Type.subclass = docInternalS1TypeSub
|
||||
# end class docInternalS1TypeSub
|
||||
|
||||
|
@ -266,6 +326,8 @@ supermod.docInternalS1Type.subclass = docInternalS1TypeSub
|
|||
class docInternalS2TypeSub(supermod.docInternalS2Type):
|
||||
def __init__(self, para=None, sect3=None, mixedclass_=None, content_=None):
|
||||
supermod.docInternalS2Type.__init__(self, mixedclass_, content_)
|
||||
|
||||
|
||||
supermod.docInternalS2Type.subclass = docInternalS2TypeSub
|
||||
# end class docInternalS2TypeSub
|
||||
|
||||
|
@ -273,6 +335,8 @@ supermod.docInternalS2Type.subclass = docInternalS2TypeSub
|
|||
class docInternalS3TypeSub(supermod.docInternalS3Type):
|
||||
def __init__(self, para=None, sect3=None, mixedclass_=None, content_=None):
|
||||
supermod.docInternalS3Type.__init__(self, mixedclass_, content_)
|
||||
|
||||
|
||||
supermod.docInternalS3Type.subclass = docInternalS3TypeSub
|
||||
# end class docInternalS3TypeSub
|
||||
|
||||
|
@ -280,6 +344,8 @@ supermod.docInternalS3Type.subclass = docInternalS3TypeSub
|
|||
class docInternalS4TypeSub(supermod.docInternalS4Type):
|
||||
def __init__(self, para=None, mixedclass_=None, content_=None):
|
||||
supermod.docInternalS4Type.__init__(self, mixedclass_, content_)
|
||||
|
||||
|
||||
supermod.docInternalS4Type.subclass = docInternalS4TypeSub
|
||||
# end class docInternalS4TypeSub
|
||||
|
||||
|
@ -287,6 +353,8 @@ supermod.docInternalS4Type.subclass = docInternalS4TypeSub
|
|||
class docURLLinkSub(supermod.docURLLink):
|
||||
def __init__(self, url=None, valueOf_='', mixedclass_=None, content_=None):
|
||||
supermod.docURLLink.__init__(self, mixedclass_, content_)
|
||||
|
||||
|
||||
supermod.docURLLink.subclass = docURLLinkSub
|
||||
# end class docURLLinkSub
|
||||
|
||||
|
@ -294,6 +362,8 @@ supermod.docURLLink.subclass = docURLLinkSub
|
|||
class docAnchorTypeSub(supermod.docAnchorType):
|
||||
def __init__(self, id=None, valueOf_='', mixedclass_=None, content_=None):
|
||||
supermod.docAnchorType.__init__(self, mixedclass_, content_)
|
||||
|
||||
|
||||
supermod.docAnchorType.subclass = docAnchorTypeSub
|
||||
# end class docAnchorTypeSub
|
||||
|
||||
|
@ -301,6 +371,8 @@ supermod.docAnchorType.subclass = docAnchorTypeSub
|
|||
class docFormulaTypeSub(supermod.docFormulaType):
|
||||
def __init__(self, id=None, valueOf_='', mixedclass_=None, content_=None):
|
||||
supermod.docFormulaType.__init__(self, mixedclass_, content_)
|
||||
|
||||
|
||||
supermod.docFormulaType.subclass = docFormulaTypeSub
|
||||
# end class docFormulaTypeSub
|
||||
|
||||
|
@ -308,6 +380,8 @@ supermod.docFormulaType.subclass = docFormulaTypeSub
|
|||
class docIndexEntryTypeSub(supermod.docIndexEntryType):
|
||||
def __init__(self, primaryie='', secondaryie=''):
|
||||
supermod.docIndexEntryType.__init__(self, primaryie, secondaryie)
|
||||
|
||||
|
||||
supermod.docIndexEntryType.subclass = docIndexEntryTypeSub
|
||||
# end class docIndexEntryTypeSub
|
||||
|
||||
|
@ -315,6 +389,8 @@ supermod.docIndexEntryType.subclass = docIndexEntryTypeSub
|
|||
class docListTypeSub(supermod.docListType):
|
||||
def __init__(self, listitem=None):
|
||||
supermod.docListType.__init__(self, listitem)
|
||||
|
||||
|
||||
supermod.docListType.subclass = docListTypeSub
|
||||
# end class docListTypeSub
|
||||
|
||||
|
@ -322,6 +398,8 @@ supermod.docListType.subclass = docListTypeSub
|
|||
class docListItemTypeSub(supermod.docListItemType):
|
||||
def __init__(self, para=None):
|
||||
supermod.docListItemType.__init__(self, para)
|
||||
|
||||
|
||||
supermod.docListItemType.subclass = docListItemTypeSub
|
||||
# end class docListItemTypeSub
|
||||
|
||||
|
@ -329,6 +407,8 @@ supermod.docListItemType.subclass = docListItemTypeSub
|
|||
class docSimpleSectTypeSub(supermod.docSimpleSectType):
|
||||
def __init__(self, kind=None, title=None, para=None):
|
||||
supermod.docSimpleSectType.__init__(self, kind, title, para)
|
||||
|
||||
|
||||
supermod.docSimpleSectType.subclass = docSimpleSectTypeSub
|
||||
# end class docSimpleSectTypeSub
|
||||
|
||||
|
@ -336,6 +416,8 @@ supermod.docSimpleSectType.subclass = docSimpleSectTypeSub
|
|||
class docVarListEntryTypeSub(supermod.docVarListEntryType):
|
||||
def __init__(self, term=None):
|
||||
supermod.docVarListEntryType.__init__(self, term)
|
||||
|
||||
|
||||
supermod.docVarListEntryType.subclass = docVarListEntryTypeSub
|
||||
# end class docVarListEntryTypeSub
|
||||
|
||||
|
@ -343,6 +425,8 @@ supermod.docVarListEntryType.subclass = docVarListEntryTypeSub
|
|||
class docRefTextTypeSub(supermod.docRefTextType):
|
||||
def __init__(self, refid=None, kindref=None, external=None, valueOf_='', mixedclass_=None, content_=None):
|
||||
supermod.docRefTextType.__init__(self, mixedclass_, content_)
|
||||
|
||||
|
||||
supermod.docRefTextType.subclass = docRefTextTypeSub
|
||||
# end class docRefTextTypeSub
|
||||
|
||||
|
@ -350,6 +434,8 @@ supermod.docRefTextType.subclass = docRefTextTypeSub
|
|||
class docTableTypeSub(supermod.docTableType):
|
||||
def __init__(self, rows=None, cols=None, row=None, caption=None):
|
||||
supermod.docTableType.__init__(self, rows, cols, row, caption)
|
||||
|
||||
|
||||
supermod.docTableType.subclass = docTableTypeSub
|
||||
# end class docTableTypeSub
|
||||
|
||||
|
@ -357,6 +443,8 @@ supermod.docTableType.subclass = docTableTypeSub
|
|||
class docRowTypeSub(supermod.docRowType):
|
||||
def __init__(self, entry=None):
|
||||
supermod.docRowType.__init__(self, entry)
|
||||
|
||||
|
||||
supermod.docRowType.subclass = docRowTypeSub
|
||||
# end class docRowTypeSub
|
||||
|
||||
|
@ -364,6 +452,8 @@ supermod.docRowType.subclass = docRowTypeSub
|
|||
class docEntryTypeSub(supermod.docEntryType):
|
||||
def __init__(self, thead=None, para=None):
|
||||
supermod.docEntryType.__init__(self, thead, para)
|
||||
|
||||
|
||||
supermod.docEntryType.subclass = docEntryTypeSub
|
||||
# end class docEntryTypeSub
|
||||
|
||||
|
@ -371,6 +461,8 @@ supermod.docEntryType.subclass = docEntryTypeSub
|
|||
class docHeadingTypeSub(supermod.docHeadingType):
|
||||
def __init__(self, level=None, valueOf_='', mixedclass_=None, content_=None):
|
||||
supermod.docHeadingType.__init__(self, mixedclass_, content_)
|
||||
|
||||
|
||||
supermod.docHeadingType.subclass = docHeadingTypeSub
|
||||
# end class docHeadingTypeSub
|
||||
|
||||
|
@ -378,6 +470,8 @@ supermod.docHeadingType.subclass = docHeadingTypeSub
|
|||
class docImageTypeSub(supermod.docImageType):
|
||||
def __init__(self, width=None, type_=None, name=None, height=None, valueOf_='', mixedclass_=None, content_=None):
|
||||
supermod.docImageType.__init__(self, mixedclass_, content_)
|
||||
|
||||
|
||||
supermod.docImageType.subclass = docImageTypeSub
|
||||
# end class docImageTypeSub
|
||||
|
||||
|
@ -385,6 +479,8 @@ supermod.docImageType.subclass = docImageTypeSub
|
|||
class docDotFileTypeSub(supermod.docDotFileType):
|
||||
def __init__(self, name=None, valueOf_='', mixedclass_=None, content_=None):
|
||||
supermod.docDotFileType.__init__(self, mixedclass_, content_)
|
||||
|
||||
|
||||
supermod.docDotFileType.subclass = docDotFileTypeSub
|
||||
# end class docDotFileTypeSub
|
||||
|
||||
|
@ -392,6 +488,8 @@ supermod.docDotFileType.subclass = docDotFileTypeSub
|
|||
class docTocItemTypeSub(supermod.docTocItemType):
|
||||
def __init__(self, id=None, valueOf_='', mixedclass_=None, content_=None):
|
||||
supermod.docTocItemType.__init__(self, mixedclass_, content_)
|
||||
|
||||
|
||||
supermod.docTocItemType.subclass = docTocItemTypeSub
|
||||
# end class docTocItemTypeSub
|
||||
|
||||
|
@ -399,6 +497,8 @@ supermod.docTocItemType.subclass = docTocItemTypeSub
|
|||
class docTocListTypeSub(supermod.docTocListType):
|
||||
def __init__(self, tocitem=None):
|
||||
supermod.docTocListType.__init__(self, tocitem)
|
||||
|
||||
|
||||
supermod.docTocListType.subclass = docTocListTypeSub
|
||||
# end class docTocListTypeSub
|
||||
|
||||
|
@ -406,6 +506,8 @@ supermod.docTocListType.subclass = docTocListTypeSub
|
|||
class docLanguageTypeSub(supermod.docLanguageType):
|
||||
def __init__(self, langid=None, para=None):
|
||||
supermod.docLanguageType.__init__(self, langid, para)
|
||||
|
||||
|
||||
supermod.docLanguageType.subclass = docLanguageTypeSub
|
||||
# end class docLanguageTypeSub
|
||||
|
||||
|
@ -413,13 +515,18 @@ supermod.docLanguageType.subclass = docLanguageTypeSub
|
|||
class docParamListTypeSub(supermod.docParamListType):
|
||||
def __init__(self, kind=None, parameteritem=None):
|
||||
supermod.docParamListType.__init__(self, kind, parameteritem)
|
||||
|
||||
|
||||
supermod.docParamListType.subclass = docParamListTypeSub
|
||||
# end class docParamListTypeSub
|
||||
|
||||
|
||||
class docParamListItemSub(supermod.docParamListItem):
|
||||
def __init__(self, parameternamelist=None, parameterdescription=None):
|
||||
supermod.docParamListItem.__init__(self, parameternamelist, parameterdescription)
|
||||
supermod.docParamListItem.__init__(
|
||||
self, parameternamelist, parameterdescription)
|
||||
|
||||
|
||||
supermod.docParamListItem.subclass = docParamListItemSub
|
||||
# end class docParamListItemSub
|
||||
|
||||
|
@ -427,6 +534,8 @@ supermod.docParamListItem.subclass = docParamListItemSub
|
|||
class docParamNameListSub(supermod.docParamNameList):
|
||||
def __init__(self, parametername=None):
|
||||
supermod.docParamNameList.__init__(self, parametername)
|
||||
|
||||
|
||||
supermod.docParamNameList.subclass = docParamNameListSub
|
||||
# end class docParamNameListSub
|
||||
|
||||
|
@ -434,6 +543,8 @@ supermod.docParamNameList.subclass = docParamNameListSub
|
|||
class docParamNameSub(supermod.docParamName):
|
||||
def __init__(self, direction=None, ref=None, mixedclass_=None, content_=None):
|
||||
supermod.docParamName.__init__(self, mixedclass_, content_)
|
||||
|
||||
|
||||
supermod.docParamName.subclass = docParamNameSub
|
||||
# end class docParamNameSub
|
||||
|
||||
|
@ -441,6 +552,8 @@ supermod.docParamName.subclass = docParamNameSub
|
|||
class docXRefSectTypeSub(supermod.docXRefSectType):
|
||||
def __init__(self, id=None, xreftitle=None, xrefdescription=None):
|
||||
supermod.docXRefSectType.__init__(self, id, xreftitle, xrefdescription)
|
||||
|
||||
|
||||
supermod.docXRefSectType.subclass = docXRefSectTypeSub
|
||||
# end class docXRefSectTypeSub
|
||||
|
||||
|
@ -448,6 +561,8 @@ supermod.docXRefSectType.subclass = docXRefSectTypeSub
|
|||
class docCopyTypeSub(supermod.docCopyType):
|
||||
def __init__(self, link=None, para=None, sect1=None, internal=None):
|
||||
supermod.docCopyType.__init__(self, link, para, sect1, internal)
|
||||
|
||||
|
||||
supermod.docCopyType.subclass = docCopyTypeSub
|
||||
# end class docCopyTypeSub
|
||||
|
||||
|
@ -455,9 +570,12 @@ supermod.docCopyType.subclass = docCopyTypeSub
|
|||
class docCharTypeSub(supermod.docCharType):
|
||||
def __init__(self, char=None, valueOf_=''):
|
||||
supermod.docCharType.__init__(self, char)
|
||||
|
||||
|
||||
supermod.docCharType.subclass = docCharTypeSub
|
||||
# end class docCharTypeSub
|
||||
|
||||
|
||||
class docParaTypeSub(supermod.docParaType):
|
||||
def __init__(self, char=None, valueOf_=''):
|
||||
supermod.docParaType.__init__(self, char)
|
||||
|
@ -471,7 +589,7 @@ class docParaTypeSub(supermod.docParaType):
|
|||
|
||||
if child_.nodeType == Node.TEXT_NODE:
|
||||
obj_ = self.mixedclass_(MixedContainer.CategoryText,
|
||||
MixedContainer.TypeNone, '', child_.nodeValue)
|
||||
MixedContainer.TypeNone, '', child_.nodeValue)
|
||||
self.content.append(obj_)
|
||||
elif child_.nodeType == Node.ELEMENT_NODE and \
|
||||
nodeName_ == "ref":
|
||||
|
@ -494,12 +612,9 @@ supermod.docParaType.subclass = docParaTypeSub
|
|||
# end class docParaTypeSub
|
||||
|
||||
|
||||
|
||||
def parse(inFilename):
|
||||
doc = minidom.parse(inFilename)
|
||||
rootNode = doc.documentElement
|
||||
rootObj = supermod.DoxygenType.factory()
|
||||
rootObj.build(rootNode)
|
||||
return rootObj
|
||||
|
||||
|
||||
|
|
Plik diff jest za duży
Load Diff
|
@ -3,8 +3,6 @@
|
|||
"""
|
||||
Generated Mon Feb 9 19:08:05 2009 by generateDS.py.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from xml.dom import minidom
|
||||
|
||||
|
@ -14,6 +12,7 @@ from . import compound
|
|||
|
||||
from . import indexsuper as supermod
|
||||
|
||||
|
||||
class DoxygenTypeSub(supermod.DoxygenType):
|
||||
def __init__(self, version=None, compound=None):
|
||||
supermod.DoxygenType.__init__(self, version, compound)
|
||||
|
@ -34,6 +33,7 @@ class DoxygenTypeSub(supermod.DoxygenType):
|
|||
|
||||
return results
|
||||
|
||||
|
||||
supermod.DoxygenType.subclass = DoxygenTypeSub
|
||||
# end class DoxygenTypeSub
|
||||
|
||||
|
@ -55,6 +55,7 @@ class CompoundTypeSub(supermod.CompoundType):
|
|||
|
||||
return results
|
||||
|
||||
|
||||
supermod.CompoundType.subclass = CompoundTypeSub
|
||||
# end class CompoundTypeSub
|
||||
|
||||
|
@ -64,6 +65,7 @@ class MemberTypeSub(supermod.MemberType):
|
|||
def __init__(self, kind=None, refid=None, name=''):
|
||||
supermod.MemberType.__init__(self, kind, refid, name)
|
||||
|
||||
|
||||
supermod.MemberType.subclass = MemberTypeSub
|
||||
# end class MemberTypeSub
|
||||
|
||||
|
@ -76,4 +78,3 @@ def parse(inFilename):
|
|||
rootObj.build(rootNode)
|
||||
|
||||
return rootObj
|
||||
|
||||
|
|
|
@ -4,16 +4,12 @@
|
|||
# Generated Thu Jun 11 18:43:54 2009 by generateDS.py.
|
||||
#
|
||||
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import sys
|
||||
|
||||
from xml.dom import minidom
|
||||
from xml.dom import Node
|
||||
|
||||
import six
|
||||
|
||||
#
|
||||
# User methods
|
||||
#
|
||||
|
@ -28,12 +24,16 @@ except ImportError as exp:
|
|||
class GeneratedsSuper(object):
|
||||
def format_string(self, input_data, input_name=''):
|
||||
return input_data
|
||||
|
||||
def format_integer(self, input_data, input_name=''):
|
||||
return '%d' % input_data
|
||||
|
||||
def format_float(self, input_data, input_name=''):
|
||||
return '%f' % input_data
|
||||
|
||||
def format_double(self, input_data, input_name=''):
|
||||
return '%e' % input_data
|
||||
|
||||
def format_boolean(self, input_data, input_name=''):
|
||||
return '%s' % input_data
|
||||
|
||||
|
@ -45,9 +45,9 @@ except ImportError as exp:
|
|||
|
||||
## from IPython.Shell import IPShellEmbed
|
||||
## args = ''
|
||||
## ipshell = IPShellEmbed(args,
|
||||
# ipshell = IPShellEmbed(args,
|
||||
## banner = 'Dropping into IPython',
|
||||
## exit_msg = 'Leaving Interpreter, back to program.')
|
||||
# exit_msg = 'Leaving Interpreter, back to program.')
|
||||
|
||||
# Then use the following line where and when you want to drop into the
|
||||
# IPython shell:
|
||||
|
@ -63,20 +63,23 @@ ExternalEncoding = 'ascii'
|
|||
# Support/utility functions.
|
||||
#
|
||||
|
||||
|
||||
def showIndent(outfile, level):
|
||||
for idx in range(level):
|
||||
outfile.write(' ')
|
||||
|
||||
|
||||
def quote_xml(inStr):
|
||||
s1 = (isinstance(inStr, six.string_types) and inStr or
|
||||
s1 = (isinstance(inStr, str) and inStr or
|
||||
'%s' % inStr)
|
||||
s1 = s1.replace('&', '&')
|
||||
s1 = s1.replace('<', '<')
|
||||
s1 = s1.replace('>', '>')
|
||||
return s1
|
||||
|
||||
|
||||
def quote_attrib(inStr):
|
||||
s1 = (isinstance(inStr, six.string_types) and inStr or
|
||||
s1 = (isinstance(inStr, str) and inStr or
|
||||
'%s' % inStr)
|
||||
s1 = s1.replace('&', '&')
|
||||
s1 = s1.replace('<', '<')
|
||||
|
@ -90,6 +93,7 @@ def quote_attrib(inStr):
|
|||
s1 = '"%s"' % s1
|
||||
return s1
|
||||
|
||||
|
||||
def quote_python(inStr):
|
||||
s1 = inStr
|
||||
if s1.find("'") == -1:
|
||||
|
@ -121,26 +125,33 @@ class MixedContainer(object):
|
|||
TypeDecimal = 5
|
||||
TypeDouble = 6
|
||||
TypeBoolean = 7
|
||||
|
||||
def __init__(self, category, content_type, name, value):
|
||||
self.category = category
|
||||
self.content_type = content_type
|
||||
self.name = name
|
||||
self.value = value
|
||||
|
||||
def getCategory(self):
|
||||
return self.category
|
||||
|
||||
def getContenttype(self, content_type):
|
||||
return self.content_type
|
||||
|
||||
def getValue(self):
|
||||
return self.value
|
||||
|
||||
def getName(self):
|
||||
return self.name
|
||||
|
||||
def export(self, outfile, level, name, namespace):
|
||||
if self.category == MixedContainer.CategoryText:
|
||||
outfile.write(self.value)
|
||||
elif self.category == MixedContainer.CategorySimple:
|
||||
self.exportSimple(outfile, level, name)
|
||||
else: # category == MixedContainer.CategoryComplex
|
||||
self.value.export(outfile, level, namespace,name)
|
||||
self.value.export(outfile, level, namespace, name)
|
||||
|
||||
def exportSimple(self, outfile, level, name):
|
||||
if self.content_type == MixedContainer.TypeString:
|
||||
outfile.write('<%s>%s</%s>' % (self.name, self.value, self.name))
|
||||
|
@ -152,19 +163,20 @@ class MixedContainer(object):
|
|||
outfile.write('<%s>%f</%s>' % (self.name, self.value, self.name))
|
||||
elif self.content_type == MixedContainer.TypeDouble:
|
||||
outfile.write('<%s>%g</%s>' % (self.name, self.value, self.name))
|
||||
|
||||
def exportLiteral(self, outfile, level, name):
|
||||
if self.category == MixedContainer.CategoryText:
|
||||
showIndent(outfile, level)
|
||||
outfile.write('MixedContainer(%d, %d, "%s", "%s"),\n' % \
|
||||
(self.category, self.content_type, self.name, self.value))
|
||||
outfile.write('MixedContainer(%d, %d, "%s", "%s"),\n' %
|
||||
(self.category, self.content_type, self.name, self.value))
|
||||
elif self.category == MixedContainer.CategorySimple:
|
||||
showIndent(outfile, level)
|
||||
outfile.write('MixedContainer(%d, %d, "%s", "%s"),\n' % \
|
||||
(self.category, self.content_type, self.name, self.value))
|
||||
outfile.write('MixedContainer(%d, %d, "%s", "%s"),\n' %
|
||||
(self.category, self.content_type, self.name, self.value))
|
||||
else: # category == MixedContainer.CategoryComplex
|
||||
showIndent(outfile, level)
|
||||
outfile.write('MixedContainer(%d, %d, "%s",\n' % \
|
||||
(self.category, self.content_type, self.name,))
|
||||
outfile.write('MixedContainer(%d, %d, "%s",\n' %
|
||||
(self.category, self.content_type, self.name,))
|
||||
self.value.exportLiteral(outfile, level + 1)
|
||||
showIndent(outfile, level)
|
||||
outfile.write(')\n')
|
||||
|
@ -175,6 +187,7 @@ class _MemberSpec(object):
|
|||
self.name = name
|
||||
self.data_type = data_type
|
||||
self.container = container
|
||||
|
||||
def set_name(self, name): self.name = name
|
||||
def get_name(self): return self.name
|
||||
def set_data_type(self, data_type): self.data_type = data_type
|
||||
|
@ -190,12 +203,14 @@ class _MemberSpec(object):
|
|||
class DoxygenType(GeneratedsSuper):
|
||||
subclass = None
|
||||
superclass = None
|
||||
|
||||
def __init__(self, version=None, compound=None):
|
||||
self.version = version
|
||||
if compound is None:
|
||||
self.compound = []
|
||||
else:
|
||||
self.compound = compound
|
||||
|
||||
def factory(*args_, **kwargs_):
|
||||
if DoxygenType.subclass:
|
||||
return DoxygenType.subclass(*args_, **kwargs_)
|
||||
|
@ -208,6 +223,7 @@ class DoxygenType(GeneratedsSuper):
|
|||
def insert_compound(self, index, value): self.compound[index] = value
|
||||
def get_version(self): return self.version
|
||||
def set_version(self, version): self.version = version
|
||||
|
||||
def export(self, outfile, level, namespace_='', name_='DoxygenType', namespacedef_=''):
|
||||
showIndent(outfile, level)
|
||||
outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))
|
||||
|
@ -219,27 +235,34 @@ class DoxygenType(GeneratedsSuper):
|
|||
outfile.write('</%s%s>\n' % (namespace_, name_))
|
||||
else:
|
||||
outfile.write(' />\n')
|
||||
|
||||
def exportAttributes(self, outfile, level, namespace_='', name_='DoxygenType'):
|
||||
outfile.write(' version=%s' % (self.format_string(quote_attrib(self.version).encode(ExternalEncoding), input_name='version'), ))
|
||||
outfile.write(' version=%s' % (self.format_string(quote_attrib(
|
||||
self.version).encode(ExternalEncoding), input_name='version'), ))
|
||||
|
||||
def exportChildren(self, outfile, level, namespace_='', name_='DoxygenType'):
|
||||
for compound_ in self.compound:
|
||||
compound_.export(outfile, level, namespace_, name_='compound')
|
||||
|
||||
def hasContent_(self):
|
||||
if (
|
||||
self.compound is not None
|
||||
):
|
||||
):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def exportLiteral(self, outfile, level, name_='DoxygenType'):
|
||||
level += 1
|
||||
self.exportLiteralAttributes(outfile, level, name_)
|
||||
if self.hasContent_():
|
||||
self.exportLiteralChildren(outfile, level, name_)
|
||||
|
||||
def exportLiteralAttributes(self, outfile, level, name_):
|
||||
if self.version is not None:
|
||||
showIndent(outfile, level)
|
||||
outfile.write('version = %s,\n' % (self.version,))
|
||||
|
||||
def exportLiteralChildren(self, outfile, level, name_):
|
||||
showIndent(outfile, level)
|
||||
outfile.write('compound=[\n')
|
||||
|
@ -253,18 +276,21 @@ class DoxygenType(GeneratedsSuper):
|
|||
level -= 1
|
||||
showIndent(outfile, level)
|
||||
outfile.write('],\n')
|
||||
|
||||
def build(self, node_):
|
||||
attrs = node_.attributes
|
||||
self.buildAttributes(attrs)
|
||||
for child_ in node_.childNodes:
|
||||
nodeName_ = child_.nodeName.split(':')[-1]
|
||||
self.buildChildren(child_, nodeName_)
|
||||
|
||||
def buildAttributes(self, attrs):
|
||||
if attrs.get('version'):
|
||||
self.version = attrs.get('version').value
|
||||
|
||||
def buildChildren(self, child_, nodeName_):
|
||||
if child_.nodeType == Node.ELEMENT_NODE and \
|
||||
nodeName_ == 'compound':
|
||||
nodeName_ == 'compound':
|
||||
obj_ = CompoundType.factory()
|
||||
obj_.build(child_)
|
||||
self.compound.append(obj_)
|
||||
|
@ -274,6 +300,7 @@ class DoxygenType(GeneratedsSuper):
|
|||
class CompoundType(GeneratedsSuper):
|
||||
subclass = None
|
||||
superclass = None
|
||||
|
||||
def __init__(self, kind=None, refid=None, name=None, member=None):
|
||||
self.kind = kind
|
||||
self.refid = refid
|
||||
|
@ -282,6 +309,7 @@ class CompoundType(GeneratedsSuper):
|
|||
self.member = []
|
||||
else:
|
||||
self.member = member
|
||||
|
||||
def factory(*args_, **kwargs_):
|
||||
if CompoundType.subclass:
|
||||
return CompoundType.subclass(*args_, **kwargs_)
|
||||
|
@ -298,6 +326,7 @@ class CompoundType(GeneratedsSuper):
|
|||
def set_kind(self, kind): self.kind = kind
|
||||
def get_refid(self): return self.refid
|
||||
def set_refid(self, refid): self.refid = refid
|
||||
|
||||
def export(self, outfile, level, namespace_='', name_='CompoundType', namespacedef_=''):
|
||||
showIndent(outfile, level)
|
||||
outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))
|
||||
|
@ -309,28 +338,35 @@ class CompoundType(GeneratedsSuper):
|
|||
outfile.write('</%s%s>\n' % (namespace_, name_))
|
||||
else:
|
||||
outfile.write(' />\n')
|
||||
|
||||
def exportAttributes(self, outfile, level, namespace_='', name_='CompoundType'):
|
||||
outfile.write(' kind=%s' % (quote_attrib(self.kind), ))
|
||||
outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))
|
||||
outfile.write(' refid=%s' % (self.format_string(quote_attrib(
|
||||
self.refid).encode(ExternalEncoding), input_name='refid'), ))
|
||||
|
||||
def exportChildren(self, outfile, level, namespace_='', name_='CompoundType'):
|
||||
if self.name is not None:
|
||||
showIndent(outfile, level)
|
||||
outfile.write('<%sname>%s</%sname>\n' % (namespace_, self.format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_))
|
||||
outfile.write('<%sname>%s</%sname>\n' % (namespace_, self.format_string(
|
||||
quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_))
|
||||
for member_ in self.member:
|
||||
member_.export(outfile, level, namespace_, name_='member')
|
||||
|
||||
def hasContent_(self):
|
||||
if (
|
||||
self.name is not None or
|
||||
self.member is not None
|
||||
):
|
||||
):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def exportLiteral(self, outfile, level, name_='CompoundType'):
|
||||
level += 1
|
||||
self.exportLiteralAttributes(outfile, level, name_)
|
||||
if self.hasContent_():
|
||||
self.exportLiteralChildren(outfile, level, name_)
|
||||
|
||||
def exportLiteralAttributes(self, outfile, level, name_):
|
||||
if self.kind is not None:
|
||||
showIndent(outfile, level)
|
||||
|
@ -338,9 +374,11 @@ class CompoundType(GeneratedsSuper):
|
|||
if self.refid is not None:
|
||||
showIndent(outfile, level)
|
||||
outfile.write('refid = %s,\n' % (self.refid,))
|
||||
|
||||
def exportLiteralChildren(self, outfile, level, name_):
|
||||
showIndent(outfile, level)
|
||||
outfile.write('name=%s,\n' % quote_python(self.name).encode(ExternalEncoding))
|
||||
outfile.write('name=%s,\n' % quote_python(
|
||||
self.name).encode(ExternalEncoding))
|
||||
showIndent(outfile, level)
|
||||
outfile.write('member=[\n')
|
||||
level += 1
|
||||
|
@ -353,26 +391,29 @@ class CompoundType(GeneratedsSuper):
|
|||
level -= 1
|
||||
showIndent(outfile, level)
|
||||
outfile.write('],\n')
|
||||
|
||||
def build(self, node_):
|
||||
attrs = node_.attributes
|
||||
self.buildAttributes(attrs)
|
||||
for child_ in node_.childNodes:
|
||||
nodeName_ = child_.nodeName.split(':')[-1]
|
||||
self.buildChildren(child_, nodeName_)
|
||||
|
||||
def buildAttributes(self, attrs):
|
||||
if attrs.get('kind'):
|
||||
self.kind = attrs.get('kind').value
|
||||
if attrs.get('refid'):
|
||||
self.refid = attrs.get('refid').value
|
||||
|
||||
def buildChildren(self, child_, nodeName_):
|
||||
if child_.nodeType == Node.ELEMENT_NODE and \
|
||||
nodeName_ == 'name':
|
||||
nodeName_ == 'name':
|
||||
name_ = ''
|
||||
for text__content_ in child_.childNodes:
|
||||
name_ += text__content_.nodeValue
|
||||
self.name = name_
|
||||
elif child_.nodeType == Node.ELEMENT_NODE and \
|
||||
nodeName_ == 'member':
|
||||
nodeName_ == 'member':
|
||||
obj_ = MemberType.factory()
|
||||
obj_.build(child_)
|
||||
self.member.append(obj_)
|
||||
|
@ -382,10 +423,12 @@ class CompoundType(GeneratedsSuper):
|
|||
class MemberType(GeneratedsSuper):
|
||||
subclass = None
|
||||
superclass = None
|
||||
|
||||
def __init__(self, kind=None, refid=None, name=None):
|
||||
self.kind = kind
|
||||
self.refid = refid
|
||||
self.name = name
|
||||
|
||||
def factory(*args_, **kwargs_):
|
||||
if MemberType.subclass:
|
||||
return MemberType.subclass(*args_, **kwargs_)
|
||||
|
@ -398,6 +441,7 @@ class MemberType(GeneratedsSuper):
|
|||
def set_kind(self, kind): self.kind = kind
|
||||
def get_refid(self): return self.refid
|
||||
def set_refid(self, refid): self.refid = refid
|
||||
|
||||
def export(self, outfile, level, namespace_='', name_='MemberType', namespacedef_=''):
|
||||
showIndent(outfile, level)
|
||||
outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))
|
||||
|
@ -409,25 +453,32 @@ class MemberType(GeneratedsSuper):
|
|||
outfile.write('</%s%s>\n' % (namespace_, name_))
|
||||
else:
|
||||
outfile.write(' />\n')
|
||||
|
||||
def exportAttributes(self, outfile, level, namespace_='', name_='MemberType'):
|
||||
outfile.write(' kind=%s' % (quote_attrib(self.kind), ))
|
||||
outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))
|
||||
outfile.write(' refid=%s' % (self.format_string(quote_attrib(
|
||||
self.refid).encode(ExternalEncoding), input_name='refid'), ))
|
||||
|
||||
def exportChildren(self, outfile, level, namespace_='', name_='MemberType'):
|
||||
if self.name is not None:
|
||||
showIndent(outfile, level)
|
||||
outfile.write('<%sname>%s</%sname>\n' % (namespace_, self.format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_))
|
||||
outfile.write('<%sname>%s</%sname>\n' % (namespace_, self.format_string(
|
||||
quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_))
|
||||
|
||||
def hasContent_(self):
|
||||
if (
|
||||
self.name is not None
|
||||
):
|
||||
):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def exportLiteral(self, outfile, level, name_='MemberType'):
|
||||
level += 1
|
||||
self.exportLiteralAttributes(outfile, level, name_)
|
||||
if self.hasContent_():
|
||||
self.exportLiteralChildren(outfile, level, name_)
|
||||
|
||||
def exportLiteralAttributes(self, outfile, level, name_):
|
||||
if self.kind is not None:
|
||||
showIndent(outfile, level)
|
||||
|
@ -435,23 +486,28 @@ class MemberType(GeneratedsSuper):
|
|||
if self.refid is not None:
|
||||
showIndent(outfile, level)
|
||||
outfile.write('refid = %s,\n' % (self.refid,))
|
||||
|
||||
def exportLiteralChildren(self, outfile, level, name_):
|
||||
showIndent(outfile, level)
|
||||
outfile.write('name=%s,\n' % quote_python(self.name).encode(ExternalEncoding))
|
||||
outfile.write('name=%s,\n' % quote_python(
|
||||
self.name).encode(ExternalEncoding))
|
||||
|
||||
def build(self, node_):
|
||||
attrs = node_.attributes
|
||||
self.buildAttributes(attrs)
|
||||
for child_ in node_.childNodes:
|
||||
nodeName_ = child_.nodeName.split(':')[-1]
|
||||
self.buildChildren(child_, nodeName_)
|
||||
|
||||
def buildAttributes(self, attrs):
|
||||
if attrs.get('kind'):
|
||||
self.kind = attrs.get('kind').value
|
||||
if attrs.get('refid'):
|
||||
self.refid = attrs.get('refid').value
|
||||
|
||||
def buildChildren(self, child_, nodeName_):
|
||||
if child_.nodeType == Node.ELEMENT_NODE and \
|
||||
nodeName_ == 'name':
|
||||
nodeName_ == 'name':
|
||||
name_ = ''
|
||||
for text__content_ in child_.childNodes:
|
||||
name_ += text__content_.nodeValue
|
||||
|
@ -465,6 +521,7 @@ Options:
|
|||
-s Use the SAX parser, not the minidom parser.
|
||||
"""
|
||||
|
||||
|
||||
def usage():
|
||||
print(USAGE_TEXT)
|
||||
sys.exit(1)
|
||||
|
@ -479,7 +536,7 @@ def parse(inFileName):
|
|||
doc = None
|
||||
sys.stdout.write('<?xml version="1.0" ?>\n')
|
||||
rootObj.export(sys.stdout, 0, name_="doxygenindex",
|
||||
namespacedef_='')
|
||||
namespacedef_='')
|
||||
return rootObj
|
||||
|
||||
|
||||
|
@ -492,7 +549,7 @@ def parseString(inString):
|
|||
doc = None
|
||||
sys.stdout.write('<?xml version="1.0" ?>\n')
|
||||
rootObj.export(sys.stdout, 0, name_="doxygenindex",
|
||||
namespacedef_='')
|
||||
namespacedef_='')
|
||||
return rootObj
|
||||
|
||||
|
||||
|
@ -518,9 +575,7 @@ def main():
|
|||
usage()
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
#import pdb
|
||||
#pdb.run('main()')
|
||||
# pdb.run('main()')
|
||||
|
|
|
@ -4,25 +4,13 @@
|
|||
# This file was generated by gr_modtool, a tool from the GNU Radio framework
|
||||
# This file is a part of gr-droneid
|
||||
#
|
||||
# GNU Radio is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3, or (at your option)
|
||||
# any later version.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# GNU Radio is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU Radio; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
"""
|
||||
Utilities for extracting text from generated classes.
|
||||
"""
|
||||
from __future__ import unicode_literals
|
||||
|
||||
|
||||
def is_string(txt):
|
||||
if isinstance(txt, str):
|
||||
|
@ -34,11 +22,13 @@ def is_string(txt):
|
|||
pass
|
||||
return False
|
||||
|
||||
|
||||
def description(obj):
|
||||
if obj is None:
|
||||
return None
|
||||
return description_bit(obj).strip()
|
||||
|
||||
|
||||
def description_bit(obj):
|
||||
if hasattr(obj, 'content'):
|
||||
contents = [description_bit(item) for item in obj.content]
|
||||
|
@ -51,7 +41,8 @@ def description_bit(obj):
|
|||
elif is_string(obj):
|
||||
return obj
|
||||
else:
|
||||
raise Exception('Expecting a string or something with content, content_ or value attribute')
|
||||
raise Exception(
|
||||
'Expecting a string or something with content, content_ or value attribute')
|
||||
# If this bit is a paragraph then add one some line breaks.
|
||||
if hasattr(obj, 'name') and obj.name == 'para':
|
||||
result += "\n\n"
|
||||
|
|
|
@ -0,0 +1,446 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
|
||||
__applicationName__ = "doxypy"
|
||||
__blurb__ = """
|
||||
doxypy is an input filter for Doxygen. It preprocesses python
|
||||
files so that docstrings of classes and functions are reformatted
|
||||
into Doxygen-conform documentation blocks.
|
||||
"""
|
||||
|
||||
__doc__ = __blurb__ + \
|
||||
"""
|
||||
In order to make Doxygen preprocess files through doxypy, simply
|
||||
add the following lines to your Doxyfile:
|
||||
FILTER_SOURCE_FILES = YES
|
||||
INPUT_FILTER = "python /path/to/doxypy.py"
|
||||
"""
|
||||
|
||||
__version__ = "0.4.2"
|
||||
__date__ = "5th December 2008"
|
||||
__website__ = "http://code.foosel.org/doxypy"
|
||||
|
||||
__author__ = (
|
||||
"Philippe 'demod' Neumann (doxypy at demod dot org)",
|
||||
"Gina 'foosel' Haeussge (gina at foosel dot net)"
|
||||
)
|
||||
|
||||
__licenseName__ = "GPL v2"
|
||||
__license__ = """This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
import sys
|
||||
import re
|
||||
|
||||
from argparse import ArgumentParser
|
||||
|
||||
|
||||
class FSM(object):
|
||||
"""Implements a finite state machine.
|
||||
|
||||
Transitions are given as 4-tuples, consisting of an origin state, a target
|
||||
state, a condition for the transition (given as a reference to a function
|
||||
which gets called with a given piece of input) and a pointer to a function
|
||||
to be called upon the execution of the given transition.
|
||||
"""
|
||||
|
||||
"""
|
||||
@var transitions holds the transitions
|
||||
@var current_state holds the current state
|
||||
@var current_input holds the current input
|
||||
@var current_transition hold the currently active transition
|
||||
"""
|
||||
|
||||
def __init__(self, start_state=None, transitions=[]):
|
||||
self.transitions = transitions
|
||||
self.current_state = start_state
|
||||
self.current_input = None
|
||||
self.current_transition = None
|
||||
|
||||
def setStartState(self, state):
|
||||
self.current_state = state
|
||||
|
||||
def addTransition(self, from_state, to_state, condition, callback):
|
||||
self.transitions.append([from_state, to_state, condition, callback])
|
||||
|
||||
def makeTransition(self, input):
|
||||
""" Makes a transition based on the given input.
|
||||
|
||||
@param input input to parse by the FSM
|
||||
"""
|
||||
for transition in self.transitions:
|
||||
[from_state, to_state, condition, callback] = transition
|
||||
if from_state == self.current_state:
|
||||
match = condition(input)
|
||||
if match:
|
||||
self.current_state = to_state
|
||||
self.current_input = input
|
||||
self.current_transition = transition
|
||||
if args.debug:
|
||||
print("# FSM: executing (%s -> %s) for line '%s'" %
|
||||
(from_state, to_state, input), file=sys.stderr)
|
||||
callback(match)
|
||||
return
|
||||
|
||||
|
||||
class Doxypy(object):
|
||||
def __init__(self):
|
||||
string_prefixes = "[uU]?[rR]?"
|
||||
|
||||
self.start_single_comment_re = re.compile(
|
||||
r"^\s*%s(''')" % string_prefixes)
|
||||
self.end_single_comment_re = re.compile(r"(''')\s*$")
|
||||
|
||||
self.start_double_comment_re = re.compile(
|
||||
r'^\s*%s(""")' % string_prefixes)
|
||||
self.end_double_comment_re = re.compile(r'(""")\s*$')
|
||||
|
||||
self.single_comment_re = re.compile(
|
||||
r"^\s*%s(''').*(''')\s*$" % string_prefixes)
|
||||
self.double_comment_re = re.compile(
|
||||
r'^\s*%s(""").*(""")\s*$' % string_prefixes)
|
||||
|
||||
self.defclass_re = re.compile(r"^(\s*)(def .+:|class .+:)")
|
||||
self.empty_re = re.compile(r"^\s*$")
|
||||
self.hashline_re = re.compile(r"^\s*#.*$")
|
||||
self.importline_re = re.compile(r"^\s*(import |from .+ import)")
|
||||
|
||||
self.multiline_defclass_start_re = re.compile(
|
||||
r"^(\s*)(def|class)(\s.*)?$")
|
||||
self.multiline_defclass_end_re = re.compile(r":\s*$")
|
||||
|
||||
# Transition list format
|
||||
# ["FROM", "TO", condition, action]
|
||||
transitions = [
|
||||
# FILEHEAD
|
||||
|
||||
# single line comments
|
||||
["FILEHEAD", "FILEHEAD", self.single_comment_re.search,
|
||||
self.appendCommentLine],
|
||||
["FILEHEAD", "FILEHEAD", self.double_comment_re.search,
|
||||
self.appendCommentLine],
|
||||
|
||||
# multiline comments
|
||||
["FILEHEAD", "FILEHEAD_COMMENT_SINGLE",
|
||||
self.start_single_comment_re.search, self.appendCommentLine],
|
||||
["FILEHEAD_COMMENT_SINGLE", "FILEHEAD",
|
||||
self.end_single_comment_re.search, self.appendCommentLine],
|
||||
["FILEHEAD_COMMENT_SINGLE", "FILEHEAD_COMMENT_SINGLE",
|
||||
self.catchall, self.appendCommentLine],
|
||||
["FILEHEAD", "FILEHEAD_COMMENT_DOUBLE",
|
||||
self.start_double_comment_re.search, self.appendCommentLine],
|
||||
["FILEHEAD_COMMENT_DOUBLE", "FILEHEAD",
|
||||
self.end_double_comment_re.search, self.appendCommentLine],
|
||||
["FILEHEAD_COMMENT_DOUBLE", "FILEHEAD_COMMENT_DOUBLE",
|
||||
self.catchall, self.appendCommentLine],
|
||||
|
||||
# other lines
|
||||
["FILEHEAD", "FILEHEAD", self.empty_re.search, self.appendFileheadLine],
|
||||
["FILEHEAD", "FILEHEAD", self.hashline_re.search, self.appendFileheadLine],
|
||||
["FILEHEAD", "FILEHEAD", self.importline_re.search,
|
||||
self.appendFileheadLine],
|
||||
["FILEHEAD", "DEFCLASS", self.defclass_re.search, self.resetCommentSearch],
|
||||
["FILEHEAD", "DEFCLASS_MULTI",
|
||||
self.multiline_defclass_start_re.search, self.resetCommentSearch],
|
||||
["FILEHEAD", "DEFCLASS_BODY", self.catchall, self.appendFileheadLine],
|
||||
|
||||
# DEFCLASS
|
||||
|
||||
# single line comments
|
||||
["DEFCLASS", "DEFCLASS_BODY",
|
||||
self.single_comment_re.search, self.appendCommentLine],
|
||||
["DEFCLASS", "DEFCLASS_BODY",
|
||||
self.double_comment_re.search, self.appendCommentLine],
|
||||
|
||||
# multiline comments
|
||||
["DEFCLASS", "COMMENT_SINGLE",
|
||||
self.start_single_comment_re.search, self.appendCommentLine],
|
||||
["COMMENT_SINGLE", "DEFCLASS_BODY",
|
||||
self.end_single_comment_re.search, self.appendCommentLine],
|
||||
["COMMENT_SINGLE", "COMMENT_SINGLE",
|
||||
self.catchall, self.appendCommentLine],
|
||||
["DEFCLASS", "COMMENT_DOUBLE",
|
||||
self.start_double_comment_re.search, self.appendCommentLine],
|
||||
["COMMENT_DOUBLE", "DEFCLASS_BODY",
|
||||
self.end_double_comment_re.search, self.appendCommentLine],
|
||||
["COMMENT_DOUBLE", "COMMENT_DOUBLE",
|
||||
self.catchall, self.appendCommentLine],
|
||||
|
||||
# other lines
|
||||
["DEFCLASS", "DEFCLASS", self.empty_re.search, self.appendDefclassLine],
|
||||
["DEFCLASS", "DEFCLASS", self.defclass_re.search, self.resetCommentSearch],
|
||||
["DEFCLASS", "DEFCLASS_MULTI",
|
||||
self.multiline_defclass_start_re.search, self.resetCommentSearch],
|
||||
["DEFCLASS", "DEFCLASS_BODY", self.catchall, self.stopCommentSearch],
|
||||
|
||||
# DEFCLASS_BODY
|
||||
|
||||
["DEFCLASS_BODY", "DEFCLASS",
|
||||
self.defclass_re.search, self.startCommentSearch],
|
||||
["DEFCLASS_BODY", "DEFCLASS_MULTI",
|
||||
self.multiline_defclass_start_re.search, self.startCommentSearch],
|
||||
["DEFCLASS_BODY", "DEFCLASS_BODY", self.catchall, self.appendNormalLine],
|
||||
|
||||
# DEFCLASS_MULTI
|
||||
["DEFCLASS_MULTI", "DEFCLASS",
|
||||
self.multiline_defclass_end_re.search, self.appendDefclassLine],
|
||||
["DEFCLASS_MULTI", "DEFCLASS_MULTI",
|
||||
self.catchall, self.appendDefclassLine],
|
||||
]
|
||||
|
||||
self.fsm = FSM("FILEHEAD", transitions)
|
||||
self.outstream = sys.stdout
|
||||
|
||||
self.output = []
|
||||
self.comment = []
|
||||
self.filehead = []
|
||||
self.defclass = []
|
||||
self.indent = ""
|
||||
|
||||
def __closeComment(self):
|
||||
"""Appends any open comment block and triggering block to the output."""
|
||||
|
||||
if args.autobrief:
|
||||
if len(self.comment) == 1 \
|
||||
or (len(self.comment) > 2 and self.comment[1].strip() == ''):
|
||||
self.comment[0] = self.__docstringSummaryToBrief(
|
||||
self.comment[0])
|
||||
|
||||
if self.comment:
|
||||
block = self.makeCommentBlock()
|
||||
self.output.extend(block)
|
||||
|
||||
if self.defclass:
|
||||
self.output.extend(self.defclass)
|
||||
|
||||
def __docstringSummaryToBrief(self, line):
|
||||
"""Adds \\brief to the docstrings summary line.
|
||||
|
||||
A \\brief is prepended, provided no other doxygen command is at the
|
||||
start of the line.
|
||||
"""
|
||||
stripped = line.strip()
|
||||
if stripped and not stripped[0] in ('@', '\\'):
|
||||
return "\\brief " + line
|
||||
else:
|
||||
return line
|
||||
|
||||
def __flushBuffer(self):
|
||||
"""Flushes the current outputbuffer to the outstream."""
|
||||
if self.output:
|
||||
try:
|
||||
if args.debug:
|
||||
print("# OUTPUT: ", self.output, file=sys.stderr)
|
||||
print("\n".join(self.output), file=self.outstream)
|
||||
self.outstream.flush()
|
||||
except IOError:
|
||||
# Fix for FS#33. Catches "broken pipe" when doxygen closes
|
||||
# stdout prematurely upon usage of INPUT_FILTER, INLINE_SOURCES
|
||||
# and FILTER_SOURCE_FILES.
|
||||
pass
|
||||
self.output = []
|
||||
|
||||
def catchall(self, input):
|
||||
"""The catchall-condition, always returns true."""
|
||||
return True
|
||||
|
||||
def resetCommentSearch(self, match):
|
||||
"""Restarts a new comment search for a different triggering line.
|
||||
|
||||
Closes the current commentblock and starts a new comment search.
|
||||
"""
|
||||
if args.debug:
|
||||
print("# CALLBACK: resetCommentSearch", file=sys.stderr)
|
||||
self.__closeComment()
|
||||
self.startCommentSearch(match)
|
||||
|
||||
def startCommentSearch(self, match):
|
||||
"""Starts a new comment search.
|
||||
|
||||
Saves the triggering line, resets the current comment and saves
|
||||
the current indentation.
|
||||
"""
|
||||
if args.debug:
|
||||
print("# CALLBACK: startCommentSearch", file=sys.stderr)
|
||||
self.defclass = [self.fsm.current_input]
|
||||
self.comment = []
|
||||
self.indent = match.group(1)
|
||||
|
||||
def stopCommentSearch(self, match):
|
||||
"""Stops a comment search.
|
||||
|
||||
Closes the current commentblock, resets the triggering line and
|
||||
appends the current line to the output.
|
||||
"""
|
||||
if args.debug:
|
||||
print("# CALLBACK: stopCommentSearch", file=sys.stderr)
|
||||
self.__closeComment()
|
||||
|
||||
self.defclass = []
|
||||
self.output.append(self.fsm.current_input)
|
||||
|
||||
def appendFileheadLine(self, match):
|
||||
"""Appends a line in the FILEHEAD state.
|
||||
|
||||
Closes the open comment block, resets it and appends the current line.
|
||||
"""
|
||||
if args.debug:
|
||||
print("# CALLBACK: appendFileheadLine", file=sys.stderr)
|
||||
self.__closeComment()
|
||||
self.comment = []
|
||||
self.output.append(self.fsm.current_input)
|
||||
|
||||
def appendCommentLine(self, match):
|
||||
"""Appends a comment line.
|
||||
|
||||
The comment delimiter is removed from multiline start and ends as
|
||||
well as singleline comments.
|
||||
"""
|
||||
if args.debug:
|
||||
print("# CALLBACK: appendCommentLine", file=sys.stderr)
|
||||
(from_state, to_state, condition, callback) = self.fsm.current_transition
|
||||
|
||||
# single line comment
|
||||
if (from_state == "DEFCLASS" and to_state == "DEFCLASS_BODY") \
|
||||
or (from_state == "FILEHEAD" and to_state == "FILEHEAD"):
|
||||
# remove comment delimiter from begin and end of the line
|
||||
activeCommentDelim = match.group(1)
|
||||
line = self.fsm.current_input
|
||||
self.comment.append(line[line.find(
|
||||
activeCommentDelim) + len(activeCommentDelim):line.rfind(activeCommentDelim)])
|
||||
|
||||
if (to_state == "DEFCLASS_BODY"):
|
||||
self.__closeComment()
|
||||
self.defclass = []
|
||||
# multiline start
|
||||
elif from_state == "DEFCLASS" or from_state == "FILEHEAD":
|
||||
# remove comment delimiter from begin of the line
|
||||
activeCommentDelim = match.group(1)
|
||||
line = self.fsm.current_input
|
||||
self.comment.append(
|
||||
line[line.find(activeCommentDelim) + len(activeCommentDelim):])
|
||||
# multiline end
|
||||
elif to_state == "DEFCLASS_BODY" or to_state == "FILEHEAD":
|
||||
# remove comment delimiter from end of the line
|
||||
activeCommentDelim = match.group(1)
|
||||
line = self.fsm.current_input
|
||||
self.comment.append(line[0:line.rfind(activeCommentDelim)])
|
||||
if (to_state == "DEFCLASS_BODY"):
|
||||
self.__closeComment()
|
||||
self.defclass = []
|
||||
# in multiline comment
|
||||
else:
|
||||
# just append the comment line
|
||||
self.comment.append(self.fsm.current_input)
|
||||
|
||||
def appendNormalLine(self, match):
|
||||
"""Appends a line to the output."""
|
||||
if args.debug:
|
||||
print("# CALLBACK: appendNormalLine", file=sys.stderr)
|
||||
self.output.append(self.fsm.current_input)
|
||||
|
||||
def appendDefclassLine(self, match):
|
||||
"""Appends a line to the triggering block."""
|
||||
if args.debug:
|
||||
print("# CALLBACK: appendDefclassLine", file=sys.stderr)
|
||||
self.defclass.append(self.fsm.current_input)
|
||||
|
||||
def makeCommentBlock(self):
|
||||
"""Indents the current comment block with respect to the current
|
||||
indentation level.
|
||||
|
||||
@returns a list of indented comment lines
|
||||
"""
|
||||
doxyStart = "##"
|
||||
commentLines = self.comment
|
||||
|
||||
commentLines = ["%s# %s" % (self.indent, x) for x in commentLines]
|
||||
l = [self.indent + doxyStart]
|
||||
l.extend(commentLines)
|
||||
|
||||
return l
|
||||
|
||||
def parse(self, input):
|
||||
"""Parses a python file given as input string and returns the doxygen-
|
||||
compatible representation.
|
||||
|
||||
@param input the python code to parse
|
||||
@returns the modified python code
|
||||
"""
|
||||
lines = input.split("\n")
|
||||
|
||||
for line in lines:
|
||||
self.fsm.makeTransition(line)
|
||||
|
||||
if self.fsm.current_state == "DEFCLASS":
|
||||
self.__closeComment()
|
||||
|
||||
return "\n".join(self.output)
|
||||
|
||||
def parseFile(self, filename):
|
||||
"""Parses a python file given as input string and returns the doxygen-
|
||||
compatible representation.
|
||||
|
||||
@param input the python code to parse
|
||||
@returns the modified python code
|
||||
"""
|
||||
f = open(filename, 'r')
|
||||
|
||||
for line in f:
|
||||
self.parseLine(line.rstrip('\r\n'))
|
||||
if self.fsm.current_state == "DEFCLASS":
|
||||
self.__closeComment()
|
||||
self.__flushBuffer()
|
||||
f.close()
|
||||
|
||||
def parseLine(self, line):
|
||||
"""Parse one line of python and flush the resulting output to the
|
||||
outstream.
|
||||
|
||||
@param line the python code line to parse
|
||||
"""
|
||||
self.fsm.makeTransition(line)
|
||||
self.__flushBuffer()
|
||||
|
||||
|
||||
def argParse():
|
||||
"""Parses commandline args."""
|
||||
parser = ArgumentParser(prog=__applicationName__)
|
||||
|
||||
parser.add_argument("--version", action="version",
|
||||
version="%(prog)s " + __version__
|
||||
)
|
||||
parser.add_argument("--autobrief", action="store_true",
|
||||
help="use the docstring summary line as \\brief description"
|
||||
)
|
||||
parser.add_argument("--debug", action="store_true",
|
||||
help="enable debug output on stderr"
|
||||
)
|
||||
parser.add_argument("filename", metavar="FILENAME")
|
||||
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def main():
|
||||
"""Starts the parser on the file given by the filename as the first
|
||||
argument on the commandline.
|
||||
"""
|
||||
global args
|
||||
args = argParse()
|
||||
fsm = Doxypy()
|
||||
fsm.parseFile(args.filename)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
|
@ -4,4 +4,3 @@
|
|||
* module are listed here or in the subcategories below.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef PYDOC_MACROS_H
|
||||
#define PYDOC_MACROS_H
|
||||
|
||||
#define __EXPAND(x) x
|
||||
#define __COUNT(_1, _2, _3, _4, _5, _6, _7, COUNT, ...) COUNT
|
||||
#define __VA_SIZE(...) __EXPAND(__COUNT(__VA_ARGS__, 7, 6, 5, 4, 3, 2, 1))
|
||||
#define __CAT1(a, b) a##b
|
||||
#define __CAT2(a, b) __CAT1(a, b)
|
||||
#define __DOC1(n1) __doc_##n1
|
||||
#define __DOC2(n1, n2) __doc_##n1##_##n2
|
||||
#define __DOC3(n1, n2, n3) __doc_##n1##_##n2##_##n3
|
||||
#define __DOC4(n1, n2, n3, n4) __doc_##n1##_##n2##_##n3##_##n4
|
||||
#define __DOC5(n1, n2, n3, n4, n5) __doc_##n1##_##n2##_##n3##_##n4##_##n5
|
||||
#define __DOC6(n1, n2, n3, n4, n5, n6) __doc_##n1##_##n2##_##n3##_##n4##_##n5##_##n6
|
||||
#define __DOC7(n1, n2, n3, n4, n5, n6, n7) \
|
||||
__doc_##n1##_##n2##_##n3##_##n4##_##n5##_##n6##_##n7
|
||||
#define DOC(...) __EXPAND(__EXPAND(__CAT2(__DOC, __VA_SIZE(__VA_ARGS__)))(__VA_ARGS__))
|
||||
|
||||
#endif // PYDOC_MACROS_H
|
|
@ -2,42 +2,37 @@
|
|||
# Copyright 2010-2012 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file was generated by gr_modtool, a tool from the GNU Radio framework
|
||||
# This file is a part of gr-droneid
|
||||
# This file is a part of gnuradio
|
||||
#
|
||||
# GNU Radio is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3, or (at your option)
|
||||
# any later version.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# GNU Radio is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU Radio; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
"""
|
||||
Creates the swig_doc.i SWIG interface file.
|
||||
Execute using: python swig_doc.py xml_path outputfilename
|
||||
Updates the *pydoc_h files for a module
|
||||
Execute using: python update_pydoc.py xml_path outputfilename
|
||||
|
||||
The file instructs SWIG to transfer the doxygen comments into the
|
||||
The file instructs Pybind11 to transfer the doxygen comments into the
|
||||
python docstrings.
|
||||
|
||||
"""
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import sys, time
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
import glob
|
||||
import re
|
||||
import json
|
||||
from argparse import ArgumentParser
|
||||
|
||||
from doxyxml import DoxyIndex, DoxyClass, DoxyFriend, DoxyFunction, DoxyFile
|
||||
from doxyxml import DoxyOther, base
|
||||
|
||||
|
||||
def py_name(name):
|
||||
bits = name.split('_')
|
||||
return '_'.join(bits[1:])
|
||||
|
||||
|
||||
def make_name(name):
|
||||
bits = name.split('_')
|
||||
return bits[0] + '_make_' + '_'.join(bits[1:])
|
||||
|
@ -62,6 +57,7 @@ class Block(object):
|
|||
is_a_block = di.has_member(friendname, DoxyFunction)
|
||||
return is_a_block
|
||||
|
||||
|
||||
class Block2(object):
|
||||
"""
|
||||
Checks if doxyxml produced objects correspond to a new style
|
||||
|
@ -75,7 +71,8 @@ class Block2(object):
|
|||
# Check for a parsing error.
|
||||
if item.error():
|
||||
return False
|
||||
is_a_block2 = item.has_member('make', DoxyFunction) and item.has_member('sptr', DoxyOther)
|
||||
is_a_block2 = item.has_member(
|
||||
'make', DoxyFunction) and item.has_member('sptr', DoxyOther)
|
||||
return is_a_block2
|
||||
|
||||
|
||||
|
@ -87,6 +84,7 @@ def utoascii(text):
|
|||
return ''
|
||||
out = text.encode('ascii', 'replace')
|
||||
# swig will require us to replace blackslash with 4 backslashes
|
||||
# TODO: evaluate what this should be for pybind11
|
||||
out = out.replace(b'\\', b'\\\\\\\\')
|
||||
out = out.replace(b'"', b'\\"').decode('ascii')
|
||||
return str(out)
|
||||
|
@ -105,6 +103,7 @@ def combine_descriptions(obj):
|
|||
description.append(dd)
|
||||
return utoascii('\n\n'.join(description)).strip()
|
||||
|
||||
|
||||
def format_params(parameteritems):
|
||||
output = ['Args:']
|
||||
template = ' {0} : {1}'
|
||||
|
@ -112,10 +111,13 @@ def format_params(parameteritems):
|
|||
output.append(template.format(pi.name, pi.description))
|
||||
return '\n'.join(output)
|
||||
|
||||
|
||||
entry_templ = '%feature("docstring") {name} "{docstring}"'
|
||||
|
||||
|
||||
def make_entry(obj, name=None, templ="{description}", description=None, params=[]):
|
||||
"""
|
||||
Create a docstring entry for a swig interface file.
|
||||
Create a docstring key/value pair, where the key is the object name.
|
||||
|
||||
obj - a doxyxml object from which documentation will be extracted.
|
||||
name - the name of the C object (defaults to obj.name())
|
||||
|
@ -125,7 +127,9 @@ def make_entry(obj, name=None, templ="{description}", description=None, params=[
|
|||
used as the description instead of extracting it from obj.
|
||||
"""
|
||||
if name is None:
|
||||
name=obj.name()
|
||||
name = obj.name()
|
||||
if hasattr(obj, '_parse_data') and hasattr(obj._parse_data, 'definition'):
|
||||
name = obj._parse_data.definition.split(' ')[-1]
|
||||
if "operator " in name:
|
||||
return ''
|
||||
if description is None:
|
||||
|
@ -134,56 +138,28 @@ def make_entry(obj, name=None, templ="{description}", description=None, params=[
|
|||
description += '\n\n'
|
||||
description += utoascii(format_params(params))
|
||||
docstring = templ.format(description=description)
|
||||
if not docstring:
|
||||
return ''
|
||||
return entry_templ.format(
|
||||
name=name,
|
||||
docstring=docstring,
|
||||
)
|
||||
|
||||
|
||||
def make_func_entry(func, name=None, description=None, params=None):
|
||||
"""
|
||||
Create a function docstring entry for a swig interface file.
|
||||
|
||||
func - a doxyxml object from which documentation will be extracted.
|
||||
name - the name of the C object (defaults to func.name())
|
||||
description - if this optional variable is set then it's value is
|
||||
used as the description instead of extracting it from func.
|
||||
params - a parameter list that overrides using func.params.
|
||||
"""
|
||||
#if params is None:
|
||||
# params = func.params
|
||||
#params = [prm.declname for prm in params]
|
||||
#if params:
|
||||
# sig = "Params: (%s)" % ", ".join(params)
|
||||
#else:
|
||||
# sig = "Params: (NONE)"
|
||||
#templ = "{description}\n\n" + sig
|
||||
#return make_entry(func, name=name, templ=utoascii(templ),
|
||||
# description=description)
|
||||
return make_entry(func, name=name, description=description, params=params)
|
||||
return {name: docstring}
|
||||
|
||||
|
||||
def make_class_entry(klass, description=None, ignored_methods=[], params=None):
|
||||
"""
|
||||
Create a class docstring for a swig interface file.
|
||||
Create a class docstring key/value pair.
|
||||
"""
|
||||
if params is None:
|
||||
params = klass.params
|
||||
output = []
|
||||
output.append(make_entry(klass, description=description, params=params))
|
||||
output = {}
|
||||
output.update(make_entry(klass, description=description, params=params))
|
||||
for func in klass.in_category(DoxyFunction):
|
||||
if func.name() not in ignored_methods:
|
||||
name = klass.name() + '::' + func.name()
|
||||
output.append(make_func_entry(func, name=name))
|
||||
return "\n\n".join(output)
|
||||
output.update(make_entry(func, name=name))
|
||||
return output
|
||||
|
||||
|
||||
def make_block_entry(di, block):
|
||||
"""
|
||||
Create class and function docstrings of a gnuradio block for a
|
||||
swig interface file.
|
||||
Create class and function docstrings of a gnuradio block
|
||||
"""
|
||||
descriptions = []
|
||||
# Get the documentation associated with the class.
|
||||
|
@ -208,48 +184,42 @@ def make_block_entry(di, block):
|
|||
super_description = "\n\n".join(descriptions)
|
||||
# Associate the combined description with the class and
|
||||
# the make function.
|
||||
output = []
|
||||
output.append(make_class_entry(block, description=super_description))
|
||||
output.append(make_func_entry(make_func, description=super_description,
|
||||
params=block.params))
|
||||
return "\n\n".join(output)
|
||||
output = {}
|
||||
output.update(make_class_entry(block, description=super_description))
|
||||
output.update(make_entry(make_func, description=super_description,
|
||||
params=block.params))
|
||||
return output
|
||||
|
||||
|
||||
def make_block2_entry(di, block):
|
||||
"""
|
||||
Create class and function docstrings of a new style gnuradio block for a
|
||||
swig interface file.
|
||||
Create class and function docstrings of a new style gnuradio block
|
||||
"""
|
||||
descriptions = []
|
||||
# For new style blocks all the relevant documentation should be
|
||||
# associated with the 'make' method.
|
||||
class_description = combine_descriptions(block)
|
||||
make_func = block.get_member('make', DoxyFunction)
|
||||
make_description = combine_descriptions(make_func)
|
||||
description = class_description + "\n\nConstructor Specific Documentation:\n\n" + make_description
|
||||
description = class_description + \
|
||||
"\n\nConstructor Specific Documentation:\n\n" + make_description
|
||||
# Associate the combined description with the class and
|
||||
# the make function.
|
||||
output = []
|
||||
output.append(make_class_entry(
|
||||
block, description=description,
|
||||
ignored_methods=['make'], params=make_func.params))
|
||||
output = {}
|
||||
output.update(make_class_entry(
|
||||
block, description=description,
|
||||
ignored_methods=['make'], params=make_func.params))
|
||||
makename = block.name() + '::make'
|
||||
output.append(make_func_entry(
|
||||
make_func, name=makename, description=description,
|
||||
params=make_func.params))
|
||||
return "\n\n".join(output)
|
||||
output.update(make_entry(
|
||||
make_func, name=makename, description=description,
|
||||
params=make_func.params))
|
||||
return output
|
||||
|
||||
def make_swig_interface_file(di, swigdocfilename, custom_output=None):
|
||||
|
||||
output = ["""
|
||||
/*
|
||||
* This file was automatically generated using swig_doc.py.
|
||||
*
|
||||
* Any changes to it will be lost next time it is regenerated.
|
||||
*/
|
||||
"""]
|
||||
def get_docstrings_dict(di, custom_output=None):
|
||||
|
||||
if custom_output is not None:
|
||||
output.append(custom_output)
|
||||
output = {}
|
||||
if custom_output:
|
||||
output.update(custom_output)
|
||||
|
||||
# Create docstrings for the blocks.
|
||||
blocks = di.in_category(Block)
|
||||
|
@ -262,21 +232,23 @@ def make_swig_interface_file(di, swigdocfilename, custom_output=None):
|
|||
# Don't want to risk writing to output twice.
|
||||
if make_func.name() not in make_funcs:
|
||||
make_funcs.add(make_func.name())
|
||||
output.append(make_block_entry(di, block))
|
||||
output.update(make_block_entry(di, block))
|
||||
except block.ParsingError:
|
||||
sys.stderr.write('Parsing error for block {0}\n'.format(block.name()))
|
||||
sys.stderr.write(
|
||||
'Parsing error for block {0}\n'.format(block.name()))
|
||||
raise
|
||||
|
||||
for block in blocks2:
|
||||
try:
|
||||
make_func = block.get_member('make', DoxyFunction)
|
||||
make_func_name = block.name() +'::make'
|
||||
make_func_name = block.name() + '::make'
|
||||
# Don't want to risk writing to output twice.
|
||||
if make_func_name not in make_funcs:
|
||||
make_funcs.add(make_func_name)
|
||||
output.append(make_block2_entry(di, block))
|
||||
output.update(make_block2_entry(di, block))
|
||||
except block.ParsingError:
|
||||
sys.stderr.write('Parsing error for block {0}\n'.format(block.name()))
|
||||
sys.stderr.write(
|
||||
'Parsing error for block {0}\n'.format(block.name()))
|
||||
raise
|
||||
|
||||
# Create docstrings for functions
|
||||
|
@ -285,9 +257,10 @@ def make_swig_interface_file(di, swigdocfilename, custom_output=None):
|
|||
if f.name() not in make_funcs and not f.name().startswith('std::')]
|
||||
for f in funcs:
|
||||
try:
|
||||
output.append(make_func_entry(f))
|
||||
output.update(make_entry(f))
|
||||
except f.ParsingError:
|
||||
sys.stderr.write('Parsing error for function {0}\n'.format(f.name()))
|
||||
sys.stderr.write(
|
||||
'Parsing error for function {0}\n'.format(f.name()))
|
||||
|
||||
# Create docstrings for classes
|
||||
block_names = [block.name() for block in blocks]
|
||||
|
@ -296,37 +269,104 @@ def make_swig_interface_file(di, swigdocfilename, custom_output=None):
|
|||
if k.name() not in block_names and not k.name().startswith('std::')]
|
||||
for k in klasses:
|
||||
try:
|
||||
output.append(make_class_entry(k))
|
||||
output.update(make_class_entry(k))
|
||||
except k.ParsingError:
|
||||
sys.stderr.write('Parsing error for class {0}\n'.format(k.name()))
|
||||
|
||||
# Docstrings are not created for anything that is not a function or a class.
|
||||
# If this excludes anything important please add it here.
|
||||
|
||||
output = "\n\n".join(output)
|
||||
return output
|
||||
|
||||
|
||||
def sub_docstring_in_pydoc_h(pydoc_files, docstrings_dict, output_dir, filter_str=None):
|
||||
if filter_str:
|
||||
docstrings_dict = {
|
||||
k: v for k, v in docstrings_dict.items() if k.startswith(filter_str)}
|
||||
|
||||
with open(os.path.join(output_dir, 'docstring_status'), 'w') as status_file:
|
||||
|
||||
for pydoc_file in pydoc_files:
|
||||
if filter_str:
|
||||
filter_str2 = "::".join((filter_str, os.path.split(
|
||||
pydoc_file)[-1].split('_pydoc_template.h')[0]))
|
||||
docstrings_dict2 = {
|
||||
k: v for k, v in docstrings_dict.items() if k.startswith(filter_str2)}
|
||||
else:
|
||||
docstrings_dict2 = docstrings_dict
|
||||
|
||||
file_in = open(pydoc_file, 'r').read()
|
||||
for key, value in docstrings_dict2.items():
|
||||
file_in_tmp = file_in
|
||||
try:
|
||||
doc_key = key.split("::")
|
||||
# if 'gr' in doc_key:
|
||||
# doc_key.remove('gr')
|
||||
doc_key = '_'.join(doc_key)
|
||||
regexp = r'(__doc_{} =\sR\"doc\()[^)]*(\)doc\")'.format(
|
||||
doc_key)
|
||||
regexp = re.compile(regexp, re.MULTILINE)
|
||||
|
||||
(file_in, nsubs) = regexp.subn(
|
||||
r'\1' + value + r'\2', file_in, count=1)
|
||||
if nsubs == 1:
|
||||
status_file.write("PASS: " + pydoc_file + "\n")
|
||||
except KeyboardInterrupt:
|
||||
raise KeyboardInterrupt
|
||||
except: # be permissive, TODO log, but just leave the docstring blank
|
||||
status_file.write("FAIL: " + pydoc_file + "\n")
|
||||
file_in = file_in_tmp
|
||||
|
||||
output_pathname = os.path.join(output_dir, os.path.basename(
|
||||
pydoc_file).replace('_template.h', '.h'))
|
||||
with open(output_pathname, 'w') as file_out:
|
||||
file_out.write(file_in)
|
||||
|
||||
|
||||
def copy_docstring_templates(pydoc_files, output_dir):
|
||||
with open(os.path.join(output_dir, 'docstring_status'), 'w') as status_file:
|
||||
for pydoc_file in pydoc_files:
|
||||
file_in = open(pydoc_file, 'r').read()
|
||||
output_pathname = os.path.join(output_dir, os.path.basename(
|
||||
pydoc_file).replace('_template.h', '.h'))
|
||||
with open(output_pathname, 'w') as file_out:
|
||||
file_out.write(file_in)
|
||||
status_file.write("DONE")
|
||||
|
||||
|
||||
def argParse():
|
||||
"""Parses commandline args."""
|
||||
desc = 'Scrape the doxygen generated xml for docstrings to insert into python bindings'
|
||||
parser = ArgumentParser(description=desc)
|
||||
|
||||
parser.add_argument("function", help="Operation to perform on docstrings", choices=[
|
||||
"scrape", "sub", "copy"])
|
||||
|
||||
parser.add_argument("--xml_path")
|
||||
parser.add_argument("--bindings_dir")
|
||||
parser.add_argument("--output_dir")
|
||||
parser.add_argument("--json_path")
|
||||
parser.add_argument("--filter", default=None)
|
||||
|
||||
return parser.parse_args()
|
||||
|
||||
swig_doc = open(swigdocfilename, 'w')
|
||||
swig_doc.write(output)
|
||||
swig_doc.close()
|
||||
|
||||
if __name__ == "__main__":
|
||||
# Parse command line options and set up doxyxml.
|
||||
err_msg = "Execute using: python swig_doc.py xml_path outputfilename"
|
||||
if len(sys.argv) != 3:
|
||||
raise Exception(err_msg)
|
||||
xml_path = sys.argv[1]
|
||||
swigdocfilename = sys.argv[2]
|
||||
di = DoxyIndex(xml_path)
|
||||
|
||||
# gnuradio.gr.msq_queue.insert_tail and delete_head create errors unless docstrings are defined!
|
||||
# This is presumably a bug in SWIG.
|
||||
#msg_q = di.get_member(u'gr_msg_queue', DoxyClass)
|
||||
#insert_tail = msg_q.get_member(u'insert_tail', DoxyFunction)
|
||||
#delete_head = msg_q.get_member(u'delete_head', DoxyFunction)
|
||||
output = []
|
||||
#output.append(make_func_entry(insert_tail, name='gr_py_msg_queue__insert_tail'))
|
||||
#output.append(make_func_entry(delete_head, name='gr_py_msg_queue__delete_head'))
|
||||
custom_output = "\n\n".join(output)
|
||||
|
||||
# Generate the docstrings interface file.
|
||||
make_swig_interface_file(di, swigdocfilename, custom_output=custom_output)
|
||||
args = argParse()
|
||||
if args.function.lower() == 'scrape':
|
||||
di = DoxyIndex(args.xml_path)
|
||||
docstrings_dict = get_docstrings_dict(di)
|
||||
with open(args.json_path, 'w') as fp:
|
||||
json.dump(docstrings_dict, fp)
|
||||
elif args.function.lower() == 'sub':
|
||||
with open(args.json_path, 'r') as fp:
|
||||
docstrings_dict = json.load(fp)
|
||||
pydoc_files = glob.glob(os.path.join(
|
||||
args.bindings_dir, '*_pydoc_template.h'))
|
||||
sub_docstring_in_pydoc_h(
|
||||
pydoc_files, docstrings_dict, args.output_dir, args.filter)
|
||||
elif args.function.lower() == 'copy':
|
||||
pydoc_files = glob.glob(os.path.join(
|
||||
args.bindings_dir, '*_pydoc_template.h'))
|
||||
copy_docstring_templates(pydoc_files, args.output_dir)
|
|
@ -1,4 +1,3 @@
|
|||
It is considered good practice to add examples in here to demonstrate the
|
||||
functionality of your OOT module. Python scripts, GRC flow graphs or other
|
||||
code can go here.
|
||||
|
||||
|
|
|
@ -3,23 +3,12 @@
|
|||
# This file was generated by gr_modtool, a tool from the GNU Radio framework
|
||||
# This file is a part of gr-droneid
|
||||
#
|
||||
# GNU Radio is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3, or (at your option)
|
||||
# any later version.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# GNU Radio is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU Radio; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
|
||||
install(FILES
|
||||
droneid_extractor.block.yml
|
||||
droneid_time_sync.block.yml
|
||||
droneid_demodulation.block.yml DESTINATION share/gnuradio/grc/blocks
|
||||
droneid_demodulation.block.yml
|
||||
DESTINATION share/gnuradio/grc/blocks
|
||||
)
|
||||
|
|
|
@ -3,7 +3,7 @@ label: demodulation
|
|||
category: '[droneid]'
|
||||
|
||||
templates:
|
||||
imports: import droneid
|
||||
imports: import gnuradio.droneid as droneid
|
||||
make: droneid.demodulation(${sample_rate})
|
||||
|
||||
# Make one 'parameters' list entry for every parameter you want settable from the GUI.
|
||||
|
|
|
@ -3,7 +3,7 @@ label: extractor
|
|||
category: '[droneid]'
|
||||
|
||||
templates:
|
||||
imports: import droneid
|
||||
imports: import gnuradio.droneid as droneid
|
||||
make: droneid.extractor(${sample_rate})
|
||||
|
||||
# Make one 'parameters' list entry for every parameter you want settable from the GUI.
|
||||
|
|
|
@ -3,7 +3,7 @@ label: time_sync
|
|||
category: '[droneid]'
|
||||
|
||||
templates:
|
||||
imports: import droneid
|
||||
imports: import gnuradio.droneid as droneid
|
||||
make: droneid.time_sync(${sample_rate})
|
||||
|
||||
# Make one 'parameters' list entry for every parameter you want settable from the GUI.
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
# Copyright 2011,2012 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file was generated by gr_modtool, a tool from the GNU Radio framework
|
||||
# This file is a part of gr-droneid
|
||||
#
|
||||
# GNU Radio is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# GNU Radio is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU Radio; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
|
||||
########################################################################
|
||||
# Install public header files
|
||||
########################################################################
|
||||
install(FILES
|
||||
api.h
|
||||
extractor.h
|
||||
time_sync.h
|
||||
../../lib/utils.h
|
||||
demodulation.h DESTINATION include/droneid
|
||||
)
|
|
@ -1,34 +0,0 @@
|
|||
/*
|
||||
* Copyright 2011 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file was generated by gr_modtool, a tool from the GNU Radio framework
|
||||
* This file is a part of gr-droneid
|
||||
*
|
||||
* GNU Radio is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* GNU Radio is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GNU Radio; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDED_DRONEID_API_H
|
||||
#define INCLUDED_DRONEID_API_H
|
||||
|
||||
#include <gnuradio/attributes.h>
|
||||
|
||||
#ifdef gnuradio_droneid_EXPORTS
|
||||
#define DRONEID_API __GR_ATTR_EXPORT
|
||||
#else
|
||||
#define DRONEID_API __GR_ATTR_IMPORT
|
||||
#endif
|
||||
|
||||
#endif /* INCLUDED_DRONEID_API_H */
|
|
@ -0,0 +1,19 @@
|
|||
# Copyright 2011,2012 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file was generated by gr_modtool, a tool from the GNU Radio framework
|
||||
# This file is a part of gr-droneid
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
|
||||
########################################################################
|
||||
# Install public header files
|
||||
########################################################################
|
||||
install(FILES
|
||||
api.h
|
||||
extractor.h
|
||||
time_sync.h
|
||||
../../../lib/utils.h
|
||||
demodulation.h
|
||||
DESTINATION include/gnuradio/droneid
|
||||
)
|
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* Copyright 2011 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file was generated by gr_modtool, a tool from the GNU Radio framework
|
||||
* This file is a part of gr-droneid
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef INCLUDED_DRONEID_API_H
|
||||
#define INCLUDED_DRONEID_API_H
|
||||
|
||||
#include <gnuradio/attributes.h>
|
||||
|
||||
#ifdef gnuradio_droneid_EXPORTS
|
||||
#define DRONEID_API __GR_ATTR_EXPORT
|
||||
#else
|
||||
#define DRONEID_API __GR_ATTR_IMPORT
|
||||
#endif
|
||||
|
||||
#endif /* INCLUDED_DRONEID_API_H */
|
|
@ -21,7 +21,7 @@
|
|||
#ifndef INCLUDED_DRONEID_DEMODULATION_H
|
||||
#define INCLUDED_DRONEID_DEMODULATION_H
|
||||
|
||||
#include <droneid/api.h>
|
||||
#include <gnuradio/droneid/api.h>
|
||||
#include <gnuradio/sync_block.h>
|
||||
|
||||
namespace gr {
|
||||
|
@ -35,7 +35,7 @@ namespace gr {
|
|||
class DRONEID_API demodulation : virtual public gr::sync_block
|
||||
{
|
||||
public:
|
||||
typedef boost::shared_ptr<demodulation> sptr;
|
||||
typedef std::shared_ptr<demodulation> sptr;
|
||||
|
||||
/*!
|
||||
* \brief Return a shared_ptr to a new instance of droneid::demodulation.
|
|
@ -21,7 +21,7 @@
|
|||
#ifndef INCLUDED_DRONEID_EXTRACTOR_H
|
||||
#define INCLUDED_DRONEID_EXTRACTOR_H
|
||||
|
||||
#include <droneid/api.h>
|
||||
#include <gnuradio/droneid/api.h>
|
||||
#include <gnuradio/sync_block.h>
|
||||
|
||||
namespace gr {
|
||||
|
@ -35,7 +35,7 @@ namespace gr {
|
|||
class DRONEID_API extractor : virtual public gr::sync_block
|
||||
{
|
||||
public:
|
||||
typedef boost::shared_ptr<extractor> sptr;
|
||||
typedef std::shared_ptr<extractor> sptr;
|
||||
|
||||
/*!
|
||||
* \brief Return a shared_ptr to a new instance of droneid::extractor.
|
|
@ -21,7 +21,7 @@
|
|||
#ifndef INCLUDED_DRONEID_TIME_SYNC_H
|
||||
#define INCLUDED_DRONEID_TIME_SYNC_H
|
||||
|
||||
#include <droneid/api.h>
|
||||
#include <gnuradio/droneid/api.h>
|
||||
#include <gnuradio/sync_block.h>
|
||||
|
||||
namespace gr {
|
||||
|
@ -35,7 +35,7 @@ namespace gr {
|
|||
class DRONEID_API time_sync : virtual public gr::sync_block
|
||||
{
|
||||
public:
|
||||
typedef boost::shared_ptr<time_sync> sptr;
|
||||
typedef std::shared_ptr<time_sync> sptr;
|
||||
|
||||
/*!
|
||||
* \brief Return a shared_ptr to a new instance of droneid::time_sync.
|
|
@ -3,20 +3,8 @@
|
|||
# This file was generated by gr_modtool, a tool from the GNU Radio framework
|
||||
# This file is a part of gr-droneid
|
||||
#
|
||||
# GNU Radio is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3, or (at your option)
|
||||
# any later version.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# GNU Radio is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU Radio; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
|
||||
########################################################################
|
||||
# Setup library
|
||||
|
|
|
@ -75,7 +75,7 @@ namespace gr {
|
|||
std::cout << "FFT SIZE: " << fft_size_ << ", sample rate: " << sample_rate_ << "\n";
|
||||
|
||||
zc_ = create_zc_sequence(sample_rate_, 600);
|
||||
fft_ = std::unique_ptr<gr::fft::fft_complex>(new gr::fft::fft_complex(static_cast<int>(fft_size_), true, 1));
|
||||
fft_ = std::unique_ptr<gr::fft::fft_complex_fwd>(new gr::fft::fft_complex_fwd(static_cast<int>(fft_size_), 1));
|
||||
fft_shift_ = std::unique_ptr<gr::fft::fft_shift<std::complex<float>>>(new gr::fft::fft_shift<std::complex<float>>(fft_size_));
|
||||
|
||||
std::copy(zc_.begin(), zc_.end(), fft_->get_inbuf());
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#ifndef INCLUDED_DRONEID_DEMODULATION_IMPL_H
|
||||
#define INCLUDED_DRONEID_DEMODULATION_IMPL_H
|
||||
|
||||
#include <droneid/demodulation.h>
|
||||
#include <gnuradio/droneid/demodulation.h>
|
||||
#include <gnuradio/fft/fft.h>
|
||||
#include <gnuradio/fft/fft_shift.h>
|
||||
|
||||
|
@ -37,7 +37,7 @@ namespace gr {
|
|||
void write_samples(const std::string &path, const std::complex<float> * samples, uint32_t element_count);
|
||||
void write_samples(const std::string & path, const std::vector<std::complex<float>> & samples);
|
||||
|
||||
std::unique_ptr<gr::fft::fft_complex> fft_;
|
||||
std::unique_ptr<gr::fft::fft_complex_fwd> fft_;
|
||||
std::unique_ptr<gr::fft::fft_shift<std::complex<float>>> fft_shift_;
|
||||
size_t sample_count_;
|
||||
uint32_t cfo_cp_len_;
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#ifndef INCLUDED_DRONEID_EXTRACTOR_IMPL_H
|
||||
#define INCLUDED_DRONEID_EXTRACTOR_IMPL_H
|
||||
|
||||
#include <droneid/extractor.h>
|
||||
#include <gnuradio/droneid/extractor.h>
|
||||
|
||||
namespace gr {
|
||||
namespace droneid {
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace gr {
|
|||
auto zc_sequence = create_zc_sequence(sample_rate_, 600);
|
||||
std::for_each(zc_sequence.begin(), zc_sequence.end(), [](std::complex<float> & sample){ sample = std::conj(sample); });
|
||||
std::reverse(zc_sequence.begin(), zc_sequence.end());
|
||||
correlator_ptr_ = std::unique_ptr<filter_t>(new filter_t(1, zc_sequence));
|
||||
correlator_ptr_ = std::unique_ptr<filter_t>(new filter_t(zc_sequence));
|
||||
|
||||
message_port_register_in(pmt::mp("pdus"));
|
||||
message_port_register_out(pmt::mp("pdus"));
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#ifndef INCLUDED_DRONEID_TIME_SYNC_IMPL_H
|
||||
#define INCLUDED_DRONEID_TIME_SYNC_IMPL_H
|
||||
|
||||
#include <droneid/time_sync.h>
|
||||
#include <gnuradio/droneid/time_sync.h>
|
||||
|
||||
#include <gnuradio/filter/fir_filter.h>
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ std::vector<std::complex<float>> create_zc_sequence(const double sample_rate, co
|
|||
sequence[(fft_size / 2) - 1] = 0;
|
||||
|
||||
// Create an FFT object that is configured to run an inverse FFT
|
||||
gr::fft::fft_complex ifft(static_cast<int>(fft_size), false, 1);
|
||||
gr::fft::fft_complex_rev ifft(static_cast<int>(fft_size), 1);
|
||||
|
||||
// FFT-shift the inputs (swap the left and right halves) and store in the IFFT input buffer
|
||||
std::copy(sequence.begin() + (fft_size/2), sequence.begin() + fft_size, ifft.get_inbuf());
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
# Copyright 2011 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file was generated by gr_modtool, a tool from the GNU Radio framework
|
||||
# This file is a part of gr-droneid
|
||||
#
|
||||
# GNU Radio is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# GNU Radio is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU Radio; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
|
||||
########################################################################
|
||||
# Include python install macros
|
||||
########################################################################
|
||||
include(GrPython)
|
||||
if(NOT PYTHONINTERP_FOUND)
|
||||
return()
|
||||
endif()
|
||||
|
||||
########################################################################
|
||||
# Install python sources
|
||||
########################################################################
|
||||
GR_PYTHON_INSTALL(
|
||||
FILES
|
||||
__init__.py
|
||||
DESTINATION ${GR_PYTHON_DIR}/droneid
|
||||
)
|
||||
|
||||
########################################################################
|
||||
# Handle the unit tests
|
||||
########################################################################
|
||||
include(GrTest)
|
||||
|
||||
set(GR_TEST_TARGET_DEPS gnuradio-droneid)
|
||||
set(GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/swig)
|
||||
GR_ADD_TEST(qa_extractor ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_extractor.py)
|
||||
GR_ADD_TEST(qa_time_sync ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_time_sync.py)
|
||||
GR_ADD_TEST(qa_demodulation ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_demodulation.py)
|
|
@ -1,37 +0,0 @@
|
|||
#
|
||||
# Copyright 2008,2009 Free Software Foundation, Inc.
|
||||
#
|
||||
# This application is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This application is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
|
||||
# The presence of this file turns this directory into a Python package
|
||||
|
||||
'''
|
||||
This is the GNU Radio DRONEID module. Place your Python package
|
||||
description here (python/__init__.py).
|
||||
'''
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import swig generated symbols into the droneid namespace
|
||||
try:
|
||||
# this might fail if the module is python-only
|
||||
from .droneid_swig import *
|
||||
except ImportError:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
pass
|
||||
|
||||
# import any pure python here
|
||||
#
|
|
@ -0,0 +1,5 @@
|
|||
*~
|
||||
*.pyc
|
||||
*.pyo
|
||||
build*/
|
||||
examples/grc/*.py
|
|
@ -0,0 +1,41 @@
|
|||
# Copyright 2011 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file was generated by gr_modtool, a tool from the GNU Radio framework
|
||||
# This file is a part of gr-droneid
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
|
||||
########################################################################
|
||||
# Include python install macros
|
||||
########################################################################
|
||||
include(GrPython)
|
||||
if(NOT PYTHONINTERP_FOUND)
|
||||
return()
|
||||
endif()
|
||||
|
||||
add_subdirectory(bindings)
|
||||
|
||||
########################################################################
|
||||
# Install python sources
|
||||
########################################################################
|
||||
GR_PYTHON_INSTALL(
|
||||
FILES
|
||||
__init__.py
|
||||
DESTINATION ${GR_PYTHON_DIR}/gnuradio/droneid
|
||||
)
|
||||
|
||||
########################################################################
|
||||
# Handle the unit tests
|
||||
########################################################################
|
||||
include(GrTest)
|
||||
|
||||
set(GR_TEST_TARGET_DEPS gnuradio-droneid)
|
||||
|
||||
# Create a package directory that tests can import. It includes everything
|
||||
# from `python/`.
|
||||
add_custom_target(
|
||||
copy_module_for_tests ALL
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_BINARY_DIR}/test_modules/gnuradio/droneid/
|
||||
)
|
|
@ -0,0 +1,23 @@
|
|||
#
|
||||
# Copyright 2008,2009 Free Software Foundation, Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
|
||||
# The presence of this file turns this directory into a Python package
|
||||
|
||||
'''
|
||||
This is the GNU Radio DRONEID module. Place your Python package
|
||||
description here (python/__init__.py).
|
||||
'''
|
||||
import os
|
||||
|
||||
# import pybind11 generated symbols into the droneid namespace
|
||||
try:
|
||||
# this might fail if the module is python-only
|
||||
from .droneid_python import *
|
||||
except ModuleNotFoundError:
|
||||
pass
|
||||
|
||||
# import any pure python here
|
||||
#
|
|
@ -0,0 +1,48 @@
|
|||
# Copyright 2020 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is part of GNU Radio
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
|
||||
########################################################################
|
||||
# Check if there is C++ code at all
|
||||
########################################################################
|
||||
if(NOT droneid_sources)
|
||||
MESSAGE(STATUS "No C++ sources... skipping python bindings")
|
||||
return()
|
||||
endif(NOT droneid_sources)
|
||||
|
||||
########################################################################
|
||||
# Check for pygccxml
|
||||
########################################################################
|
||||
GR_PYTHON_CHECK_MODULE_RAW(
|
||||
"pygccxml"
|
||||
"import pygccxml"
|
||||
PYGCCXML_FOUND
|
||||
)
|
||||
|
||||
include(GrPybind)
|
||||
|
||||
########################################################################
|
||||
# Python Bindings
|
||||
########################################################################
|
||||
|
||||
list(APPEND droneid_python_files
|
||||
demodulation_python.cc
|
||||
extractor_python.cc
|
||||
time_sync_python.cc
|
||||
python_bindings.cc)
|
||||
|
||||
GR_PYBIND_MAKE_OOT(droneid
|
||||
../../..
|
||||
gr::droneid
|
||||
"${droneid_python_files}")
|
||||
|
||||
# copy bindings extension for use in QA test module
|
||||
add_custom_command(TARGET droneid_python POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:droneid_python>
|
||||
${CMAKE_BINARY_DIR}/test_modules/gnuradio/droneid/
|
||||
)
|
||||
|
||||
install(TARGETS droneid_python DESTINATION ${GR_PYTHON_DIR}/gnuradio/droneid COMPONENT pythonapi)
|
|
@ -0,0 +1,54 @@
|
|||
import warnings
|
||||
import argparse
|
||||
from gnuradio.bindtool import BindingGenerator
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
parser = argparse.ArgumentParser(description='Bind a GR Out of Tree Block')
|
||||
parser.add_argument('--module', type=str,
|
||||
help='Name of gr module containing file to bind (e.g. fft digital analog)')
|
||||
|
||||
parser.add_argument('--output_dir', default=tempfile.gettempdir(),
|
||||
help='Output directory of generated bindings')
|
||||
parser.add_argument('--prefix', help='Prefix of Installed GNU Radio')
|
||||
|
||||
parser.add_argument(
|
||||
'--filename', help="File to be parsed")
|
||||
|
||||
parser.add_argument(
|
||||
'--defines', help='Set additional defines for precompiler', default=(), nargs='*')
|
||||
parser.add_argument(
|
||||
'--include', help='Additional Include Dirs, separated', default=(), nargs='*')
|
||||
|
||||
parser.add_argument(
|
||||
'--status', help='Location of output file for general status (used during cmake)', default=None
|
||||
)
|
||||
parser.add_argument(
|
||||
'--flag_automatic', default='0'
|
||||
)
|
||||
parser.add_argument(
|
||||
'--flag_pygccxml', default='0'
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
prefix = args.prefix
|
||||
output_dir = args.output_dir
|
||||
defines = tuple(','.join(args.defines).split(','))
|
||||
includes = ','.join(args.include)
|
||||
name = args.module
|
||||
|
||||
namespace = ['gr', name]
|
||||
prefix_include_root = name
|
||||
|
||||
|
||||
with warnings.catch_warnings():
|
||||
warnings.filterwarnings("ignore", category=DeprecationWarning)
|
||||
|
||||
bg = BindingGenerator(prefix, namespace,
|
||||
prefix_include_root, output_dir, define_symbols=defines, addl_includes=includes,
|
||||
catch_exceptions=False, write_json_output=False, status_output=args.status,
|
||||
flag_automatic=True if args.flag_automatic.lower() in [
|
||||
'1', 'true'] else False,
|
||||
flag_pygccxml=True if args.flag_pygccxml.lower() in ['1', 'true'] else False)
|
||||
bg.gen_file_binding(args.filename)
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Copyright 2022 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNU Radio
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
*/
|
||||
|
||||
/***********************************************************************************/
|
||||
/* This file is automatically generated using bindtool and can be manually edited */
|
||||
/* The following lines can be configured to regenerate this file during cmake */
|
||||
/* If manual edits are made, the following tags should be modified accordingly. */
|
||||
/* BINDTOOL_GEN_AUTOMATIC(0) */
|
||||
/* BINDTOOL_USE_PYGCCXML(0) */
|
||||
/* BINDTOOL_HEADER_FILE(demodulation.h) */
|
||||
/* BINDTOOL_HEADER_FILE_HASH(7321ce66fa65dcf2a0ce59807bde53dc) */
|
||||
/***********************************************************************************/
|
||||
|
||||
#include <pybind11/complex.h>
|
||||
#include <pybind11/pybind11.h>
|
||||
#include <pybind11/stl.h>
|
||||
|
||||
namespace py = pybind11;
|
||||
|
||||
#include <gnuradio/droneid/demodulation.h>
|
||||
// pydoc.h is automatically generated in the build directory
|
||||
#include <demodulation_pydoc.h>
|
||||
|
||||
void bind_demodulation(py::module& m)
|
||||
{
|
||||
|
||||
using demodulation = ::gr::droneid::demodulation;
|
||||
|
||||
|
||||
py::class_<demodulation,
|
||||
gr::sync_block,
|
||||
gr::block,
|
||||
gr::basic_block,
|
||||
std::shared_ptr<demodulation>>(m, "demodulation", D(demodulation))
|
||||
|
||||
.def(py::init(&demodulation::make), py::arg("sample_rate"), D(demodulation, make))
|
||||
|
||||
|
||||
;
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
This directory stores templates for docstrings that are scraped from the include header files for each block
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* Copyright 2022 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNU Radio
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
*/
|
||||
#include "pydoc_macros.h"
|
||||
#define D(...) DOC(gr, droneid, __VA_ARGS__)
|
||||
/*
|
||||
This file contains placeholders for docstrings for the Python bindings.
|
||||
Do not edit! These were automatically extracted during the binding process
|
||||
and will be overwritten during the build process
|
||||
*/
|
||||
|
||||
|
||||
static const char* __doc_gr_droneid_demodulation = R"doc()doc";
|
||||
|
||||
|
||||
static const char* __doc_gr_droneid_demodulation_demodulation = R"doc()doc";
|
||||
|
||||
|
||||
static const char* __doc_gr_droneid_demodulation_make = R"doc()doc";
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* Copyright 2022 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNU Radio
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
*/
|
||||
#include "pydoc_macros.h"
|
||||
#define D(...) DOC(gr, droneid, __VA_ARGS__)
|
||||
/*
|
||||
This file contains placeholders for docstrings for the Python bindings.
|
||||
Do not edit! These were automatically extracted during the binding process
|
||||
and will be overwritten during the build process
|
||||
*/
|
||||
|
||||
|
||||
static const char* __doc_gr_droneid_extractor = R"doc()doc";
|
||||
|
||||
|
||||
static const char* __doc_gr_droneid_extractor_extractor = R"doc()doc";
|
||||
|
||||
|
||||
static const char* __doc_gr_droneid_extractor_make = R"doc()doc";
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* Copyright 2022 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNU Radio
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
*/
|
||||
#include "pydoc_macros.h"
|
||||
#define D(...) DOC(gr, droneid, __VA_ARGS__)
|
||||
/*
|
||||
This file contains placeholders for docstrings for the Python bindings.
|
||||
Do not edit! These were automatically extracted during the binding process
|
||||
and will be overwritten during the build process
|
||||
*/
|
||||
|
||||
|
||||
static const char* __doc_gr_droneid_time_sync = R"doc()doc";
|
||||
|
||||
|
||||
static const char* __doc_gr_droneid_time_sync_time_sync = R"doc()doc";
|
||||
|
||||
|
||||
static const char* __doc_gr_droneid_time_sync_make = R"doc()doc";
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Copyright 2022 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNU Radio
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
*/
|
||||
|
||||
/***********************************************************************************/
|
||||
/* This file is automatically generated using bindtool and can be manually edited */
|
||||
/* The following lines can be configured to regenerate this file during cmake */
|
||||
/* If manual edits are made, the following tags should be modified accordingly. */
|
||||
/* BINDTOOL_GEN_AUTOMATIC(0) */
|
||||
/* BINDTOOL_USE_PYGCCXML(0) */
|
||||
/* BINDTOOL_HEADER_FILE(extractor.h) */
|
||||
/* BINDTOOL_HEADER_FILE_HASH(bfe8b9e8c5e043607eaabb92f9931a15) */
|
||||
/***********************************************************************************/
|
||||
|
||||
#include <pybind11/complex.h>
|
||||
#include <pybind11/pybind11.h>
|
||||
#include <pybind11/stl.h>
|
||||
|
||||
namespace py = pybind11;
|
||||
|
||||
#include <gnuradio/droneid/extractor.h>
|
||||
// pydoc.h is automatically generated in the build directory
|
||||
#include <extractor_pydoc.h>
|
||||
|
||||
void bind_extractor(py::module& m)
|
||||
{
|
||||
|
||||
using extractor = ::gr::droneid::extractor;
|
||||
|
||||
|
||||
py::class_<extractor,
|
||||
gr::sync_block,
|
||||
gr::block,
|
||||
gr::basic_block,
|
||||
std::shared_ptr<extractor>>(m, "extractor", D(extractor))
|
||||
|
||||
.def(py::init(&extractor::make), py::arg("sample_rate"), D(extractor, make))
|
||||
|
||||
|
||||
;
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
./include/gnuradio/droneid/demodulation.hError occurred while running CASTXML xml file does not exist
|
|
@ -0,0 +1,80 @@
|
|||
# Utilities for reading values in header files
|
||||
|
||||
from argparse import ArgumentParser
|
||||
import re
|
||||
|
||||
|
||||
class PybindHeaderParser:
|
||||
def __init__(self, pathname):
|
||||
with open(pathname, 'r') as f:
|
||||
self.file_txt = f.read()
|
||||
|
||||
def get_flag_automatic(self):
|
||||
# p = re.compile(r'BINDTOOL_GEN_AUTOMATIC\(([^\s])\)')
|
||||
# m = p.search(self.file_txt)
|
||||
m = re.search(r'BINDTOOL_GEN_AUTOMATIC\(([^\s])\)', self.file_txt)
|
||||
if (m and m.group(1) == '1'):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def get_flag_pygccxml(self):
|
||||
# p = re.compile(r'BINDTOOL_USE_PYGCCXML\(([^\s])\)')
|
||||
# m = p.search(self.file_txt)
|
||||
m = re.search(r'BINDTOOL_USE_PYGCCXML\(([^\s])\)', self.file_txt)
|
||||
if (m and m.group(1) == '1'):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def get_header_filename(self):
|
||||
# p = re.compile(r'BINDTOOL_HEADER_FILE\(([^\s]*)\)')
|
||||
# m = p.search(self.file_txt)
|
||||
m = re.search(r'BINDTOOL_HEADER_FILE\(([^\s]*)\)', self.file_txt)
|
||||
if (m):
|
||||
return m.group(1)
|
||||
else:
|
||||
return None
|
||||
|
||||
def get_header_file_hash(self):
|
||||
# p = re.compile(r'BINDTOOL_HEADER_FILE_HASH\(([^\s]*)\)')
|
||||
# m = p.search(self.file_txt)
|
||||
m = re.search(r'BINDTOOL_HEADER_FILE_HASH\(([^\s]*)\)', self.file_txt)
|
||||
if (m):
|
||||
return m.group(1)
|
||||
else:
|
||||
return None
|
||||
|
||||
def get_flags(self):
|
||||
return f'{self.get_flag_automatic()};{self.get_flag_pygccxml()};{self.get_header_filename()};{self.get_header_file_hash()};'
|
||||
|
||||
|
||||
def argParse():
|
||||
"""Parses commandline args."""
|
||||
desc = 'Reads the parameters from the comment block in the pybind files'
|
||||
parser = ArgumentParser(description=desc)
|
||||
|
||||
parser.add_argument("function", help="Operation to perform on comment block of pybind file", choices=[
|
||||
"flag_auto", "flag_pygccxml", "header_filename", "header_file_hash", "all"])
|
||||
parser.add_argument(
|
||||
"pathname", help="Pathname of pybind c++ file to read, e.g. blockname_python.cc")
|
||||
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# Parse command line options and set up doxyxml.
|
||||
args = argParse()
|
||||
|
||||
pbhp = PybindHeaderParser(args.pathname)
|
||||
|
||||
if args.function == "flag_auto":
|
||||
print(pbhp.get_flag_automatic())
|
||||
elif args.function == "flag_pygccxml":
|
||||
print(pbhp.get_flag_pygccxml())
|
||||
elif args.function == "header_filename":
|
||||
print(pbhp.get_header_filename())
|
||||
elif args.function == "header_file_hash":
|
||||
print(pbhp.get_header_file_hash())
|
||||
elif args.function == "all":
|
||||
print(pbhp.get_flags())
|
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* Copyright 2020 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNU Radio
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
*/
|
||||
|
||||
#include <pybind11/pybind11.h>
|
||||
|
||||
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
|
||||
#include <numpy/arrayobject.h>
|
||||
|
||||
namespace py = pybind11;
|
||||
|
||||
// Headers for binding functions
|
||||
/**************************************/
|
||||
// The following comment block is used for
|
||||
// gr_modtool to insert function prototypes
|
||||
// Please do not delete
|
||||
/**************************************/
|
||||
// BINDING_FUNCTION_PROTOTYPES(
|
||||
void bind_demodulation(py::module& m);
|
||||
void bind_extractor(py::module& m);
|
||||
void bind_time_sync(py::module& m);
|
||||
// ) END BINDING_FUNCTION_PROTOTYPES
|
||||
|
||||
|
||||
// We need this hack because import_array() returns NULL
|
||||
// for newer Python versions.
|
||||
// This function is also necessary because it ensures access to the C API
|
||||
// and removes a warning.
|
||||
void* init_numpy()
|
||||
{
|
||||
import_array();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PYBIND11_MODULE(droneid_python, m)
|
||||
{
|
||||
// Initialize the numpy C API
|
||||
// (otherwise we will see segmentation faults)
|
||||
init_numpy();
|
||||
|
||||
// Allow access to base block methods
|
||||
py::module::import("gnuradio.gr");
|
||||
|
||||
/**************************************/
|
||||
// The following comment block is used for
|
||||
// gr_modtool to insert binding function calls
|
||||
// Please do not delete
|
||||
/**************************************/
|
||||
// BINDING_FUNCTION_CALLS(
|
||||
bind_demodulation(m);
|
||||
bind_extractor(m);
|
||||
bind_time_sync(m);
|
||||
// ) END BINDING_FUNCTION_CALLS
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Copyright 2022 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNU Radio
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
*/
|
||||
|
||||
/***********************************************************************************/
|
||||
/* This file is automatically generated using bindtool and can be manually edited */
|
||||
/* The following lines can be configured to regenerate this file during cmake */
|
||||
/* If manual edits are made, the following tags should be modified accordingly. */
|
||||
/* BINDTOOL_GEN_AUTOMATIC(0) */
|
||||
/* BINDTOOL_USE_PYGCCXML(0) */
|
||||
/* BINDTOOL_HEADER_FILE(time_sync.h) */
|
||||
/* BINDTOOL_HEADER_FILE_HASH(00c50b003099ddf3ea0d482c279fdcb7) */
|
||||
/***********************************************************************************/
|
||||
|
||||
#include <pybind11/complex.h>
|
||||
#include <pybind11/pybind11.h>
|
||||
#include <pybind11/stl.h>
|
||||
|
||||
namespace py = pybind11;
|
||||
|
||||
#include <gnuradio/droneid/time_sync.h>
|
||||
// pydoc.h is automatically generated in the build directory
|
||||
#include <time_sync_pydoc.h>
|
||||
|
||||
void bind_time_sync(py::module& m)
|
||||
{
|
||||
|
||||
using time_sync = ::gr::droneid::time_sync;
|
||||
|
||||
|
||||
py::class_<time_sync,
|
||||
gr::sync_block,
|
||||
gr::block,
|
||||
gr::basic_block,
|
||||
std::shared_ptr<time_sync>>(m, "time_sync", D(time_sync))
|
||||
|
||||
.def(py::init(&time_sync::make), py::arg("sample_rate"), D(time_sync, make))
|
||||
|
||||
|
||||
;
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright 2022 gr-droneid author.
|
||||
#
|
||||
# This is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This software is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this software; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
|
||||
from gnuradio import gr, gr_unittest
|
||||
from gnuradio import blocks
|
||||
import droneid_swig as droneid
|
||||
|
||||
class qa_demodulation(gr_unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.tb = gr.top_block()
|
||||
|
||||
def tearDown(self):
|
||||
self.tb = None
|
||||
|
||||
def test_001_t(self):
|
||||
# set up fg
|
||||
self.tb.run()
|
||||
# check data
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
gr_unittest.run(qa_demodulation)
|
|
@ -1,41 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright 2022 gr-droneid author.
|
||||
#
|
||||
# This is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This software is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this software; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
|
||||
from gnuradio import gr, gr_unittest
|
||||
from gnuradio import blocks
|
||||
import droneid_swig as droneid
|
||||
|
||||
class qa_extractor(gr_unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.tb = gr.top_block()
|
||||
|
||||
def tearDown(self):
|
||||
self.tb = None
|
||||
|
||||
def test_001_t(self):
|
||||
# set up fg
|
||||
self.tb.run()
|
||||
# check data
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
gr_unittest.run(qa_extractor)
|
|
@ -1,41 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright 2022 gr-droneid author.
|
||||
#
|
||||
# This is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This software is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this software; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
|
||||
from gnuradio import gr, gr_unittest
|
||||
from gnuradio import blocks
|
||||
import droneid_swig as droneid
|
||||
|
||||
class qa_time_sync(gr_unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.tb = gr.top_block()
|
||||
|
||||
def tearDown(self):
|
||||
self.tb = None
|
||||
|
||||
def test_001_t(self):
|
||||
# set up fg
|
||||
self.tb.run()
|
||||
# check data
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
gr_unittest.run(qa_time_sync)
|
|
@ -1,66 +0,0 @@
|
|||
# Copyright 2011 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file was generated by gr_modtool, a tool from the GNU Radio framework
|
||||
# This file is a part of gr-droneid
|
||||
#
|
||||
# GNU Radio is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# GNU Radio is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU Radio; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
|
||||
########################################################################
|
||||
# Check if there is C++ code at all
|
||||
########################################################################
|
||||
if(NOT droneid_sources)
|
||||
MESSAGE(STATUS "No C++ sources... skipping swig/")
|
||||
return()
|
||||
endif(NOT droneid_sources)
|
||||
|
||||
########################################################################
|
||||
# Include swig generation macros
|
||||
########################################################################
|
||||
find_package(SWIG)
|
||||
find_package(PythonLibs)
|
||||
if(NOT SWIG_FOUND OR NOT PYTHONLIBS_FOUND)
|
||||
return()
|
||||
endif()
|
||||
include(GrSwig)
|
||||
include(GrPython)
|
||||
|
||||
########################################################################
|
||||
# Setup swig generation
|
||||
########################################################################
|
||||
set(GR_SWIG_INCLUDE_DIRS $<TARGET_PROPERTY:gnuradio::runtime_swig,INTERFACE_INCLUDE_DIRECTORIES>)
|
||||
set(GR_SWIG_TARGET_DEPS gnuradio::runtime_swig)
|
||||
|
||||
set(GR_SWIG_LIBRARIES gnuradio-droneid)
|
||||
|
||||
set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/droneid_swig_doc.i)
|
||||
set(GR_SWIG_DOC_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../include)
|
||||
|
||||
GR_SWIG_MAKE(droneid_swig droneid_swig.i)
|
||||
|
||||
########################################################################
|
||||
# Install the build swig module
|
||||
########################################################################
|
||||
GR_SWIG_INSTALL(TARGETS droneid_swig DESTINATION ${GR_PYTHON_DIR}/droneid)
|
||||
|
||||
########################################################################
|
||||
# Install swig .i files for development
|
||||
########################################################################
|
||||
install(
|
||||
FILES
|
||||
droneid_swig.i
|
||||
${CMAKE_CURRENT_BINARY_DIR}/droneid_swig_doc.i
|
||||
DESTINATION ${GR_INCLUDE_DIR}/droneid/swig
|
||||
)
|
|
@ -1,30 +0,0 @@
|
|||
/* -*- c++ -*- */
|
||||
|
||||
#define DRONEID_API
|
||||
|
||||
%include "gnuradio.i" // the common stuff
|
||||
%include "std_vector.i"
|
||||
|
||||
//load generated python docstrings
|
||||
%include "droneid_swig_doc.i"
|
||||
|
||||
%{
|
||||
#include "droneid/extractor.h"
|
||||
#include "droneid/time_sync.h"
|
||||
#include "droneid/demodulation.h"
|
||||
//#include "droneid/utils.h"
|
||||
%}
|
||||
|
||||
%include "droneid/extractor.h"
|
||||
GR_SWIG_BLOCK_MAGIC2(droneid, extractor);
|
||||
%include "droneid/time_sync.h"
|
||||
GR_SWIG_BLOCK_MAGIC2(droneid, time_sync);
|
||||
//%include "droneid/utils.h"
|
||||
|
||||
//%{
|
||||
// unsigned int get_long_cp_len(double sample_rate);
|
||||
//unsigned int get_short_cp_len(double sample_rate);
|
||||
//unsigned int get_fft_size(double sample_rate);
|
||||
//%}
|
||||
%include "droneid/demodulation.h"
|
||||
GR_SWIG_BLOCK_MAGIC2(droneid, demodulation);
|
Ładowanie…
Reference in New Issue