Macros Map

Post here to discuss any new features, components, chips, etc, that you would like to see in Flowcode.
Post Reply
Alan_37
Posts: 186
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 7:23 pm
Has thanked: 54 times
Been thanked: 26 times

Macros Map

Post by Alan_37 »

HI,

My project got so big that I am struggling to remember the Map
and where all the Macros are.

I know I can go to Main and follow from there but
it would be great to have a Map of all Macros on one page maybe in the Project Explorer.


Regards

Alan_37
Posts: 186
Joined: Thu Dec 03, 2020 7:23 pm
Has thanked: 54 times
Been thanked: 26 times

Re: Macros Map

Post by Alan_37 »

Hi

So is this something possible?

Steve-Matrix
Matrix Staff
Posts: 1465
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 204 times
Been thanked: 347 times

Re: Macros Map

Post by Steve-Matrix »

It is possible, but not easy to get something that automatically creates a useful visual layout. I've put it on our list of proposed features and will have a think and see if there is anything we can do.

As an alternative, there may be some 3rd party tools that could help you now. For example, I've used a tool in the past called "Cpp Depends" which can generate graphical maps of macros/functions. Here's an example of it run on C code generated by a sample Flowcode project (also attached). The project is very simple - the "main" and 3 "FCM_" are the user macros - but the analysis can be complex as it shows all the component macros too. The map for a bigger project will be a lot more complex than this!
Flowcode C code  Analysis.png
Flowcode C code Analysis.png (173.91 KiB) Viewed 8740 times
There are other tools that can do a similar thing.
Attachments
MacroMapExample.h
(14.42 KiB) Downloaded 308 times
MacroMapExample.c
(127.26 KiB) Downloaded 312 times
MacroMapExample.fcfx
(21.37 KiB) Downloaded 306 times

Alan_37
Posts: 186
Joined: Thu Dec 03, 2020 7:23 pm
Has thanked: 54 times
Been thanked: 26 times

Re: Macros Map

Post by Alan_37 »

Hi Steve,

Thanks for your reply,

I understand, It doesn’t have to be complex just a Map to help visualize
the project structure, a flowchart of all macros
With names on 1 page.

I think the function list occurrences may help a bit in developing this feature.

Thanks again
Last edited by Alan_37 on Wed Aug 21, 2024 10:26 pm, edited 1 time in total.

kersing
Valued Contributor
Posts: 192
Joined: Wed Dec 02, 2020 7:28 pm
Has thanked: 77 times
Been thanked: 64 times

Re: Macros Map

Post by kersing »

just a flowchart of all macros
How would you handle recursive calls or even more complex: macro A calling macro B which calls macro A etc etc?

Alan_37
Posts: 186
Joined: Thu Dec 03, 2020 7:23 pm
Has thanked: 54 times
Been thanked: 26 times

Re: Macros Map

Post by Alan_37 »

Hi Kersing,

Yes, I understand it's easier said than done, but I trust the team can accomplish this.

In my experience, when developing something I always start
by throwing in something very simple and then continuing to refine
from there.

What I mean by that as an example: Main --> expand --> Macro A, B, C, expand B find macro D, and so on
like browsing a folder tree, it's ok if it does not show every detail, there are updates for that :)

Steve-Matrix
Matrix Staff
Posts: 1465
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 204 times
Been thanked: 347 times

Re: Macros Map

Post by Steve-Matrix »

I've created a quick web page that might achieve what you want:
https://www.flowcode.co.uk/FlowchartView/macro-map.php

Note that it does not currently identify macros that are properties of components. (edit: this means it is not yet suitable for Web Developer apps).

I've done only a bit of testing, so please let me know if there are any problems or you work like to see additional features.

Alan_37
Posts: 186
Joined: Thu Dec 03, 2020 7:23 pm
Has thanked: 54 times
Been thanked: 26 times

Flowcode v10 Re: Macros Map

Post by Alan_37 »

Hi Steve,

Thank you for taking the time to address this. I've tested it with both small and large flowcode files, and I think it's a very promising start.

With the smaller flowcode files, I can generally follow and understand what's happening. However, when working with larger files,
the map with over 3000 lines becomes overwhelming and impossible to understand.

Here are some suggestions to improve usability.

> Showing an Expanded map of all macros at once is overwhelming and difficult to understand instead, an expandable tree of macros would
allow users to expand and follow one path at a time.

> Using indentation does not clearly show the macro location, a more graphical expandable tree would solve that.

> Some macros are not important to the map, an exclude from Map would solve that.

I think the final product should look something like Regedit in Windows.

Thanks again for your efforts.

Best regards,

Alan

Post Reply