Board index FlightGear Development Aircraft

Su-15

Questions and discussion about creating aircraft. Flight dynamics, 3d models, cockpits, systems, animation, textures.

Re: Su-15

Postby vitos » Sat Oct 31, 2015 11:21 pm

Hooray wrote in Sat Oct 31, 2015 11:19 pm:lol, see the history of the wiki article (or even just the screen shot): those are proof that this worked already 2 years ago


You may also present me link to FG source code, to help me find out how canvas is made at that. It's not called "support", dude.

You want me to search trough thousand lines of Your code to find how some method is implemented. While it's gotta be documented instead - by You as You said You do support that thing.
Last edited by vitos on Sat Oct 31, 2015 11:29 pm, edited 1 time in total.
Waste of time: too unprofitable for work, too exhausting for hobby.
User avatar
vitos
 
Posts: 615
Joined: Sun Jan 25, 2009 8:10 pm
Location: Moscow, Russia
Callsign: vitos
IRC name: vitos
Version: 3.4
OS: Debian

Re: Su-15

Postby Hooray » Sat Oct 31, 2015 11:29 pm

Sorry, please don't get this wrong - but as usual, I am interested in some of your work, but I find your attitude tedious to deal with, and your language hard to understand - which makes the whole exchange a waste of my time.

If in doubt, you could take a look at the wiki and work through the examples - others have managed to create working MapStructure layers (Red Leader, omega95, artix to just a few) - without any of them having been familiar with Canvas originally.

Note that this is not about me, or us, you will see that Philosopher was the primary designer/developer of the MapStructure framework. And once you look at the documentation (which is pretty good compared to most other features in FG), you will also see that MapStructure contained solutions to problems that you are only just beginning to understand.

Equally, you don't have to use MapStructure at all, as long as you understand what you are doing - e.g. just look at omega95's VSD work or Thorsten's space shuttle (trajectory) map: neither of those are using MapStructure, just "pure" Nasal/Canvas.

However, I stand by my suggestion that MapStructure is the right framework, and approach, to do what you are doing here, because it was specifically designed with your use case in mind - including custom filtering (spatial search of AI/MP traffic, and geographical filters - using not just geodinfo() calls but even the hard-coded terrain pre-sampler).

Anyway, I am happy to re-iterate that I am impressed that you got this working, even regardless of you using MapStructure or not - and given that you say that the Canvas docs are soooo lacking in quality, I encourage you to help get involved in maintaining the Canvas docs on the wiki, by adding your valuable input. Which is also why I suggested that you post links to your code implementing the Radar.
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: 12058
Joined: Tue Mar 25, 2008 8:40 am

Re: Su-15

Postby vitos » Sat Oct 31, 2015 11:32 pm

It's going nowhere. As usual.

I did needed README.canvas file - with all methods of canvas class which existed. Or wiki with it. With examples of using. Not some

var updater = func {
if (typeof(me.symbol.model) == 'hash') try_aux_method(me.symbol.model, "update");
me.symbol.update();
}

if (me.options != nil and me.options['update_wrapper'] != nil) {
me.options.update_wrapper( me, updater ); # call external wrapper (usually for profiling purposes)
} else {
updater();
}
},


And it's not my job to do that - but Yours. And without any of my question for that, but just because it's normal way of coworking.

But, since I already made everything I meant to do, I do not care much. If there is not normal wiki for others - it's their problem, not mine - already.
Last edited by vitos on Sat Oct 31, 2015 11:39 pm, edited 1 time in total.
Waste of time: too unprofitable for work, too exhausting for hobby.
User avatar
vitos
 
Posts: 615
Joined: Sun Jan 25, 2009 8:10 pm
Location: Moscow, Russia
Callsign: vitos
IRC name: vitos
Version: 3.4
OS: Debian

Re: Su-15

Postby Hooray » Sat Oct 31, 2015 11:37 pm

vitos wrote in Sat Oct 31, 2015 11:32 pm:It's going nowhere. As usual.

