[Flightgear-devel] Query about groundradar Instrument module

2011-09-29 Thread Robbo
Hi,

I am trying to familiarise myself with Flightgear's source code so that I
may try and contribute.  I am currently looking at the 'groundradar'
instrument module and there is something within that is causing me some
confusion.

Essentially, there is a 'texture' declared as follows:
static const char* default_texture_name =
"Aircraft/Instruments/Textures/od_groundradar.rgb";

This is then used by the following method:
void GroundRadar::createTexture(const char* texture_name)

in the following way:
FGTextureManager::addTexture(texture_name, getTexture());

Now all is good at this point until I go and look for this file, which i
expected to find in data/Aircraft/Instruments/Textures/, however, this file
does not appear there, nor does it appear anywhere else on my filesystem
either.

I thought, well maybe the code is not actually using this texture, since its
a 'default_texture', however, when i change the name to point to something
else which also does not exist, then, the once black background becomes
white!

So I am assuming that this file MUST be somewhere, but I have no idea where
it is, can anyone assist me with this?

Thanks

Robbo
--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Query about groundradar Instrument module

2011-10-01 Thread Robbo
James, this sounds very interesting. I will check out the code this weekend
if I get time and have a look through. I am pretty sure that this is the way
I need to go to implement my instument!

Alan, that instrument looks interesting. I may be able to use the technique
for a 'layer' on my display. Is it essentially 'redrawing' parts of image
texture tiles, calculated by position?

I think my solution could use the tiled background with a dynamic layer on
top.

Robbo
On Oct 1, 2011 9:40 AM, "James Turner"  wrote:
>
> On 30 Sep 2011, at 19:52, Michael Robson wrote:
>
>> Essentially what I am looking to do is create some instruments of my own
with some detailed generation of graphical entities that are being
continually updated. I am therefore assuming that a 'dynamic texture' is the
way to go with this. If there is another way, perhaps better, then I am open
to suggestions!
>
> Correct, basically.
>
> Also note i just added a 'NavDisplay' instrument to Git, which is another
kind of dynamic texture, along with ground-radar. It's new, untested code
(that's part of my plan for this weekend), but is designed to show
navigation type info (route, waypoints, traffic, airports, navaids) in a
customisable way, and hence be used to simulate the navigation modes of
various modern cockpits.
>
> Depending on what you want to do, you might be able to use the code as is,
or certainly use it as an example (along with the other render-to-texture
instruments)
>
> But, be aware I'm still shaking the bugs out - and then I need to write
some docs :)
>
> James
>
>
>
--
> All of the data generated in your IT infrastructure is seriously valuable.
> Why? It contains a definitive record of application performance, security
> threats, fraudulent activity, and more. Splunk takes this data and makes
> sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2dcopy2
> ___
> Flightgear-devel mailing list
> Flightgear-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/flightgear-devel
>
--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Query about groundradar Instrument module

2011-10-01 Thread Robbo
Ok so I think that I am making some progress here, but what I really need to
do is 'register a listener',  so that my code can be called for updating the
dynamic texture.

I have looked, but I am not too sure what to register my object as a
listener with, can anyone point me in the right direction?

I can see that in 'groundradar' there are two listeners registered, one with
radar-range and one with airport, but what i really need is to have my code
called continuously as part of the osg::frame!

Any help would be appreciated,

Robbo

On 1 October 2011 18:23, Alan Teeder  wrote:

>
>
>  *From:* Robbo 
> *Sent:* Saturday, October 01, 2011 10:57 AM
> *To:* FlightGear developers 
> discussions
> *Subject:* Re: [Flightgear-devel] Query about groundradar Instrument
> module
>
> Alan, that instrument looks interesting. I may be able to use the technique
> for a 'layer' on my display. Is it essentially 'redrawing' parts of image
> texture tiles, calculated by position?
>
>
>
>
>
> Robbo
>
> The map uses the  animation (usually used in Livery over MP)
> to select which image tile to display, and the  animation to
> pan the image with lat-long.
>
> Alan
>
>
> --
> All of the data generated in your IT infrastructure is seriously valuable.
> Why? It contains a definitive record of application performance, security
> threats, fraudulent activity, and more. Splunk takes this data and makes
> sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2dcopy2
> ___
> Flightgear-devel mailing list
> Flightgear-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/flightgear-devel
>
>
--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Query about groundradar Instrument module

2011-10-01 Thread Robbo
Actually, I think that the solution here would be to just use a standard
OSG::NodeCallBack technique! please correct me if there is a better way of
doing this within FGFS!

Robbo

On 1 October 2011 21:07, Robbo  wrote:

