Canvas - Getting started: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(http://forum.flightgear.org/viewtopic.php?f=71&t=26761)
 
mNo edit summary
Line 2: Line 2:
{{WIP}}
{{WIP}}
{{DeQuote}}
{{DeQuote}}
{{FGCquote
|1= Normally, you would start by prototyping instruments using a standalone GUI dialog, which greatly simplifies the whole prototyping process, because reloading/switching aircraft in FG still works only very unreliably - equally, lose coupling is much easier to accomplish by using a standalone GUI dialog.
For starters, you will probably want to use the Nasal console and play with the code snippets from: [[Canvas Snippets]]
The whole idea of this article is to get people started doing basic stuff, and then let them integrate things as required - i.e. "Canvas Snippets" is all about providing building blocks that can be adapted as needed.
|2= {{cite web
  | url    = http://forum.flightgear.org/viewtopic.php?p=250202#p250202
  | title  = <nowiki>Re: Developing a Canvas Cockpit for the CRJ700</nowiki>
  | author = <nowiki>Hooray</nowiki>
  | date  = Jul 7th, 2015
  }}
}}
{{FGCquote
|1= Features closely related to existing stuff (think PFD, ND, EICAS/EFIS) would ideally be based on adapting, generaliing and refactoring existing code (as per Gijs' ND effort) though - but you would inevitably benefit from knowing how Nasal/Canvas work under the hood, especially in order to learn how to use the corresponding frameworks (think MapStructure), because most people have a hard time understanding the reasons for contributing to a generic/aircraft-agnostic effort even though their primary motivation is a single project only.
|2= {{cite web
  | url    = http://forum.flightgear.org/viewtopic.php?p=250202#p250202
  | title  = <nowiki>Re: Developing a Canvas Cockpit for the CRJ700</nowiki>
  | author = <nowiki>Hooray</nowiki>
  | date  = Jul 7th, 2015
  }}
}}
{{FGCquote
|1= In other words, feel free to ask questions or help improve the wiki docs if you think anything is missing - please do so via the main Canvas forum, we should usually be able to answer most questions pretty quickly, or at least provide snippets/pointers to snippets.
You will definitely benefit from understanding Nasal, and object-oriented programming in particular, a few fairly accessible introductory articles are these:
[[Howto:Start using vectors and hashes in Nasal]]
[[Object oriented programming in Nasal]]
[[Object Oriented Programming with Nasal]]
Once you have worked through these and played with a few examples, I would suggest to look at the Canvas docs, the API reference, and the snippets on the wiki.
For prototyping purposes, I would suggest to create a standard canvas GUI dialog: [[Howto:Creating a Canvas GUI dialog file]]
And you should also learn how to use io.include() and friends to split up your Nasal sources into separate files and make things more modular.
|2= {{cite web
  | url    = http://forum.flightgear.org/viewtopic.php?p=250202#p250202
  | title  = <nowiki>Re: Developing a Canvas Cockpit for the CRJ700</nowiki>
  | author = <nowiki>Hooray</nowiki>
  | date  = Jul 7th, 2015
  }}
}}
{{FGCquote
|1= Note that you don't need to be an experienced Nasal coder to use Nasal/Canvas, but understanding a few basic concepts will greatly simplify the whole process.
The other part of this is artwork, which is usually created/edited using the Inkscape SVG editor.
And it also makes sense to look at people who have previously done related work (e.g. Gijs, Hyde, artix, Philosopher, TheTom etc) - if in doubt, check the commit logs of aircraft using Canvas to look up whose involved.
(but please don't just send tons of PMs to those, but instead ask general questions on the forum, and offer to provide something in return, i.e. document your journey, help improve the wiki/docs or help improve/write tutorials etc)
|2= {{cite web
  | url    = http://forum.flightgear.org/viewtopic.php?p=250202#p250202
  | title  = <nowiki>Re: Developing a Canvas Cockpit for the CRJ700</nowiki>
  | author = <nowiki>Hooray</nowiki>
  | date  = Jul 7th, 2015
  }}
}}
{{FGCquote
|1= For a few more relevant pointers/discussions, please see:
[http://forum.flightgear.org/search.php?st=0&sk=t&sd=d&sr=posts&keywords=canvas+animated+svg search.php?st=0&sk=t&sd=d&sr=posts&keywords=canvas+animated+svg]
[http://forum.flightgear.org/search.php?st=0&sk=t&sd=d&sr=posts&keywords=canvas+animated+inkscape search.php?st=0&sk=t&sd=d&sr=posts&keywords=canvas+animated+inkscape]
[http://forum.flightgear.org/search.php?st=0&sk=t&sd=d&sr=posts&keywords=nasal+canvas+animated+timers+listeners search.php?st=0&sk=t&sd=d&sr=posts&keywords=nasal+canvas+animated+timers+listeners]
(it would be great, if someone could copy relevant stuff over to the wiki so that these postings can be turned into a new wiki article)
|2= {{cite web
  | url    = http://forum.flightgear.org/viewtopic.php?p=250202#p250202
  | title  = <nowiki>Re: Developing a Canvas Cockpit for the CRJ700</nowiki>
  | author = <nowiki>Hooray</nowiki>
  | date  = Jul 7th, 2015
  }}
}}
{{FGCquote
|1= Features closely related to existing stuff (think PFD, ND, EICAS/EFIS) would ideally be based on adapting, generaliing and refactoring existing code (as per Gijs' ND effort) though - but you would inevitably benefit from knowing how Nasal/Canvas work under the hood, especially in order to learn how to use the corresponding frameworks (think MapStructure), because most people have a hard time understanding the reasons for contributing to a generic/aircraft-agnostic effort even though their primary motivation is a single project only.
|2= {{cite web
  | url    = http://forum.flightgear.org/viewtopic.php?p=250202#p250202
  | title  = <nowiki>Re: Developing a Canvas Cockpit for the CRJ700</nowiki>
  | author = <nowiki>Hooray</nowiki>
  | date  = Jul 7th, 2015
  }}
}}




{{Canvas Navigation}}
{{Canvas Navigation}}

Revision as of 14:46, 8 July 2015

This article is a stub. You can help the wiki by expanding it.
WIP.png Work in progress
This article or section will be worked on in the upcoming hours or days.
See history for the latest developments.
Note  In its current form, this section/article is largely based on quotes collected from various related discussions/channels (devel list, forum etc) using the Instant-Cquotes script. Wiki users and other contributors are encouraged to help rewrite/edit contents accordingly to help get rid of unnecessary quoting (i.e. while the wiki is not intended to be a collection of quotes, quotes are sometimes the best/easiest way to bootstrap new articles, while also providing a good way to link back to related discussions in the archives).

While rewriting usually only entails changing first person speech to 3rd person. However, please try to retain references/links to the original discussion whenever possible.

Cquote1.png Normally, you would start by prototyping instruments using a standalone GUI dialog, which greatly simplifies the whole prototyping process, because reloading/switching aircraft in FG still works only very unreliably - equally, lose coupling is much easier to accomplish by using a standalone GUI dialog.

For starters, you will probably want to use the Nasal console and play with the code snippets from: Canvas Snippets

The whole idea of this article is to get people started doing basic stuff, and then let them integrate things as required - i.e. "Canvas Snippets" is all about providing building blocks that can be adapted as needed.
— Hooray (Jul 7th, 2015). Re: Developing a Canvas Cockpit for the CRJ700.
(powered by Instant-Cquotes)
Cquote2.png
Cquote1.png Features closely related to existing stuff (think PFD, ND, EICAS/EFIS) would ideally be based on adapting, generaliing and refactoring existing code (as per Gijs' ND effort) though - but you would inevitably benefit from knowing how Nasal/Canvas work under the hood, especially in order to learn how to use the corresponding frameworks (think MapStructure), because most people have a hard time understanding the reasons for contributing to a generic/aircraft-agnostic effort even though their primary motivation is a single project only.
— Hooray (Jul 7th, 2015). Re: Developing a Canvas Cockpit for the CRJ700.
(powered by Instant-Cquotes)
Cquote2.png
Cquote1.png In other words, feel free to ask questions or help improve the wiki docs if you think anything is missing - please do so via the main Canvas forum, we should usually be able to answer most questions pretty quickly, or at least provide snippets/pointers to snippets.

You will definitely benefit from understanding Nasal, and object-oriented programming in particular, a few fairly accessible introductory articles are these: Howto:Start using vectors and hashes in Nasal

Object oriented programming in Nasal

Object Oriented Programming with Nasal Once you have worked through these and played with a few examples, I would suggest to look at the Canvas docs, the API reference, and the snippets on the wiki. For prototyping purposes, I would suggest to create a standard canvas GUI dialog: Howto:Creating a Canvas GUI dialog file

And you should also learn how to use io.include() and friends to split up your Nasal sources into separate files and make things more modular.
— Hooray (Jul 7th, 2015). Re: Developing a Canvas Cockpit for the CRJ700.
(powered by Instant-Cquotes)
Cquote2.png
Cquote1.png Note that you don't need to be an experienced Nasal coder to use Nasal/Canvas, but understanding a few basic concepts will greatly simplify the whole process.

The other part of this is artwork, which is usually created/edited using the Inkscape SVG editor. And it also makes sense to look at people who have previously done related work (e.g. Gijs, Hyde, artix, Philosopher, TheTom etc) - if in doubt, check the commit logs of aircraft using Canvas to look up whose involved.

(but please don't just send tons of PMs to those, but instead ask general questions on the forum, and offer to provide something in return, i.e. document your journey, help improve the wiki/docs or help improve/write tutorials etc)
— Hooray (Jul 7th, 2015). Re: Developing a Canvas Cockpit for the CRJ700.
(powered by Instant-Cquotes)
Cquote2.png
Cquote1.png For a few more relevant pointers/discussions, please see:

search.php?st=0&sk=t&sd=d&sr=posts&keywords=canvas+animated+svg

search.php?st=0&sk=t&sd=d&sr=posts&keywords=canvas+animated+inkscape

search.php?st=0&sk=t&sd=d&sr=posts&keywords=nasal+canvas+animated+timers+listeners

(it would be great, if someone could copy relevant stuff over to the wiki so that these postings can be turned into a new wiki article)
— Hooray (Jul 7th, 2015). Re: Developing a Canvas Cockpit for the CRJ700.
(powered by Instant-Cquotes)
Cquote2.png
Cquote1.png Features closely related to existing stuff (think PFD, ND, EICAS/EFIS) would ideally be based on adapting, generaliing and refactoring existing code (as per Gijs' ND effort) though - but you would inevitably benefit from knowing how Nasal/Canvas work under the hood, especially in order to learn how to use the corresponding frameworks (think MapStructure), because most people have a hard time understanding the reasons for contributing to a generic/aircraft-agnostic effort even though their primary motivation is a single project only.
— Hooray (Jul 7th, 2015). Re: Developing a Canvas Cockpit for the CRJ700.
(powered by Instant-Cquotes)
Cquote2.png