From: Jon S. B. <jon...@co...> - 2010-08-19 12:11:53
|
I've created a new class that I call FGModelFunctions. This is a class that will be inherited by other models (and I use that term loosely to refer to FGModel-derived objects and other classes that represent "models" of things, such as the FGEngine class, etc.). I have extracted the code from FGModel that had done the loading of pre- and post- functions, and interface properties and moved it into FGModelFunctions. Now, FGModel inherits from FGModelFunctions. I have also made FGEngine inherit from that. I have had to slightly modify FGRocket so I can try this out, but that has only been due to the fact that the Calculate() function is only defined in FGEngine-derived objects. So, what I think I have now (I have not tested this, yet), is a FGRocket class that allows me to create interface properties within the rocket engine definition <rocket ...> in the config file, and specify new properties for that engine and new functions that will be performed either before the main engine logic or after the main logic. Theoretically, I guess, you could override the entire operation of the rocket (or other engine, once that is added). Also, perhaps an FGGenericEngine could be created that would be solely defined by <function>s. This is all still under investigation. I am not yet sure how to handle the fact that there may be multiple engines used for any vehicle, and so properties would need to be created that account for that. I think I have a couple of ideas for that, but as before I am hesitant to use [#] or something like that as a wildcard for engine numbering, and prefer it to be automatic. The FGPropulsion class (as do other FGModel-derived objects that can be specified in a config file) also features the model functions capability, so for a specific aircraft model, indexed engine properties could be manipulated. Again, this feature is in beta, and I imagine it will morph before it gets to its final state. I am also still considering the property binding problem that we've been discussing. Lots going on! Jon |