Manual¶
Installation¶
Install from PyPI:
pip install pyrf
Or Obtain the Development Version:
git clone git://github.com/pyrf/pyrf.git
(Or Download a Stable Release)
Then Install from Source or Extracted Tarball/Zip file:
python setup.py install
Installing GUI Requirements¶
On Debian/Ubuntu:
apt-get install python-pyside python-twisted python-numpy \
python-zope.interface python-pip
pip install -e git://github.com/pyrf/qtreactor.git#egg=qtreactor
On Windows:
Download and install:
Find the latest version of each of the following and install:
- NumPy for 32-bit Python 2.7 e.g. “numpy-1.6.2-win32-superpack-python2.7.exe”
- PySide for 32-bit Python 2.7 e.g. “PySide-1.1.2.win32-py2.7.exe”
- zope.interface for 32-bit Python 2.7 e.g. “zope.interface-4.0.3-py2.7-win32.egg”
- Twisted for 32-bit Python 2.7 e.g. “Twisted-12.3.0.win32-py2.7.msi”
- pywin32 for 32-bit Python 2.7 e.g. “pywin32-218.win32-py2.7.exe”
Download the latest version of qtreactor, extract it then switch to the qtreactor directory and run:
python setup.py install
Installing GUI Requirements from Source¶
On Debian/Ubuntu:
apt-get install qt-sdk python-dev cmake
pip install -r gui-requirements.txt
Building EXE Version of GUI¶
On Windows:
Install the GUI requirements above and make sure you can launch the GUI.
Find and install the latest version of py2exe for 32-bit Python2.7 e.g. “py2exe-0.6.9.win32-py2.7.exe”.
Then switch to your pyrf directory and run:
python setup.py py2exe
API for WSA4000 RF Receiver¶
pyrf.devices.thinkrf.WSA4000
is the class that provides access
to WSA4000 devices.
Its methods closely match the SCPI Command Set described in the
Programmers Reference available in
ThinkRF Resources.
There are simple examples that use this API under the “examples” directory included with the source code.
This API may be used in a blocking mode (the default) or in an asynchronous mode with using the Twisted python library. Asynchronous modes using other libraries may be added in the future.
In blocking mode all methods that read from the device will wait to receive a response before returning.
In asynchronous mode all methods will send their commands to the device and then immediately return a Twisted Deferred object. If you need to wait for the response or completion of this command you can attach a callback to the Deferred object and the Twisted reactor will call it when ready. You may choose to use Twisted’s inlineCallbacks function decorator to write Twisted code that resembles synchronous code by yielding the Deferred objects returned from the API.
To use the asynchronous when a WSA4000 instance is created
you must pass a pyrf.connectors.twisted_async.TwistedConnector
instance as the connector parameter, as in twisted_show_i_q.py
Processing Tools¶
Additional PyRF tools are under active development, but will soon support processing blocks, multiprocess use and distributed processing as described in Planned Development.
GUI¶
wsa4000gui
is a cross-platform GUI application built with the
Qt toolkit and PySide bindings for Python.
The GUI may be launched with the command:
wsa4000gui <hostname> [--reset]
If hostname is not specified a dialog will appear asking you to enter one.
If --reset
is used the WSA will be reset to defaults before the GUI
appears.