Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,24 @@ F Prime Python Model is a utility for translating `fpp-to-json` AST, Location Ma
and Analysis JSON to Python data structures. For more information on the `fpp-to-json`
tool, see the [FPP User's Guide](https://nasa.github.io/fpp/fpp-users-guide.html#Analyzing-and-Translating-Models_Generating-JSON-Models).


## Installation

```sh
git clone https://github.com/fprime-community/fprime-python-model.git
cd fprime-python-model
pip install .
pip install git+https://github.com/fprime-community/fprime-python-model.git
```

## Usage
In order to use this utility, you must first run the `fpp-to-json` tool to generate
the AST, Location Map, and Analysis JSON files for a given FPP model. For specific
steps on how to run `fpp-to-json`, see the
[FPP User's Guide](https://nasa.github.io/fpp/fpp-users-guide.html#Analyzing-and-Translating-Models_Generating-JSON-Models).
the AST, Location Map, and Analysis JSON files for a given FPP model.

* When using `fpp-to-json` as part of a larger project, you can set
`FPRIME_ENABLE_JSON_MODEL_GENERATION=ON` in your settings.ini to generate JSON
files automatically.
* For specific steps on how to run `fpp-to-json` manually, see the
[FPP User's Guide](https://nasa.github.io/fpp/fpp-users-guide.html#Analyzing-and-Translating-Models_Generating-JSON-Models).

> Note: When running the `fpp-to-json` tool, ensure that you *do not* include the
> `-s` option as that will prevent the Analysis JSON from being generated.
> Note: When running the `fpp-to-json` tool, ensure that you *do not* include the
> `-s` option as that will prevent the Analysis JSON from being generated.

Once the AST, Location Map, and Analysis JSON files have been generated, you can
translate the model JSON to it's Python representation by doing:
Expand All @@ -40,7 +41,7 @@ the FPP AST, Location Map, and Analysis of the model:

```python
model.ast # Model AST
model.locations # Location map
model.location_map # Location map
model.analysis # Model Analysis data structure
```

Expand Down