Declare external reactions in C++ code, rather than in XML configuration. #1204
Unanswered
scotteh432
asked this question in
Q&A
Replies: 1 comment
-
// Ok, here! How would I declare an External Reaction?
shared_ptr<JSBSim::FGExternalReactions> ptr = f.GetExternalReactions(); // Is this a step in right direction?
ptr->Load(someXmlElement); // This does not work, my compiler complains I'm doing something wrong. These lines look good to me however you should call them after your model has been loaded i.e. after If that does not help, it would be helpful to provide the error message that your compiler is returning. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
I'm embedding JSBSim inside another program for a project I am working on involving aircraft towing systems. To get this to work, it would be very nice to be able to declare an External Reaction via the C++ code rather than in the XML configuration files. I've read through the documentation on the FGExternalReactions, which indicates that this should be possible, but alas, I cannot figure out how.
I've tried accessing the FGExternalReactions through the GetExternalReactions from the FGFDMExec class. But I can't seem to do anything with it once I have it without causing my code to not compile. I believe I should be able to call the Load() method to initialize an external reaction from an XML element. But I can't seem to call this method without causing my code to fail to compile.
Any help in solving this issue would be much appreciated. I'm willing to accept the answer of "just use the XML configuration files" if there's no good way to do this, I just want to explore this avenue first, as I believe it will make the workflow of my project cleaner. Thank you very much for your time.
Beta Was this translation helpful? Give feedback.
All reactions