yes, it is - but like I mentioned, I have a track record of walking people through the whole process, SUCCESSFULLY - which is why I mentioned omega95, Red Leader and artix: those are just 3 people who managed to work with the advice that we gave to them in response to questions they asked on the Canvas forum.


I do need README.canvas file - with all methods as existed. Or wiki with it. With examples of using.

$FG_ROOT/Nasal/canvas/api.nas is the file to look at it -and given your track record of working with Nasal, that should probably even suffice.

And the wiki contains exactly what you are asking for, not just in terms of pointers, but also documentation, tutorials and code snippets - even entirely unrelated to MapStructure

And it's not my job to do that - but Yours. And without any of my question for that, but just because it's normal way of coworking.


You are very mistaken regarding my role in all this, as usual.
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: 12058
Joined: Tue Mar 25, 2008 8:40 am

Re: Su-15

Postby vitos » Sat Oct 31, 2015 11:40 pm

Hooray wrote in Sat Oct 31, 2015 11:37 pm:And the wiki contains exactly what you are asking for, not just in terms of pointers, but also documentation, tutorials and code snippets - even entirely unrelated to MapStructure


Try to prove it by exact quote and link. As I said - I do not need it already, and if You will start my model then You will be sure that I do not.

Just as proof that You are true and do say what's real - BTW only such people worth to work together with.

Reminder: question is "how to create list of nasal canvas objects, add and delete something at it in runtime, and getting number of elements of it".
Waste of time: too unprofitable for work, too exhausting for hobby.
User avatar
vitos
 
Posts: 615
Joined: Sun Jan 25, 2009 8:10 pm
Location: Moscow, Russia
Callsign: vitos
IRC name: vitos
Version: 3.4
OS: Debian

Re: Su-15

Postby Hooray » Sat Oct 31, 2015 11:51 pm

I take it that you don't want to deal with MapStructure, which is fine (the extra500 guys also refuse to use it) - however, you should make sure to understand what it is doing and what problems it is solving, and which ones you are likely to encounter sooner or later.

I am the first to admit that the MapStructure framework deals with some fairly sophisticated Nasal concepts, i.e. it was written by a guy who belongs to a tiny group of maybe 2-3 people who know stuff about the Nasal engine that nobody else understands - I also it find it a little obscure in some places.

But the whole point is that MapStructure.nas does not need to be looked at, let alone, modified usually.
As could be seen by the work that omega95 and Red Leader have completed. Yet, people CAN extend the code if they want to (like artix has demonstrated).

Depending on your priorities, you are likely to re-invent MapStructure sooner or later anyway - simply because it is solving a bunch of problems, such as being able to reuse instruments (like your radar) on other aircraft, support multiple concurrent instances, reuse the radar even in GUI dialogs (widgets), but also support custom styling - as well as provide well-encapsulated building blocks to handle efficient filtering/searching and updating of (radar) layers, which translates into much better performance - but also additional optimization opportunities.

It is poorly-structured Nasal/Canvas code that is reflecting badly upon Nasal, Canvas, FlightGear as a whole -but also individual aircraft - such as the m2000 or the extra500 which are using naive/inefficient algorithms to solve problems in a slow way.

Nasal and Canvas are obviously already much slower than the same C++/OSG or OpenGL code - so people need to use their brains to come up with superior, and reusable, code - if they don't do that, Nasal/Canvas are going to create a plethora of performance issues somewhere down the road.

And even at the MapStructure level that holds true - which is why things are so well encapsulated, so that we can profile/optimize bottlenecks, which all MapStructure users/aircraft will benefit from - without any of those aircraft (777, 747, 787, A320 etc) requiring modifications.

PS: Regarding your last question: Have you actually looked at any of the Nasal/Canvas snippets on the wiki or in $FG_ROOT ? I am just wondering, because you have literally written thousands of lines of Nasal code over the years, but you are apparently failing to recognize that such code is all over the place - is it because it is using OOP or what is the problem ?

Anyway, here's just one example adding a handful of Canvas elements to a group: http://wiki.flightgear.org/Canvas_Snipp ... ScrollArea

Once you really understand what you are doing (at the Radar level!), you will sooner or later want to look at this instead: http://wiki.flightgear.org/Canvas_Snipp ... ymbolCache

