Board index FlightGear Development Aircraft Cockpit development

A330-200 with Canvas and other features

Discussion about creating 2d and 3d cockpits.

A330-200 with Canvas and other features

Postby artix » Tue Aug 05, 2014 6:04 pm

Hello, i'm making some improvements to the excellent Omega Hangar's Airbus A330-200 aircraft.
This fork supports Canvas ND, more realistic flight modes (NAV, SRS, CLB, DES, OP CLB, OP DES,...), PFD improvements (target speed, terrain on alt tape,...), Throttle detents positions (REV, IDLE, CLB, TOGA), ILS auto-tuning, mCDU runway and Airport page and much more.

There are still bugs and graphical imperfections but i'm still working on it.

Some preview screenshots:

Image

Image

Image

Image

Image

Image

Image
artix
 
Posts: 93
Joined: Wed Jun 25, 2014 9:42 pm
OS: Mac OS X

Re: A330-200 with Canvas and other features

Postby Hooray » Tue Aug 05, 2014 6:14 pm

This is looking really good - regarding your ND changes, I would love to see them so that we can review them and get them committed to the main fgdata branch, or at least the canvas-hackers clone. We now have several people independently working on ND related additions, so it makes sense to provide a common baseline that they can use for their work. As you may have noticed, omega95 also started working with the ND - so it really makes sense to put up your changes as early as possible, so that we can review them, and update our own code accordingly. Having more ND use-cases will be really useful, and I am sure that Gijs and Hyde will also appreciate your contributions - we should just make sure that all changes align well with the rest of the -still evolving- framework.

BTW: The holding pattern, I'd like to see generalized, too - so that this becomes a MapStructure feature :D

Concerning the PFD, is it also using Canvas ? And if so, is it using Gijs' original PFD code ?
Ideally, the code should be generalized and reused, too.

Thus, if possible, please put up a merge request, or at least some kind of git branch, so that we can have a look - if you're familiar with git, we can also directly add you to the canvas-hackers clone, so that you can continue your development there - to hopefully better coordinate development with related efforts.

PS: You may want to upload a few screen shots to the wiki and update the wiki article, and newsletter, accordingly. And please, do feel invited to also update the ND article to mention your own work there, so that others are made aware of it - so that we don't end up with multiple people working on overlapping features. Thank you!
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: A330-200 with Canvas and other features

Postby artix » Tue Aug 05, 2014 6:25 pm

Hello Hooray, the project is on Gitorious:

https://gitorious.org/a330-200

I'm glad to collaborate with Omega95 and other developers.
Maybe my implementation of the ND is not so generalizable because i developed it on current FlightGear release and i had to make a lot of hacks, but we can try to integrate different approaches in order to create a generic Airbus ND.

As for the PFD it's not using canvas at the moment. I just changed some stuff into the original xml file and changed some texture too.

I will update the wiki ASAP (maybe tomorrow) and I will write a complete changelog of the features i've implemented.

Thank you!
artix
 
Posts: 93
Joined: Wed Jun 25, 2014 9:42 pm
OS: Mac OS X

Re: A330-200 with Canvas and other features

Postby Hooray » Tue Aug 05, 2014 6:31 pm

Thanks for clarifying: Could you push some rebased/squashed branch to the same clone so that we can have a look without having to go through all ~160 commits ? :D
5-20 commits would seem fine to me - if the code is sufficiently well-commented, a single commit will also do.
And given that this is a separate clone, we still need to find a way in order to collaborate with others using fgdata clones ...
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: A330-200 with Canvas and other features

Postby artix » Tue Aug 05, 2014 6:35 pm

Sure, i'll do it tomorrow because i'm going out now :)
artix
 
Posts: 93
Joined: Wed Jun 25, 2014 9:42 pm
OS: Mac OS X

Re: A330-200 with Canvas and other features

Postby Hooray » Tue Aug 05, 2014 6:37 pm

Maybe my implementation of the ND is not so generalizable because i developed it on current FlightGear release and i had to make a lot of hacks, but we can try to integrate different approaches in order to create a generic Airbus ND.


Actually, I just went through it, and I am wondering why you took all our modular code and put it into a handful of files ?
Maintenance and code-reuse is going to be a huge challenge like that - why exactly did you do it this way ??
Honestly, this would still need a bit of work to align well with other ongoing efforts, or none of this will be easily reusable unfortunately.

Specifically, your ND.nas file is a fairly massive code reuse challenge in my eyes: https://gitorious.org/a330-200/a330-200 ... /ND/ND.nas

Otherwise, I do like that you started working with custom MapStructure layers ...

But from a structural standpoint, we should definitely explore cleaning up things post 3.2 :wink:
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: A330-200 with Canvas and other features

