Const to Flowcode - Copying from C to FC made simple

Use this section to discuss your embedded Flowcode projects.
Post Reply
mnfisher
Valued Contributor
Posts: 938
http://meble-kuchenne.info.pl
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 502 times

Const to Flowcode - Copying from C to FC made simple

Post by mnfisher »

Another project.

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
You can edit values by clicking on them - if required. At present it isn't possible to add lines by typing them in (but this could be added?)

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..
CToFC.zip
(2.54 MiB) Downloaded 175 times
Martin

www.flowcodexchange.com

Post Reply