A propsal regarding the generalization of aircraft systems
Abstract: Currently, the electrical system seems to be the only system that can be configured by the user. Other systems are either fully hardcoded into Flightgear, or have yet to be modelled. Since dedication to code that simulates such thing as hydraulic or bleed air system isn't going to appear anytime soon, it is my opinion that it might be a good idea to modify the electrical system into a more abstract/generic form. The idea is to make the simulation of other aircraft systems easier. Of course, instead of being hardcoded into Flightgear, unique behaviours to individual system may have to make user-configurable somehow. Problems: Why should the electrical system be made generic? Take the electrical system, hydraulic system, and bleed air system as the examples. All these system are basically different forms of moving something from point A, through medium B, to point C. That battery on the electrical system is similar in function to the hydraulic fluid accumlator, or the air tank in the bleed air system. In fact, they can all be modelled using a Queue... or a Stack, storing a table of values. The electrical bus, hydraulic and bleed air lines are similar in functions, and its implementation can be as simple as *b = &a; (in C's terms). Because there are so many commonalities between these systems, it would be wise to combine them into one piece of code, and implements the behaviours of a specific system using extensions. Possible benfitis: By generalizing systems, a framework is created which will make life easier for other developers who wish to create new aircraft systems. I guess what I am trying to advocate here is OOP for aircraft systems. To make this approach more flexible and worthwhile, Nasal should be allowed to define the system's behaviour. This way, Nasal scripts can be served as templates in the creation of new aircraft systems for Flightgear, or allow non-programmers like me to create new aircraft system without having to use C++. Let's say I want to define a datalink system between avionics, all I would have to do is treat the Queues as the buffers and write strings into them. Possible issues: As with any other dependency, there is a danger that changes to the generic system may break all the aircraft systems. Therefore, should this proposal gets implemented, the generic system would need to be implmented in such a way to keep possible changes to the minimium. Also, having everything based on a single framework would create single point failure. Hence, the generic system would need to be very robust, or more than one implementation would be needed. Conclusion: My intention is to bring attention to the simulation of aircraft systems, and start some discussions among developers. I hope someone will take this proposal into consideration. Ampere _______________________________________________ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d