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-12-10 22:15:21 +00:00
|
|
|
# Stormscope Controller
|
|
|
|
var StormscopeController =
|
|
|
|
{
|
|
|
|
new : func (page, svg)
|
|
|
|
{
|
2017-12-27 19:51:54 +00:00
|
|
|
var obj = {
|
2018-01-13 18:53:06 +00:00
|
|
|
parents : [ StormscopeController, MFDPageController.new(page) ],
|
2017-12-27 19:51:54 +00:00
|
|
|
_crsrToggle : 0,
|
|
|
|
_recipient : nil,
|
|
|
|
_page : page,
|
|
|
|
};
|
|
|
|
|
2017-12-10 22:15:21 +00:00
|
|
|
return obj;
|
|
|
|
},
|
2017-12-27 19:51:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Input Handling
|
|
|
|
handleCRSR : func() {
|
|
|
|
me._crsrToggle = (! me._crsrToggle);
|
|
|
|
if (me._crsrToggle) {
|
|
|
|
} else {
|
|
|
|
me._page.hideCRSR();
|
|
|
|
}
|
|
|
|
return emesary.Transmitter.ReceiptStatus_Finished;
|
|
|
|
},
|
|
|
|
handleFMSInner : func(value) {
|
|
|
|
if (me._crsrToggle == 1) {
|
|
|
|
# Scroll through whatever is the current list
|
|
|
|
return emesary.Transmitter.ReceiptStatus_Finished;
|
|
|
|
} else {
|
|
|
|
# Pass to the page group controller to display and scroll through the page group menu
|
2018-01-13 18:53:06 +00:00
|
|
|
return me._page.mfd.SurroundController.handleFMSInner(value);
|
2017-12-27 19:51:54 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
handleFMSOuter : func(value) {
|
|
|
|
if (me._crsrToggle == 1) {
|
|
|
|
return emesary.Transmitter.ReceiptStatus_Finished;
|
|
|
|
} else {
|
|
|
|
# Pass to the page group controller to display and scroll through the page group menu
|
2018-01-13 18:53:06 +00:00
|
|
|
return me._page.mfd.SurroundController.handleFMSOuter(value);
|
2017-12-27 19:51:54 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
handleEnter : func(value) {
|
|
|
|
if (me._crsrToggle == 1) {
|
|
|
|
return emesary.Transmitter.ReceiptStatus_Finished;
|
|
|
|
} else {
|
|
|
|
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
# Reset controller if required when the page is displayed or hidden
|
|
|
|
ondisplay : func() {
|
|
|
|
me.RegisterWithEmesary();
|
|
|
|
},
|
|
|
|
offdisplay : func() {
|
|
|
|
me.DeRegisterWithEmesary();
|
|
|
|
},
|
|
|
|
|
2017-12-10 22:15:21 +00:00
|
|
|
};
|