On Fri, Jan 2, 2009 at 10:05 AM, Torsten Dreyer <tors...@t3r.de> wrote: >> I don't think a normalized voltage makes any sense. It should be real >> voltage in volts. Then the particular instruments should check for >> acceptable input voltage. I must be missing some point, what's wrong >> with this approach? > Nothing is wrong with this approach, but the normalized, dimensionless > approach is a more general one. Please let me explain why: > In navradio.cxx only the basic functionality of a radio is modeled, like > setting frequencies, receiving something, spitting out audio etc. > It does not model any particular radio and it does know anything about the > powersupply of the radio. And it doesn't care at all if it is 12VDC, 24VDC, > 110VAC, 220VAC or gallons of beer (who knows what the future brings?). But it > should know, that if the power-supply drops below 70% (as an example) it > stops working and if it raises above 150% (another example) it blows its > internal fuse (hopefully).
For such generic models the configuration xml should provide the the relevant voltages of the operating characteristics (not necessarily only min/max). If I have a 12V instrument modeled in xml on top of the C++ code, I still want to be able to plug it in into a 28V system and see it being fried (or whatever the operating limits say). Preferably such limits are private to each instrument, so shouldn't even pollute the property tree. Example: <dme> <name>12V dme instrument</name> <number>0</number> <voltages> <minimum>7</minimum> <maximum>15</maximum> </voltages> </dme> I can point to this piece of xml and say it models a 12V dme. I can stick it into aircraft, and depending on the absolute voltages provided, it just does the right thing. On the C++ side this is essentially what James Turner suggested with the ElectricalInstrument/DigitalInstrument approach, but with the important difference that the normalization factors do not come from a global place, but from the configuration for each instrument (because it isn't about "what the aircraft electrical system considers nominal", it is about each instrument!). The fact that the derived dme instrument is using normalized values *inside of itself* is okay with me, as long as it isn't visible from the outside. Also, the electrical system can be modeled in nasal if preferred, it just needs to provide real voltages to the instruments. -- Csaba/Jester ------------------------------------------------------------------------------ _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel