Importing Topologies Issues #1439
aaron-hutton
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been testing a project that imports topologies to combine them as described here and have hit various problems. I started with a simple example where I created a working topology and then tried to import it into a main topology without adding any extra functionality, essentially useless, but good to see how importing worked.
I'm not quite sure how to classify the problems I encountered. They could be me being stupid, bugs, design flaws or intentional. I'm just going to write them out and the F' team can decide.
It would be nice to be able to build partial applications, so individual groups of components can be tested without requiring the whole application, but it seems like you can only have a single
register_fprime_executable
, so this doesn't seem possible. It may be that my knowledge of CMake isn't good enough to set this up...Each topology needs its own
TopologyState
object, which seems to require that each topology has its own FPP module (as documented in the FPP documentation), which isn't inherently a problem, but seems to produce a few of these other problemsWith a topology and multiple instances defined in a single module
A
, when importing the topology into a different moduleB
I getundefined symbol
errors as it cannot find the instances due to them not being located in moduleA
but it is searching in moduleB
. This can be fixed by addressing the instances asinstance A.x
inside the topology.When importing instances from a different module the
TopologyAc.cpp
file generates with<module>_<instance name>
as the instance name. This is fine for most instances which don't use theFpp.ToCpp.Phases
, however for those that do the variable name is unexpected and causesnot declared in this scope
errors. If you switch the variable name in theFpp.ToCpp.Phases
snippets, then the original topology no longer compiles.If we could disable compilation of the original topology when compiling the main topology this would also be fine, but turning off its compilation causes the topology import to fail as the
fpp
file is no longer being compiled?The only solution I found to this was to move the instances into their own module,
A_instances
, which then allowed me to address them asA_instances_<instance name>
in the snippets, which then works for both the original topology and the main importing topology.After doing the above the connections in the topology cause
undefined symbol
errors, so I had to switch all of the instances in the connections toA_instances.<instance name>.<port> -> A_instances.<instance name>.<port>
which obviously introduces a lot of extra code, reducing readability. After these steps it finally compiles.As a side note, if importing topologies is a direction the F' team wishes to push in the future, it may make sense to modify one of the example applications to include importing. It would, of course, be perfectly understandable if you chose not to do this for the sake of simplicity for people new to F'.
Beta Was this translation helpful? Give feedback.
All reactions