Editing Guided Tutorial GNU Radio in Python

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 890: Line 890:
 
Before we begin, we need to figure out what the commands for gr_modtool are so let's ask for help.
 
Before we begin, we need to figure out what the commands for gr_modtool are so let's ask for help.
  
<pre>$ gr_modtool --help
+
<pre>$ gr_modtool help
Usage: gr_modtool [OPTIONS] COMMAND [ARGS]...
+
Usage:
 +
gr_modtool [options] -- Run  with the given options.
 +
gr_modtool help -- Show a list of commands.
 +
gr_modtool help  -- Shows the help for a given command.
  
  A tool for editing GNU Radio out-of-tree modules.
+
List of possible commands:
 
 
Options:
 
  --help  Show this message and exit.
 
 
 
Commands:
 
  add      Adds a block to the out-of-tree module.
 
  disable  Disable selected block in module.
 
  info      Return information about a given module
 
  makeyaml  Generate YAML files for GRC block bindings.
 
  newmod    Create new empty module, use add to add blocks.
 
  rename    Rename a block inside a module.
 
  rm        Remove a block from a module.
 
  update    Update the grc bindings for a block
 
 
 
  Manipulate with GNU Radio modules source code tree. Call it without
 
  options to run specified command interactively
 
  
 +
Name      Aliases          Description
 +
=====================================================================
 +
disable  dis              Disable block (comments out CMake entries for files)
 +
info      getinfo,inf      Return information about a given module
 +
remove    rm,del          Remove block (delete files and remove Makefile entries)
 +
makexml  mx              Make XML file for GRC block bindings
 +
add      insert          Add block to the out-of-tree module.
 +
newmod    nm,create        Create a new out-of-tree module
 
</pre>
 
</pre>
 
We immediately see there are many commands available. In this tutorial we will only cover '''newmod''' and '''add'''; however, the thorough explanation should enable smooth usage of the other gr_modtool commands without guidance.
 
We immediately see there are many commands available. In this tutorial we will only cover '''newmod''' and '''add'''; however, the thorough explanation should enable smooth usage of the other gr_modtool commands without guidance.
Line 917: Line 912:
  
 
<pre>
 
<pre>
$ gr_modtool newmod --help
+
$ gr_modtool help newmod
Usage: gr_modtool newmod [OPTIONS] MODULE-NAME
+
Usage: gr_modtool nm [options].
 
+
Call gr_modtool without any options to run it interactively.
  Create a new out-of-tree module
 
 
 
  The argument MODULE-NAME is the name of the module to be added.
 
  
 
Options:
 
Options:
   --srcdir TEXT            Source directory for the module template.
+
   General options:
  -d, --directory TEXT      Base directory of the module. Defaults to the cwd.
+
    -h, --help          Displays this help message.
  --skip-lib               Don't do anything in the lib/ subdirectory.
+
    -d DIRECTORY, --directory=DIRECTORY
  --skip-swig               Don't do anything in the swig/ subdirectory.
+
                        Base directory of the module. Defaults to the cwd.
  --skip-python            Don't do anything in the python/ subdirectory.
+
    -n MODULE_NAME, --module-name=MODULE_NAME
  --skip-grc               Don't do anything in the grc/ subdirectory.
+
                        Use this to override the current module's name (is
  --scm-mode [yes|no|auto]  Use source control management [ yes | no | auto ]).
+
                        normally autodetected).
  -y, --yes                 Answer all questions with 'yes'. This can
+
    -N BLOCK_NAME, --block-name=BLOCK_NAME
                            overwrite and delete your files, so be careful.
+
                        Name of the block, where applicable.
  --help                    Show this message and exit.
+
    --skip-lib         Don't do anything in the lib/ subdirectory.
 +
    --skip-swig         Don't do anything in the swig/ subdirectory.
 +
    --skip-Python      Don't do anything in the Python/ subdirectory.
 +
    --skip-grc         Don't do anything in the grc/ subdirectory.
 +
    --scm-mode=SCM_MODE
 +
                        Use source control management (yes, no or auto).
 +
    -y, --yes           Answer all questions with 'yes'. This can overwrite
 +
                        and delete your files, so be careful.
  
 +
  New out-of-tree module options:
 +
    --srcdir=SRCDIR    Source directory for the module template
 
</pre>
 
</pre>
 
Now that we have read over the list of commands for newmod, we can deduce that the one we want to pick is -n which is the default so we can simply type the MODULE_NAME after newmod. It is actually advised to avoid using "-n" as for other commands it can override the auto-detected name. For now, let's ignore the other options.
 
Now that we have read over the list of commands for newmod, we can deduce that the one we want to pick is -n which is the default so we can simply type the MODULE_NAME after newmod. It is actually advised to avoid using "-n" as for other commands it can override the auto-detected name. For now, let's ignore the other options.

Please note that all contributions to GNU Radio are considered to be released under the Creative Commons Attribution-ShareAlike (see GNU Radio:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel | Editing help (opens in new window)