And once you understand the relationship between Canvas elements and radar items, you will want to revisit using MapStructure for all this, because it will save you tons of time - meaning that your existing code could be re-implemented via MapStructure using a fraction of the code/time required, while providing great performance benefits.
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: 12058
Joined: Tue Mar 25, 2008 8:40 am

Re: Su-15

Postby vitos » Sat Oct 31, 2015 11:56 pm

It's adding at widgets level, not at canvas object level. And there is not a thing about if it could be done out of "new" function, could You add something to that later or not. And how to delete and get number of elements? You did not answered question fully.
Waste of time: too unprofitable for work, too exhausting for hobby.
User avatar
vitos
 
Posts: 615
Joined: Sun Jan 25, 2009 8:10 pm
Location: Moscow, Russia
Callsign: vitos
IRC name: vitos
Version: 3.4
OS: Debian

Re: Su-15

Postby Hooray » Sun Nov 01, 2015 12:01 am

vitos wrote in Sat Oct 31, 2015 11:56 pm:It's adding at widgets level, not at canvas object level. And there is not a thing about if it could be done out of "new" function. And how to delete and get number of elements? You did not answered question fully.


dude, I did - those are just properties after all, so you can use props.nas APIs - like removeAllChildren()
but you want to AVOID that, due to it being **** stupid and unfriendly to Canvas for obvious reasons: viewtopic.php?f=4&t=25747&p=259641&hilit=removeAllChildren#p259641

And no, there is nothing widget specific about adding raster images to another group, really - just believe me.

And the whole thing is entirely self-contained, too - so can be put into arbitrary functions.

Frankly, your last posting sums up the whole point of why MapStructure exists - because your question translates into "what is 1+1", while you are being told how to do addition (and how NOT to do it).

To be perfectly honest, you are trying to use a technology that you don't understand fully - which is fine, because there is a framework saving people from having to learn all the difficult stuff (aka MapStructure), but then you are failing to recognize that....

So you are basically begging to reinvent MapStructure (or fail somewhere along the way) - because you are asking us to provide the exact pointers that make your code dead-slow and naive, which is the sole reason for the existence of MapStructure....
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: 12058
Joined: Tue Mar 25, 2008 8:40 am

Re: Su-15

Postby vitos » Sun Nov 01, 2015 12:05 am

Not. I do not need Your "MapStructure". I did need You to be true - and prove that with exact code lines and links as answer for my questions - common questions of anyone who would start to deal with that canvas thing. You did failed with that - which means not only that You are not right and not everything is documented well, but You are not true, and trying to use that conversation with me as form of advertisement of You and Your stuff for anyone reading that topic.
Last edited by vitos on Sun Nov 01, 2015 12:09 am, edited 1 time in total.
Waste of time: too unprofitable for work, too exhausting for hobby.
User avatar
vitos
 
Posts: 615
Joined: Sun Jan 25, 2009 8:10 pm
Location: Moscow, Russia
Callsign: vitos
IRC name: vitos
Version: 3.4
OS: Debian

Re: Su-15

Postby Hooray » Sun Nov 01, 2015 12:09 am

Honestly, I did not - I even provided concrete non-MapStructure advice.

if you don't understand all this, you should probably stop using Nasal/Canvas altogether, because you are really just wasting your time here - it is like someone coming here asking how to do a FDM, but refusing to use JSBSim or YASim (i.e. coding a FDM engine from scratch) - while it is possible (and perfectly legit), it is unnecessarily tedious and difficult, because others have already spent the time to come up with a reusable framework (in fact, two!)- so if you are not willing to learn the corresponding skills, to use a certain technology, but want to reinvent the wheel from scratch, it is your choice - but don't expect to come up with something that is superior anytime soon - especially not given the nature of your questions.

MapStructure was developed by people who had probably ~500 hrs of experience working with Nasal/Canvas, and it was developed after looking at literally dozens of use-cases (aircraft, dialogs, scenarios).

