Re: [Svxlink-devel] Bugs when parsing /etc/svxlink.d/ModuleEcholink.conf
Brought to you by:
sm0svx
From: Tobias <jso...@ho...> - 2009-09-05 09:52:53
|
Hi again Just discovered that my patch doesn't compile very well. Looks like a problem with const map and []. I have fixed this issue. I have also moved the str2param function templates to AsyncConfig and renamed them to getCfg. The new change destcription: LocationInfo.cpp/h: Removed the need for splitStr and compile time dependency of boost/tokenizer. Split the constructor in to smaller parts making it easier to see what it does. Unified error messages to the form used for Coordinates. Changed behaviour to parse all known parameters not stopping for any errors. Rationale I would find it annoying to be forced to try starting the program multiple times when the errors could be reported on the first attempt. Changed defaults according to Adi Bier's recommendation. Default for FREQUENCY is 0. Default for LAT_POSITION is 0.0.0N. Default for LON_POSITION is 0.0.0E. Hopefully will someone not transmitting direct current on the north pole be able to figure out what is wrong. Added default constructors for struct Cfg and struct Coordinate AsyncConfig.cpp/h Added function templates getCfg parsing configuration string using operator >>. This removes the need for manual conversion for all types with a suitable definition of >>. There is a ranged getCfg overload that use < and > for checking. Added a new function returning string containing config as a complement to the existing returning a bool. Changed this for getValue function to const. Removed function hidden in a comment. Enjoy /Tobias Tobias wrote: > I have finished restructuring the constructor of LocationInfo. > > Changes: > LocationInfo.cpp/h: > Removed the need for splitStr and compile time dependency > of boost/tokenizer. > Split the constructor in to smaller parts making it easier > to see what it does. > Unified error messages to the form used for Coordinates. > Changed behaviour to parse all known parameters not stopping > for any errors. Rationale I would find it annoying to be > forced to try starting the program multiple times when the > errors could be reported on the first attempt. > Changed defaults according to Adi Bier's recommendation. > Default for FREQUENCY is 0. > Default for LAT_POSITION is 0.0.0N. > Default for LON_POSITION is 0.0.0E. > Hopefully will someone not transmitting direct current on the > north pole be able to figure out what is wrong. > Added default constructors for struct Cfg and struct Coordinate > > AsyncConfig.cpp/h > Added a new function returning string containing config as > a complement to the existing returning a bool. > Changed this for getValue function to const. > Removed function hidden in a comment. > > /Tobias > > > Adi Bier wrote: >> Hi Tobias, >>> BEACON_INTERVAL has two defaults. 600000 when the tag is removed and >>> 0 if left empty(BEACON_INTERVAL=). >> >> loc_cfg.interval should be 600000 or more under all circumstances, >> BEACON_INTERVAL is read as minutes >> >>> FREQUENCY, TX_POWER, ANTENNA_GAIN, will be >>> unitialised if removed or empty. If I'm not mistaken the generated >>> default constructor for loc_cfg leaves >>> built in types unitialised. >>> >> ANTENNA_GAIN, ANTENNA_HEIGHT and TX_POWER are only used to calculate >> the range of the link/repeater. If not set, the range is 0. >> My suggestions as defaults: ANTENNA_GAIN=0, ANTENNA_HEIGHT=10, TX_POWER=0 >> >>> I suggest: 1 Parsing all known tags regardless of previous errors. 2 >>> Empty and not found should result in a suitable default, for the >>> missing configuration tag. >> It's hard to define default values for positions and frequency, if the >> location extension shall make sense the user must put in real data. >> I think it's better to stop locationinfo if not all variables have >> reasonable values. >> >> 73's de Adi, DL1HRC >> >>> I'm willing to implement these changes. I only need defaults. Or more >>> accurately I had already started restructuring when I notised the >>> bugreport in the responce to Soundcard support. >>> /Tobias >>> >>> >>> >>> <P><p><font face="Arial, Helvetica, sans-serif" size="2" >>> style="font-size:13.5px">_______________________________________________________________<BR><a >>> style="font-family: Tahoma, sans-serif; font-size: 10px; color: #00f" >>> href="http://www.eniro.se/?partnerid=spray_mail" >>> target="_blank">Eniro Supersök - är vad det heter</a></font> >>> >>> ------------------------------------------------------------------------ >>> >>> ------------------------------------------------------------------------------ >>> >>> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 >>> 30-Day trial. Simplify your report design, integration and deployment >>> - and focus on what you do best, core application coding. Discover >>> what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july >>> ------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> Svxlink-devel mailing list >>> Svx...@li... >>> https://lists.sourceforge.net/lists/listinfo/svxlink-devel >>> >> >> >> ------------------------------------------------------------------------ >> >> ------------------------------------------------------------------------------ >> >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 >> 30-Day trial. Simplify your report design, integration and deployment >> - and focus on what you do best, core application coding. Discover >> what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Svxlink-devel mailing list >> Svx...@li... >> https://lists.sourceforge.net/lists/listinfo/svxlink-devel > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > > > ------------------------------------------------------------------------ > > _______________________________________________ > Svxlink-devel mailing list > Svx...@li... > https://lists.sourceforge.net/lists/listinfo/svxlink-devel |