diff --git a/Aircraft/Instruments-3d/FG1000/Models/DirectTo.svg b/Aircraft/Instruments-3d/FG1000/Models/DirectTo.svg index 6f7eecdbb..ba818c841 100644 --- a/Aircraft/Instruments-3d/FG1000/Models/DirectTo.svg +++ b/Aircraft/Instruments-3d/FG1000/Models/DirectTo.svg @@ -23,9 +23,9 @@ borderopacity="0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="12.989583" - inkscape:cx="963.35035" - inkscape:cy="168.45634" + inkscape:zoom="2.2962556" + inkscape:cx="778.1918" + inkscape:cy="230.23655" inkscape:document-units="px" inkscape:current-layer="DirectToGroup" showgrid="true" @@ -69,7 +69,7 @@ id="DirectToGroup" inkscape:label="#g9755"> @@ -93,7 +93,7 @@ height="19.691175" width="139.19115" id="rect9753" - style="opacity:1;fill:#1a3030;fill-opacity:1;fill-rule:nonzero;stroke:#fffcfa;stroke-width:1.30882514;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + style="opacity:1;fill:#4b4b4b;fill-opacity:1;fill-rule:nonzero;stroke:#fffcfa;stroke-width:1.30882514;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> IDENT, FACILITY, CITY CITY + x="711.01562" + y="187.80469">CITY REGION + x="948.65234" + y="136.96484">REGION K @@ -218,11 +218,11 @@ inkscape:label="#text4166" sodipodi:linespacing="125%" id="DirectToID2" - y="137.08984" + y="137.16016" x="732.99805" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#80ffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" xml:space="preserve">F @@ -275,7 +275,7 @@ height="20.289667" width="39.789661" id="rect3455" - style="opacity:1;fill:#1a3030;fill-opacity:1;fill-rule:nonzero;stroke:#fffcfa;stroke-width:1;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + style="opacity:1;fill:#4b4b4b;fill-opacity:1;fill-rule:nonzero;stroke:#fffcfa;stroke-width:1;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> 000 + style="opacity:1;fill:#1a3030;fill-opacity:1;fill-rule:nonzero;stroke:#fffcfa;stroke-width:2;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + ry="0" /> ACTIVATE? + style="display:inline;opacity:1;fill:#4b4b4b;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.99528456;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> Zoom nm NORTH UP + style="font-size:17.21218109px;line-height:1.25;fill:#ffffff;fill-opacity:1;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;">NORTH UP + + + + REGION + + + + REGION + REGION + REGION + REGION + + + diff --git a/Aircraft/Instruments-3d/FG1000/Nasal/DirectTo/DirectTo.nas b/Aircraft/Instruments-3d/FG1000/Nasal/DirectTo/DirectTo.nas index ce15cdd4d..8a120232d 100644 --- a/Aircraft/Instruments-3d/FG1000/Nasal/DirectTo/DirectTo.nas +++ b/Aircraft/Instruments-3d/FG1000/Nasal/DirectTo/DirectTo.nas @@ -7,6 +7,8 @@ var DirectTo = { + SHORTCUTS : [ "FPL", "NRST", "RECENT", "USER", "AIRWAY" ], + new : func (mfd, myCanvas, device, svg) { var obj = { @@ -45,7 +47,15 @@ var DirectTo = obj.VNVAltEntry = PFD.DataEntryElement.new(obj.pageName, svg, "VNVAlt", "", 5, "0123456789"); obj.VNVOffsetEntry = PFD.DataEntryElement.new(obj.pageName, svg, "VNVOffset", "", 2, "0123456789"); obj.CourseEntry = PFD.DataEntryElement.new(obj.pageName, svg, "Course", "", 3, "0123456789"); - obj.Activate = PFD.TextElement.new(obj.pageName, svg, "Activate", "ACTIVATE"); + obj.Activate = PFD.TextElement.new(obj.pageName, svg, "Activate", "ACTIVATE?"); + + # The Shortcut window. This allows the user to scroll through a set of lists + # of waypoints. + obj.WaypointSubmenuGroup = obj._SVGGroup.getElementById("DirectToWaypointSubmenuGroup"); + assert(obj.WaypointSubmenuGroup != nil, "Unable to find DirectToWaypointSubmenuGroup"); + obj.WaypointSubmenuGroup.setVisible(0); + obj.WaypointSubmenuSelect = PFD.ScrollElement.new(obj.pageName, svg, "WaypointSubmenuSelect", DirectTo.SHORTCUTS); + obj.WaypointSubmenuScroll = PFD.GroupElement.new(obj.pageName, svg, [ "WaypointSubmenuScroll" ] , 4, "WaypointSubmenuScroll", 0, "WaypointSubmenuScrollTrough" , "WaypointSubmenuScrollThumb", 60); # The Airport Chart obj.DirectToChart = obj._group.createChild("map"); @@ -88,9 +98,11 @@ var DirectTo = }, displayDestination : func(destination) { + #me.IDEntry.clearElement(); + if (destination != nil) { # Display a given location - debug.dump(destination); + #debug.dump(destination); me.DirectToChart.setVisible(1); me.DirectToChart.getController().setPosition(destination.lat,destination.lon); me.setTextElement("Name", string.uc(destination.name)); @@ -117,17 +129,12 @@ var DirectTo = me.CourseEntry.setValue(0); } }, + setRange : func(range, label) { me.DirectToChart.setRange(range); me.DirectToChart.update(); me.setTextElement("RangeDisplay", label); }, - # Clear any cursor, highlights. Used when exiting from CRSR mode - resetCRSR : func() { - me.airportEntry.unhighlightElement(); - me.runwaySelect.unhighlightElement(); - me.freqSelect.hideCRSR(); - }, offdisplay : func() { me._group.setVisible(0); diff --git a/Aircraft/Instruments-3d/FG1000/Nasal/DirectTo/DirectToController.nas b/Aircraft/Instruments-3d/FG1000/Nasal/DirectTo/DirectToController.nas index dbb199e45..69530aa47 100644 --- a/Aircraft/Instruments-3d/FG1000/Nasal/DirectTo/DirectToController.nas +++ b/Aircraft/Instruments-3d/FG1000/Nasal/DirectTo/DirectToController.nas @@ -53,17 +53,21 @@ var DirectToController = obj.page.Activate ]; + obj._activateIndex = size(obj._cursorElements) - 1; + # -1 indicates nothing selected at present obj._selectedElement = -1; + # Whether the WaypointSubmenuGroup is enabled + obj._waypointSubmenuVisible = 0; + return obj; }, setCursorElement : func(value) { - if (me._selectedElement != -1) { - # Unhighlight the current element, if one is highlighted - me._cursorElements[me._selectedElement ].unhighlightElement(); + for (var i = 0; i < size(me._cursorElements); i = i+1) { + me._cursorElements[i].unhighlightElement(); } if (value < 0) value = 0; @@ -98,23 +102,129 @@ var DirectToController = # No effect, but shouldn't be passed to underlying page? return emesary.Transmitter.ReceiptStatus_Finished; }, - handleFMSInner : func(value) { - if (me._selectedElement == -1) { - # TODO: handle display of waypoint submenu on anti-clockwise initial rotation! - # If no element is selected, then the inner FMS knob selects the ID field - me.nextCursorElement(1); + updateWaypointSubmenu : func() { + var type = me.page.WaypointSubmenuSelect.getValue(); + + var items = []; + + if (type == "FPL") { + # Get the contents of the flightplan and display the list of waypoints. + var fp = me.getNavData("Flightplan"); + + for (var i = 0; i < fp.getPlanSize(); i = i + 1) { + var wp = fp.getWP(i); + if (wp.wp_name != nil) append(items, wp.wp_name); + } + } + + if (type == "NRST") { + # Get the nearest airports + var apts = me.getNavData("NearestAirports"); + + for (var i = 0; i < size(apts); i = i + 1) { + var apt = apts[i]; + if (apt.id != nil) append(items, apt.id); + } + } + + if (type == "RECENT") { + # Get the set of recent waypoints + items = me.getNavData("RecentWaypoints"); + } + + if (type == "USER") { + items = me.getNavData("UserWaypoints"); + } + + if (type == "AIRWAY") { + var fp = me.getNavData("AirwayWaypoints"); + if (fp != nil) { + for (var i = 0; i < fp.getPlanSize(); i = i + 1) { + var wp = fp.getWP(i); + if (wp.wp_name != nil) append(items, wp.wp_name); + } + } + } + + if ((items != nil) and (size(items) > 0)) { + # At this point we have a vector of waypoint names. We need to convert + # this into a vector of { "WaypointSubmenuScroll" : [name] } hashes for consumption by the + # list of waypoints + var groupitems = []; + foreach (var item; items) { + append(groupitems, { "WaypointSubmenuScroll" : item } ); + } + + # Now display them! + me.page.WaypointSubmenuScroll.setValues(groupitems); + } else { + # Nothing to display + me.page.WaypointSubmenuScroll.setValues([]); + } + }, + + getNavData : func(type, value=nil) { + # Use Emesary to get a piece from the NavData system, using the provided + # type and value; + var notification = notifications.PFDEventNotification.new( + "MFD", + 1, + notifications.PFDEventNotification.NavData, + {Id: type, Value: value}); + + var response = me._transmitter.NotifyAll(notification); + + if (! me._transmitter.IsFailed(response)) { + return notification.EventParameter.Value; + } else { + return nil; + } + }, + + handleFMSInner : func(value) { + + if (me._waypointSubmenuVisible) { + # We're in the Waypoint Submenu, in which case the inner FMS knob + # selects between the different waypoint types. + me.page.WaypointSubmenuSelect.highlightElement(); + me.page.WaypointSubmenuSelect.incrSmall(value); + # Now update the Scroll group with the new type of waypoints + me.updateWaypointSubmenu(); + } else if (me._selectedElement == -1) { + if (value == -1) { + # The WaypointSubmenuGroup group is displayed if the small FMS knob is rotated + # anti-clockwise as an initial rotation. + me._cursorElements[0].unhighlightElement(); + + me.page.WaypointSubmenuGroup.setVisible(1); + me.page.WaypointSubmenuSelect.highlightElement(); + me._waypointSubmenuVisible = 1; + me.updateWaypointSubmenu(); + } else { + # If the user rotates clockwise, then they simply start editing + # the cursor element + me.nextCursorElement(1); + me._cursorElements[me._selectedElement].incrSmall(value); + } + } else { + # We've already got something selected, and we're not in the + # WaypointSubmenuGroup, so increment it. + me._cursorElements[me._selectedElement].incrSmall(value); } - me._cursorElements[me._selectedElement].incrSmall(value); return emesary.Transmitter.ReceiptStatus_Finished; }, handleFMSOuter : func(value) { - if (me._selectedElement == -1) { + if (me._waypointSubmenuVisible) { + # We're in the Waypoint Submenu, in which case the outer FMS knob + # selects between the different waypoints in the Waypoint Submenu. + me.page.WaypointSubmenuSelect.unhighlightElement(); + me.page.WaypointSubmenuScroll.incrLarge(value); + } else if (me._selectedElement == -1) { # If no element is selected, then the Outer FMS knob has no effect return emesary.Transmitter.ReceiptStatus_Finished; - } - - if (me._cursorElements[me._selectedElement].isInEdit()) { + } else if (me._cursorElements[me._selectedElement].isInEdit()) { + # If we're editing an element, then get on with it! me._cursorElements[me._selectedElement].incrLarge(value); } else { me.nextCursorElement(value); @@ -123,30 +233,110 @@ var DirectToController = return emesary.Transmitter.ReceiptStatus_Finished; }, handleEnter : func(value) { - if (me._selectedElement == -1) { + if (me._waypointSubmenuVisible) { + # If we're in the Waypoint Submenu, then take whatever is highlighted + # in the scroll list, load it and hide the Waypoint submenu + var id = me.page.WaypointSubmenuScroll.getValue(); + if (id != nil) me.loadDestination(id); + me.page.WaypointSubmenuGroup.setVisible(0); + me._waypointSubmenuVisible = 0; + + # Select the activate ACTIVATE item. + me.setCursorElement(me._activateIndex); + } else if (me._selectedElement == -1) { # If no element is selected, then the ENT key has no effect return emesary.Transmitter.ReceiptStatus_Finished; + } else { + + # If we're on the Activate button, then set up the DirectTo and hide the + # page. We're finished + if (me._selectedElement == me._activateIndex) { + var mappage = me._page.getMFD().getPage("NavigationMap"); + assert(mappage != nil, "Unable to find NavigationMap page"); + me._page.getDevice().selectPage(mappage); + return emesary.Transmitter.ReceiptStatus_Finished; + } + + # If we're editing an element, complete the data entry. + if (me._cursorElements[me._selectedElement].isInEdit()) { + me._cursorElements[me._selectedElement].enterElement(); + } + + if (me._cursorElements[me._selectedElement] == me.page.IDEntry) { + # We've finished entering an ID, so load it. + me.loadDestination(me.page.IDEntry.getValue()); + } + + # Determine where to highlight next. In most cases, we go straight to ACTIVATE. + # The exception is the VNV Alt field which goes to the VNV Distance field; + if (me._cursorElements[me._selectedElement] == me.page.VNVAltEntry) { + # VNV DIS entry is the next element + me.nextCursorElement(1); + } else { + # ACTIVATE is the last element of the group + me.setCursorElement(me._activateIndex); + } } - # If we're on the Activate button, then set up the DirectTo and hide the - # page. We're finished - if (me._cursorElements[me._selectedElement] == me.page.Activate) { + return emesary.Transmitter.ReceiptStatus_Finished; + }, + handleClear : func(value) { + if (me._waypointSubmenuVisible) { + # If we're in the Waypoint Submenu, then this clears it. + me.page.WaypointSubmenuGroup.setVisible(0); + me._waypointSubmenuVisible = 0; + } else if ((me._selectedElement != -1) and me._cursorElements[me._selectedElement].isInEdit()) { + me._cursorElements[me._selectedElement].clearElement(); + } else { + # Cancel the entire Direct To page, and go back to the Navigation Map. var mappage = me._page.getMFD().getPage("NavigationMap"); assert(mappage != nil, "Unable to find NavigationMap page"); me._page.getDevice().selectPage(mappage); - return emesary.Transmitter.ReceiptStatus_Finished; + } + return emesary.Transmitter.ReceiptStatus_Finished; + }, + + # Reset controller if required when the page is displayed or hidden + ondisplay : func() { + me.RegisterWithEmesary(); + for (var i = 0; i < size(me._cursorElements); i = i+1) { + me._cursorElements[i].unhighlightElement(); } - # If we're editing an element, complete the data entry. - if (me._cursorElements[me._selectedElement].isInEdit()) { - me._cursorElements[me._selectedElement].enterElement(); - } + me._selectedElement = -1; - if (me._cursorElements[me._selectedElement] == me.page.IDEntry) { - # We've finished entering an ID, so load it. - var destination = me.getDestination(me.page.IDEntry.getValue()); - if (destination != nil) { + var id = me.getNavData("CurrentDTO"); + me.page.IDEntry.setValue(id); + me.loadDestination(id); + }, + offdisplay : func() { + me.DeRegisterWithEmesary(); + }, + + loadDestination : func(id) { + var d = { + id: id, + name: "", + lat: 0, + lon: 0, + course : 0, + range_nm : 0, + }; + + if ((id != nil) and size(id) > 1) { + # Use Emesary to get the destination + var notification = notifications.PFDEventNotification.new( + "MFD", + 1, + notifications.PFDEventNotification.NavData, + {Id: "NavDataByID", Value: id}); + + var response = me._transmitter.NotifyAll(notification); + var retval = notification.EventParameter.Value; + + if ((! me._transmitter.IsFailed(response)) and (size(retval) > 0)) { + var destination = retval[0]; # set the course and distance to the destination if required var (course, dist) = courseAndDistance(destination); var d = { @@ -157,84 +347,9 @@ var DirectToController = course : course, range_nm : dist, }; - me.page.displayDestination(d); } } - # Determine where to highlight next. In most cases, we go straight to ACTIVATE. - # The exception is the VNV Alt field which goes to the VNV Distance field; - if (me._cursorElements[me._selectedElement] == me.page.VNVAltEntry) { - # VNV DIS entry is the next element - me.nextCursorElement(1); - } else { - # ACTIVATE is the last element of the group - me.setCursorElement(size(me._cursorElements) - 1); - } - - return emesary.Transmitter.ReceiptStatus_Finished; - }, - handleClear : func(value) { - var mappage = me._page.getMFD().getPage("NavigationMap"); - assert(mappage != nil, "Unable to find NavigationMap page"); - me._page.getDevice().selectPage(mappage); - return emesary.Transmitter.ReceiptStatus_Finished; - }, - - handleSoftKey : func(key) { - # DirectTo has no softkeys, but if the user presses one from the underlying - # page we should switch outselves off. - me.page.setVisible(0); - return emesary.Transmitter.ReceiptStatus_OK; - }, - - # Reset controller if required when the page is displayed or hidden - ondisplay : func() { - me.RegisterWithEmesary(); - for (var i = 0; i < size(me._cursorElements); i = i+1) { - me._cursorElements[i].unhighlightElement(); - } - - me.setCursorElement(0); - - me.page.IDEntry.setValue("KHAF"); - - var destination = me.getDestination(me.page.IDEntry.getValue()); - if (destination != nil) { - - # set the course and distance to the destination if required - var (course, dist) = courseAndDistance(destination); - var d = { - id: destination.id, - name: destination.name, - lat: destination.lat, - lon: destination.lon, - course : course, - range_nm : dist, - }; - me.page.displayDestination(d); - } - - - }, - offdisplay : func() { - me.DeRegisterWithEmesary(); - }, - - getDestination : func(id) { - # Use Emesary to get the destination - var notification = notifications.PFDEventNotification.new( - "MFD", - 1, - notifications.PFDEventNotification.NavData, - {Id: "NavDataByID", Value: id}); - - var response = me._transmitter.NotifyAll(notification); - var retval = notification.EventParameter.Value; - - if ((! me._transmitter.IsFailed(response)) and (size(retval) > 0)) { - return retval[0]; - } else { - return nil; - } + me.page.displayDestination(d); }, }; diff --git a/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/NavDataInterface.nas b/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/NavDataInterface.nas index 13ef1341d..9351eae9b 100644 --- a/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/NavDataInterface.nas +++ b/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/NavDataInterface.nas @@ -14,6 +14,16 @@ new : func (device) obj._registered = 0; obj._device = device; + # List of recently use waypoints + obj._recentWaypoints = std.Vector.new(); + + # Current DirectTo ID. + var nearest = obj.getNearestAirports(); + if (size(nearest) > 0) { + nearest = nearest[0]; + obj._currentDTO = nearest.id; + } + return obj; }, @@ -41,6 +51,11 @@ getNearestAirports : func() getAirportById : func(id) { var apt = findAirportsByICAO(id, "airport"); + + if ((apt != nil) and (! me._recentWaypoints.contains(id))) { + me._recentWaypoints.insert(0, id); + } + return apt; }, @@ -57,9 +72,65 @@ getNavDataById : func (id) # Check for fix. if (size(navdata) == 0) navdata = findFixesByID(id); + if ((size(navdata) > 0) and (! me._recentWaypoints.contains(id))) { + me._recentWaypoints.insert(0, id); + } + return navdata; }, +# Retrieve the current flightplan and return it +getFlightplan : func () +{ + return flightplan(); +}, + +# Retrieve the Airway waypoints on the current leg. +getAirwayWaypoints : func() { + var fp = flightplan(); + if (fp != nil) { + var current_wp = fp.currentWP(); + if ((current_wp != nil) and (fp.indexOfWP(current_wp) > 0)) { + var last_wp = fp.getWP(fp.indexOfWP(current_wp) -1); + return airwaysRoute(last_wp, current_wp); + } + } + return nil; +}, + +# Return the recently seen waypoints, collected from previous calls to +# other nav data functions +getRecentWaypoints : func() +{ + return me._recentWaypoints.vector; +}, + +# Add an ID to the list of recent waypoints +addRecentWaypoint : func(id) +{ + if ((id != nil) and (! me._recentWaypoints.contains(id))) { + me._recentWaypoints.insert(0, id); + } +}, + +# Return the array of user waypoints. TODO +getUserWaypoints : func() +{ + return []; +}, + +# Return the current DTO location to use +getCurrentDTO : func() +{ + return me._currentDTO; +}, + +# Set the current DTO location to use +setCurrentDTO : func(id) +{ + me._currentDTO = id; +}, + RegisterWithEmesary : func() { if (me._recipient == nil){ @@ -80,13 +151,35 @@ RegisterWithEmesary : func() return emesary.Transmitter.ReceiptStatus_Finished; } if (id == "AirportByID") { - var apt = controller.getAirportById(notification.EventParameter.Value); - notification.EventParameter.Value = apt; + notification.EventParameter.Value = controller.getAirportById(notification.EventParameter.Value); return emesary.Transmitter.ReceiptStatus_Finished; } if (id == "NavDataByID") { - var navdata = controller.getNavDataById(notification.EventParameter.Value); - notification.EventParameter.Value = navdata; + notification.EventParameter.Value = controller.getNavDataById(notification.EventParameter.Value); + return emesary.Transmitter.ReceiptStatus_Finished; + } + if (id == "Flightplan") { + notification.EventParameter.Value = controller.getFlightplan(); + return emesary.Transmitter.ReceiptStatus_Finished; + } + if (id == "RecentWaypoints") { + notification.EventParameter.Value = controller.getRecentWaypoints(); + return emesary.Transmitter.ReceiptStatus_Finished; + } + if (id == "AddRecentWaypoint") { + controller.addRecentWaypoint(notification.EventParameter.Value); + return emesary.Transmitter.ReceiptStatus_Finished; + } + if (id == "AirwayWaypoints") { + notification.EventParameter.Value = controller.getAirwayWaypoints(); + return emesary.Transmitter.ReceiptStatus_Finished; + } + if (id == "UserWaypoints") { + notification.EventParameter.Value = controller.getUserWaypoints(); + return emesary.Transmitter.ReceiptStatus_Finished; + } + if (id == "CurrentDTO") { + notification.EventParameter.Value = controller.getCurrentDTO(); return emesary.Transmitter.ReceiptStatus_Finished; } } diff --git a/Aircraft/Instruments-3d/FG1000/Nasal/NearestAirports/NearestAirportsController.nas b/Aircraft/Instruments-3d/FG1000/Nasal/NearestAirports/NearestAirportsController.nas index 83d561b51..8707b7f4d 100644 --- a/Aircraft/Instruments-3d/FG1000/Nasal/NearestAirports/NearestAirportsController.nas +++ b/Aircraft/Instruments-3d/FG1000/Nasal/NearestAirports/NearestAirportsController.nas @@ -167,7 +167,7 @@ var NearestAirportsController = ondisplay : func() { me._currentGroup = NearestAirportsController.UIGROUP.NONE; me.RegisterWithEmesary(); - me.getAirports(); + me.getNearestAirports(); me.page.mfd.NavigationMap.getController().enableDTO(1); }, offdisplay : func() { @@ -175,7 +175,7 @@ var NearestAirportsController = me.DeRegisterWithEmesary(); }, - getAirports : func() { + getNearestAirports : func() { var notification = notifications.PFDEventNotification.new( "MFD", diff --git a/Nasal/canvas/PFD/ScrollElement.nas b/Nasal/canvas/PFD/ScrollElement.nas index b16776963..5074cee2e 100644 --- a/Nasal/canvas/PFD/ScrollElement.nas +++ b/Nasal/canvas/PFD/ScrollElement.nas @@ -89,9 +89,11 @@ var ScrollElement = } }, highlightElement : func() { - me._flashElement(); - me._flashTimer = maketimer(0.5, me, me._flashElement); - me._flashTimer.start(); + if (me._flashTimer == nil) { + me._flashElement(); + me._flashTimer = maketimer(0.5, me, me._flashElement); + me._flashTimer.start(); + } }, unhighlightElement : func() { if (me._flashTimer != nil) me._flashTimer.stop();