So it is there for a reason - and not using it for charting purposes is obviously fine, just like coming up with a custom FDM in scripting/C++ space is, but if your time is precious, maybe just consider using a dedicated framework instead - or alternatively, spend the time -and mental power- to learn the underlying technologies first, so that you can come up with something much better, superior to MapStructure
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: 12058
Joined: Tue Mar 25, 2008 8:40 am

Re: Su-15

Postby vitos » Sun Nov 01, 2015 12:10 am

Yeah, I could. But not with people as You.
Waste of time: too unprofitable for work, too exhausting for hobby.
User avatar
vitos
 
Posts: 615
Joined: Sun Jan 25, 2009 8:10 pm
Location: Moscow, Russia
Callsign: vitos
IRC name: vitos
Version: 3.4
OS: Debian

Re: Su-15

Postby Hooray » Sun Nov 01, 2015 12:18 am

vitos wrote in Sun Nov 01, 2015 12:10 am:Yeah, I could. But not with people as You.


The really sad thing is that I am far from being the problem here - I told you repeatedly that you don't have to use MapStructure at all, and I even provided advice on using the corresponding APIs directly, as well as pointers to related modules.
Others have managed to work with such, and even less, advice just fine.

But at some point you are either going to give up, or begin to understand, that you will need a way to selectively and efficiently update/add/remove and animate map items (canvas elements) - which is pretty much the only thing that MapStructure is really good at - using under 1kb of code (last I checked), with a typical spatial search function being in the 20 LOC ballpark - i.e. to render something like this, regardless of the aircraft/GUI dialog, and regardless of the number of INDEPENDENT instances:

Image

If you can come up with code beating this (functionality/performance-wise), you should probably post your own code here, so that others can use that instead of MapStructure - and in fact, I will gladly volunteer to update all aircraft accordingly. :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: 12058
Joined: Tue Mar 25, 2008 8:40 am

Re: Su-15

Postby vitos » Sun Nov 01, 2015 12:21 am

That's what I meant.
Waste of time: too unprofitable for work, too exhausting for hobby.
User avatar
vitos
 
Posts: 615
Joined: Sun Jan 25, 2009 8:10 pm
Location: Moscow, Russia
Callsign: vitos
IRC name: vitos
Version: 3.4
OS: Debian

Re: Su-15

Postby Hooray » Sun Nov 01, 2015 12:27 am

and it is extensively well-covered on the wiki and the forum, e.g. in the thread where Red Leader came up with his custom MapStructure layer.

In the case of your "radar" layer, all you need to do is open a test dialog showing the "TFC" (=traffic) layer which will show AI/MP traffic in your vicinity. You can do that using the dialog snippet on the wiki (easier prototyping, no exiting/restarting required to test your changes).

Once you have this working, you can simply go to $FG_ROOT/Nasal/canvas/map/TFC.lcontroller and modify the function named searchCmd()

searchCmd() returns a vector of objects to be displayed, updated and animated, and it will do that efficiently (automatically) - so given the features that you need (geodinfo based terrain sampling) you would simply filter/exclude aircraft that are out of range, or behind a mountain (certain elevation) - given that you managed to do this already, you understand how to do this.

You can check the MapStructure article on the wiki for more in depth info
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: 12058
Joined: Tue Mar 25, 2008 8:40 am

Re: Su-15

Postby vitos » Sun Nov 01, 2015 12:32 am

I already made things what I need. What I was curious - if someone would want to explain basic level instead of pushing own midone, or not. Of course not.

That midlevels would not do in most of cases. Most of instruments is individual and have onwn special advantages and limitations.

To me point of sureness was then I recognized that there will not be any more or less real Moon at FG. Somehow it said that it will not add new levels but new and new midones instead.
Waste of time: too unprofitable for work, too exhausting for hobby.
User avatar
vitos
 
Posts: 615
Joined: Sun Jan 25, 2009 8:10 pm
Location: Moscow, Russia
Callsign: vitos
IRC name: vitos
Version: 3.4
OS: Debian

PreviousNext

Return to Aircraft

Who is online

Users browsing this forum: AhrefsBot [Bot], Google [Bot] and 2 guests