> Ok so I think that I am making some progress here, but what I really need
> to do is 'register a listener',  so that my code can be called for updating
> the dynamic texture.
>
> I have looked, but I am not too sure what to register my object as a
> listener with, can anyone point me in the right direction?
>
> I can see that in 'groundradar' there are two listeners registered, one
> with radar-range and one with airport, but what i really need is to have my
> code called continuously as part of the osg::frame!
>
> Any help would be appreciated,
>
> Robbo
>
> On 1 October 2011 18:23, Alan Teeder  wrote:
>
>>
>>
>>  *From:* Robbo 
>> *Sent:* Saturday, October 01, 2011 10:57 AM
>> *To:* FlightGear developers 
>> discussions
>> *Subject:* Re: [Flightgear-devel] Query about groundradar Instrument
>> module
>>
>> Alan, that instrument looks interesting. I may be able to use the
>> technique for a 'layer' on my display. Is it essentially 'redrawing' parts
>> of image texture tiles, calculated by position?
>>
>>
>>
>>
>>
>> Robbo
>>
>> The map uses the  animation (usually used in Livery over
>> MP) to select which image tile to display, and the  animation
>> to pan the image with lat-long.
>>
>> Alan
>>
>>
>> --
>> All of the data generated in your IT infrastructure is seriously valuable.
>> Why? It contains a definitive record of application performance, security
>> threats, fraudulent activity, and more. Splunk takes this data and makes
>> sense of it. IT sense. And common sense.
>> http://p.sf.net/sfu/splunk-d2dcopy2
>> ___
>> Flightgear-devel mailing list
>> Flightgear-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/flightgear-devel
>>
>>
>
--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


[Flightgear-devel] Object scope help

2011-10-11 Thread Robbo
Hi,

I am trying to develop a radar module which consists of two 'texture'
classes that are overlaid.

The classes are instantiated within instrument_manager:

} else if ( name == "taradar" ) {
set_subsystem( id, new TaRadar( node ), 1 );

} else if ( name == "taecho" ) {
set_subsystem( id, new TaEcho( node ), 1 );

and the objects perform as i would expect within flightgear.

next, I wish to call a method (TaRadar::getAngle) from within TaEcho, so to
do this, I assume that i do something like:

TaRadar* _taradar_node = (TaRadar*) globals->get_subsystem("
taradar");
cout << "angle: " << _taradar_node->getAngle << endl;
  OR (neither work)
FGInstrumentMgr *imgr = (FGInstrumentMgr *)
globals->get_subsystem("instrumentation");
_taradar_node = (TaRadar *) imgr->get_subsystem("taradar");
cout << "angle: " << _taradar_node->getAngle << endl;

Now then, if TaRadar::getAngle() has the following fixed code:

return 10;

everything works ok, but if the method returns an object variable:

return _angle;

I get a segmentation fault.  I assume this to be because the private
variable (_angle) has not been initialised, however, i even tried setting
the value to a fixed value within the constructor and it still does not
work.

constructor:

TaRadar::TaRadar(SGPropertyNode *node) {
cout << "TaRadar initialise" << endl;
_angle=5; //(declared in .hxx as float _angle;)
}

Does anybody know why this variable is appearing to be not initialised? am i
calling the wrong function to return a pointer to this object?

Thanks for any help
--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Object scope help

2011-10-11 Thread Robbo
Csaba,

Thanks, that makes complete sense, I did not spot that the id may be how it
is registered.

However, I have checked what value comes back from id and it is
'instrument-1-taradar', so i changed my call to:

globals->get_subsystem("instrument-1-taradar");

but this is still returning NULL!

i print out some useful info from my code:

log: set_subsystem: taecho: instrument-0-taecho
log: TaEcho constructor called
log: set_subsystem: taradar: instrument-1-taradar
log: TaRadar constructor called
log: TaRadar isnull = YES

Any other ideas why this is NULL?

Cheers

Robbo


2011/10/11 Csaba Halász 

> On Tue, Oct 11, 2011 at 11:31 PM, Robbo  wrote:
> >
> > The classes are instantiated within instrument_manager:
> >
> > } else if ( name == "taradar" ) {
> > set_subsystem( id, new TaRadar( node ), 1 );
>
> Notice that the subsystem will be registered using the "id" not the
> "name". So make sure you are using the correct value when retrieving
> it, below:
>
> > TaRadar* _taradar_node = (TaRadar*) globals->get_subsystem("taradar");
>
> --
> Csaba/Jester
>
>
> --
> All the data continuously generated in your IT infrastructure contains a
> definitive record of customers, application performance, security
> threats, fraudulent activity and more. Splunk takes this data and makes
> sense of it. Business sense. IT sense. Common sense.
> http://p.sf.net/sfu/splunk-d2d-oct
> ___
> Flightgear-devel mailing list
> Flightgear-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/flightgear-devel
>
>
--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel