Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
===========================================
* Requirements
===========================================

1.  Python 2.7
2.  PIP module system
3.  Py.test module (see "Testing" section)
4.  Py.test coverage module (see "Coverage" section)

===========================================
* What's what?
===========================================

FlightSoftware/
  |   This directory contains all of the Python flight software.
  |
  +-- test_*.py
  |   These are pytest-based tests for the module of the associated name.
  |   They are run automatically by pytest with the command 'make test'.
  |
  +-- run_*.py
  |   These are utility testing/demo programs, each with a main() function.
  |   - run_agent.py - Internal test program for receiving supernova bus traffic.
  |   - run_send.py - Internal test program for sending command packets.
  |   - run_terminal.py - Internal test program for a two-way shell terminal.
  |   - run_hardware.py - Internal test program for hardware commands.
  |
  +-- bbb_*.py
  |   This is code specific to the BBB hardware, and manages the overall
  |   flight operations.
  |   - bbb_main.py - Executable program.
  |
  +-- tk1_*.py
  |   This is code specific to the TK1 hardware, and manages the camera functionality,
  |   including triggering images and copying the image data to the radio.
  |   - tk1_main.py - Executable program.
  |
  +-- agent.py
  |   Module that handles receiving data from the Supernova bus, including decoding
  |   packets and dispatching to the appropriate handler (as provided by the caller).
  |
  +-- spacepacket.py
  |   Module that defines the data structures for Supernova packets.  It actually
  |   implements the serialization and deserialization.
  |
  +-- supernova.py
  |   Module that defines the utilities and properties about the Supernova bus.
  |
  +-- payload_cmd_handler.py
  +-- payload_cmd_defs.py
  |   Module that handles payload-specific command functionality.  This includes
  |   dispatching based on the command ID.  It also implements several common
  |   pieces of payload functionality (e.g. running shell commands).
  |
  +-- send.py
  |   Module that handles sending data to the Supernova bus.
  |
  +-- flight_sm.py
  |   Implementation of the Flight finite state machine.
  |   It has a level of abstraction from the actual hardware so that
  |   various sequences of events can be tested.
  |
  +-- hardware.py
  |   Hardware layer implementation.
  |   Most of the implementation consists of sending Supernova bus commands.
  |
  +-- hardware_mock.py
  |   Hardware layer mock.
  |   Should be a mirror of the above, but it simply logs and prints activities.

===========================================
* Setting up PIP
===========================================

If 'pip' is not installed, there is an Ubuntu package for it.
Note that this installs the version for Python 2.7.

    sudo apt-get install python-pip


===========================================
* Required modules
===========================================

Running the software requires the following pip modules:

    * enum34

These can be installed by running 'pip install <modulename>'


===========================================
* Testing
===========================================

The test setup is based on the py.test framework.  More information
can be found online at:

    http://docs.pytest.org/

To install, assuming that the system already has the 'pip' utility:

    pip install -U pytest

All tests are run simply by executing:

    pytest

===========================================
* Line Coverage
===========================================

The test coverage of the core modules can be measured and reported
using the pytest coverage plug-in.  More information can be
found online at:

    https://pypi.python.org/pypi/pytest-cov/


To install, assuming that the system already has the 'pip' utility:

    pip install -U pytest-cov

The line coverage report can be generated by running:

    pytest --cov=.

The argument of the --cov option restricts the report to only the
modules in the current directory.  (Otherwise, it will include
code in the standard library which is not of interest.)  Specific
modules can also be named via this option.