2018-02-09 18:55:53 +00:00
|
|
|
# Copyright 2018 Stuart Buchanan
|
|
|
|
# This file is part of FlightGear.
|
|
|
|
#
|
|
|
|
# Foobar is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# FlightGear is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with FlightGear. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
2017-11-24 23:04:46 +00:00
|
|
|
# Navigation Map Controller
|
2017-12-27 19:51:54 +00:00
|
|
|
var NavigationMapController =
|
2017-11-24 23:04:46 +00:00
|
|
|
{
|
2017-12-27 19:51:54 +00:00
|
|
|
new : func (page, svg)
|
2017-11-24 23:04:46 +00:00
|
|
|
{
|
2018-01-08 21:39:39 +00:00
|
|
|
var obj = { parents : [ NavigationMapController, MFDPageController.new(page) ] };
|
2017-12-10 22:15:21 +00:00
|
|
|
obj.page = page;
|
2017-11-24 23:04:46 +00:00
|
|
|
return obj;
|
|
|
|
},
|
2017-12-31 16:10:52 +00:00
|
|
|
|
|
|
|
# Set the DTO line target
|
|
|
|
setDTOLineTarget : func(lat, lon) {
|
2018-03-17 22:04:41 +00:00
|
|
|
me.page.MFDMap.setDTOLineTarget(lat, lon);
|
2017-12-31 16:10:52 +00:00
|
|
|
},
|
|
|
|
enableDTO : func(enable) {
|
2018-03-17 22:04:41 +00:00
|
|
|
me.page.MFDMap.enableDTO(enable)
|
2017-12-31 16:10:52 +00:00
|
|
|
},
|
|
|
|
|
2018-01-08 21:39:39 +00:00
|
|
|
handleRange : func(val)
|
|
|
|
{
|
2018-03-17 22:04:41 +00:00
|
|
|
me.page.MFDMap.handleRange(val);
|
2017-12-10 22:15:21 +00:00
|
|
|
},
|
2018-01-08 21:39:39 +00:00
|
|
|
|
2017-12-10 22:15:21 +00:00
|
|
|
# Reset controller if required when the page is displayed or hidden
|
|
|
|
ondisplay : func() {
|
|
|
|
me.RegisterWithEmesary();
|
|
|
|
},
|
|
|
|
offdisplay : func() {
|
|
|
|
me.DeRegisterWithEmesary();
|
|
|
|
},
|
2017-11-24 23:04:46 +00:00
|
|
|
};
|