scope.grc 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  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: [9, 19]
  31. rotation: 0
  32. state: enabled
  33. blocks:
  34. - name: reference_voltage
  35. id: variable
  36. parameters:
  37. comment: ''
  38. value: '4.11'
  39. states:
  40. bus_sink: false
  41. bus_source: false
  42. bus_structure: null
  43. coordinate: [730, 64]
  44. rotation: 0
  45. state: true
  46. - name: sample_rate_hz
  47. id: variable
  48. parameters:
  49. comment: ''
  50. value: 1e6 / 2500
  51. states:
  52. bus_sink: false
  53. bus_source: false
  54. bus_structure: null
  55. coordinate: [437, 63]
  56. rotation: 0
  57. state: enabled
  58. - name: blocks_short_to_float_0
  59. id: blocks_short_to_float
  60. parameters:
  61. affinity: ''
  62. alias: ''
  63. comment: ''
  64. maxoutbuf: '0'
  65. minoutbuf: '0'
  66. scale: 1024 / reference_voltage
  67. vlen: '1'
  68. states:
  69. bus_sink: false
  70. bus_source: false
  71. bus_structure: null
  72. coordinate: [409, 253]
  73. rotation: 0
  74. state: true
  75. - name: epy_block_0
  76. id: epy_block
  77. parameters:
  78. _source_code: "import struct\nimport time\n\nimport gnuradio\nimport numpy\nimport\
  79. \ serial\n\n\nclass ArduinoAnalogReadings(gnuradio.gr.sync_block):\n def\
  80. \ __init__(self, port=\"/dev/ttyUSB0\", baud_rate=115200, timeout=2):\n \
  81. \ gnuradio.gr.sync_block.__init__(\n self, name=\"Arduino Analog\
  82. \ Readings\", in_sig=[], out_sig=[numpy.int16]\n )\n self._serial_port\
  83. \ = serial.Serial(port, baud_rate, timeout=timeout)\n self._readings_counter\
  84. \ = 0\n self._start_timestamp = None\n\n def work(self, input_items,\
  85. \ output_items):\n # pylint: disable=unused-argument\n if not\
  86. \ self._start_timestamp:\n self._start_timestamp = time.time()\n\
  87. \ output_items[0][0] = struct.unpack(\">H\", self._serial_port.read(2))[0]\n\
  88. \ self._readings_counter += 1\n if self._readings_counter % 1000\
  89. \ == 0:\n print(self._readings_counter / (time.time() - self._start_timestamp),\
  90. \ \"Hz\")\n return 1\n"
  91. affinity: ''
  92. alias: ''
  93. baud_rate: '115200'
  94. comment: ''
  95. maxoutbuf: '0'
  96. minoutbuf: '0'
  97. port: '''/dev/ttyUSB0'''
  98. timeout: '2'
  99. states:
  100. _io_cache: ('Arduino Analog Readings', 'ArduinoAnalogReadings', [('port', "'/dev/ttyUSB0'"),
  101. ('baud_rate', '115200'), ('timeout', '2')], [], [('0', 'short', 1)], '', [])
  102. bus_sink: false
  103. bus_source: false
  104. bus_structure: null
  105. coordinate: [22, 221]
  106. rotation: 0
  107. state: true
  108. - name: qtgui_freq_sink_x_0
  109. id: qtgui_freq_sink_x
  110. parameters:
  111. affinity: ''
  112. alias: ''
  113. alpha1: '1.0'
  114. alpha10: '1.0'
  115. alpha2: '1.0'
  116. alpha3: '1.0'
  117. alpha4: '1.0'
  118. alpha5: '1.0'
  119. alpha6: '1.0'
  120. alpha7: '1.0'
  121. alpha8: '1.0'
  122. alpha9: '1.0'
  123. autoscale: 'False'
  124. average: '1.0'
  125. axislabels: 'True'
  126. bw: sample_rate_hz
  127. color1: '"blue"'
  128. color10: '"dark blue"'
  129. color2: '"red"'
  130. color3: '"green"'
  131. color4: '"black"'
  132. color5: '"cyan"'
  133. color6: '"magenta"'
  134. color7: '"yellow"'
  135. color8: '"dark red"'
  136. color9: '"dark green"'
  137. comment: ''
  138. ctrlpanel: 'False'
  139. fc: '0'
  140. fftsize: '1024'
  141. freqhalf: 'True'
  142. grid: 'False'
  143. gui_hint: ''
  144. label: Relative Gain
  145. label1: ''
  146. label10: ''''''
  147. label2: ''''''
  148. label3: ''''''
  149. label4: ''''''
  150. label5: ''''''
  151. label6: ''''''
  152. label7: ''''''
  153. label8: ''''''
  154. label9: ''''''
  155. legend: 'False'
  156. maxoutbuf: '0'
  157. minoutbuf: '0'
  158. name: '""'
  159. nconnections: '1'
  160. showports: 'False'
  161. tr_chan: '0'
  162. tr_level: '0.0'
  163. tr_mode: qtgui.TRIG_MODE_FREE
  164. tr_tag: '""'
  165. type: float
  166. units: dB
  167. update_time: '0.10'
  168. width1: '2'
  169. width10: '1'
  170. width2: '1'
  171. width3: '1'
  172. width4: '1'
  173. width5: '1'
  174. width6: '1'
  175. width7: '1'
  176. width8: '1'
  177. width9: '1'
  178. wintype: firdes.WIN_BLACKMAN_hARRIS
  179. ymax: '0'
  180. ymin: '-100'
  181. states:
  182. bus_sink: false
  183. bus_source: false
  184. bus_structure: null
  185. coordinate: [768, 356]
  186. rotation: 0
  187. state: true
  188. - name: qtgui_number_sink_0
  189. id: qtgui_number_sink
  190. parameters:
  191. affinity: ''
  192. alias: ''
  193. autoscale: 'False'
  194. avg: '0'
  195. color1: ("black", "black")
  196. color10: ("black", "black")
  197. color2: ("black", "black")
  198. color3: ("black", "black")
  199. color4: ("black", "black")
  200. color5: ("black", "black")
  201. color6: ("black", "black")
  202. color7: ("black", "black")
  203. color8: ("black", "black")
  204. color9: ("black", "black")
  205. comment: ''
  206. factor1: '1'
  207. factor10: '1'
  208. factor2: '1'
  209. factor3: '1'
  210. factor4: '1'
  211. factor5: '1'
  212. factor6: '1'
  213. factor7: '1'
  214. factor8: '1'
  215. factor9: '1'
  216. graph_type: qtgui.NUM_GRAPH_HORIZ
  217. gui_hint: ''
  218. label1: Voltage
  219. label10: ''
  220. label2: ''
  221. label3: ''
  222. label4: ''
  223. label5: ''
  224. label6: ''
  225. label7: ''
  226. label8: ''
  227. label9: ''
  228. max: reference_voltage
  229. min: '0'
  230. name: '""'
  231. nconnections: '1'
  232. type: float
  233. unit1: V
  234. unit10: ''
  235. unit2: ''
  236. unit3: ''
  237. unit4: ''
  238. unit5: ''
  239. unit6: ''
  240. unit7: ''
  241. unit8: ''
  242. unit9: ''
  243. update_time: '0.10'
  244. states:
  245. bus_sink: false
  246. bus_source: false
  247. bus_structure: null
  248. coordinate: [723, 489]
  249. rotation: 0
  250. state: true
  251. - name: qtgui_time_sink_x_0
  252. id: qtgui_time_sink_x
  253. parameters:
  254. affinity: ''
  255. alias: ''
  256. alpha1: '1.0'
  257. alpha10: '1.0'
  258. alpha2: '1.0'
  259. alpha3: '1.0'
  260. alpha4: '1.0'
  261. alpha5: '1.0'
  262. alpha6: '1.0'
  263. alpha7: '1.0'
  264. alpha8: '1.0'
  265. alpha9: '1.0'
  266. autoscale: 'False'
  267. axislabels: 'True'
  268. color1: blue
  269. color10: dark blue
  270. color2: red
  271. color3: green
  272. color4: black
  273. color5: cyan
  274. color6: magenta
  275. color7: yellow
  276. color8: dark red
  277. color9: dark green
  278. comment: ''
  279. ctrlpanel: 'False'
  280. entags: 'True'
  281. grid: 'False'
  282. gui_hint: ''
  283. label1: Signal 1
  284. label10: Signal 10
  285. label2: Signal 2
  286. label3: Signal 3
  287. label4: Signal 4
  288. label5: Signal 5
  289. label6: Signal 6
  290. label7: Signal 7
  291. label8: Signal 8
  292. label9: Signal 9
  293. legend: 'False'
  294. marker1: '-1'
  295. marker10: '-1'
  296. marker2: '-1'
  297. marker3: '-1'
  298. marker4: '-1'
  299. marker5: '-1'
  300. marker6: '-1'
  301. marker7: '-1'
  302. marker8: '-1'
  303. marker9: '-1'
  304. name: '""'
  305. nconnections: '1'
  306. size: int(sample_rate_hz*2)
  307. srate: sample_rate_hz
  308. stemplot: 'False'
  309. style1: '1'
  310. style10: '1'
  311. style2: '1'
  312. style3: '1'
  313. style4: '1'
  314. style5: '1'
  315. style6: '1'
  316. style7: '1'
  317. style8: '1'
  318. style9: '1'
  319. tr_chan: '0'
  320. tr_delay: '0'
  321. tr_level: '0.0'
  322. tr_mode: qtgui.TRIG_MODE_FREE
  323. tr_slope: qtgui.TRIG_SLOPE_POS
  324. tr_tag: '""'
  325. type: float
  326. update_time: '0.10'
  327. width1: '2'
  328. width10: '1'
  329. width2: '1'
  330. width3: '1'
  331. width4: '1'
  332. width5: '1'
  333. width6: '1'
  334. width7: '1'
  335. width8: '1'
  336. width9: '1'
  337. ylabel: Voltage
  338. ymax: reference_voltage
  339. ymin: '0'
  340. yunit: '"V"'
  341. states:
  342. bus_sink: false
  343. bus_source: false
  344. bus_structure: null
  345. coordinate: [768, 221]
  346. rotation: 0
  347. state: true
  348. connections:
  349. - [blocks_short_to_float_0, '0', qtgui_freq_sink_x_0, '0']
  350. - [blocks_short_to_float_0, '0', qtgui_number_sink_0, '0']
  351. - [blocks_short_to_float_0, '0', qtgui_time_sink_x_0, '0']
  352. - [epy_block_0, '0', blocks_short_to_float_0, '0']
  353. metadata:
  354. file_format: 1