Debian Codegraph @

Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/NavigationMap/NavigationMapController.nas

raw
1 # Copyright 2018 Stuart Buchanan
2 # This file is part of FlightGear.
3 #
4 # FlightGear is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 2 of the License, or
7 # (at your option) any later version.
8 #
9 # FlightGear is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with FlightGear. If not, see <http://www.gnu.org/licenses/>.
16 #
17 # Navigation Map Controller
18 var NavigationMapController =
19 {
20 new : func (page, svg)
21 {
22 var obj = { parents : [ NavigationMapController, MFDPageController.new(page) ] };
23 obj.page = page;
24 return obj;
25 },
26
27 # Set the DTO line target
28 setDTOLineTarget : func(lat, lon) {
29 me.page.MFDMap.setDTOLineTarget(lat, lon);
30 },
31 enableDTO : func(enable) {
32 me.page.MFDMap.enableDTO(enable)
33 },
34
35 handleRange : func(val)
36 {
37 me.page.MFDMap.handleRange(val);
38 },
39
40 # Reset controller if required when the page is displayed or hidden
41 ondisplay : func() {
42 me.RegisterWithEmesary();
43 },
44 offdisplay : func() {
45 me.DeRegisterWithEmesary();
46 },
47 };