Advertisement
duggabe

xmt_rcv_switch_Pluto.grc

Jun 5th, 2021
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.12 KB | None | 0 0
  1. options:
  2. parameters:
  3. author: Barry Duggan
  4. catch_exceptions: 'True'
  5. category: '[GRC Hier Blocks]'
  6. cmake_opt: ''
  7. comment: ''
  8. copyright: ''
  9. description: Pluto Station control module
  10. gen_cmake: 'On'
  11. gen_linking: dynamic
  12. generate_options: qt_gui
  13. hier_block_src_path: '.:'
  14. id: xmt_rcv_switch_Pluto
  15. max_nouts: '0'
  16. output_language: python
  17. placement: (0,0)
  18. qt_qss_theme: ''
  19. realtime_scheduling: ''
  20. run: 'True'
  21. run_command: '{python} -u {filename}'
  22. run_options: prompt
  23. sizing_mode: fixed
  24. thread_safe_setters: ''
  25. title: xmt_rcv_switch_Pluto
  26. states:
  27. bus_sink: false
  28. bus_source: false
  29. bus_structure: null
  30. coordinate: [16, 12.0]
  31. rotation: 0
  32. state: enabled
  33.  
  34. blocks:
  35. - name: freq
  36. id: variable_qtgui_entry
  37. parameters:
  38. comment: 9,0
  39. gui_hint: 9,0,1,1
  40. label: Receive Freq
  41. type: real
  42. value: 144.92e6
  43. states:
  44. bus_sink: false
  45. bus_source: false
  46. bus_structure: null
  47. coordinate: [440, 12.0]
  48. rotation: 0
  49. state: true
  50. - name: gain
  51. id: variable_qtgui_range
  52. parameters:
  53. comment: 1,0
  54. gui_hint: 1,0,1,3
  55. label: Rcv Gain
  56. min_len: '200'
  57. orient: QtCore.Qt.Horizontal
  58. rangeType: float
  59. start: '0'
  60. step: '1'
  61. stop: '73'
  62. value: '50'
  63. widget: slider
  64. states:
  65. bus_sink: false
  66. bus_source: false
  67. bus_structure: null
  68. coordinate: [184, 12.0]
  69. rotation: 0
  70. state: true
  71. - name: offset
  72. id: variable_qtgui_chooser
  73. parameters:
  74. comment: 9,1
  75. gui_hint: 9,1,1,1
  76. label: Offset
  77. label0: '"-600kHz"'
  78. label1: '"0"'
  79. label2: '"+600kHz"'
  80. label3: ''
  81. label4: ''
  82. labels: '["-600kHz", "0", "+600kHz"]'
  83. num_opts: '0'
  84. option0: '-600000'
  85. option1: '0'
  86. option2: '600000'
  87. option3: '3'
  88. option4: '4'
  89. options: '[-600000, 0, 600000]'
  90. orient: Qt.QVBoxLayout
  91. type: int
  92. value: '0'
  93. widget: combo_box
  94. states:
  95. bus_sink: false
  96. bus_source: false
  97. bus_structure: null
  98. coordinate: [584, 12.0]
  99. rotation: 0
  100. state: true
  101. - name: samp_rate
  102. id: variable
  103. parameters:
  104. comment: ''
  105. value: '768000'
  106. states:
  107. bus_sink: false
  108. bus_source: false
  109. bus_structure: null
  110. coordinate: [16, 156.0]
  111. rotation: 0
  112. state: enabled
  113. - name: tx_atten
  114. id: variable_qtgui_range
  115. parameters:
  116. comment: 2,0
  117. gui_hint: 2,0,1,3
  118. label: Tx Attenuation
  119. min_len: '200'
  120. orient: QtCore.Qt.Horizontal
  121. rangeType: float
  122. start: '0'
  123. step: '1'
  124. stop: '89'
  125. value: '50'
  126. widget: slider
  127. states:
  128. bus_sink: false
  129. bus_source: false
  130. bus_structure: null
  131. coordinate: [304, 12.0]
  132. rotation: 0
  133. state: true
  134. - name: tx_freq
  135. id: variable
  136. parameters:
  137. comment: ''
  138. value: freq+offset
  139. states:
  140. bus_sink: false
  141. bus_source: false
  142. bus_structure: null
  143. coordinate: [104, 156.0]
  144. rotation: 0
  145. state: true
  146. - name: variable_qtgui_label_0
  147. id: variable_qtgui_label
  148. parameters:
  149. comment: 9,2
  150. formatter: None
  151. gui_hint: 9,2,1,1
  152. label: Transmit Freq
  153. type: real
  154. value: tx_freq
  155. states:
  156. bus_sink: false
  157. bus_source: false
  158. bus_structure: null
  159. coordinate: [752, 12.0]
  160. rotation: 0
  161. state: enabled
  162. - name: variable_qtgui_toggle_button_msg_0
  163. id: variable_qtgui_toggle_button_msg
  164. parameters:
  165. comment: ''
  166. gui_hint: 3,2,1,1
  167. initPressed: 'False'
  168. label: Transmit
  169. outputmsgname: value
  170. pressBackgroundColor: red
  171. pressFontColor: default
  172. pressed: '1'
  173. relBackgroundColor: white
  174. relFontColor: default
  175. released: '0'
  176. type: int
  177. value: '0'
  178. states:
  179. bus_sink: false
  180. bus_source: false
  181. bus_structure: null
  182. coordinate: [16, 420.0]
  183. rotation: 0
  184. state: true
  185. - name: blocks_mute_xx_0
  186. id: blocks_mute_xx
  187. parameters:
  188. affinity: ''
  189. alias: ''
  190. comment: ''
  191. maxoutbuf: '0'
  192. minoutbuf: '0'
  193. mute: 'False'
  194. type: complex
  195. states:
  196. bus_sink: false
  197. bus_source: false
  198. bus_structure: null
  199. coordinate: [656, 224.0]
  200. rotation: 0
  201. state: true
  202. - name: blocks_selector_0
  203. id: blocks_selector
  204. parameters:
  205. affinity: ''
  206. alias: ''
  207. comment: ''
  208. enabled: 'False'
  209. input_index: '0'
  210. maxoutbuf: '0'
  211. minoutbuf: '0'
  212. num_inputs: '1'
  213. num_outputs: '1'
  214. output_index: '0'
  215. showports: 'False'
  216. type: complex
  217. vlen: '1'
  218. states:
  219. bus_sink: false
  220. bus_source: false
  221. bus_structure: null
  222. coordinate: [536, 616.0]
  223. rotation: 0
  224. state: true
  225. - name: epy_block_0
  226. id: epy_block
  227. parameters:
  228. _source_code: "\"\"\"\nTransmit / Receive Controller\n\"\"\"\n\nimport numpy as\
  229. \ np\nfrom gnuradio import gr\nimport time\nimport pmt\n\nclass blk(gr.sync_block):\n\
  230. \ \"\"\"\n reads input from a message port\n generates control messages\n\
  231. \ \"\"\"\n def __init__(self):\n gr.sync_block.__init__(self,\n\
  232. \ name='XMT/RCV Control', # will show up in GRC\n in_sig=None,\n\
  233. \ out_sig=None)\n self.message_port_register_in(pmt.intern('msg_in'))\n\
  234. \ self.message_port_register_out(pmt.intern('burst'))\n self.message_port_register_out(pmt.intern('tx_mute'))\n\
  235. \ self.message_port_register_out(pmt.intern('rx_led'))\n self.message_port_register_out(pmt.intern('ant_sw'))\n\
  236. \ self.message_port_register_out(pmt.intern('sw_cmd'))\n self.message_port_register_out(pmt.intern('pa_sw'))\n\
  237. \ self.message_port_register_out(pmt.intern('rx_mute'))\n self.set_msg_handler(pmt.intern('msg_in'),\
  238. \ self.handle_msg)\n\n def handle_msg(self, msg):\n _debug = 0 \
  239. \ # set to zero to turn off diagnostics\n\n try:\n new_val\
  240. \ = pmt.to_python(pmt.cdr(msg))\n except Exception as e:\n \
  241. \ gr.log.error(\"Error with message conversion: %s\" % str(e))\n if\
  242. \ (_debug):\n print (\"new_val =\", new_val)\n if (new_val\
  243. \ == 1):\n\n # (1) mute receive\n if (_debug):\n \
  244. \ print (\"t1\")\n self.message_port_pub(pmt.intern('rx_mute'),\
  245. \ pmt.to_pmt(True))\n\n # (2) turn off rcv LED\n if (_debug):\n\
  246. \ print (\"t2\")\n self.message_port_pub(pmt.intern('rx_led'),\n\
  247. \ pmt.cons(pmt.intern('pressed'),\n pmt.from_bool(False)))\n\
  248. \n # (3) send message to relay_sequencer\n if (_debug):\n\
  249. \ print (\"t3\")\n self.message_port_pub(pmt.intern('sw_cmd'),\n\
  250. \ pmt.cons(pmt.intern('pressed'),\n pmt.from_long(1)))\n\
  251. \n # (4) turn on Antenna LED\n if (_debug):\n \
  252. \ print (\"t4\")\n self.message_port_pub(pmt.intern('ant_sw'),\n\
  253. \ pmt.cons(pmt.intern('pressed'),\n pmt.from_bool(True)))\n\
  254. \n elif (new_val == 3):\n\n # (9) turn on Amp LED\n \
  255. \ if (_debug):\n print (\"t9\")\n self.message_port_pub(pmt.intern('pa_sw'),\n\
  256. \ pmt.cons(pmt.intern('pressed'),\n pmt.from_bool(True)))\n\
  257. \n # (10) delay 10 ms\n time.sleep (0.01)\n\n \
  258. \ # (11) unmute transmit (enable Selector)\n if (_debug):\n \
  259. \ print (\"t11\")\n self.message_port_pub(pmt.intern('tx_mute'),\
  260. \ pmt.to_pmt(True))\n\n # (12) send message to burst tagger\n \
  261. \ if (_debug):\n print (\"t12\")\n self.message_port_pub(pmt.intern('burst'),\n\
  262. \ pmt.cons(pmt.intern('pressed'),\n pmt.from_long(1)))\n\
  263. \n elif (new_val == 0):\n\n # (12) send message to burst tagger\n\
  264. \ if (_debug):\n print (\"t12\")\n self.message_port_pub(pmt.intern('burst'),\n\
  265. \ pmt.cons(pmt.intern('pressed'),\n pmt.from_long(0)))\n\
  266. \n # (11.5) delay 5 ms\n time.sleep (0.005)\n\n \
  267. \ # (11) mute transmit (disable Selector)\n if (_debug):\n \
  268. \ print (\"r11\")\n self.message_port_pub(pmt.intern('tx_mute'),\
  269. \ pmt.to_pmt(False))\n\n # (10) send message to relay_sequencer\n\
  270. \ if (_debug):\n print (\"r10\")\n self.message_port_pub(pmt.intern('sw_cmd'),\n\
  271. \ pmt.cons(pmt.intern('pressed'),\n pmt.from_long(0)))\n\
  272. \n # (9) turn off Amp LED\n if (_debug):\n \
  273. \ print (\"r9\")\n self.message_port_pub(pmt.intern('pa_sw'),\n\
  274. \ pmt.cons(pmt.intern('pressed'),\n pmt.from_bool(False)))\n\
  275. \n elif (new_val == 2):\n\n # (4) turn off Antenna LED\n \
  276. \ if (_debug):\n print (\"r4\")\n self.message_port_pub(pmt.intern('ant_sw'),\n\
  277. \ pmt.cons(pmt.intern('pressed'),\n pmt.from_bool(False)))\n\
  278. \n # (3) delay 10 ms\n time.sleep (0.01)\n\n \
  279. \ # (2) turn on rcv LED\n if (_debug):\n print (\"\
  280. r2\")\n self.message_port_pub(pmt.intern('rx_led'),\n \
  281. \ pmt.cons(pmt.intern('pressed'),\n pmt.from_bool(True)))\n\
  282. \n # unmute receive\n if (_debug):\n print\
  283. \ (\"r1\")\n self.message_port_pub(pmt.intern('rx_mute'), pmt.to_pmt(False))\n\
  284. \n\n"
  285. affinity: ''
  286. alias: ''
  287. comment: ''
  288. maxoutbuf: '0'
  289. minoutbuf: '0'
  290. states:
  291. _io_cache: ('XMT/RCV Control', 'blk', [], [('msg_in', 'message', 1)], [('rx_mute',
  292. 'message', 1), ('pa_sw', 'message', 1), ('sw_cmd', 'message', 1), ('ant_sw',
  293. 'message', 1), ('rx_led', 'message', 1), ('tx_mute', 'message', 1), ('burst',
  294. 'message', 1)], '\n reads input from a message port\n generates control
  295. messages\n ', [])
  296. bus_sink: false
  297. bus_source: false
  298. bus_structure: null
  299. coordinate: [320, 368.0]
  300. rotation: 0
  301. state: true
  302. - name: iio_pluto_sink_0
  303. id: iio_pluto_sink
  304. parameters:
  305. affinity: ''
  306. alias: ''
  307. attenuation1: tx_atten
  308. bandwidth: '200000'
  309. buffer_size: '32768'
  310. comment: ''
  311. cyclic: 'False'
  312. filter: ''
  313. filter_source: '''Auto'''
  314. fpass: samp_rate/4
  315. frequency: int(tx_freq)
  316. fstop: samp_rate/3
  317. samplerate: samp_rate
  318. uri: ip:192.168.3.1
  319. states:
  320. bus_sink: false
  321. bus_source: false
  322. bus_structure: null
  323. coordinate: [928, 604.0]
  324. rotation: 0
  325. state: true
  326. - name: iio_pluto_source_0
  327. id: iio_pluto_source
  328. parameters:
  329. affinity: ''
  330. alias: ''
  331. bandwidth: '200000'
  332. bbdc: 'True'
  333. buffer_size: '32768'
  334. comment: ''
  335. filter: ''
  336. filter_source: '''Auto'''
  337. fpass: samp_rate/4
  338. frequency: int(freq)
  339. fstop: samp_rate/3
  340. gain1: '''manual'''
  341. manual_gain1: gain
  342. maxoutbuf: '0'
  343. minoutbuf: '0'
  344. quadrature: 'True'
  345. rfdc: 'True'
  346. samplerate: samp_rate
  347. uri: ip:192.168.3.1
  348. states:
  349. bus_sink: false
  350. bus_source: false
  351. bus_structure: null
  352. coordinate: [336, 140.0]
  353. rotation: 0
  354. state: true
  355. - name: low_pass_filter_0
  356. id: low_pass_filter
  357. parameters:
  358. affinity: ''
  359. alias: ''
  360. beta: '6.76'
  361. comment: ''
  362. cutoff_freq: '5000'
  363. decim: '1'
  364. gain: '1'
  365. interp: '1'
  366. maxoutbuf: '0'
  367. minoutbuf: '0'
  368. samp_rate: samp_rate
  369. type: fir_filter_ccf
  370. width: '1000'
  371. win: window.WIN_HAMMING
  372. states:
  373. bus_sink: false
  374. bus_source: false
  375. bus_structure: null
  376. coordinate: [736, 612.0]
  377. rotation: 0
  378. state: true
  379. - name: note_0
  380. id: note
  381. parameters:
  382. alias: ''
  383. comment: 'All I/O sample rates have been
  384.  
  385. set to 768kHz for USRP and Pluto'
  386. note: I/O sample rates = 768kHz
  387. states:
  388. bus_sink: false
  389. bus_source: false
  390. bus_structure: null
  391. coordinate: [16, 220.0]
  392. rotation: 0
  393. state: true
  394. - name: qtgui_ledindicator_0
  395. id: qtgui_ledindicator
  396. parameters:
  397. affinity: ''
  398. alias: ''
  399. cellalignment: '1'
  400. comment: ''
  401. gui_hint: 0,2,1,1
  402. label: '"Power Amp"'
  403. maxSize: '40'
  404. offColor: gray
  405. onColor: red
  406. position: '1'
  407. state: 'False'
  408. verticalalignment: '1'
  409. states:
  410. bus_sink: false
  411. bus_source: false
  412. bus_structure: null
  413. coordinate: [608, 324.0]
  414. rotation: 0
  415. state: true
  416. - name: qtgui_ledindicator_1
  417. id: qtgui_ledindicator
  418. parameters:
  419. affinity: ''
  420. alias: ''
  421. cellalignment: '1'
  422. comment: ''
  423. gui_hint: 0,1,1,1
  424. label: '"Antenna"'
  425. maxSize: '40'
  426. offColor: lime
  427. onColor: yellow
  428. position: '1'
  429. state: 'False'
  430. verticalalignment: '1'
  431. states:
  432. bus_sink: false
  433. bus_source: false
  434. bus_structure: null
  435. coordinate: [608, 436.0]
  436. rotation: 0
  437. state: true
  438. - name: qtgui_ledindicator_2
  439. id: qtgui_ledindicator
  440. parameters:
  441. affinity: ''
  442. alias: ''
  443. cellalignment: '1'
  444. comment: ''
  445. gui_hint: 0,0,1,1
  446. label: '"Receive"'
  447. maxSize: '40'
  448. offColor: gray
  449. onColor: lime
  450. position: '1'
  451. state: 'True'
  452. verticalalignment: '1'
  453. states:
  454. bus_sink: false
  455. bus_source: false
  456. bus_structure: null
  457. coordinate: [608, 516.0]
  458. rotation: 0
  459. state: true
  460. - name: zeromq_pub_msg_sink_0
  461. id: zeromq_pub_msg_sink
  462. parameters:
  463. address: tcp://192.168.1.194:49202
  464. affinity: ''
  465. alias: ''
  466. bind: 'True'
  467. comment: ''
  468. timeout: '100'
  469. states:
  470. bus_sink: false
  471. bus_source: false
  472. bus_structure: null
  473. coordinate: [800, 356.0]
  474. rotation: 0
  475. state: true
  476. - name: zeromq_pub_sink_0
  477. id: zeromq_pub_sink
  478. parameters:
  479. address: tcp://127.0.0.1:49201
  480. affinity: ''
  481. alias: ''
  482. comment: ''
  483. hwm: '-1'
  484. key: ''
  485. pass_tags: 'False'
  486. timeout: '100'
  487. type: complex
  488. vlen: '1'
  489. states:
  490. bus_sink: false
  491. bus_source: false
  492. bus_structure: null
  493. coordinate: [792, 212.0]
  494. rotation: 0
  495. state: true
  496. - name: zeromq_sub_msg_source_0
  497. id: zeromq_sub_msg_source
  498. parameters:
  499. address: tcp://192.168.1.137:49204
  500. affinity: ''
  501. alias: ''
  502. bind: 'False'
  503. comment: ''
  504. maxoutbuf: '0'
  505. minoutbuf: '0'
  506. timeout: '100'
  507. states:
  508. bus_sink: false
  509. bus_source: false
  510. bus_structure: null
  511. coordinate: [16, 356.0]
  512. rotation: 0
  513. state: true
  514. - name: zeromq_sub_source_0
  515. id: zeromq_sub_source
  516. parameters:
  517. address: tcp://127.0.0.1:49203
  518. affinity: ''
  519. alias: ''
  520. comment: ''
  521. hwm: '-1'
  522. key: ''
  523. maxoutbuf: '0'
  524. minoutbuf: '0'
  525. pass_tags: 'False'
  526. timeout: '100'
  527. type: complex
  528. vlen: '1'
  529. states:
  530. bus_sink: false
  531. bus_source: false
  532. bus_structure: null
  533. coordinate: [128, 588.0]
  534. rotation: 0
  535. state: true
  536.  
  537. connections:
  538. - [blocks_mute_xx_0, '0', zeromq_pub_sink_0, '0']
  539. - [blocks_selector_0, '0', low_pass_filter_0, '0']
  540. - [epy_block_0, ant_sw, qtgui_ledindicator_1, state]
  541. - [epy_block_0, pa_sw, qtgui_ledindicator_0, state]
  542. - [epy_block_0, rx_led, qtgui_ledindicator_2, state]
  543. - [epy_block_0, rx_mute, blocks_mute_xx_0, set_mute]
  544. - [epy_block_0, sw_cmd, zeromq_pub_msg_sink_0, in]
  545. - [epy_block_0, tx_mute, blocks_selector_0, en]
  546. - [iio_pluto_source_0, '0', blocks_mute_xx_0, '0']
  547. - [low_pass_filter_0, '0', iio_pluto_sink_0, '0']
  548. - [variable_qtgui_toggle_button_msg_0, state, epy_block_0, msg_in]
  549. - [zeromq_sub_msg_source_0, out, epy_block_0, msg_in]
  550. - [zeromq_sub_source_0, '0', blocks_selector_0, '0']
  551.  
  552. metadata:
  553. file_format: 1
  554.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement