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: qtgui_freq_sink_x_0
  204. id: qtgui_freq_sink_x
  205. parameters:
  206. affinity: ''
  207. alias: ''
  208. alpha1: '1.0'
  209. alpha10: '1.0'
  210. alpha2: '1.0'
  211. alpha3: '1.0'
  212. alpha4: '1.0'
  213. alpha5: '1.0'
  214. alpha6: '1.0'
  215. alpha7: '1.0'
  216. alpha8: '1.0'
  217. alpha9: '1.0'
  218. autoscale: 'False'
  219. average: '1.0'
  220. axislabels: 'True'
  221. bw: sample_rate_hz
  222. color1: '"blue"'
  223. color10: '"dark blue"'
  224. color2: '"red"'
  225. color3: '"green"'
  226. color4: '"black"'
  227. color5: '"cyan"'
  228. color6: '"magenta"'
  229. color7: '"yellow"'
  230. color8: '"dark red"'
  231. color9: '"dark green"'
  232. comment: ''
  233. ctrlpanel: 'False'
  234. fc: '0'
  235. fftsize: '1024'
  236. freqhalf: 'False'
  237. grid: 'False'
  238. gui_hint: ''
  239. label: Relative Gain
  240. label1: ''
  241. label10: ''''''
  242. label2: ''''''
  243. label3: ''''''
  244. label4: ''''''
  245. label5: ''''''
  246. label6: ''''''
  247. label7: ''''''
  248. label8: ''''''
  249. label9: ''''''
  250. legend: 'False'
  251. maxoutbuf: '0'
  252. minoutbuf: '0'
  253. name: '""'
  254. nconnections: '1'
  255. showports: 'False'
  256. tr_chan: '0'
  257. tr_level: '0.0'
  258. tr_mode: qtgui.TRIG_MODE_FREE
  259. tr_tag: '""'
  260. type: float
  261. units: dB
  262. update_time: '0.10'
  263. width1: '2'
  264. width10: '1'
  265. width2: '1'
  266. width3: '1'
  267. width4: '1'
  268. width5: '1'
  269. width6: '1'
  270. width7: '1'
  271. width8: '1'
  272. width9: '1'
  273. wintype: firdes.WIN_BLACKMAN_hARRIS
  274. ymax: '0'
  275. ymin: '-100'
  276. states:
  277. bus_sink: false
  278. bus_source: false
  279. bus_structure: null
  280. coordinate: [897, 459]
  281. rotation: 0
  282. state: enabled
  283. - name: qtgui_number_sink_0
  284. id: qtgui_number_sink
  285. parameters:
  286. affinity: ''
  287. alias: ''
  288. autoscale: 'False'
  289. avg: '0'
  290. color1: ("black", "black")
  291. color10: ("black", "black")
  292. color2: ("black", "black")
  293. color3: ("black", "black")
  294. color4: ("black", "black")
  295. color5: ("black", "black")
  296. color6: ("black", "black")
  297. color7: ("black", "black")
  298. color8: ("black", "black")
  299. color9: ("black", "black")
  300. comment: ''
  301. factor1: '1'
  302. factor10: '1'
  303. factor2: '1'
  304. factor3: '1'
  305. factor4: '1'
  306. factor5: '1'
  307. factor6: '1'
  308. factor7: '1'
  309. factor8: '1'
  310. factor9: '1'
  311. graph_type: qtgui.NUM_GRAPH_HORIZ
  312. gui_hint: ''
  313. label1: Voltage
  314. label10: ''
  315. label2: ''
  316. label3: ''
  317. label4: ''
  318. label5: ''
  319. label6: ''
  320. label7: ''
  321. label8: ''
  322. label9: ''
  323. max: input_voltage_max
  324. min: input_voltage_min
  325. name: '""'
  326. nconnections: '1'
  327. type: float
  328. unit1: V
  329. unit10: ''
  330. unit2: ''
  331. unit3: ''
  332. unit4: ''
  333. unit5: ''
  334. unit6: ''
  335. unit7: ''
  336. unit8: ''
  337. unit9: ''
  338. update_time: '0.10'
  339. states:
  340. bus_sink: false
  341. bus_source: false
  342. bus_structure: null
  343. coordinate: [1490, 428]
  344. rotation: 0
  345. state: enabled
  346. - name: qtgui_number_sink_0_0
  347. id: qtgui_number_sink
  348. parameters:
  349. affinity: ''
  350. alias: ''
  351. autoscale: 'False'
  352. avg: '0'
  353. color1: ("black", "black")
  354. color10: ("black", "black")
  355. color2: ("black", "black")
  356. color3: ("black", "black")
  357. color4: ("black", "black")
  358. color5: ("black", "black")
  359. color6: ("black", "black")
  360. color7: ("black", "black")
  361. color8: ("black", "black")
  362. color9: ("black", "black")
  363. comment: ''
  364. factor1: '1'
  365. factor10: '1'
  366. factor2: '1'
  367. factor3: '1'
  368. factor4: '1'
  369. factor5: '1'
  370. factor6: '1'
  371. factor7: '1'
  372. factor8: '1'
  373. factor9: '1'
  374. graph_type: qtgui.NUM_GRAPH_HORIZ
  375. gui_hint: ''
  376. label1: ''
  377. label10: ''
  378. label2: ''
  379. label3: ''
  380. label4: ''
  381. label5: ''
  382. label6: ''
  383. label7: ''
  384. label8: ''
  385. label9: ''
  386. max: '1024'
  387. min: '0'
  388. name: '"Arduino Reading"'
  389. nconnections: '1'
  390. type: short
  391. unit1: ''
  392. unit10: ''
  393. unit2: ''
  394. unit3: ''
  395. unit4: ''
  396. unit5: ''
  397. unit6: ''
  398. unit7: ''
  399. unit8: ''
  400. unit9: ''
  401. update_time: '0.10'
  402. states:
  403. bus_sink: false
  404. bus_source: false
  405. bus_structure: null
  406. coordinate: [452, 499]
  407. rotation: 0
  408. state: disabled
  409. - name: qtgui_time_sink_x_0
  410. id: qtgui_time_sink_x
  411. parameters:
  412. affinity: ''
  413. alias: ''
  414. alpha1: '1.0'
  415. alpha10: '1.0'
  416. alpha2: '1.0'
  417. alpha3: '1.0'
  418. alpha4: '1.0'
  419. alpha5: '1.0'
  420. alpha6: '1.0'
  421. alpha7: '1.0'
  422. alpha8: '1.0'
  423. alpha9: '1.0'
  424. autoscale: 'False'
  425. axislabels: 'True'
  426. color1: blue
  427. color10: dark blue
  428. color2: red
  429. color3: green
  430. color4: black
  431. color5: cyan
  432. color6: magenta
  433. color7: yellow
  434. color8: dark red
  435. color9: dark green
  436. comment: ''
  437. ctrlpanel: 'False'
  438. entags: 'True'
  439. grid: 'False'
  440. gui_hint: ''
  441. label1: Signal 1
  442. label10: Signal 10
  443. label2: Signal 2
  444. label3: Signal 3
  445. label4: Signal 4
  446. label5: Signal 5
  447. label6: Signal 6
  448. label7: Signal 7
  449. label8: Signal 8
  450. label9: Signal 9
  451. legend: 'False'
  452. marker1: '-1'
  453. marker10: '-1'
  454. marker2: '-1'
  455. marker3: '-1'
  456. marker4: '-1'
  457. marker5: '-1'
  458. marker6: '-1'
  459. marker7: '-1'
  460. marker8: '-1'
  461. marker9: '-1'
  462. name: '""'
  463. nconnections: '1'
  464. size: int(sample_rate_hz*2)
  465. srate: sample_rate_hz
  466. stemplot: 'False'
  467. style1: '1'
  468. style10: '1'
  469. style2: '1'
  470. style3: '1'
  471. style4: '1'
  472. style5: '1'
  473. style6: '1'
  474. style7: '1'
  475. style8: '1'
  476. style9: '1'
  477. tr_chan: '0'
  478. tr_delay: '0'
  479. tr_level: '0.0'
  480. tr_mode: qtgui.TRIG_MODE_FREE
  481. tr_slope: qtgui.TRIG_SLOPE_POS
  482. tr_tag: '""'
  483. type: float
  484. update_time: '0.10'
  485. width1: '2'
  486. width10: '1'
  487. width2: '1'
  488. width3: '1'
  489. width4: '1'
  490. width5: '1'
  491. width6: '1'
  492. width7: '1'
  493. width8: '1'
  494. width9: '1'
  495. ylabel: Voltage
  496. ymax: input_voltage_max
  497. ymin: input_voltage_min
  498. yunit: '"V"'
  499. states:
  500. bus_sink: false
  501. bus_source: false
  502. bus_structure: null
  503. coordinate: [1462, 292]
  504. rotation: 0
  505. state: enabled
  506. - name: qtgui_time_sink_x_0_0
  507. id: qtgui_time_sink_x
  508. parameters:
  509. affinity: ''
  510. alias: ''
  511. alpha1: '1.0'
  512. alpha10: '1.0'
  513. alpha2: '1.0'
  514. alpha3: '1.0'
  515. alpha4: '1.0'
  516. alpha5: '1.0'
  517. alpha6: '1.0'
  518. alpha7: '1.0'
  519. alpha8: '1.0'
  520. alpha9: '1.0'
  521. autoscale: 'False'
  522. axislabels: 'True'
  523. color1: blue
  524. color10: dark blue
  525. color2: red
  526. color3: green
  527. color4: black
  528. color5: cyan
  529. color6: magenta
  530. color7: yellow
  531. color8: dark red
  532. color9: dark green
  533. comment: ''
  534. ctrlpanel: 'False'
  535. entags: 'True'
  536. grid: 'False'
  537. gui_hint: ''
  538. label1: Signal 1
  539. label10: Signal 10
  540. label2: Signal 2
  541. label3: Signal 3
  542. label4: Signal 4
  543. label5: Signal 5
  544. label6: Signal 6
  545. label7: Signal 7
  546. label8: Signal 8
  547. label9: Signal 9
  548. legend: 'False'
  549. marker1: '-1'
  550. marker10: '-1'
  551. marker2: '-1'
  552. marker3: '-1'
  553. marker4: '-1'
  554. marker5: '-1'
  555. marker6: '-1'
  556. marker7: '-1'
  557. marker8: '-1'
  558. marker9: '-1'
  559. name: '""'
  560. nconnections: '1'
  561. size: int(sample_rate_hz*2)
  562. srate: sample_rate_hz
  563. stemplot: 'False'
  564. style1: '1'
  565. style10: '1'
  566. style2: '1'
  567. style3: '1'
  568. style4: '1'
  569. style5: '1'
  570. style6: '1'
  571. style7: '1'
  572. style8: '1'
  573. style9: '1'
  574. tr_chan: '0'
  575. tr_delay: '0'
  576. tr_level: '0.0'
  577. tr_mode: qtgui.TRIG_MODE_FREE
  578. tr_slope: qtgui.TRIG_SLOPE_POS
  579. tr_tag: '""'
  580. type: float
  581. update_time: '0.10'
  582. width1: '2'
  583. width10: '1'
  584. width2: '1'
  585. width3: '1'
  586. width4: '1'
  587. width5: '1'
  588. width6: '1'
  589. width7: '1'
  590. width8: '1'
  591. width9: '1'
  592. ylabel: Arduino Input Voltage
  593. ymax: reference_voltage
  594. ymin: '0'
  595. yunit: '"V"'
  596. states:
  597. bus_sink: false
  598. bus_source: false
  599. bus_structure: null
  600. coordinate: [881, 627]
  601. rotation: 0
  602. state: disabled
  603. - name: serial_source_block
  604. id: epy_block
  605. parameters:
  606. _source_code: "import gnuradio\nimport numpy\nimport serial\n\n\nclass SerialSourceBlock(gnuradio.gr.sync_block):\n\
  607. \ def __init__(\n self, port=\"/dev/ttyUSB0\", baud_rate=115200, buffer_max_length=10,\
  608. \ timeout=2\n ):\n gnuradio.gr.sync_block.__init__(\n self,\
  609. \ name=\"Serial Source Block\", in_sig=None, out_sig=[numpy.int16]\n \
  610. \ )\n self._serial_port = serial.Serial(\n port=port,\
  611. \ baudrate=baud_rate, bytesize=serial.EIGHTBITS, timeout=timeout\n )\n\
  612. \ self._buffer_max_length = buffer_max_length\n\n def work(self, input_items,\
  613. \ output_items):\n # pylint: disable=unused-argument\n buffer\
  614. \ = self._serial_port.read(\n 2 * min(len(output_items[0]), self._buffer_max_length)\n\
  615. \ )\n assert len(buffer) % 2 == 0\n buffer_samples_count\
  616. \ = len(buffer) // 2\n output_items[0][:buffer_samples_count] = numpy.frombuffer(buffer,\
  617. \ dtype=\">u2\")\n assert output_items[0][:buffer_samples_count].max()\
  618. \ < 1024, \"lost sync?\"\n return buffer_samples_count\n"
  619. affinity: ''
  620. alias: ''
  621. baud_rate: '115200'
  622. buffer_max_length: int(sample_rate_hz/4)
  623. comment: ''
  624. maxoutbuf: '0'
  625. minoutbuf: '0'
  626. port: '''/dev/ttyUSB0'''
  627. timeout: '2'
  628. states:
  629. _io_cache: ('Serial Source Block', 'SerialSourceBlock', [('port', "'/dev/ttyUSB0'"),
  630. ('baud_rate', '115200'), ('buffer_max_length', '10'), ('timeout', '2')], [],
  631. [('0', 'short', 1)], '', [])
  632. bus_sink: false
  633. bus_source: false
  634. bus_structure: null
  635. coordinate: [15, 276]
  636. rotation: 0
  637. state: true
  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. - [serial_source_block, '0', blocks_probe_rate_0, '0']
  647. - [serial_source_block, '0', blocks_short_to_float_0, '0']
  648. - [serial_source_block, '0', qtgui_number_sink_0_0, '0']
  649. metadata:
  650. file_format: 1