The heart of the app is a grammar tool (grammar.py
).
The grammar tool handles JSON or YAML data. Grammars support several types of element:
There are three grammars: Backup, Simple, and Intuitive.
The backup grammar covers MC6Pro backup files (the format is determined by Morningstar). They are complex, they map to the MC6Pro functionality very well, but they are impossible to read or modify manually. They are complete: all 128 banks appear, with all bank fields etc., even if only 1 or 2 actually contain real data.
The simple grammar is a much simplified version of the backup grammar. It is minimal, e.g. only banks that have data are present. It does not have all features of the backup grammar, only what is needed to implement FootSmart. You can transform simple objects into backup objects, or vice versa.
The intuitive grammar is the format for FootSmart configuration files. It is minimal like the simple grammar, and it is very different in structure from the simple or backup grammar. Intuitive objects can be transformed into simple objects, but not vice versa.
Footsmart began with the backup grammar. I built this grammar to parse the backup files from the MC6Pro. For this reason, the backup grammar is defensive. Instead of accepting as much as possible, I only accept what I know and understand. Anything else raises an error. This means a lot of features are not (yet) supported. If you find one, please let me know and we can work on it.
After I got the backup grammar working, I started on the first version of the simple format. This was pretty complex, I had some features (like a navigation mode that inserted banks and presets) that were complex, and I spent a lot of time making sure that the transformation was bi-directional, that you could generate a simple config from your existing backup. This proved too complex, and so I scrapped this approach. I reduced the simple grammar code back to a minimum (you can still see relics from the complex approach) and began with the latest approach.
The current approach uses the simple grammar as an intermediate language. It is very easy to keep the bidirectional transformation between simple and backup formats, and I have sacrificed the ability to generate an intuitive format in exchange for more freedom in creating FootSmart features. FootSmart (intuitive) format gets tranlated into Simple format, then into Backup format, which you then upload to the MC6Pro.
There is a pretty comprehensive set of tests. They can be run via:
python3 test_grammar.py
python3 test_simple.py
python3 test_intuitive.py