From: David M. <da...@me...> - 2001-07-31 20:31:03
|
Curtis L. Olson writes: > Realizing that my name isn't Alex, what I see lacking is some of > the systems controls, electrical, fuel, etc. ... all those little > switches and buttons on the periphery of the instrument panel > ... fuel tank select/cutoff, master switch, stuff like that. That could be done with the current panel support, but I think that it would be unreasonably difficult. Right now, the only conditional included in the panel support is a switch layer, which can choose one of two sublayers based on the value of a boolean property. That's usable -- we could nest the active parts (display/reading) of each instrument inside a switch layer for the battery master switch, then inside another for the avionics master switch, then inside another for the individual instrument's power switch, if any -- but, well, yech. At the other extreme, I could make the panel code (or the property code in general) into a full-blown, Turing-complete programming language by adding XML-encoded if-statements, for-loops, operators, etc. -- but, well, yech again. So where's the sweet spot here? I'm pretty sure that we should allow individual transformations, textures, text chunks, and actions to be conditionalized, as well as full layers. We probably also want a layer that can group sublayers, and a way to conditionalize based on more complex value comparisons than simply true/false. I'm trying to imagine the abstract structure (or, if you prefer, the XML markup); implementing it won't be hard once we know what to do. Should we allow an optional <condition>...</condition> block inside any layer, transformation, action, or text chunk, and use the object only if the condition passes? That would make life easier in some ways, i.e. <layer> <name>Hello World Display</name> <condition> <not> <property>/attitude/nasty</property> </not> </condition> ... </layer> but we'd lose the equivalent of if...else and would have to repeat conditions. The absence of a condition would always count as true. The condition could be quite elaborate: <layer> <name>ACME Display</name> <condition> <and> <property>/panel/battery-master-switch</property> <property>/panel/avionics-master-switch</property> <property>/panel/acme-instrument/power-switch</property> </and> </condition> ... </layer> I'd love to hear from everyone, but especially from the people who have actually contributed instruments or panels. All the best, David -- David Megginson da...@me... |