Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fpp-to-json utilities #207

Merged
merged 13 commits into from
Aug 1, 2024
10 changes: 10 additions & 0 deletions .github/actions/spelling/allow.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
abspath
abstractmethod
agg
annotatable
api
appendable
argparse
Expand All @@ -19,21 +20,30 @@ autoescape
autosectionlabel
backport
baremetal
binop
Binops
buf
bytearray
calcsize
changelog
chdir
classmethod
elts
Endian
endian
Endianness
endianness
expr
idx
lestarch
LGTM
lgtm
Linux
localhost
preannot
preannotations
postannot
postannotations
Prm
prm
Serializables
Expand Down
1 change: 1 addition & 0 deletions .github/actions/spelling/excludes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ ignore$
^\.github/
pyproject.toml
setup.py
\.json$
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Documentation:
https://www.sphinx-doc.org/en/master/usage/configuration.html
"""

# pylint: disable=invalid-name

import re
Expand Down
9 changes: 6 additions & 3 deletions src/fprime/common/models/serialize/array_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Created on May 29, 2020
@author: jishii
"""

from fprime.util.string_util import format_string_template

from . import serializable_type
Expand Down Expand Up @@ -95,9 +96,11 @@ def to_jsonable(self):
"type": self.__class__.__name__,
"size": self.LENGTH,
"format": self.FORMAT,
"values": None
if self._val is None
else [member.to_jsonable() for member in self._val],
"values": (
None
if self._val is None
else [member.to_jsonable() for member in self._val]
),
}

def serialize(self):
Expand Down
1 change: 1 addition & 0 deletions src/fprime/common/models/serialize/bool_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Created on Dec 18, 2014
@author: tcanham, reder
"""

import struct

from .type_base import ValueType
Expand Down
1 change: 1 addition & 0 deletions src/fprime/common/models/serialize/enum_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Created on Dec 18, 2014
@author: tcanham, reder
"""

import struct

from .type_base import DictionaryType
Expand Down
1 change: 1 addition & 0 deletions src/fprime/common/models/serialize/numerical_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

@author mstarch
"""

import abc
import struct

Expand Down
1 change: 1 addition & 0 deletions src/fprime/common/models/serialize/serializable_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
@author: tcanham

"""

from fprime.util.string_util import format_string_template

from . import array_type
Expand Down
1 change: 1 addition & 0 deletions src/fprime/common/models/serialize/string_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
@author: tcanham

"""

import struct

from fprime.constants import DATA_ENCODING
Expand Down
1 change: 1 addition & 0 deletions src/fprime/constants.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Provided constants for use within the fprime system.
"""

# pylint: disable=W0105
"""
In order to transmit data in a serialized format, string objects need to be encoded. Otherwise,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

@author thomas-bc
"""

import subprocess
import sys
import requests
Expand Down
1 change: 1 addition & 0 deletions src/fprime/fbuild/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Supplies high-level build functions to the greater fprime helper CLI. This maps from user command space to the specific
build system handler underneath.
"""

import os
import re
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions src/fprime/fbuild/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

@author mstarch
"""

import argparse
from pathlib import Path
from typing import Callable, Dict, List, Tuple
Expand Down
1 change: 1 addition & 0 deletions src/fprime/fbuild/cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

@author mstarch
"""

# Get a cache directory for building CMakeList file, if need and remove at exit
import collections
import copy
Expand Down
1 change: 1 addition & 0 deletions src/fprime/fbuild/gcovr.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""" fprime.fbuild.gcovr: coverage target implementations """

import itertools
import shutil
import subprocess
Expand Down
1 change: 1 addition & 0 deletions src/fprime/fbuild/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

@author mstarch
"""

import configparser
import os
import sys
Expand Down
1 change: 1 addition & 0 deletions src/fprime/fbuild/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

@author lestarch
"""

import functools
import itertools
from abc import ABC, abstractmethod
Expand Down
1 change: 1 addition & 0 deletions src/fprime/fbuild/target_definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
as such, each target need only be instantiated but need not be assigned to anything.

"""

from .gcovr import GcovrTarget
from .target import BuildSystemTarget, TargetScope
from .types import BuildType
Expand Down
1 change: 1 addition & 0 deletions src/fprime/fpp/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

@author mstarch
"""

import itertools
import subprocess
from pathlib import Path
Expand Down
1 change: 0 additions & 1 deletion src/fprime/fpp/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
@author thomas-bc
"""


import argparse
import os
import tempfile
Expand Down
Empty file.
Empty file.
20 changes: 20 additions & 0 deletions src/fprime/fpp/utils/fpp_to_json/example_visitors/example.fpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module A {
constant B = 1
constant C = 0x44
constant D = "hello"

instance E: Component.A base id 0x4444
instance F: Component.B base id 0x5555 \
queue size 10

topology G {
import I

instance E
instance F

connections H {
E.pout -> F.pin
}
}
}
Loading
Loading