scope.grc 9.0 KB

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