Again based on an experiment I did on making a Flowchart viewer.
This copies const or #defines from C to Flowcode - for me one of the problems with flowcharts is the hard-coded values. Easy to write but hard to maintain at a later date.
This copies const declarations of the form:
Code: Select all
const type var_name = value; // comment
const type2 var2 = value; // comment
..
or
#define name value
#define name2 value
Comments (on const lines) are added to the FC as the description. There might be a limit on length - but at present it doesn't check or truncate this?
It uses the C type to 'guess' the relevant type for FC - which crashes if too large a value is passed in (for example b1 (bit) = 123)
It uses a list of common types (int, float, uint8_t etc) - but uses s16 if no match found. The list could be user editable if needed?)
Simply select the constants (as many as needed) in the C source - copy (ctrl-c) and then add them all to the app by clicking '+' Note that you can force names to upper case by clicking the checkbox (before adding them)
Then click 'add to flowcode' - select the program to add them to - and then select (or enter - I'd recommend saving to a new file)
To add further values - use menu file - new to clear.
This makes adding large numbers of constants very quick and easy..
Martin
www.flowcodexchange.com