Board index FlightGear Development Canvas

2-nd version of fgplot

Canvas is FlightGear's new fully scriptable 2D drawing system that will allow you to easily create new instruments, HUDs and even GUI dialogs and custom GUI widgets, without having to write C++ code and without having to rebuild FlightGear.

2-nd version of fgplot

Postby kuifje09 » Mon Mar 17, 2014 8:09 pm

I have just finished my first appraoch to push fgplot into some classes.
Should be used as standalone or plugged in into another ( controling ) program.
You cannot have just a line, that's the point here.

If you dare to try, don't forget you need the last updates of flightgear and simgear and also osg. That is because
of the use of the mouse-buttons to work a little more easy.

There is a problem in resizing which can and will, crash your flightgear ! But only if you resize rapidly and continues.
Must be a bug, but I do not see it. But funny to see how the color become white and all freezes. Then it crashes.

If the masters of canvas and nasal would give it a try..... Read the PReadme first to get the first idea of the program and the classes. it is not 100% as requested, but thats how it it works with me.... :|
If you want to have a talk on skype... send an email or privmessage.

A picture : Image

Then the contend in a tar ! [url http://home.online.nl/wijo2/graph.nas.tar]The tar file[/url]

Edit: O, I forgot, you can start as much as your system allows. I ran 10 of these together...
And, it is full of debug messages.. it is not cleaned at all !
Last edited by kuifje09 on Tue Mar 18, 2014 9:34 am, edited 3 times in total.
kuifje09
 
Posts: 579
Joined: Tue May 17, 2011 8:51 pm

Re: 2-nd version of fgplot

Postby Hooray » Tue Mar 18, 2014 1:21 am

This is looking very good, regarding the images, you need to use the "img" tag.
Code: Select all
[img]http://home.online.nl/wijo2/FGplot2.jpg[/img]

becomes:
Image

I'll have another look during the weekend, in the meantime, you may want to update the fgplot wiki article and maybe add a paragraph to the upcoming newsletter, you can also upload some screen shots there: http://wiki.flightgear.org/FGPlot

Also, let us know if you'd like to try committing this to a gitorious branch, you have commit access to the "canvas-hackers" repo, and we can provide a helping hand - it seems, you already handled the difficult bits successfully :D

It is great that this has progressed already so far, because that will enable us to peer-review things in time for 3.2, so that we can get this committed to fgdata - I'll go over your code together with Philosopher, and we'll ask galvedro to have another look, too
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: 11317
Joined: Tue Mar 25, 2008 8:40 am

Re: 2-nd version of fgplot

Postby kuifje09 » Tue Mar 18, 2014 8:00 am

Already did an update to remove a bug. ( in the tar )
I realy need to talk about naming and using better widgets already created... i.e. text or button.
But those I created are functional and dedicated to this fgplot.
Oh yes... need a lot of checking for errors on user input and other errors... ( w.i.p.)
Even more user functions are wanted. save/load ????
kuifje09
 
Posts: 579
Joined: Tue May 17, 2011 8:51 pm

Re: 2-nd version of fgplot

Postby Hooray » Tue Mar 18, 2014 8:20 am

Is this using "pure canvas" or still using the old PUI/XML dialogs ?
If it's just Canvas, you should ideally use TheTom's widget class, check $FG_ROOT/Nasal/canvas/gui
You can also check the "widgets" sub folder there, which demonstrates how to implement a button widget.
That's basically how future widgets should be implemented.

For saving/loading, you'll probably want to use $FG_ROOT/Nasal/io.nas and the write_properties()/read_properties() helpers there.
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: 11317
Joined: Tue Mar 25, 2008 8:40 am

Re: 2-nd version of fgplot

Postby kuifje09 » Tue Mar 18, 2014 9:27 am

It is pure canvas. Or at least I meant to use only canvas. ( execpt i.e. gui.popupTip() )

About the crashing of FG. I did switch off the canvas buildin resize, but is it possible something interferes with what I try to do. because my resize just makes FG hang, or crash.
Sometimes I get this message:
FATAL:std::bad_alloc
kuifje09
 
Posts: 579
Joined: Tue May 17, 2011 8:51 pm

Re: 2-nd version of fgplot

Postby kuifje09 » Tue Mar 18, 2014 10:04 am

well, I found when resize only content and not size:
me._Dialog.setInt("content-size[0]",cx);
me._Dialog.setInt("content-size[1]",cy);

It give me no crashes, wel... at least less, that must have been my mistake. ?

Also discovered, the propertee-browser steels my return's when I try to enter text in some fields.
kuifje09
 
Posts: 579
Joined: Tue May 17, 2011 8:51 pm

Re: 2-nd version of fgplot

Postby kuifje09 » Wed Mar 19, 2014 3:29 pm

Some updates again, a save and load and some improvements.
Still not much on testing on validity...
kuifje09
 
Posts: 579
Joined: Tue May 17, 2011 8:51 pm

Re: 2-nd version of fgplot

Postby kuifje09 » Thu Mar 20, 2014 3:33 pm

Did a few more updates and a few extra functions...
I think this is it for the moment...
Think it all over and maby make first a few real widgets, it is now very dedicated.

Still crashes when resizing...
kuifje09
 
Posts: 579
Joined: Tue May 17, 2011 8:51 pm

Re: 2-nd version of fgplot

Postby Hooray » Thu Mar 20, 2014 4:10 pm

we currently seem to have quite a few people interested in doing/helping with Canvas/GUI development, so it would be a good idea to coordinate things a little here
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: 11317
Joined: Tue Mar 25, 2008 8:40 am

Re: 2-nd version of fgplot

Postby kuifje09 » Thu Mar 20, 2014 10:32 pm

Well if you did try, you found some bug or incompleteness, I just repaired some of those.
Just 1 known to go, after loading props from a saved file, you need to reopen the menu.
(I'm doing bad on update of the menu entries. will be fixed soon.)

Still to go, Add a (configurable) tickmark.

This version is a bit cleaner. tried to kickout all direct calls and accessing to variables of a caller.
Getting data or setting, all has to go via parent/baseclass-routines. Then it can also be run from/within another application.
kuifje09
 
Posts: 579
Joined: Tue May 17, 2011 8:51 pm

Re: 2-nd version of fgplot

Postby kuifje09 » Sun Mar 23, 2014 8:09 pm

Now I know about the stopPropagation() the crash on resizing is almost gone...
Also better resizing of lines ...
kuifje09
 
Posts: 579
Joined: Tue May 17, 2011 8:51 pm

Re: 2-nd version of fgplot

Postby kuifje09 » Thu Apr 10, 2014 3:27 pm

Update: removed bug in Pchooser
kuifje09
 
Posts: 579
Joined: Tue May 17, 2011 8:51 pm

Re: 2-nd version of fgplot

Postby Hooray » Fri May 09, 2014 7:34 pm

So is this something that should be reviewed to be included in 3.2 ?
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: 11317
Joined: Tue Mar 25, 2008 8:40 am

Re: 2-nd version of fgplot

Postby kuifje09 » Mon May 12, 2014 11:26 am

Hi Hooray,

If this "tool" could be of some help and looks good enough, it would be fine to get it in the distibution.
I forgot to implement the tickmarks... howmuch time do I have to get the tickmark into it
As I am currently addicted to create some objects.

Cheers.
kuifje09
 
Posts: 579
Joined: Tue May 17, 2011 8:51 pm

Re: 2-nd version of fgplot

Postby Hooray » Mon May 12, 2014 11:27 am

I think it's still 3-4 weeks (?), check the wiki (release plan) - so that should not be a problem, but the review may take some time. Fortunately, this is a new and optional feature, so easier to get reviewed :-)
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: 11317
Joined: Tue Mar 25, 2008 8:40 am

Next

Return to Canvas

Who is online

Users browsing this forum: No registered users and 0 guests