Canvas Glass Cockpit Efforts

From FlightGear wiki
Jump to: navigation, search


This article is a stub. You can help the wiki by expanding it.
Easily instantiate Canvas MFDs for development and testing purposes, without requiring an aircraft, including full support for multiple independent instances for each MFD.
This is an adapted version of the Garmin GPSMap 196 that is currently being developed by F-JJTH. Here, the whole instrument is entirely set up in XML space without using any Nasal, including buttons/event handling, but also the embedded canvas region that serves as the 'screen'. The idea is to allow arbitrary MFDs to be specified in an aircraft-agnostic fashion, including displays like a PFD, NavDisplay or EFB. For details, please see Canvas Glass Cockpit Efforts.
Error creating thumbnail: File missing
This demonstrates how a purely XML-based MFD framework can instantiate dynamic MapStructure layers - none of this involves any Nasal coding now, it's just an XML file - to learn more, see Canvas Glass Cockpit Efforts.
This screen shot shows the texture of the hard-coded KLN89 instrument used as a skin/theme for the MFD instrument, with a MapStructure-powered map shown.

This is a list of Canvas related glass cockpit efforts, i.e. projects implementing modern MFD avionics.

Goal Description Progress People Comments
747 PFD ... 40}% completed (people) ...
NavDisplay ... 60}% completed (people) ...
Garmin GNS530 ... 20}% completed cbendele ...
Garmin GPSMap 196 ... 20}% completed F-JJTH ...
Avidyne Entegra R9 ... 40}% completed (people) ...
Canvas EFB Framework ... 10}% completed (people) ...

XML Framework

Merge-arrow.gif
It has been suggested that this article or section be merged into CanvasMFD. This has been proposed since June 2014.
Cquote1.png Given the recent trend of having several MFD-related efforts without any kind of collaboration/code reuse going on here among our contributors (PFD, ND, Avidyne Entegra R9, EFB), I have started prototyping a generic MFD framework that is purely XML-based, inspired by discussions we've had over the last couple of weeks, and lessons learnt from the missions subsystem.
Cquote2.png
Cquote1.png It is intended to:
  • support multiple independent instances
  • be totally aircraft agnostic
  • support a pure dialog-driven mode
  • support skinning/theming

Cquote2.png
Cquote1.png This is supposed to support modeling complex avionics like a PFD, ND, EFB, CDU etc - and, eventually, also the Avidyne Entegra R9.

It's currently just a prototype, but it gets away with very little code and we really only need a few more "skins" for common avionics.
I am willing to extend this over time and help maintain it if people can agree to use something like this.

It should be straightforward to allow such "MFDs" to be reloaded from disk at run-time, i.e. for more rapid prototyping.

Cquote2.png
Note  This is work in progress - the idea is to identify required building blocks to easily specify most MFD functionality in a generic fashion, without requiring a ton of custom Nasal code and without being specific to a single type of MFD. The whole concept is based on FlightGear_Missions_and_Adventures#XML_Extension_Framework, i.e. providing a Nasal-space mechanism to expose and re-define building blocks to XML space.

The Nasal/Canvas data structures will be transparently created and compiled for each MFD. Each MFD consists of an arbitrary number of buttons, modes and pages. Each MFD can be instantiated multiple times, and each MFD is designed to be aircraft/instrument agnostic, i.e. also works just in a conventional Canvas dialog. Buttons can trigger and switch between modes, and modes may have pages (conventionally implemented through a single SVG file). Each page consists of an arbitrary number of page elements, which can in turn be animated/updated via listeners and timers. Should look at existing displays, especially the NavDisplay and the update() method in navdisplay.mfd, but the most complete test-case would probably be the Avidyne Entegra R9


Note  Contributors wanting to check out the topics/canvas-mfd-framework branch, need to follow these 3 steps:
  • git remote add canvas-hackers git@gitorious.org:fg/canvas-hackers-fgdata
  • git fetch canvas-hackers
  • git checkout --track -b topics/canvas-mfd-framework canvas-hackers/topics/canvas-mfd-framework

This will give you a local branch named topics/canvas-mfd-framework, so that you can easily pull/push changes. When pulling, it makes sense to pull with --rebase

Please never push directly to the master/next branches, and please don't push force (-f) either.

Files

Each MFD instrument will consist of at least the following files:

  • a PropertyList-encoded XML file specifying the instrument
  • a raster image used as the skin/background image
  • a SVG image used for placing buttons and event handling

Header

  • Canvas size/view
  • colors/transparency

Primitives

  • Button
  • Mode
  • Page
  • Page-Element
  • Task (maketimer based)
  • Event handling (listener based)
<?xml version="1.0"?>

<!-- see: http://wiki.flightgear.org/Canvas_Glass_Cockpit_Efforts  -->
<PropertyList>
	<name>Garmin GPSMap196</name>
	<description></description>
	<version></version>
	<developers></developers>

	<debug-mode type="bool">0</debug-mode>

	<!-- screen dimensions -->
	<size-x>320</size-x>
	<size-y>160</size-y>

	<!-- skin setup for the GUI dialog, skin and event handling -->
	<skin>
		<!-- dialog dimensions -->
		<width>1024</width>
		<height>512</height>
		<!-- dialog title -->
		<title>GPSMap196 MFD demo</title>

		<!-- the background image we're going to use -->
		<background-image>Aircraft/Instruments-3d/GPSmap196/widget/gpsmap196-widget.png</background-image>

		<!-- setting up all buttons for the dialog -->
		<buttons>
			<svg-filename>Aircraft/Instruments-3d/GPSmap196/widget/gpsmap196-widget.svg</svg-filename>
			<button>
				<name>gps196.widget.button.power</name> <!-- svg element ID -->
				<property>button-power</property> <!-- relative property -->
				<tooltip>switch device on/off</tooltip> <!-- mouseover tooltip -->
			</button>

			<button>
				<name>gps196.widget.button.quit</name> <!-- svg element ID -->
				<property>button-quit</property> <!-- relative property -->
				<tooltip>quit</tooltip> <!-- mouseover tooltip -->
			</button>
			
		</buttons>


		<!-- the embedded canvas serving as the screen -->
		<screen>
			<size>
				<x>563</x>
				<y>359</y>
			</size>

			<translation>
				<x>87</x>
				<y>53</y>
			</translation>
		</screen>
	</skin>

		<!--this implements individual MFD pages -->
	<pages>
		<page>
			<name>test</name>
			<type>svg</type>
			<svg-filename>foo.svg</svg-filename>
			<elements>
				
			</elements>
		</page>

		<page>
			<name>map-page</name>
			<type>map</type>
			<layers>
				<layer>
					<name>FIX</name>
				</layer>
			</layers>
		</page>

	</pages>

</PropertyList>