From: dave p. <ski...@mi...> - 2011-02-12 20:54:46
|
I am having trouble getting the modified gearscissors.nas to run with the stand alone nasal. after adding the three numbers in gedit and saving the file, I get $ nasal gearscissors.nas > GearScissorInterpolation.xml Runtime error: undefined symbol at gearscissors.nas, line 1 If I don't edit the file after copying just your template, I get $ nasal gearscissors.nas > GearScissorInterpolation.xml Parse error: parse error at line 5 which is what I would expect as I have not replaced the text with a number. If I just add the first two numbers, I get a parse error at line 7 (as expected), but If I add the 3rd number or even just delete or comment out that line, I get $ nasal gearscissors.nas > GearScissorInterpolation.xml Runtime error: undefined symbol at gearscissors.nas, line 1 Here is the gearscissors.nas after adding in the correct numbers for the c172p nose strut: import("math"); var acos = func(x) { math.atan2(math.sqrt(math.abs(1-x*x)), x) } var R2D = 180.0 / math.pi; var scissor_dist = 0.240626; var scissor = 0.194716; var oleo = 0.1893439; var theta0 = acos(scissor_dist/2/scissor) * R2D; print( "<?xml version = '1.0' encoding = 'UTF-8' ?>\n" ); print( "<PropertyList>\n" ); for( var i = 0; i < 1.05; i += 0.05 ) { print( "<entry>\n" ); var l = (1.0-i) * oleo/2; l += (scissor_dist-oleo)/2; print( "<ind>" ~ sprintf("%4.3f", i ) ~ "</ind>\n" ); print( "<dep>" ~ sprintf("%4.3f", acos( l / scissor ) * R2D - theta0 ) ~ "</dep>\n" ); print( "</entry>\n" ); } print( "</PropertyList>\n" ); The stand-alone nasal compiled fine. Any ideas what is wrong here? On 02/12/2011 12:59 PM, Torsten Dreyer wrote: >> By the way. The filtering that will remain in the c172p action-sim.nas >> for the nav radio could be moved to navradio.cxx. Here again, the >> needle damping and the needle behavior when tuned to an out-of-range >> frequency or when the gs is out of range is device dependent. The >> filtered values are used by Aircraft/Instruments-3d/vor/vor.xml and >> vor2.xml. I was afraid that modifying navradio.cxx to achieve realistic >> needle behavior for this vor model might break other vor/gs head or hsi >> models. > We can now easily use the autopilot filters for that, just add a file with the > content > > <PropertyList> > <filter> > <name>CDI0 lowpass</name> > <debug>false</debug> > <type>exponential</type> > <filter-time>2.0</filter-time> > <input>instrumentation/nav[0]/heading-needle-deflection-norm</input> > <output>instrumentation/nav[0]/filtered-cdiNAV0-deflection</output> > </filter> > <!-- > More filters here > --> > </PropertyList> > > And add > <autopilot> > <name>A very descriptive name for this file like Instrument-Filter</name> > <path>Aircraft/c172p/path/to/that/file</path> > </autopilot> > > to c172p-set.xml under /sim/systems > > No need for coding here, too. > > Greetings, Torsten > > ------------------------------------------------------------------------------ > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb > _______________________________________________ > Flightgear-devel mailing list > Fli...@li... > https://lists.sourceforge.net/lists/listinfo/flightgear-devel > |