Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #41 from oresat/3.2.0-can-bus_rework
Browse files Browse the repository at this point in the history
3.2.0 can bus rework
  • Loading branch information
dmitri-mcguckin authored Feb 18, 2021
2 parents 7b15d38 + dc1cacf commit 51a39a6
Show file tree
Hide file tree
Showing 71 changed files with 2,018 additions and 1,872 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
release:
types: [ created ]



jobs:
deploy:

Expand All @@ -14,10 +16,10 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.9

- name: Update Pip
run: python -m pip install --upgrade pip
run: python3 -m pip install --upgrade pip

- name: Install regular and dev dependencies
run: pip install .[dev]
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.9

- name: Update Pip
run: python -m pip install --upgrade pip
run: python3 -m pip install --upgrade pip

- name: Install regular and dev dependencies
run: pip install .[dev]
Expand All @@ -30,4 +30,4 @@ jobs:
flake8 canopen_monitor --count --exit-zero --max-complexity=30 --max-line-length=127 --statistics
- name: Run unit tests
run: pytest tests/*
run: python3 -m unittest tests/spec_*.py
8 changes: 0 additions & 8 deletions MANIFEST.in

This file was deleted.

134 changes: 18 additions & 116 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,148 +2,50 @@

[![license](https://img.shields.io/github/license/oresat/CANopen-monitor)](./LICENSE)
[![pypi](https://img.shields.io/pypi/v/canopen-monitor)](https://pypi.org/project/canopen-monitor)
[![read the docs](https://readthedocs.org/projects/canopen-monitor/badge/?version=latest)](https://canopen-monitor.readthedocs.io/en/latest/?badge=latest)
[![read the docs](https://readthedocs.org/projects/canopen-monitor/badge/?version=latest)](https://canopen-monitor.readthedocs.io)
[![issues](https://img.shields.io/github/issues/oresat/CANopen-monitor/bug?label=issues)](https://github.com/oresat/CANopen-monitor/issues?q=is%3Aopen+is%3Aissue+label%3Abug)
[![unit tests](https://img.shields.io/github/workflow/status/oresat/CANopen-monitor/Unit%20Tests?label=unit%20tests)](https://github.com/oresat/CANopen-monitor/actions?query=workflow%3A%22Unit+Tests%22)
[![deployment](https://img.shields.io/github/workflow/status/oresat/CANopen-monitor/Deploy%20to%20PyPi?label=deployment)](https://github.com/oresat/CANopen-monitor/actions?query=workflow%3A%22Deploy+to+PyPi%22)

A utility for displaying and tracking activity over the CAN bus.
An NCurses-based TUI application for tracking activity over the CAN bus and decoding messages with provided EDS/OD files.

***

# Quick Start *(Usage)*
# Quick Start

## Install *(from PyPi)*
### Install

`$` `pip install package-demo`
`$` `pip install canopen-monitor`


## Run
### Run

`$` `canopen-monitor`

***

# Development and Contribution
# Configuration

## Build
The default configurations provided by CANOpen Monitor can be found in [canopen_monitor/assets](./canopen_monitor/assets). These are the default assets provided. At runtime these configs are copied to `~/.config/canopen-monitor` where they can be modified and the changes will persist.

`$` `python setup.py bdist_wheel sdist`
***

## Install Locally
# Development and Contribution

`$` `pip install -e .[dev]`
### Documentation

*(The `-e` flag creates a symbolic-link to your local development version, so there's no need to uninstall and reinstall every time. Set it and forget it.)*
Check out our [Read The Docs](https://canopen-monitor.readthedocs.io) pages for more info on the application sub-components and methods.

## Create or Update Manifest
### Install Locally

`$` `rm -f MANIFEST.in && check-manifest --update`
`$` `pip install -e .[dev]`

## Create or Update Sphinx Documentation
*(Note: the `-e` flag creates a symbolic-link to your local development version. Set it once, and forget it)*

`$` `sphinx-apidoc -f -o docs canopen_monitor && make -C docs html`
### Create Documentation Locally

***
`$` `make -C docs clean html`

# Default Configs

These are the auto-generated configs that can be found at `~/.config/canopen-monitor/`

`devices.json:`
```json
{
"dead_timeout": 120,
"devices": [
"can0"
],
"stale_timeout": 60
}
```
A set of devices configs including a list of CAN Buses that CAN Monitor will try to bind to on launch as well as respective timeout lengths.

*(note: additional buses can be added via cmd-line arguments, see `canopen-monitor --help`)*

 

`layout.json`
```json
{
"data": [
{
"data": [
{
"capacity": null,
"fields": {
"COB ID": "arb_id",
"Node Name": "node_name",
"Interface": "interface",
"State": "status",
"Status": "parsed_msg"
},
"frame_types": [
"HEARTBEAT"
],
"name": "Hearbeats",
"type": "message_table"
},
{
"capacity": null,
"fields": [],
"frame_types": [],
"name": "Info",
"type": "message_table"
}
],
"split": "vertical",
"type": "grid"
},
{
"capacity": null,
"fields": {
"COB ID": "arb_id",
"Node Name": "node_name",
"Interface": "interface",
"Type": "message_type",
"Time Stamp": "timestamp",
"Message": "parsed_msg"
},
"frame_types": [
"NMT",
"SYNC",
"TIME",
"EMER",
"PDO1_TX",
"PDO1_RX",
"PDO2_TX",
"PDO2_RX",
"PDO3_TX",
"PDO3_RX",
"PDO4_TX",
"PDO4_RX",
"SDO_TX",
"SDO_RX",
"UKNOWN"
],
"name": "Misc",
"type": "message_table"
}
],
"split": "horizontal",
"type": "grid"
}
```
A recursive set of dictionaries that define how CAN Monitor constructs the UI layout and what CAN Message types go to what tables.

 

`nodes.json`
```json
{
"64": "MDC"
}
```
A list of COB ID's in decimal notation that have a paired name which will override the default display name of that node in CAN Monitor.
*(Note: documentation is configured to auto-build with ReadTheDocs on every push to master)*

***

Expand Down
28 changes: 12 additions & 16 deletions canopen_monitor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,19 @@
PATCH = 0

APP_NAME = 'canopen-monitor'
APP_DESCRIPTION \
= 'A utility for displaying and tracking activity over the CAN bus.'
APP_VERSION = "{}.{}.{}".format(MAJOR, MINOR, PATCH)
APP_AUTHOR = "Dmitri McGuckin"
APP_DESCRIPTION = 'An NCurses-based TUI application for tracking activity' \
' over the CAN bus and decoding messages with provided' \
' EDS/OD files.'
APP_VERSION = f'{MAJOR}.{MINOR}.{PATCH}'
APP_AUTHOR = 'Dmitri McGuckin'
APP_EMAIL = '[email protected]'
APP_URL = "https://github.com/oresat/CANopen-monitor"
APP_URL = 'https://github.com/oresat/CANopen-monitor'
APP_LICENSE = 'GPL-3.0'

CONFIG_FORMAT_VERSION = 1
CONFIG_DIR = os.path.expanduser('~/.config/{}'.format(APP_NAME)) + os.sep
CACHE_DIR = os.path.expanduser('~/.cache/{}'.format(APP_NAME)) + os.sep
ASSETS_DIR \
= os.path.abspath(__path__[0] + os.sep + 'assets') + os.sep
EDS_DIR = ASSETS_DIR
DEVICES_CONFIG = CONFIG_DIR + 'devices.json'
LAYOUT_CONFIG = CONFIG_DIR + 'layout.json'
NODES_CONFIG = CONFIG_DIR + 'nodes.json'
MAINTAINER_NAME = 'Portland State Aerospace Society'
MAINTAINER_EMAIL = '[email protected]'

DEBUG = False
TIMEOUT = 0.1
CONFIG_DIR = os.path.expanduser(f'~/.config/{APP_NAME}')
CACHE_DIR = os.path.expanduser(f'~/.cache/{APP_NAME}')

CONFIG_FORMAT_VERSION = 2
Loading

0 comments on commit 51a39a6

Please sign in to comment.