Library globals

Class globals . canvas . MFD_Generic . PFD_Device

View source

Container device for pages.

Functions

DeRegisterWithEmesary

RegisterWithEmesary

instead of using the direct call method this allows the use of Emesary (via a specified or default global transmitter) example to notify that a softkey has been used. The "1" in the line below is the device ID var notification = notifications.PFDEventNotification.new(me.designation, me.DeviceId, notifications.PFDEventNotification.SoftKeyPushed, me.mpcd_button_pushed); emesary.GlobalTransmitter.NotifyAll(notification); - currently supported is 1. setting menu text directly (after page has been loaded) notifications.PFDEventNotification.new(me.designation, 1, notifications.PFDEventNotification.ChangeMenuText, [{ Id: 1, Text: "NNN"}]); 2. SoftKey selection. the device ID must match this device ID (to allow for multiple devices).

addPage

add a page to the device. - page title. - svg element id

getCurrentPage

Return the current selected page.

getPage

Get a named page

new

- svg is the page elements from the svg. - num_menu_buttons is the Number of menu buttons; starting from the bottom left then right, then top, then left. - button prefix (e.g MI_) is the prefix of the labels in the SVG for the menu boxes. - _canvas is the canvas group. - designation (optional) is used for Emesary designation NOTE: This does not actually create the canvas elements, or parse the SVG, that would typically be done in a higher level class that contains an instance of this class. see: http://wiki.flightgear.org/Canvas_MFD_Framework

notifyButton

called when a button is pushed - connecting the property to this method is implemented in the outer class

selectPage

Change to display the selected page. - the page object method controls the visibility

update

manage the update of the currently selected page

updateMenus

ensure that the menus are display correctly for the current page.