Postby artix » Tue Aug 05, 2014 6:47 pm

Hooray wrote in Tue Aug 05, 2014 6:37 pm:
Maybe my implementation of the ND is not so generalizable because i developed it on current FlightGear release and i had to make a lot of hacks, but we can try to integrate different approaches in order to create a generic Airbus ND.


Actually, I just went through it, and I am wondering why you took all our modular code and put it into a handful of files ?
Maintenance and code-reuse is going to be a huge challenge like that - why exactly did you do it this way ??
Honestly, this would still need a bit of work to align well with other ongoing efforts, or none of this will be easily reusable unfortunately.

Specifically, your ND.nas file is a fairly massive code reuse challenge in my eyes: https://gitorious.org/a330-200/a330-200 ... /ND/ND.nas

Otherwise, I do like that you started working with custom MapStructure layers ...

But from a structural standpoint, we should definitely explore cleaning up things post 3.2 :wink:



As i said, i developed the ND on top of the current FG release which lacks of most of the latest improvements made to the canvas framework that makes it more generalizable.
Consider that i started developing this for my personal use and only later it seemed to me to be worth to be published.
Of course, all that stuff has to be cleaned-up with the release of 3.2 and all the ND implementation has to be aligned with the latest canvas framework developments.
But i hope that some pieces can be useful to the overall canvas development.
artix
 
Posts: 93
Joined: Wed Jun 25, 2014 9:42 pm
OS: Mac OS X

Re: A330-200 with Canvas and other features

Postby Hooray » Tue Aug 05, 2014 7:31 pm

I still wouldn't cram everything into a single file - if necessary, you can copy the missing stuff and explicitly include it via io.include() (wrapper in a setlistener call) - that way, cleaning up things later on will be much easier, because you only need to remove the copied files, and not actually clean up everything manually. Having some giant Nasal file that has a ton of files copied into it is begging for trouble, and likely to become a maintenance nightmare. Obviously, it's up to you how to proceed with your own work - but if you want it to align well with related efforts, I'd explore cleaning this up once 3.2 is out.

I do like that you've moved some stuff to the instruments-3d folder - we should probably keep that in mind for the navdisplay - but generic features, I'd still like to keep as MapStructure layers, so that the same features can be easily reused in dialogs like the new map-canvas dialog.

Similarly, the Airbus-specific style could be added to the same style hash in navdisplay.styles - even though you're right, that it would be smart to eventually use a separate file here - but for the time being, things are very much evolving still, and we still gotta find a way to identify, generalize, and extract, common APIs - and that will be much more straightforward once we have everything in a single place.
Personally, I'd consider factoring out such stuff only after some kind of generic API for creating SVG based instruments like the ND/PFD has evolved. Otherwise, we're probably gonna see a lot of copy/paste efforts using an approach similar to your current once, which would not really serve Canvas-based efforts in the long-term, especially when it comes to optimizing things and improving code reuse. For the whole thing to really evolve properly, Gijs and Hyde need to approve of those changes - and the more end-users/aircraft we have using the framework, the more generic it will become over time - but code duplication is usually not a good idea and will only make our lives more difficult.

I do like the screen shots and the functionality shown there, but I'd suggest to coordinate things more closely with other people doing similar stuff, especially as long as the corresponding aircraft/framework is being maintained.

I don't think it will be too much to clean this up - but I wouldn't spend too much time adding features due to the current structure, unless you can easily refactor it such to move copied stuff to a file that can be removed later on easily, without crippling new functionality that you've added.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: A330-200 with Canvas and other features

Postby artix » Tue Aug 05, 2014 9:20 pm

The ND.nas must be refactored almost from scratch: it even contains unused code for features that were later implemented using MapStructure. Also, when i started to write it i had very little experience with the canvas framework, and as I gained confidence with the framework, the new code went stacked onto the old one.
I know that it's a total mess at the moment :)
In the next days i will try to refactor the whole ND implementation in order to make it much more reusable and clean.
artix
 
Posts: 93
Joined: Wed Jun 25, 2014 9:42 pm
OS: Mac OS X

Re: A330-200 with Canvas and other features

Postby Hooray » Tue Aug 05, 2014 10:12 pm

My main requests/suggestions would be the following (and I am willing to offer advice and help to make it happen):

  • add your changes to the navdisplay.styles file as a custom Airbus style
  • use dedicated MapStructure layers for new features, or simply extend existing layers (e.g. RTE/WPT for holdings)
  • reduce the amount of required custom code by using the approach taken by navdisplay.mfd - i.e. the way the whole instrument is initialized
  • generalize things and reduce the amount of aircraft-specific code

