scope.grc 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653
  1. options:
  2. parameters:
  3. author: ''
  4. category: '[GRC Hier Blocks]'
  5. cmake_opt: ''
  6. comment: ''
  7. copyright: ''
  8. description: ''
  9. gen_cmake: 'On'
  10. gen_linking: dynamic
  11. generate_options: qt_gui
  12. hier_block_src_path: '.:'
  13. id: scope
  14. max_nouts: '0'
  15. output_language: python
  16. placement: (0,0)
  17. qt_qss_theme: ''
  18. realtime_scheduling: ''
  19. run: 'True'
  20. run_command: '{python} -u {filename}'
  21. run_options: prompt
  22. sizing_mode: fixed
  23. thread_safe_setters: ''
  24. title: Arduino Voltmeter / Oscilloscope
  25. window_size: ''
  26. states:
  27. bus_sink: false
  28. bus_source: false
  29. bus_structure: null
  30. coordinate: [20, 20]
  31. rotation: 0
  32. state: enabled
  33. blocks:
  34. - name: input_voltage_max
  35. id: variable
  36. parameters:
  37. comment: ''
  38. value: reference_voltage * resistor_in_ohm / resistor_ground_ohm + reference_voltage
  39. states:
  40. bus_sink: false
  41. bus_source: false
  42. bus_structure: null
  43. coordinate: [1491, 193]
  44. rotation: 0
  45. state: true
  46. - name: input_voltage_min
  47. id: variable
  48. parameters:
  49. comment: ''
  50. value: -1 * reference_voltage * resistor_in_ohm / resistor_ref_ohm
  51. states:
  52. bus_sink: false
  53. bus_source: false
  54. bus_structure: null
  55. coordinate: [1494, 94]
  56. rotation: 0
  57. state: true
  58. - name: reference_voltage
  59. id: variable
  60. parameters:
  61. comment: ''
  62. value: '4.11'
  63. states:
  64. bus_sink: false
  65. bus_source: false
  66. bus_structure: null
  67. coordinate: [457, 222]
  68. rotation: 0
  69. state: true
  70. - name: resistor_ground_ohm
  71. id: variable
  72. parameters:
  73. comment: ''
  74. value: 10e3
  75. states:
  76. bus_sink: false
  77. bus_source: false
  78. bus_structure: null
  79. coordinate: [892, 124]
  80. rotation: 0
  81. state: true
  82. - name: resistor_in_ohm
  83. id: variable
  84. parameters:
  85. comment: ''
  86. value: 100e3
  87. states:
  88. bus_sink: false
  89. bus_source: false
  90. bus_structure: null
  91. coordinate: [926, 26]
  92. rotation: 0
  93. state: true
  94. - name: resistor_ref_ohm
  95. id: variable
  96. parameters:
  97. comment: ''
  98. value: 10e3
  99. states:
  100. bus_sink: false
  101. bus_source: false
  102. bus_structure: null
  103. coordinate: [925, 222]
  104. rotation: 0
  105. state: true
  106. - name: sample_rate_hz
  107. id: variable
  108. parameters:
  109. comment: ''
  110. value: '1044.4'
  111. states:
  112. bus_sink: false
  113. bus_source: false
  114. bus_structure: null
  115. coordinate: [58, 173]
  116. rotation: 0
  117. state: enabled
  118. - name: blocks_add_const_vxx_0
  119. id: blocks_add_const_vxx
  120. parameters:
  121. affinity: ''
  122. alias: ''
  123. comment: '- V_ref * R_in / R_ref'
  124. const: input_voltage_min
  125. maxoutbuf: '0'
  126. minoutbuf: '0'
  127. type: float
  128. vlen: '1'
  129. states:
  130. bus_sink: false
  131. bus_source: false
  132. bus_structure: null
  133. coordinate: [1116, 324]
  134. rotation: 0
  135. state: enabled
  136. - name: blocks_message_debug_0
  137. id: blocks_message_debug
  138. parameters:
  139. affinity: ''
  140. alias: ''
  141. comment: ''
  142. states:
  143. bus_sink: false
  144. bus_source: false
  145. bus_structure: null
  146. coordinate: [991, 817]
  147. rotation: 0
  148. state: true
  149. - name: blocks_multiply_const_vxx_0
  150. id: blocks_multiply_const_vxx
  151. parameters:
  152. affinity: ''
  153. alias: ''
  154. comment: (1 + R_in / R_gnd + R_in / R_ref)
  155. const: '1 + resistor_in_ohm / resistor_ground_ohm + resistor_in_ohm / resistor_ref_ohm '
  156. maxoutbuf: '0'
  157. minoutbuf: '0'
  158. type: float
  159. vlen: '1'
  160. states:
  161. bus_sink: false
  162. bus_source: false
  163. bus_structure: null
  164. coordinate: [816, 324]
  165. rotation: 0
  166. state: enabled
  167. - name: blocks_probe_rate_0
  168. id: blocks_probe_rate
  169. parameters:
  170. affinity: ''
  171. alias: ''
  172. alpha: '0.15'
  173. comment: ''
  174. maxoutbuf: '0'
  175. minoutbuf: '0'
  176. mintime: '10000.0'
  177. type: short
  178. vlen: '1'
  179. states:
  180. bus_sink: false
  181. bus_source: false
  182. bus_structure: null
  183. coordinate: [391, 781]
  184. rotation: 0
  185. state: true
  186. - name: blocks_short_to_float_0
  187. id: blocks_short_to_float
  188. parameters:
  189. affinity: ''
  190. alias: ''
  191. comment: ''
  192. maxoutbuf: '0'
  193. minoutbuf: '0'
  194. scale: 1024 / reference_voltage
  195. vlen: '1'
  196. states:
  197. bus_sink: false
  198. bus_source: false
  199. bus_structure: null
  200. coordinate: [483, 324]
  201. rotation: 0
  202. state: true
  203. - name: epy_block_0
  204. id: epy_block
  205. parameters:
  206. _source_code: "import gnuradio\nimport numpy\nimport serial\n\n\nclass ArduinoAnalogReadings(gnuradio.gr.sync_block):\n\
  207. \ def __init__(\n self, port=\"/dev/ttyUSB0\", baud_rate=115200, buffer_max_length=10,\
  208. \ timeout=2\n ):\n gnuradio.gr.sync_block.__init__(\n self,\
  209. \ name=\"Arduino Analog Readings\", in_sig=None, out_sig=[numpy.int16]\n \
  210. \ )\n self._serial_port = serial.Serial(\n port=port,\
  211. \ baudrate=baud_rate, bytesize=serial.EIGHTBITS, timeout=timeout\n )\n\
  212. \ self._buffer_max_length = buffer_max_length\n\n def work(self, input_items,\
  213. \ output_items):\n # pylint: disable=unused-argument\n buffer\
  214. \ = self._serial_port.read(\n 2 * min(len(output_items[0]), self._buffer_max_length)\n\
  215. \ )\n assert len(buffer) % 2 == 0\n buffer_samples_count\
  216. \ = len(buffer) // 2\n output_items[0][:buffer_samples_count] = numpy.frombuffer(buffer,\
  217. \ dtype=\">u2\")\n assert output_items[0][:buffer_samples_count].max()\
  218. \ < 1024, \"lost sync?\"\n return buffer_samples_count\n"
  219. affinity: ''
  220. alias: ''
  221. baud_rate: '115200'
  222. buffer_max_length: int(sample_rate_hz/4)
  223. comment: ''
  224. maxoutbuf: '0'
  225. minoutbuf: '0'
  226. port: '''/dev/ttyUSB0'''
  227. timeout: '2'
  228. states:
  229. _io_cache: ('Arduino Analog Readings', 'ArduinoAnalogReadings', [('port', "'/dev/ttyUSB0'"),
  230. ('baud_rate', '115200'), ('buffer_max_length', '10'), ('timeout', '2')], [],
  231. [('0', 'short', 1)], '', [])
  232. bus_sink: false
  233. bus_source: false
  234. bus_structure: null
  235. coordinate: [15, 276]
  236. rotation: 0
  237. state: true
  238. - name: qtgui_freq_sink_x_0
  239. id: qtgui_freq_sink_x
  240. parameters:
  241. affinity: ''
  242. alias: ''
  243. alpha1: '1.0'
  244. alpha10: '1.0'
  245. alpha2: '1.0'
  246. alpha3: '1.0'
  247. alpha4: '1.0'
  248. alpha5: '1.0'
  249. alpha6: '1.0'
  250. alpha7: '1.0'
  251. alpha8: '1.0'
  252. alpha9: '1.0'
  253. autoscale: 'False'
  254. average: '1.0'
  255. axislabels: 'True'
  256. bw: sample_rate_hz
  257. color1: '"blue"'
  258. color10: '"dark blue"'
  259. color2: '"red"'
  260. color3: '"green"'
  261. color4: '"black"'
  262. color5: '"cyan"'
  263. color6: '"magenta"'
  264. color7: '"yellow"'
  265. color8: '"dark red"'
  266. color9: '"dark green"'
  267. comment: ''
  268. ctrlpanel: 'False'
  269. fc: '0'
  270. fftsize: '1024'
  271. freqhalf: 'False'
  272. grid: 'False'
  273. gui_hint: ''
  274. label: Relative Gain
  275. label1: ''
  276. label10: ''''''
  277. label2: ''''''
  278. label3: ''''''
  279. label4: ''''''
  280. label5: ''''''
  281. label6: ''''''
  282. label7: ''''''
  283. label8: ''''''
  284. label9: ''''''
  285. legend: 'False'
  286. maxoutbuf: '0'
  287. minoutbuf: '0'
  288. name: '""'
  289. nconnections: '1'
  290. showports: 'False'
  291. tr_chan: '0'
  292. tr_level: '0.0'
  293. tr_mode: qtgui.TRIG_MODE_FREE
  294. tr_tag: '""'
  295. type: float
  296. units: dB
  297. update_time: '0.10'
  298. width1: '2'
  299. width10: '1'
  300. width2: '1'
  301. width3: '1'
  302. width4: '1'
  303. width5: '1'
  304. width6: '1'
  305. width7: '1'
  306. width8: '1'
  307. width9: '1'
  308. wintype: firdes.WIN_BLACKMAN_hARRIS
  309. ymax: '0'
  310. ymin: '-100'
  311. states:
  312. bus_sink: false
  313. bus_source: false
  314. bus_structure: null
  315. coordinate: [897, 459]
  316. rotation: 0
  317. state: enabled
  318. - name: qtgui_number_sink_0
  319. id: qtgui_number_sink
  320. parameters:
  321. affinity: ''
  322. alias: ''
  323. autoscale: 'False'
  324. avg: '0'
  325. color1: ("black", "black")
  326. color10: ("black", "black")
  327. color2: ("black", "black")
  328. color3: ("black", "black")
  329. color4: ("black", "black")
  330. color5: ("black", "black")
  331. color6: ("black", "black")
  332. color7: ("black", "black")
  333. color8: ("black", "black")
  334. color9: ("black", "black")
  335. comment: ''
  336. factor1: '1'
  337. factor10: '1'
  338. factor2: '1'
  339. factor3: '1'
  340. factor4: '1'
  341. factor5: '1'
  342. factor6: '1'
  343. factor7: '1'
  344. factor8: '1'
  345. factor9: '1'
  346. graph_type: qtgui.NUM_GRAPH_HORIZ
  347. gui_hint: ''
  348. label1: Voltage
  349. label10: ''
  350. label2: ''
  351. label3: ''
  352. label4: ''
  353. label5: ''
  354. label6: ''
  355. label7: ''
  356. label8: ''
  357. label9: ''
  358. max: input_voltage_max
  359. min: input_voltage_min
  360. name: '""'
  361. nconnections: '1'
  362. type: float
  363. unit1: V
  364. unit10: ''
  365. unit2: ''
  366. unit3: ''
  367. unit4: ''
  368. unit5: ''
  369. unit6: ''
  370. unit7: ''
  371. unit8: ''
  372. unit9: ''
  373. update_time: '0.10'
  374. states:
  375. bus_sink: false
  376. bus_source: false
  377. bus_structure: null
  378. coordinate: [1490, 428]
  379. rotation: 0
  380. state: enabled
  381. - name: qtgui_number_sink_0_0
  382. id: qtgui_number_sink
  383. parameters:
  384. affinity: ''
  385. alias: ''
  386. autoscale: 'False'
  387. avg: '0'
  388. color1: ("black", "black")
  389. color10: ("black", "black")
  390. color2: ("black", "black")
  391. color3: ("black", "black")
  392. color4: ("black", "black")
  393. color5: ("black", "black")
  394. color6: ("black", "black")
  395. color7: ("black", "black")
  396. color8: ("black", "black")
  397. color9: ("black", "black")
  398. comment: ''
  399. factor1: '1'
  400. factor10: '1'
  401. factor2: '1'
  402. factor3: '1'
  403. factor4: '1'
  404. factor5: '1'
  405. factor6: '1'
  406. factor7: '1'
  407. factor8: '1'
  408. factor9: '1'
  409. graph_type: qtgui.NUM_GRAPH_HORIZ
  410. gui_hint: ''
  411. label1: ''
  412. label10: ''
  413. label2: ''
  414. label3: ''
  415. label4: ''
  416. label5: ''
  417. label6: ''
  418. label7: ''
  419. label8: ''
  420. label9: ''
  421. max: '1024'
  422. min: '0'
  423. name: '"Arduino Reading"'
  424. nconnections: '1'
  425. type: short
  426. unit1: ''
  427. unit10: ''
  428. unit2: ''
  429. unit3: ''
  430. unit4: ''
  431. unit5: ''
  432. unit6: ''
  433. unit7: ''
  434. unit8: ''
  435. unit9: ''
  436. update_time: '0.10'
  437. states:
  438. bus_sink: false
  439. bus_source: false
  440. bus_structure: null
  441. coordinate: [452, 499]
  442. rotation: 0
  443. state: disabled
  444. - name: qtgui_time_sink_x_0
  445. id: qtgui_time_sink_x
  446. parameters:
  447. affinity: ''
  448. alias: ''
  449. alpha1: '1.0'
  450. alpha10: '1.0'
  451. alpha2: '1.0'
  452. alpha3: '1.0'
  453. alpha4: '1.0'
  454. alpha5: '1.0'
  455. alpha6: '1.0'
  456. alpha7: '1.0'
  457. alpha8: '1.0'
  458. alpha9: '1.0'
  459. autoscale: 'False'
  460. axislabels: 'True'
  461. color1: blue
  462. color10: dark blue
  463. color2: red
  464. color3: green
  465. color4: black
  466. color5: cyan
  467. color6: magenta
  468. color7: yellow
  469. color8: dark red
  470. color9: dark green
  471. comment: ''
  472. ctrlpanel: 'False'
  473. entags: 'True'
  474. grid: 'False'
  475. gui_hint: ''
  476. label1: Signal 1
  477. label10: Signal 10
  478. label2: Signal 2
  479. label3: Signal 3
  480. label4: Signal 4
  481. label5: Signal 5
  482. label6: Signal 6
  483. label7: Signal 7
  484. label8: Signal 8
  485. label9: Signal 9
  486. legend: 'False'
  487. marker1: '-1'
  488. marker10: '-1'
  489. marker2: '-1'
  490. marker3: '-1'
  491. marker4: '-1'
  492. marker5: '-1'
  493. marker6: '-1'
  494. marker7: '-1'
  495. marker8: '-1'
  496. marker9: '-1'
  497. name: '""'
  498. nconnections: '1'
  499. size: int(sample_rate_hz*2)
  500. srate: sample_rate_hz
  501. stemplot: 'False'
  502. style1: '1'
  503. style10: '1'
  504. style2: '1'
  505. style3: '1'
  506. style4: '1'
  507. style5: '1'
  508. style6: '1'
  509. style7: '1'
  510. style8: '1'
  511. style9: '1'
  512. tr_chan: '0'
  513. tr_delay: '0'
  514. tr_level: '0.0'
  515. tr_mode: qtgui.TRIG_MODE_FREE
  516. tr_slope: qtgui.TRIG_SLOPE_POS
  517. tr_tag: '""'
  518. type: float
  519. update_time: '0.10'
  520. width1: '2'
  521. width10: '1'
  522. width2: '1'
  523. width3: '1'
  524. width4: '1'
  525. width5: '1'
  526. width6: '1'
  527. width7: '1'
  528. width8: '1'
  529. width9: '1'
  530. ylabel: Voltage
  531. ymax: input_voltage_max
  532. ymin: input_voltage_min
  533. yunit: '"V"'
  534. states:
  535. bus_sink: false
  536. bus_source: false
  537. bus_structure: null
  538. coordinate: [1462, 292]
  539. rotation: 0
  540. state: enabled
  541. - name: qtgui_time_sink_x_0_0
  542. id: qtgui_time_sink_x
  543. parameters:
  544. affinity: ''
  545. alias: ''
  546. alpha1: '1.0'
  547. alpha10: '1.0'
  548. alpha2: '1.0'
  549. alpha3: '1.0'
  550. alpha4: '1.0'
  551. alpha5: '1.0'
  552. alpha6: '1.0'
  553. alpha7: '1.0'
  554. alpha8: '1.0'
  555. alpha9: '1.0'
  556. autoscale: 'False'
  557. axislabels: 'True'
  558. color1: blue
  559. color10: dark blue
  560. color2: red
  561. color3: green
  562. color4: black
  563. color5: cyan
  564. color6: magenta
  565. color7: yellow
  566. color8: dark red
  567. color9: dark green
  568. comment: ''
  569. ctrlpanel: 'False'
  570. entags: 'True'
  571. grid: 'False'
  572. gui_hint: ''
  573. label1: Signal 1
  574. label10: Signal 10
  575. label2: Signal 2
  576. label3: Signal 3
  577. label4: Signal 4
  578. label5: Signal 5
  579. label6: Signal 6
  580. label7: Signal 7
  581. label8: Signal 8
  582. label9: Signal 9
  583. legend: 'False'
  584. marker1: '-1'
  585. marker10: '-1'
  586. marker2: '-1'
  587. marker3: '-1'
  588. marker4: '-1'
  589. marker5: '-1'
  590. marker6: '-1'
  591. marker7: '-1'
  592. marker8: '-1'
  593. marker9: '-1'
  594. name: '""'
  595. nconnections: '1'
  596. size: int(sample_rate_hz*2)
  597. srate: sample_rate_hz
  598. stemplot: 'False'
  599. style1: '1'
  600. style10: '1'
  601. style2: '1'
  602. style3: '1'
  603. style4: '1'
  604. style5: '1'
  605. style6: '1'
  606. style7: '1'
  607. style8: '1'
  608. style9: '1'
  609. tr_chan: '0'
  610. tr_delay: '0'
  611. tr_level: '0.0'
  612. tr_mode: qtgui.TRIG_MODE_FREE
  613. tr_slope: qtgui.TRIG_SLOPE_POS
  614. tr_tag: '""'
  615. type: float
  616. update_time: '0.10'
  617. width1: '2'
  618. width10: '1'
  619. width2: '1'
  620. width3: '1'
  621. width4: '1'
  622. width5: '1'
  623. width6: '1'
  624. width7: '1'
  625. width8: '1'
  626. width9: '1'
  627. ylabel: Arduino Input Voltage
  628. ymax: reference_voltage
  629. ymin: '0'
  630. yunit: '"V"'
  631. states:
  632. bus_sink: false
  633. bus_source: false
  634. bus_structure: null
  635. coordinate: [896, 636]
  636. rotation: 0
  637. state: disabled
  638. connections:
  639. - [blocks_add_const_vxx_0, '0', qtgui_number_sink_0, '0']
  640. - [blocks_add_const_vxx_0, '0', qtgui_time_sink_x_0, '0']
  641. - [blocks_multiply_const_vxx_0, '0', blocks_add_const_vxx_0, '0']
  642. - [blocks_probe_rate_0, rate, blocks_message_debug_0, print]
  643. - [blocks_short_to_float_0, '0', blocks_multiply_const_vxx_0, '0']
  644. - [blocks_short_to_float_0, '0', qtgui_freq_sink_x_0, '0']
  645. - [blocks_short_to_float_0, '0', qtgui_time_sink_x_0_0, '0']
  646. - [epy_block_0, '0', blocks_probe_rate_0, '0']
  647. - [epy_block_0, '0', blocks_short_to_float_0, '0']
  648. - [epy_block_0, '0', qtgui_number_sink_0_0, '0']
  649. metadata:
  650. file_format: 1