简体   繁体   English

将 GNU radio Companion 从 Windows 转移到 Linux

[英]Transfering GNU radio Companion from Windows to Linux

I need to move a .grc file from my Windows machine to my Linux machine.我需要将 .grc 文件从我的 Windows 机器移动到我的 Linux 机器。 However they seem to save .grc files in a different manner – Linux saves using XML, and Windows saves using some sort of format that I've never seen, here is an example of the saved code from Windows:然而,他们似乎以不同的方式保存 .grc 文件——Linux 使用 XML 保存,Windows 使用某种我从未见过的格式保存,以下是 Windows 保存代码的示例:

- name: blocks_throttle_0
  id: blocks_throttle
  parameters:
    affinity: ''
    alias: ''
    comment: ''
    ignoretag: 'True'
    maxoutbuf: '0'
    minoutbuf: '0'
    samples_per_second: samp_rate
    type: complex
    vlen: '1'

When I move the .grc file saved in the format above to a Linux machine, GNU Radio Companion doesn't recognize it because the Linux GNU Radio Companion is expecting a file in XML format.当我将以上述格式保存的 .grc 文件移动到 Linux 机器时,GNU Radio Companion 无法识别它,因为 Linux GNU Radio Companion 需要 XML 格式的文件。

Here's what I've tried and why it hasn't worked这是我尝试过的方法以及为什么它不起作用

  1. Just redoing the project on Linux只是在 Linux 上重做项目

    This failed because I have a custom Python block in my code.这失败了,因为我的代码中有一个自定义的 Python 块。 When I try to hit the "use default editor" in the GUI, nothing happens.当我尝试在 GUI 中点击“使用默认编辑器”时,没有任何反应。 I followed the directions here .我按照这里的说明进行操作 However this did not work for me, so my custom block cannnot be added.但是,这对我不起作用,因此无法添加我的自定义块。

  2. Just redoing the project but adding my custom Python block straight to the .grc file只是重做项目,但将我的自定义 Python 块直接添加到 .grc 文件中

    This failed because in the Python code > is present, which makes the XML processing expect a tag there, causing the code to fail.这失败是因为在 Python 代码中>存在,这使得 XML 处理期望那里有一个标签,导致代码失败。

How can I properly convert my existing .grc files to a file format understood by the Linux version of GNU Radio Companion?如何将我现有的 .grc 文件正确转换为 Linux 版 GNU Radio Companion 能够理解的文件格式?

That has nothing to do with windows or linux, but with the version of GNU Radio you're running.这与 windows 或 linux 无关,而是与您运行的 GNU Radio 版本有关。

On windows, you seem to be running an old GNU Radio 3.7, and on Linux something newer.在 Windows 上,您似乎在运行旧的 GNU Radio 3.7,而在 Linux 上运行的是更新的东西。

Modern GRC comes with a built-in converter from the old XML format to the new YAML, but it requires some libraries that aren't necessarily already installed.现代 GRC 带有一个从旧 XML 格式到新 YAML 格式的内置转换器,但它需要一些不一定已经安装的库。 You'll want to read exactly what the console says when opening your XML flow graph.在打开 XML 流图时,您需要准确地阅读控制台所说的内容。

This failed because in the python code there is ">" present, which makes the XML processing expect a tag there--causing the code to fail.这失败了,因为在 python 代码中存在“>”,这使得 XML 处理期望那里有一个标签——导致代码失败。

That doesn't sound right.这听起来不对。 If that's actually the case, please open a bug report on https://github.com/gnuradio/gnuradio如果确实如此,请在https://github.com/gnuradio/gnuradio上打开错误报告

Here is the identified problem I was running into and some possible solutions:这是我遇到的已确定的问题以及一些可能的解决方案:

Problem: the version between the two different GNURadio companions was different.问题:两个不同的 GNURadio 伙伴之间的版本不同。 My windows machine was running the v8.0.0 Beta and the Linux machine was running v3.7.13.5.我的 Windows 机器运行的是 v8.0.0 Beta,而 Linux 机器运行的是 v3.7.13.5。 The Beta v8.0.0 is the first version to output .grc files in the format above (still unsure on what that is called), while 3.7.13.5 and earlier output .grc files in an xml format. Beta v8.0.0 是第一个以上述格式输出 .grc 文件的版本(仍然不确定它叫什么),而 3.7.13.5 和更早版本以 xml 格式输出 .grc 文件。

Solutions:解决方案:
1.) match versions 1.) 匹配版本
This takes some time to redownload and you might loose any special plugins you had on your version of GNU radio companion这需要一些时间来重新下载,并且您可能会丢失您的 GNU 无线电伴侣版本上的任何特殊插件

2.) You can add your own python block directly to the .grc file 2.) 您可以将自己的python 块直接添加到.grc 文件中
To do this you must make sure you use the XML special character guidelines for greater-than or less-than than symbols found here .为此,您必须确保对此处找到的大于或小于符号使用 XML 特殊字符指南。 Using &lt and &gt is what worked for me.使用&lt&gt对我&gt

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM