by Hooray » Fri Jan 17, 2014 6:24 pm
re: "installing multiple units per aircraft", this is something that we really want to support - and it should be greatly simplified by using OOP with different instances per instrument, like you say.
I think it's one of the things we discussed originally. In general, this is definitely technically possible - like you say, it's all about encapsulating all instrument-specific stuff in a class, and using the property tree accordingly. Most aircraft developers simply tend not to develop things this way, because it is obviously more difficult - and because it requires thinking like a "programmer" - we've seen this in various other places, including in new Nasal/canvas instruments like the 747-400 NavDisplay code, which originally also didn't support multiple aircraft, or multiple independent instances per aircraft.
I think what's really missing here is a framework, preferably modeled on top of a SGSubsystem wrapper, so that aircraft developers only need to specify instance specific variables and properties, and global/shared ones - conceptually, this is straightforward to do, and the NavDisplay framework is now doing this implicitly - i.e. it doesn't matter if you need once instance, 2 instances or 20 instances - they're all independent, and use different property branches accordingly. In fact, we generalized the code such that it now cannot only be used on different airliners/aircraft, but even use AI traffic as "source", i.e. you get to see the traffic situation from the point of view of each AI aircraft.
This is something where having a dedicated "subsystem" and "instrument" framework could help aircraft developers come up with generic instruments that do not suffer from hard-coded restrictions.
I would be very interested in helping with this, because there's quite a number of instruments that contain such hard-coded design limitations - and it would be awesome to get rid of those, for the sake of the project, but also to ensure that other aircraft developers can more easily reuse instruments, and customize/contribute things as required.
One of the things I was hoping to look into sooner or later would be generalizing the 747-400 PFD code accordingly, so that it can also be used on other aircraft, but also easily parameterized for different types of aircraft. The work isn't really difficult, but it touches a ton of places, especially because people tend to come up with "singleton" designs that are not really flexible at all.