Also, it would obviously help to directly use a full fgdata clone, so that we can use a topic branch for better coordinating canvas/MapStructure and ND/PFD changes - we can set you up with commit access so that you can directly commit there until things are sufficiently reviewed/improved to be committed back to fgdata/master.

You really did a very good job with your HOLD/DECEL/SPD-PROFILE MapStructure layers - the main thing missing there is adopting MapStructure's styling support in the *.symbol files so that aircraft developers can more easily apply a custom style (colors, fonts, line width, symbols etc) there.

Overall, it might not be such a bad idea to postpone additional work until 3.2 is out, so that you can use that as a baseline for your changes - so that we can get rid of "backported" stuff.

And it's really awesome seeing that you were able to make this all work so quickly - especially given your low number of posting here, i.e. just a handful of questions and you were able to apply all the docs and code we've provided - so kudos to you ! :D
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: A330-200 with Canvas and other features

Postby artix » Wed Aug 06, 2014 2:32 pm

Hooray wrote in Tue Aug 05, 2014 10:12 pm:use dedicated MapStructure layers for new features, or simply extend existing layers (e.g. RTE/WPT for holdings)


How can i extend already existing layers?
artix
 
Posts: 93
Joined: Wed Jun 25, 2014 9:42 pm
OS: Mac OS X

Re: A330-200 with Canvas and other features

Postby Hooray » Wed Aug 06, 2014 2:39 pm

If this is about your HOLD files, I think you can leave them as is - but in general, you'd want to edit the lcontroller file to extend the searchCmd() method there - and then use the corresponding data in the draw() method of the *.symbol file - basically, you'd "merge" the functionality of your current HOLD.lcontroller::searchCmd() method with an existing MapStructure layer - but like I said, I don't think it's really necessary - the separation is actually a good thing, as it helps keeping things clean and loosely coupled. But at some point, it may make sense to check the code to ensure that it supports multiple holding patterns per route, as well as independent instances of the layer showing different routes. I think this will evolve automatically once Gijs & Hyde start adopting your work on the 747/777 respectively - as far as I know, they don't currently have any holding pattern support - so your work should come in handy :D
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: A330-200 with Canvas and other features

Postby artix » Thu Aug 07, 2014 4:50 pm

Before working on abstraction i'm refactoring the code in order to make it more modular and clean. I created a new branch (ND_refact) for this purpose. You can take a look at it if you want.
Now all the canvas stuff is self-contained into its own directory (Models/Instruments/ND/canvas). I moved all the vor/ndb/fix/airport drawing code from ND.nas to separated MapStructure files (inside the map subdirectory) and i also deleted all the unused code from ND.nas (the old draw_route related stuff that was already implemented by using MapStructure).
I've also split many things from ND.nas and canvas_compat.nas into separated files. Now canvas_compat.nas is only used to backport some features from the 3.2 version of the canvas framework to FG 3.0 and it's only loaded if FG version is minor than 3.2.
It should be completely removed in the future.
The code used to draw departure and destination runways is still in ND.nas, but in the next days i will try to implement it using MapStructure (i wanna try to use LineSymbol for that).

There's still a lot of work to do, but i think that this little refactoring already made the code more readable and clear.
artix
 
Posts: 93
Joined: Wed Jun 25, 2014 9:42 pm
OS: Mac OS X

Re: A330-200 with Canvas and other features

Postby omega95 » Fri Aug 08, 2014 2:40 am

Hello artix! Looks like some wonderful work you've done there - I'm so glad there are others interested in maintaining the A330s. :)

I was wondering if you would just like to push these changes to my A330 repository (the original one, I guess?) I haven't exactly read the whole discussion so far, but if you're alright with it, I can give you access to the repository.

I was also wondering if you'd let me use these new instruments for my A380 project - I'm developing the rest of the A380 displays using canvas too.

Thank you very much!
Merlion Virtual Airlines - the experience of a flight time...
Get high quality aircraft, airports, video tutorials or development tools from my hangar.
omega95
 
Posts: 1222
Joined: Sat Jul 30, 2011 1:59 am
Location: -unknown-
Callsign: MIA0001, OM-EGA
IRC name: omega95
Version: 2.12 git
OS: Ubuntu 13.04

Re: A330-200 with Canvas and other features

Postby artix » Fri Aug 08, 2014 8:40 am

Hello Omega. I'd be glad to push my work to your original repository but i want to refactor the ND canvas implementation before, because the code has to be cleaned up. I could push it as a separate branch if you're ok with that.

As for your A380 project, sure, you can use my code :)
I suggest you to check the ND_refact branch, because i'm doing all the code cleanup there.

Thank you!
artix
 
Posts: 93
Joined: Wed Jun 25, 2014 9:42 pm
OS: Mac OS X

Next

Return to Cockpit development

Who is online

Users browsing this forum: No registered users and 1 guest