WordPress Shortcode for FMA Annunciations, FMC Messages & the MCP (Aviation)

This post won’t interest anybody other than a select few individuals that post technical articles to a few aviation blogs I’m involved with. However, the code is very generic and can easily be modified to suit your own specific needs.

The purpose of the shortcode is to emulate indications one would expect to see in glass cockpit Boeing aircraft; I wanted to replicate the general look of the indications or switches that are presented to the pilot. Most notably, I wanted to emulate the Flight Mode Annunciations (as displayed on the FMA), basic modes that one would select on the Mode Control Panel (MCP)… and I also wanted a basic means of formatting text to resemble FMC buttons or CDU text. Used in blog posts and technical articles, the visual representation is far more likely to reinforce a principle in the mind of the reader.

I’ve recently completed a transition from the 777 to the Boeing 737. As part of my continued effort to maintain knowledge of the aircraft I’ll be building a website at SevenThreeSeven.com. I’m using the following shortcode quite heavily in a chapter relating to automation.

Flight Mode Annunciations (FMA)

The Flight Mode Annunicator, or FMA, is the aircraft’s way of communicating the current mode of autoflight or operation. The FMA indicates to the crew where the aircraft is obtaining thrust, lateral navigation and pitch information (or guidance) for flight.

For example, the FMA indication of SPD | LNAV | VNAV PATH indicates that the thrust mode controls speed (via an FMC value), the lateral navigation of the aircraft is determined by an active lateral track, and VNAV PATH indicates that vertical navigation is commanded by a vertical FMC profile. Of course, sometimes it’s necessary for authors to discuss one mode of operation in isolation of any other… in which case they could render that information as, for example, VNAV SPD.

Primary Flight Display | Flight Mode Annunciation

The Flight Mode Annunciation (FMA) at the top of the Primary Flight Display (PFD)

The Shortcode

For the three FMA indications, the author would simply insert the following shortcode into the HMTL view of their post editor:

[fma thrust="SPD" roll="LNAV" pitch="VNAV PATH"]

If the author wanted to output only a single FMA indication, they would simply insert the following into their HTML post editor:

[fma pitch="VNAV SPD"]

If you wanted to represent an armed mode rather than the current active mode (such as FLARE – note text is white rather than green), you would do so by specifying the fontcolor in your shortcode.

[fma pitch="FLARE" fontcolor="#ffffff"]

The Mode Control Panel (MCP)

It’s often necessary to render MCP ‘switches’ in a post. Styling the text to look like the actual MCP switch leaves little doubt that the text relates directly to a switch in the aircraft. For example, when referring to the Level Change switch on the MCP, we could do so as LVL CHG.

Boeing 777 MCP

The Boeing 777 Mode Control Panel (MCP)

Having multiple styling options ensures we don’t confuse, for example, an MCP LNAV switch with an LNAV FMA annunciation.

The Shortcode

To style text with the feel of the MCP, the following shortcode should be used:

[mcp]LVL CHG[/mcp]

FMC Messages

I generally represent the FMC keyboard or CDU scratchpad by way of a simple grey style. For example, I could quickly style the FMC cruise button as  CRZ  or VNAV page as  VNAV .

The Shortcode

To style text with the feel of a FMC key or CDU scrathpad text, the following shortcode should be used:

[fmc]VNAV[/mcp]

Changing Formatting

Any of the parameters in the shortcode can be altered to change the look and feel of text. For example, the shortcode below would render  text like this .

[fmc bgcolor="#ffffc4" bordercolor="#999999"]text like this[/fmc]

By changing the default options in the shortcode, you can easily create your own default formatting.

Full Width FMA Annunciations

Sometimes it’s necessary to feature FMA indications the full width of your post. Rather than using a screenshot of an image, I’m using shortcode to emulate the FMA with armed modes in addition to active modes. Consider the following example (that you wouldn’t expect to see in the aircraft… it’s just an example).

SPD
 
|
LNAV
ROLLOUT
|
VNAV PATH
FLARE

If you’re one of the few that requires this kind of functionality in your post, get in touch with me.

The Code

You should copy the code from here rather than copying from below (to minimise the risk of copy errors). The shortcode should be copied into your theme’s functions.php file.

FMA Shortcode

function fma_indications($atts) {
extract(shortcode_atts(array(
    'thrust' => '',
    'roll' => '',
    'pitch' => '',
    'bgcolor' => '#333333',
    'bordercolor' => '#333333',
    'borderwidth' => '2px',
    'bordertype' => 'solid',
    'fontcolor' => '#00ff00',
  ), $atts));
  if ( ($thrust) && ($roll) && ($pitch) ) {
  return "<font style=\"padding: 1px 1px 1px 1px; color: $fontcolor; background-color: $bgcolor; border: $bordercolor $border $bordertype $borderwidth\">$thrust <font color=\"#cccccc\">|</font> $roll <font color=\"#cccccc\">|</font> $pitch</font>";
  } else {
  return "<font style=\"padding: 1px 1px 1px 1px; color: $fontcolor; background-color: $bgcolor; border: $bordercolor $border $bordertype $borderwidth\">$thrust$roll$pitch</font>";
 }
}
add_shortcode('fma','fma_indications');

MCP Shortcode

function modecontrolpanel($atts, $content = null ) {
extract(shortcode_atts(array(
    'bgcolor' => '#906a53',
    'bordercolor' => '#906a53',
    'borderwidth' => '0.5px',
    'bordertype' => 'solid',
    'fontcolor' => '#ffffff',
  ), $atts));
  return "<font style=\"padding: 1px 1px 1px 1px; color: $fontcolor; background-color: $bgcolor; border: $bordercolor $border $bordertype $borderwidth\">$content</font>";
}
add_shortcode('mcp','modecontrolpanel');

FMC Shortcode

function fmc_cdu($atts, $content = null ) {
extract(shortcode_atts(array(
    'bgcolor' => '#e5e5e5',
    'bordercolor' => '#000000',
    'borderwidth' => '1px',
    'bordertype' => 'solid',
    'fontcolor' => '#000000',
  ), $atts));
  return "<font style=\"padding: 1px 1px 1px 1px; color: $fontcolor; background-color: $bgcolor; border: $bordercolor $border $bordertype $borderwidth\">&nbsp;$content&nbsp;</font>";
}
add_shortcode('fmc','fmc_cdu');
First Name:
Your Email Address:
 




Download: Fma-fmc-mcp-shortcode
Description: Aviation shortcode to style FMA, FMC and MCP text.
Author:Marty
Category: PHP code
Date: March 24, 2012



If you liked this article, you may also like:

  1. [Shortcode] examples [3] – Text Boxes
  2. Display Total Number of Social Shares with PHP and WordPress Shortcode
  3. Skype Status (Text or Image) with WordPress Shortcode
  4. WordPress Audio Player and Shortcode
  5. [Shortcode] Examples 4 – Quotes, Testimonials & Lists
About Marty

is a passionate web developer from Sydney, Australia. He owns about 600 websites and makes a healthy living from working the web. As a day job, he works as a pilot for an international airline. Follow Marty on Twitter or Google+.

Trackbacks

  1. [...] This post was originally posted to one of my tech blogs and intended for just a few people that I’m working with on a few projects. However, despite [...]

  2. [...] I’ve used WordPress shortcodes to style FMA Annunciations and FMC Messages as described in this post on Internoetics.com. I’ve done so just for the sake of testing it out. Related posts:Boeing [...]

Please leave a comment or question!

*