Re: [Flightgear-devel] [PATCH] wxradar bug fix and added feature
Melchior FRANZ wrote > Subject: Re: [Flightgear-devel] [PATCH] wxradar bug fix and > added feature > > > * Csaba Halász -- Sunday 09 December 2007: > > Any ideas? Should we put in a comma-separated list of > symbolic names? > > Not comma, but yes, I think that's the best thing. There > should IMHO already be a name/number list in AIBase.hxx. Then > the property could do what we do with logging classes: > > /sim/logging/classes {STRING} = terrain|astro|flight|input|gl[...] > > Of course, these names can also change between releases, but > they are at least readable and consistent in all of fgfs. The > question is, should there be shared flags, as in: > > { "ship", 0x0001, } > { "aircraft", 0x0002, } > { "seaplane", 0x0003, } // ship and aircraft? > { "carrier", 0x0005, } > > I wouldn't mind committing your patch as a temporary > solution, if you want to make sure that the functionality is > in the release. But I think this should be fixed in the long run. > I'm not cleat what type of radar we are modelling that can distinguish between ships and carriers or seaplanes and aircraft, or even want to. There are radars which can distinguish between carrier/ships and seaplanes/aircraft. Mind you I have spent even less time than anyone thinking about this. So far. Vivian - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] [PATCH] wxradar bug fix and added feature
* Csaba Halász -- Sunday 09 December 2007: > Any ideas? Should we put in a comma-separated list of symbolic names? Not comma, but yes, I think that's the best thing. There should IMHO already be a name/number list in AIBase.hxx. Then the property could do what we do with logging classes: /sim/logging/classes {STRING} = terrain|astro|flight|input|gl[...] Of course, these names can also change between releases, but they are at least readable and consistent in all of fgfs. The question is, should there be shared flags, as in: { "ship", 0x0001, } { "aircraft", 0x0002, } { "seaplane", 0x0003, } // ship and aircraft? { "carrier", 0x0005, } I wouldn't mind committing your patch as a temporary solution, if you want to make sure that the functionality is in the release. But I think this should be fixed in the long run. m. - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] [PATCH] wxradar bug fix and added feature
On Dec 9, 2007 4:35 PM, Melchior FRANZ <[EMAIL PROTECTED]> wrote: > * Csaba Halász -- Sunday 09 December 2007: > * > On Dec 9, 2007 11:02 AM, Melchior FRANZ <[EMAIL PROTECTED]> wrote: > > > The aircraft types aren't bits, > > > I have turned them into bits :) > > Yes, I admit that I didn't spend more time for the review than > you spent for the explanation. Almost none. :-P I am sorry, got no excuse :) > I don't really like that AI types float around in different > notation, and that the input is a raw number that potentially > changes between releases. Any ideas? Should we put in a comma-separated list of symbolic names? -- Csaba/Jester - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] [PATCH] wxradar bug fix and added feature
* Csaba Halász -- Sunday 09 December 2007: * > On Dec 9, 2007 11:02 AM, Melchior FRANZ <[EMAIL PROTECTED]> wrote: > > The aircraft types aren't bits, > I have turned them into bits :) Yes, I admit that I didn't spend more time for the review than you spent for the explanation. Almost none. :-P I don't really like that AI types float around in different notation, and that the input is a raw number that potentially changes between releases. m. - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] [PATCH] wxradar bug fix and added feature
On Dec 9, 2007 11:02 AM, Melchior FRANZ <[EMAIL PROTECTED]> wrote: > * Csaba Halász -- Wednesday 05 December 2007: > > First patch fixes a bug caused by the uninitialized _range_nm member. > > If it happens to contain nan, this will never get overwritten. > > Second patch adds support for filtering what should be displayed. > > Do the patches apply to both branches? Umm, theoretically, yes. I think the wxradar works for plib too. I'll check. > How's the mask supposed to work? The aircraft types aren't bits, > but just an index, so you could always only select one of them, no? > Not really what we usually call a mask. And when would you like to > show ships, and nothing else (not even carriers)? Wouldn't it be > better to turn the aircraft numbers into bits first? I have turned them into bits :) int type = ac->getType(); if ((1 << type) & type_mask) continue; Ships and carriers would therefore be (1 << otShip) | (1 << otCarrier) = 12 for the mask. (Note that in the code snippet above, the type_mask variable is negated) Do we have a place for documentation about such features? -- Csaba/Jester - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] [PATCH] wxradar bug fix and added feature
* Csaba Halász -- Wednesday 05 December 2007: > First patch fixes a bug caused by the uninitialized _range_nm member. > If it happens to contain nan, this will never get overwritten. > Second patch adds support for filtering what should be displayed. Do the patches apply to both branches? How's the mask supposed to work? The aircraft types aren't bits, but just an index, so you could always only select one of them, no? Not really what we usually call a mask. And when would you like to show ships, and nothing else (not even carriers)? Wouldn't it be better to turn the aircraft numbers into bits first? m. - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
[Flightgear-devel] [PATCH] wxradar bug fix and added feature
Hi! First patch fixes a bug caused by the uninitialized _range_nm member. If it happens to contain nan, this will never get overwritten. Second patch adds support for filtering what should be displayed. Comments welcome. -- Csaba/Jester Index: src/Instrumentation/wxradar.cxx === RCS file: /var/cvs/FlightGear-0.9/source/src/Instrumentation/wxradar.cxx,v retrieving revision 1.20 diff -u -r1.20 wxradar.cxx --- src/Instrumentation/wxradar.cxx 4 Oct 2007 20:40:29 - 1.20 +++ src/Instrumentation/wxradar.cxx 4 Dec 2007 23:01:24 - @@ -84,7 +84,8 @@ _sim_init_done ( false ), _resultTexture( 0 ), _wxEcho( 0 ), -_odg( 0 ) +_odg( 0 ), +_range_nm( 40.0 ) { const char *tacan_source = node->getStringValue("tacan-source", "/instrumentation/tacan"); Index: src/Instrumentation/wxradar.cxx === RCS file: /var/cvs/FlightGear-0.9/source/src/Instrumentation/wxradar.cxx,v retrieving revision 1.20 diff -u -r1.20 wxradar.cxx --- src/Instrumentation/wxradar.cxx 4 Oct 2007 20:40:29 - 1.20 +++ src/Instrumentation/wxradar.cxx 4 Dec 2007 23:01:24 - @@ -172,6 +172,9 @@ _radar_rotate_node = n->getNode("rotate", true); _radar_font_node= _Instrument->getNode("font", true); _radar_font_node->addChangeListener(this); +_radar_mask_node= n->getNode("mask", true); +if (!_radar_mask_node->hasValue()) +_radar_mask_node->setIntValue((1 << FGAIBase::MAX_OBJECTS) - 1); updateFont(); @@ -615,10 +618,14 @@ double selected_radius = 0; double selected_bearing = 0; int selected_id = fgGetInt("/instrumentation/radar/selected-id", -1); +int type_mask = ~_radar_mask_node->getIntValue(); for (; it != end; ++it) { FGAIBase *ac = *it; + int type = ac->getType(); +if ((1 << type) & type_mask) continue; + double lat = ac->_getLatitude(); double lon = ac->_getLongitude(); double alt = ac->_getAltitude(); Index: src/Instrumentation/wxradar.hxx === RCS file: /var/cvs/FlightGear-0.9/source/src/Instrumentation/wxradar.hxx,v retrieving revision 1.15 diff -u -r1.15 wxradar.hxx --- src/Instrumentation/wxradar.hxx 9 Sep 2007 23:22:14 - 1.15 +++ src/Instrumentation/wxradar.hxx 4 Dec 2007 23:01:24 - @@ -106,6 +106,7 @@ SGPropertyNode_ptr _radar_hdg_marker_node; SGPropertyNode_ptr _radar_rotate_node; SGPropertyNode_ptr _radar_font_node; +SGPropertyNode_ptr _radar_mask_node; SGPropertyNode_ptr _ai_enabled_node; - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel