| 1 |
# WARNING: *.model files will be deprecated, see: http://wiki.flightgear.org/MapStructure |
| 2 |
var RunwayNDModel = {}; |
| 3 |
RunwayNDModel.new = func make( LayerModel, RunwayNDModel ); |
| 4 |
|
| 5 |
RunwayNDModel.init = func { |
| 6 |
me._view.reset(); |
| 7 |
|
| 8 |
# check if RM is active and bail out if not |
| 9 |
if (!getprop("/autopilot/route-manager/active")) |
| 10 |
print("runway-nd.model: Cannot access flight plan, route manager inactive!") and return; |
| 11 |
|
| 12 |
var desRwy = flightplan().destination_runway; |
| 13 |
var depRwy = flightplan().departure_runway; |
| 14 |
|
| 15 |
if (depRwy != nil) |
| 16 |
me.push(depRwy); |
| 17 |
if (desRwy != nil) |
| 18 |
me.push(desRwy); |
| 19 |
|
| 20 |
me.notifyView(); |
| 21 |
} |